MCPcopy Create free account
hub / github.com/LFYSec/MScan / toType

Method toType

src/main/java/pascal/taie/analysis/pta/plugin/util/CSObjs.java:124–128  ·  view source on GitHub ↗

Converts a CSObj of class to corresponding type. If the object is not a class constant, then return null.

(CSObj csObj)

Source from the content-addressed store, hash-verified

122 * not a class constant, then return null.
123 */
124 @Nullable
125 public static Type toType(CSObj csObj) {
126 Object alloc = csObj.getObject().getAllocation();
127 return alloc instanceof ClassLiteral cls ? cls.getTypeValue() : null;
128 }
129
130 /**
131 * Converts a CSObj of MethodType to corresponding MethodType.

Callers 4

methodType1ClassMethod · 0.95
methodType2ClassesMethod · 0.95
methodTypeClassMTMethod · 0.95
arrayNewInstanceMethod · 0.95

Calls 3

getTypeValueMethod · 0.80
getObjectMethod · 0.65
getAllocationMethod · 0.45

Tested by

no test coverage detected