Usages of

com.ibm.wala.types.TypeName.string2TypeName(?)
@Override protected void doNewObject(WalkContext context, CAstNode newNode, int result, Object type, int[] arguments) { assert arguments == null; TypeReference typeRef = TypeReference.findOrCreate(JavaScriptTypes.jsLoader, TypeName.string2TypeName("L" + type)); context.cfg().addInstruction(insts.NewInstruction(context.cfg().getCurrentInstruction(), result, NewSiteReference.make(context.cfg().getCurrentInstruction(), typeRef))); }
@Override public Entrypoint next() { TypeReference T = TypeReference.findOrCreate(loaderRef, TypeName.string2TypeName(classNames[index++])); MethodReference mainRef = MethodReference.findOrCreate(T, mainMethod, Descriptor .findOrCreateUTF8("([Ljava/lang/String;)V")); return new DefaultEntrypoint(mainRef, cha); }
/** * Create (or reuse) a TypeReference for the given JDT Type Binding.<br> * This method canonicalizes the TypeReferences */ public TypeReference getTypeRef(ITypeBinding type) { type = JDT2CAstUtils.getErasedType((ITypeBinding) type, fAst); // GENERICS: erasure... if (!fTypeMap.containsKey(type.getKey())) { TypeName typeName = TypeName.string2TypeName(typeToTypeID(type)); TypeReference ref = TypeReference.findOrCreate(fClassLoaderRef, typeName); fTypeMap.put(type.getKey(), ref); return ref; } return fTypeMap.get(type.getKey()); }
/** * Create (or reuse) a TypeReference for the given JDT Type Binding.<br> * This method canonicalizes the TypeReferences */ public TypeReference getTypeRef(ITypeBinding type) { type = JDT2CAstUtils.getErasedType(type, fAst); // GENERICS: erasure... if (!fTypeMap.containsKey(type.getKey())) { TypeName typeName = TypeName.string2TypeName(typeToTypeID(type)); TypeReference ref = TypeReference.findOrCreate(fClassLoaderRef, typeName); fTypeMap.put(type.getKey(), ref); return ref; } return fTypeMap.get(type.getKey()); }
/** * Test for subtype tests with interfaces; bug reported by Bruno Dufour */ @Test public void test1() { TypeReference prep_stmt_type = TypeReference.findOrCreate(ClassLoaderReference.Primordial, TypeName .string2TypeName("Ljava/sql/PreparedStatement")); TypeReference stmt_type = TypeReference.findOrCreate(ClassLoaderReference.Primordial, TypeName .string2TypeName("Ljava/sql/Statement")); IClass prep_stmt = cha.lookupClass(prep_stmt_type); IClass stmt = cha.lookupClass(stmt_type); Assert.assertTrue("did not find PreparedStatement", prep_stmt != null); Assert.assertTrue("did not find Statement", stmt != null); Assert.assertTrue(cha.implementsInterface(prep_stmt, stmt)); Assert.assertFalse(cha.implementsInterface(stmt, prep_stmt)); Assert.assertTrue(cha.isAssignableFrom(stmt, prep_stmt)); Assert.assertFalse(cha.isAssignableFrom(prep_stmt, stmt)); }
public static MethodReference getMethodReference(String funName) { boolean ctor = funName.startsWith("ctor:"); MethodReference MR; if (ctor) { TypeReference TR = TypeReference.findOrCreate(JavaScriptTypes.jsLoader, TypeName.string2TypeName("L" + funName.substring(5))); MR = JavaScriptMethods.makeCtorReference(TR); } else { TypeReference TR = TypeReference.findOrCreate(JavaScriptTypes.jsLoader, TypeName.string2TypeName("L" + funName)); MR = AstMethodReference.fnReference(TR); } return MR; }
public IClass lookupClass(String className, IClassHierarchy cha) { assert this.cha == cha; return types.get(TypeName.string2TypeName(className)); }
public IClass lookupClass(String className, IClassHierarchy cha) { assert this.cha == cha; return (IClass) types.get(TypeName.string2TypeName(className)); }
public IClass lookupClass(String className, IClassHierarchy cha) { assert this.cha == cha; return (IClass) types.get(TypeName.string2TypeName(className)); }
public MethodReference asyncEntityToMethodReference(CAstEntity asyncEntity) { CAstType.Method bodyType= (CAstType.Method) asyncEntity.getType(); CAstType retType= bodyType.getReturnType(); // CAstType owningType= bodyType.getDeclaringType(); // JavaSourceLoaderImpl fLoader = translator.loader(); Atom asyncName= Atom.findOrCreateUnicodeAtom(asyncEntity.getName()); Descriptor asyncDesc= Descriptor.findOrCreate(null, TypeName.string2TypeName(retType.getName())); // RMF 1/12/07 - Type ref must agree with what's used when the async type is defined! // The following commented-out version didn't do that... // TypeReference owningTypeRef= TypeReference.findOrCreate(fLoader.getReference(), TypeName.string2TypeName(owningType.getName())); TypeReference owningTypeRef= asyncTypeReference(asyncEntity); return MethodReference.findOrCreate(owningTypeRef, asyncName, asyncDesc); }
Usage snippet has been bookmarked! Review your bookmarks
Thank you! Review your likes