Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign up一些可能的空指针引用和正则表达式错误 #48
Comments
|
感谢,大概看了下,部分问题已确认确实存在,后续将持续改进。 |
|
@mmyjona 您这个 是商业工具吗? 我在网上找了一下 怎么 没有找到呢? |
|
@anonymoustoken 同问,我也没找到哈哈 |
|
总结这个报告: |
|
下一个版本说明时候 发布 @TommyLemon |
|
@anonymoustoken APIJSON 3.1.5 已发布 |
|
确实是误判为 bug 的报告用例 1src/main/java/zuo/biao/apijson/server/AbstractSQLConfig.java: 897 (可信度: 65%) @Override
public AbstractSQLConfig putWhere(String key, Object value, boolean prior) {
if (key != null) {
if (where == null) {
where = new LinkedHashMap<String, Object>();
}
where.put(key, value);
combine = getCombine();
List<String> andList = combine == null ? null : combine.get("&");
if (value == null) {
andList.remove(key);
}
else if (andList == null || andList.contains(key) == false) {
int i = 0;
if (andList == null) {
andList = new ArrayList<>();
}
else if (prior && andList.isEmpty() == false) {
if (andList.contains(KEY_ID)) {
i ++;
}
if (andList.contains(KEY_ID_IN)) {
i ++;
}
if (andList.contains(KEY_USER_ID)) {
i ++;
}
if (andList.contains(KEY_USER_ID_IN)) {
i ++;
}
}
if (prior) {
andList.add(i, key); //userId的优先级不能比id高 0, key);
} else {
andList.add(key); //AbstractSQLExecutor.onPutColumn里getSQL,要保证缓存的SQL和查询的SQL里 where 的 key:value 顺序一致
}
}
combine.put("&", andList);
}
return this;
}实际上在前面已经用 @NotNull
@Override
public Map<String, List<String>> getCombine() {
List<String> andList = combine == null ? null : combine.get("&");
if (andList == null) {
andList = where == null ? new ArrayList<String>() : new ArrayList<String>(where.keySet());
if (combine == null) {
combine = new HashMap<>();
}
combine.put("&", andList);
}
return combine;
}确实是误判为 bug 的报告用例 2src/main/java/zuo/biao/apijson/JSONObject.java: 411 (可信度: 95%) /**put and return value
* @param key StringUtil.isEmpty(key, true) ? key = value.getClass().getSimpleName();
* @param value
* @return value
*/
@Override
public Object put(String key, Object value) {
if (value == null) {
Log.e(TAG, "put value == null >> return null;");
return null;
}
if (StringUtil.isEmpty(key, true)) {
Class<?> clazz = value.getClass();
if (clazz == null || clazz.getAnnotation(MethodAccess.class) == null) {
throw new IllegalArgumentException("puts StringUtil.isNotEmpty(key, true) == false" +
" && clazz == null || clazz.getAnnotation(MethodAccess.class) == null" +
" \n key为空时仅支持 类型被@MethodAccess注解 的value !!!" +
" \n 如果一定要这么用,请对 " + clazz.getName() + " 注解!" +
" \n 如果是类似 key[]:{} 结构的请求,建议用 putsAll(...) !");
}
key = value.getClass().getSimpleName();
}
return super.put(key, value);
}
406 行 |
|
确实是验证为 bug 的报告用例 1 |
环境信息
问题描述
我们用我们的源伞Pinopint扫描器扫描出一些有趣的报告,可以参考看看是否有修复价值。
错误信息
APIJSON项目 - 2018年11月16日10-25-54批次 - 已标注缺陷html报告 - 2018年11月16日10-34-30.pdf