ReferenceType derivative = derivativeRef.get(); if (derivative != null) { derivative.setDelegate(delegate); } else { forRemoval.add(derivativeRef); ReferenceType genType = (ReferenceType) getGenericType(); if (genType.getDelegate() != delegate) { // avoids circular updates genType.setDelegate(delegate);
protected ResolvedType completeNonLocalType(ResolvedType ret) { if (ret.isMissing()) { return ret; // who knows ?!? } ResolvedType toResolve = ret; if (ret.isParameterizedType() || ret.isGenericType()) { toResolve = toResolve.getGenericType(); } ReferenceTypeDelegate rtd = resolveReflectionTypeDelegate((ReferenceType) toResolve, getClassLoader()); ((ReferenceType) ret).setDelegate(rtd); return ret; }
ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, ret.getDeclaredGenericSignature()), this); rawType.setDelegate(ret); genericRefType.setDelegate(ret); rawType.setGenericType(genericRefType); typeMap.put(signature, rawType);
ReferenceType genericRefType = new ReferenceType(UnresolvedType.forGenericTypeSignature(signature, retval.getDeclaredGenericSignature()), this); referenceTypeFromTypeMap.setDelegate(retval); genericRefType.setDelegate(retval); referenceTypeFromTypeMap.setGenericType(genericRefType); typeMap.put(signature, referenceTypeFromTypeMap);
ReferenceType genericRefType = makeGenericTypeFrom(delegate, ((ReferenceType) rawType)); ((ReferenceType) rawType).setGenericType(genericRefType); genericRefType.setDelegate(delegate); ((ReferenceType) rawType).setDelegate(delegate); return genericRefType;
/** * When the world is operating in 1.5 mode, the TypeMap should only contain RAW types and never directly generic types. The RAW * type will contain a reference to the generic type. * * @param type a possibly generic type for which the raw needs creating as it is not currently in the world * @return a type suitable for putting into the world */ private ResolvedType ensureRawTypeIfNecessary(ResolvedType type) { if (!isInJava5Mode() || type.isRawType()) { return type; } // Key requirement here is if it is generic, create a RAW entry to be put in the map that points to it if (type instanceof ReferenceType && ((ReferenceType) type).getDelegate() != null && type.isGenericType()) { ReferenceType rawType = new ReferenceType(type.getSignature(), this); rawType.typeKind = UnresolvedType.TypeKind.RAW; ReferenceTypeDelegate delegate = ((ReferenceType) type).getDelegate(); rawType.setDelegate(delegate); rawType.setGenericType((ReferenceType) type); return rawType; } // probably parameterized... return type; }
BcelObjectType(ReferenceType resolvedTypeX, JavaClass javaClass, boolean artificial, boolean exposedToWeaver) { super(resolvedTypeX, exposedToWeaver); this.javaClass = javaClass; this.artificial = artificial; initializeFromJavaclass(); // ATAJ: set the delegate right now for @AJ pointcut, else it is done // too late to lookup // @AJ pc refs annotation in class hierarchy resolvedTypeX.setDelegate(this); ISourceContext sourceContext = resolvedTypeX.getSourceContext(); if (sourceContext == SourceContextImpl.UNKNOWN_SOURCE_CONTEXT) { sourceContext = new SourceContextImpl(this); setSourceContext(sourceContext); } // this should only ever be java.lang.Object which is // the only class in Java-1.4 with no superclasses isObject = (javaClass.getSuperclassNameIndex() == 0); ensureAspectJAttributesUnpacked(); // if (sourceContext instanceof SourceContextImpl) { // ((SourceContextImpl)sourceContext).setSourceFileName(javaClass. // getSourceFileName()); // } setSourcefilename(javaClass.getSourceFileName()); }
simpleOrRawType.setDelegate(delegate); genericType.setDelegate(delegate); simpleOrRawType.setGenericType(genericType); return simpleOrRawType; } else { simpleOrRawType.setDelegate(delegate); return simpleOrRawType;
GeneratedReferenceTypeDelegate grtd = new GeneratedReferenceTypeDelegate(rt); grtd.setSuperclass(parent); rt.setDelegate(grtd);