[chore](vulnerability) fix fe high risk vulnerability scanned by bug scanner (#15649)

This commit is contained in:
Zhengguo Yang
2023-01-10 17:44:18 +08:00
committed by GitHub
parent 672d11522b
commit 503b6ee4da
19 changed files with 86 additions and 28 deletions

View File

@ -320,20 +320,24 @@ public class BitmapValue {
}
}
public boolean equals(BitmapValue other) {
boolean ret = false;
if (this.bitmapType != other.bitmapType) {
@Override
public boolean equals(Object other) {
if (other == null || !(other instanceof BitmapValue)) {
return false;
}
switch (other.bitmapType) { // CHECKSTYLE IGNORE THIS LINE: missing switch default
boolean ret = false;
if (this.bitmapType != ((BitmapValue) other).bitmapType) {
return false;
}
switch (((BitmapValue) other).bitmapType) { // CHECKSTYLE IGNORE THIS LINE: missing switch default
case EMPTY:
ret = true;
break;
case SINGLE_VALUE:
ret = this.singleValue == other.singleValue;
ret = this.singleValue == ((BitmapValue) other).singleValue;
break;
case BITMAP_VALUE:
ret = bitmap.equals(other.bitmap);
ret = bitmap.equals(((BitmapValue) other).bitmap);
}
return ret;
}

View File

@ -281,7 +281,7 @@ public final class FieldReflection {
private static boolean isSameType(Class<?> firstType, Class<?> secondType) {
return firstType == secondType
|| firstType.isPrimitive() && firstType == AutoType.getPrimitiveType(secondType)
|| secondType.isPrimitive() && firstType == AutoType.getPrimitiveType(secondType);
|| secondType.isPrimitive() && secondType == AutoType.getPrimitiveType(firstType);
}
}

View File

@ -158,6 +158,6 @@ public final class MethodReflection {
private static boolean isSameType(Class<?> firstType, Class<?> secondType) {
return firstType == secondType
|| firstType.isPrimitive() && firstType == AutoType.getPrimitiveType(secondType)
|| secondType.isPrimitive() && firstType == AutoType.getPrimitiveType(secondType);
|| secondType.isPrimitive() && secondType == AutoType.getPrimitiveType(firstType);
}
}