添加TODO 代码规约扫描
This commit is contained in:
parent
1157caddfd
commit
7c394a46ac
|
|
@ -21,11 +21,11 @@ public class EscapeUtil
|
|||
}
|
||||
|
||||
// special HTML characters
|
||||
TEXT['\''] = "'".toCharArray(); // 单引号
|
||||
TEXT['"'] = """.toCharArray(); // 双引号
|
||||
TEXT['&'] = "&".toCharArray(); // &符
|
||||
TEXT['<'] = "<".toCharArray(); // 小于号
|
||||
TEXT['>'] = ">".toCharArray(); // 大于号
|
||||
TEXT['\''] = "'".toCharArray();
|
||||
TEXT['"'] = """.toCharArray();
|
||||
TEXT['&'] = "&".toCharArray();
|
||||
TEXT['<'] = "<".toCharArray();
|
||||
TEXT['>'] = ">".toCharArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ public final class HtmlFilter {
|
|||
vSelfClosingTags = new String[]{"img"};
|
||||
vNeedClosingTags = new String[]{"a", "b", "strong", "i", "em"};
|
||||
vDisallowed = new String[]{};
|
||||
vAllowedProtocols = new String[]{"http", "mailto", "https"}; // no ftp.
|
||||
vAllowedProtocols = new String[]{"http", "mailto", "https"};
|
||||
vProtocolAtts = new String[]{"src", "href"};
|
||||
vRemoveBlanks = new String[]{"a", "b", "strong", "i", "em"};
|
||||
vAllowedEntities = new String[]{"amp", "gt", "lt", "quot"};
|
||||
|
|
@ -221,7 +221,7 @@ public final class HtmlFilter {
|
|||
final Matcher m = P_COMMENTS.matcher(s);
|
||||
final StringBuffer buf = new StringBuffer();
|
||||
if (m.find()) {
|
||||
final String match = m.group(1); // (.*?)
|
||||
final String match = m.group(1);
|
||||
m.appendReplacement(buf, Matcher.quoteReplacement("<!--" + htmlSpecialChars(match) + "-->"));
|
||||
}
|
||||
m.appendTail(buf);
|
||||
|
|
@ -329,12 +329,12 @@ public final class HtmlFilter {
|
|||
final List<String> paramNames = new ArrayList<>();
|
||||
final List<String> paramValues = new ArrayList<>();
|
||||
while (m2.find()) {
|
||||
paramNames.add(m2.group(1)); // ([a-z0-9]+)
|
||||
paramValues.add(m2.group(3)); // (.*?)
|
||||
paramNames.add(m2.group(1));
|
||||
paramValues.add(m2.group(3));
|
||||
}
|
||||
while (m3.find()) {
|
||||
paramNames.add(m3.group(1)); // ([a-z0-9]+)
|
||||
paramValues.add(m3.group(3)); // ([^\"\\s']+)
|
||||
paramNames.add(m3.group(1));
|
||||
paramValues.add(m3.group(3));
|
||||
}
|
||||
String paramName, paramValue;
|
||||
for (int ii = 0; ii < paramNames.size(); ii++) {
|
||||
|
|
@ -434,8 +434,8 @@ public final class HtmlFilter {
|
|||
// validate entities throughout the string
|
||||
Matcher m = P_VALID_ENTITIES.matcher(s);
|
||||
while (m.find()) {
|
||||
final String one = m.group(1); // ([^&;]*)
|
||||
final String two = m.group(2); // (?=(;|&|$))
|
||||
final String one = m.group(1);
|
||||
final String two = m.group(2);
|
||||
m.appendReplacement(buf, Matcher.quoteReplacement(checkEntity(one, two)));
|
||||
}
|
||||
m.appendTail(buf);
|
||||
|
|
@ -448,10 +448,10 @@ public final class HtmlFilter {
|
|||
StringBuffer buf = new StringBuffer();
|
||||
Matcher m = P_VALID_QUOTES.matcher(s);
|
||||
while (m.find()) {
|
||||
final String one = m.group(1); // (>|^)
|
||||
final String two = m.group(2); // ([^<]+?)
|
||||
final String three = m.group(3); // (<|$)
|
||||
// 不替换双引号为",防止json格式无效 regexReplace(P_QUOTE, """, two)
|
||||
final String one = m.group(1);
|
||||
final String two = m.group(2);
|
||||
final String three = m.group(3);
|
||||
/*不替换双引号为",防止json格式无效 regexReplace(P_QUOTE, """, two)*/
|
||||
m.appendReplacement(buf, Matcher.quoteReplacement(one + two + three));
|
||||
}
|
||||
m.appendTail(buf);
|
||||
|
|
|
|||
|
|
@ -908,7 +908,7 @@ public class ExcelUtil<T> {
|
|||
if (cell.getCellType() == CellType.NUMERIC || cell.getCellType() == CellType.FORMULA) {
|
||||
val = cell.getNumericCellValue();
|
||||
if (DateUtil.isCellDateFormatted(cell)) {
|
||||
val = DateUtil.getJavaDate((Double) val); // POI Excel 日期格式转换
|
||||
val = DateUtil.getJavaDate((Double) val);
|
||||
} else {
|
||||
if ((Double) val % 1 != 0) {
|
||||
val = new BigDecimal(val.toString());
|
||||
|
|
|
|||
|
|
@ -145,9 +145,9 @@ public final class Base64 {
|
|||
return null;
|
||||
}
|
||||
char[] base64Data = encoded.toCharArray();
|
||||
int len = removeWhiteSpace(base64Data);// 删除空格
|
||||
int len = removeWhiteSpace(base64Data);
|
||||
if (len % FOURBYTE != 0) {
|
||||
return null;// sho应该能被四整除
|
||||
return null;
|
||||
}
|
||||
int numberQuadruple = (len / FOURBYTE);
|
||||
if (numberQuadruple == 0) {
|
||||
|
|
@ -164,7 +164,7 @@ public final class Base64 {
|
|||
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))
|
||||
|| !isData((d3 = base64Data[dataIndex++])) || !isData((d4 = base64Data[dataIndex++]))) {
|
||||
return null;
|
||||
} // if found "no data" just return null
|
||||
}
|
||||
b1 = BASE_64_ALPHABET[d1];
|
||||
b2 = BASE_64_ALPHABET[d2];
|
||||
b3 = BASE_64_ALPHABET[d3];
|
||||
|
|
@ -174,16 +174,15 @@ public final class Base64 {
|
|||
decodedData[encodedIndex++] = (byte) (b3 << 6 | b4);
|
||||
}
|
||||
if (!isData((d1 = base64Data[dataIndex++])) || !isData((d2 = base64Data[dataIndex++]))) {
|
||||
return null;// if found "no data" just return null
|
||||
return null;
|
||||
}
|
||||
b1 = BASE_64_ALPHABET[d1];
|
||||
b2 = BASE_64_ALPHABET[d2];
|
||||
d3 = base64Data[dataIndex++];
|
||||
d4 = base64Data[dataIndex++];
|
||||
if (!isData((d3)) || !isData((d4))) {// Check if they are PAD characters
|
||||
if (!isData((d3)) || !isData((d4))) {
|
||||
if (isPad(d3) && isPad(d4)) {
|
||||
if ((b2 & 0xf) != 0)// last 4 bits should be zero
|
||||
{
|
||||
if ((b2 & 0xf) != 0) {
|
||||
return null;
|
||||
}
|
||||
byte[] tmp = new byte[i * 3 + 1];
|
||||
|
|
@ -192,8 +191,7 @@ public final class Base64 {
|
|||
return tmp;
|
||||
} else if (!isPad(d3) && isPad(d4)) {
|
||||
b3 = BASE_64_ALPHABET[d3];
|
||||
if ((b3 & 0x3) != 0)// last 2 bits should be zero
|
||||
{
|
||||
if ((b3 & 0x3) != 0) {
|
||||
return null;
|
||||
}
|
||||
byte[] tmp = new byte[i * 3 + 2];
|
||||
|
|
|
|||
|
|
@ -98,10 +98,10 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
|
|||
|
||||
byte[] randomBytes = new byte[16];
|
||||
ng.nextBytes(randomBytes);
|
||||
randomBytes[6] &= 0x0f; /* clear version */
|
||||
randomBytes[6] |= 0x40; /* set to version 4 */
|
||||
randomBytes[8] &= 0x3f; /* clear variant */
|
||||
randomBytes[8] |= 0x80; /* set to IETF variant */
|
||||
randomBytes[6] &= 0x0f;
|
||||
randomBytes[6] |= 0x40;
|
||||
randomBytes[8] &= 0x3f;
|
||||
randomBytes[8] |= 0x80;
|
||||
return new UUID(randomBytes);
|
||||
}
|
||||
|
||||
|
|
@ -124,10 +124,10 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
|
|||
throw new InternalError("MD5 not supported");
|
||||
}
|
||||
byte[] md5Bytes = md.digest(name);
|
||||
md5Bytes[6] &= 0x0f; /* clear version */
|
||||
md5Bytes[6] |= 0x30; /* set to version 3 */
|
||||
md5Bytes[8] &= 0x3f; /* clear variant */
|
||||
md5Bytes[8] |= 0x80; /* set to IETF variant */
|
||||
md5Bytes[6] &= 0x0f;
|
||||
md5Bytes[6] |= 0x30;
|
||||
md5Bytes[8] &= 0x3f;
|
||||
md5Bytes[8] |= 0x80;
|
||||
return new UUID(md5Bytes);
|
||||
}
|
||||
|
||||
|
|
@ -245,8 +245,8 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
|
|||
public long timestamp() throws UnsupportedOperationException
|
||||
{
|
||||
checkTimeBase();
|
||||
return (mostSigBits & 0x0FFFL) << 48//
|
||||
| ((mostSigBits >> 16) & 0x0FFFFL) << 32//
|
||||
return (mostSigBits & 0x0FFFL) << 48
|
||||
| ((mostSigBits >> 16) & 0x0FFFFL) << 32
|
||||
| mostSigBits >>> 32;
|
||||
}
|
||||
|
||||
|
|
@ -425,10 +425,10 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
|
|||
{
|
||||
// The ordering is intentionally set up so that the UUIDs
|
||||
// can simply be numerically compared as two numbers
|
||||
return (this.mostSigBits < val.mostSigBits ? -1 : //
|
||||
(this.mostSigBits > val.mostSigBits ? 1 : //
|
||||
(this.leastSigBits < val.leastSigBits ? -1 : //
|
||||
(this.leastSigBits > val.leastSigBits ? 1 : //
|
||||
return (this.mostSigBits < val.mostSigBits ? -1 :
|
||||
(this.mostSigBits > val.mostSigBits ? 1 :
|
||||
(this.leastSigBits < val.leastSigBits ? -1 :
|
||||
(this.leastSigBits > val.leastSigBits ? 1 :
|
||||
0))));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,11 +13,17 @@ public interface ValidateCodeService
|
|||
{
|
||||
/**
|
||||
* 生成验证码
|
||||
* @return AjaxResult
|
||||
* @throws IOException /
|
||||
* @throws CaptchaException /
|
||||
*/
|
||||
public AjaxResult createCaptcha() throws IOException, CaptchaException;
|
||||
|
||||
/**
|
||||
* 校验验证码
|
||||
* @param key 键
|
||||
* @param value 值
|
||||
* @throws CaptchaException /
|
||||
*/
|
||||
public void checkCaptcha(String key, String value) throws CaptchaException;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,42 +56,46 @@ public interface ISysJobService
|
|||
public int deleteJob(SysJob job) throws SchedulerException;
|
||||
|
||||
/**
|
||||
*
|
||||
* 批量删除调度信息
|
||||
*
|
||||
*
|
||||
* @param jobIds 需要删除的任务ID
|
||||
* @return 结果
|
||||
* @throws SchedulerException /
|
||||
*/
|
||||
public void deleteJobByIds(Long[] jobIds) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 任务调度状态修改
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
* @throws SchedulerException /
|
||||
*/
|
||||
public int changeStatus(SysJob job) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 立即运行任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
* @throws SchedulerException /
|
||||
*/
|
||||
public void run(SysJob job) throws SchedulerException;
|
||||
|
||||
/**
|
||||
* 新增任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
* @throws SchedulerException /
|
||||
* @throws TaskException /
|
||||
*/
|
||||
public int insertJob(SysJob job) throws SchedulerException, TaskException;
|
||||
|
||||
/**
|
||||
* 更新任务
|
||||
*
|
||||
* @param job 调度信息
|
||||
* @return 结果
|
||||
* @throws SchedulerException /
|
||||
* @throws TaskException /
|
||||
*/
|
||||
public int updateJob(SysJob job) throws SchedulerException, TaskException;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue