Exclude models for simpler types

Avoid generating models for types that can't really propagate taint
in a valuable way (e.g. primitivies, BigInt, ..). Keep tracking
bulk-like data (e.g. char[] or byte[]).
This commit is contained in:
Benjamin Muskalla
2021-10-19 13:24:32 +02:00
parent 842f617bc1
commit f36bb8baaf
2 changed files with 46 additions and 6 deletions

View File

@@ -1,5 +1,7 @@
package p;
import java.math.BigInteger;
import java.util.Collection;
import java.util.List;
public final class Pojo {
@@ -37,6 +39,34 @@ public final class Pojo {
return intValue;
}
public Integer getBoxedValue() {
return Integer.valueOf(intValue);
}
public int[] getPrimitiveArray() {
return new int[] { intValue };
}
public char[] getCharArray() {
return Character.toChars(intValue);
}
public byte[] getByteArray() {
return new byte[] { (byte) intValue };
}
public Integer[] getBoxedArray() {
return new Integer[] { Integer.valueOf(intValue) };
}
public Collection<Integer> getBoxedCollection() {
return List.of(Integer.valueOf(intValue));
}
public BigInteger getBigInt() {
return BigInteger.valueOf(intValue);
}
public void fillIn(List<String> target) {
target.add(value);
}