Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2d4176b

Browse files
author
Benjamin Muskalla
committed
Ignore Number-derived types
1 parent dbd393b commit 2d4176b

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

java/ql/src/utils/model-generator/CaptureSummaryModels.ql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ predicate isRelevantType(Type t) {
259259
not t instanceof EnumType and
260260
not t instanceof PrimitiveType and
261261
not t instanceof BoxedType and
262-
not t.(RefType).hasQualifiedName("java.math", "BigInteger") and
262+
not t.(RefType).getAnAncestor().hasQualifiedName("java.lang", "Number") and
263263
(
264264
not t.(Array).getElementType() instanceof PrimitiveType or
265265
isPrimitiveTypeUsedForBulkData(t.(Array).getElementType())

java/ql/test/utils/model-generator/p/Pojo.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package p;
22

3+
import java.math.BigDecimal;
34
import java.math.BigInteger;
45
import java.util.Arrays;
56
import java.util.Collection;
@@ -86,6 +87,10 @@ public BigInteger getBigInt() {
8687
return BigInteger.valueOf(intValue);
8788
}
8889

90+
public BigDecimal getBigDecimal() {
91+
return new BigDecimal(value);
92+
}
93+
8994
public void fillIn(List<String> target) {
9095
target.add(value);
9196
}

0 commit comments

Comments
 (0)