ResolvedType resolvedTypeFromTypeMap = typeMap.get(signature);
public BcelObjectType addSourceObjectType(String classname, byte[] bytes, boolean artificial) { BcelObjectType retval = null; String signature = UnresolvedType.forName(classname).getSignature(); ResolvedType resolvedTypeFromTypeMap = typeMap.get(signature);
ResolvedType rawType = typeMap.get(rawSignature); if (rawType == null) { rawType = resolve(UnresolvedType.forSignature(rawSignature), allowMissing);
/** * The aim of this method is to make sure a particular type is 'ok'. Some operations on the delegate for a type modify it and * this method is intended to undo that... see pr85132 */ @Override public void validateType(UnresolvedType type) { ResolvedType result = typeMap.get(type.getSignature()); if (result == null) { return; // We haven't heard of it yet } if (!result.isExposedToWeaver()) { return; // cant need resetting } result.ensureConsistent(); // If we want to rebuild it 'from scratch' then: // ClassParser cp = new ClassParser(new // ByteArrayInputStream(newbytes),new String(cs)); // try { // rt.setDelegate(makeBcelObjectType(rt,cp.parse(),true)); // } catch (ClassFormatException e) { // e.printStackTrace(); // } catch (IOException e) { // e.printStackTrace(); // } }
/** * Some TypeFactory operations create resolved types directly, but these won't be in the typeMap - this resolution process puts * them there. Resolved types are also told their world which is needed for the special autoboxing resolved types. */ public ResolvedType resolve(ResolvedType ty) { if (ty.isTypeVariableReference()) { return ty; // until type variables have proper sigs... } ResolvedType resolved = typeMap.get(ty.getSignature()); if (resolved == null) { resolved = ensureRawTypeIfNecessary(ty); typeMap.put(ty.getSignature(), resolved); resolved = ty; } resolved.world = this; return resolved; }
/** * Lookup a reference type in the world by its signature. Returns null if not found. */ public ReferenceType lookupBySignature(String signature) { return (ReferenceType) typeMap.get(signature); }