Update 'weaver' code to use genericstags/V1_9_8
@@ -386,7 +386,7 @@ public class BcelWeaver { | |||
inJar = new JarFile(inFile); | |||
try { | |||
addManifest(inJar.getManifest()); | |||
Enumeration entries = inJar.entries(); | |||
Enumeration<JarEntry> entries = inJar.entries(); | |||
while (entries.hasMoreElements()) { | |||
JarEntry entry = (JarEntry) entries.nextElement(); | |||
@@ -878,7 +878,7 @@ public class BcelWeaver { | |||
return true; | |||
} | |||
private Pointcut findFirstPointcutIn(Pointcut toSearch, Class toLookFor) { | |||
private Pointcut findFirstPointcutIn(Pointcut toSearch, Class<?> toLookFor) { | |||
if (toSearch instanceof NotPointcut) { | |||
return null; | |||
} | |||
@@ -946,7 +946,7 @@ public class BcelWeaver { | |||
manifest = new Manifest(); | |||
Map attributes = manifest.getMainAttributes(); | |||
Attributes attributes = manifest.getMainAttributes(); | |||
attributes.put(Name.MANIFEST_VERSION, WEAVER_MANIFEST_VERSION); | |||
attributes.put(CREATED_BY, WEAVER_CREATED_BY); | |||
} | |||
@@ -1254,7 +1254,7 @@ public class BcelWeaver { | |||
// if a piece of advice hasn't matched anywhere and we are in -1.5 mode, | |||
// put out a warning | |||
if (world.isInJava5Mode() && world.getLint().adviceDidNotMatch.isEnabled()) { | |||
List l = world.getCrosscuttingMembersSet().getShadowMungers(); | |||
List<ShadowMunger> l = world.getCrosscuttingMembersSet().getShadowMungers(); | |||
Set<AdviceLocation> alreadyWarnedLocations = new HashSet<>(); | |||
for (Object o : l) { |
@@ -87,7 +87,7 @@ public abstract class ExtensibleURLClassLoader extends URLClassLoader { | |||
return b; | |||
} | |||
private Class defineClass(String name, byte[] bytes /* ClassPathManager.ClassFile classFile */) throws IOException { | |||
private Class<?> defineClass(String name, byte[] bytes /* ClassPathManager.ClassFile classFile */) throws IOException { | |||
String packageName = getPackageName(name); | |||
if (packageName != null) { | |||
Package pakkage = getPackage(packageName); |
@@ -20,7 +20,7 @@ public class LightXMLParser { | |||
private final static char NULL_CHAR = '\0'; | |||
private Map<String, Object> attributes; | |||
private ArrayList children; | |||
private ArrayList<LightXMLParser> children; | |||
private String name; | |||
private char pushedBackChar; | |||
private Reader reader; | |||
@@ -38,7 +38,7 @@ public class LightXMLParser { | |||
public LightXMLParser() { | |||
this.name = null; | |||
this.attributes = new HashMap<>(); | |||
this.children = new ArrayList(); | |||
this.children = new ArrayList<>(); | |||
} | |||
public ArrayList getChildrens() { | |||
@@ -53,7 +53,7 @@ public class LightXMLParser { | |||
this.pushedBackChar = NULL_CHAR; | |||
this.attributes = new HashMap<>(); | |||
this.name = null; | |||
this.children = new ArrayList(); | |||
this.children = new ArrayList<>(); | |||
this.reader = reader; | |||
while (true) { |
@@ -80,7 +80,7 @@ public class SimpleAOPParser { | |||
return sap.m_definition; | |||
} | |||
private void startElement(String qName, Map attrMap) throws Exception { | |||
private void startElement(String qName, Map<String, Object> attrMap) throws Exception { | |||
if (ASPECT_ELEMENT.equals(qName)) { | |||
String name = (String) attrMap.get(NAME_ATTRIBUTE); | |||
String scopePattern = replaceXmlAnd((String) attrMap | |||
@@ -233,7 +233,7 @@ public class SimpleAOPParser { | |||
} | |||
} | |||
private String getWithinAttribute(Map attributes) { | |||
private String getWithinAttribute(Map<String, Object> attributes) { | |||
return replaceXmlAnd((String) attributes.get(WITHIN_ATTRIBUTE)); | |||
} | |||
@@ -253,7 +253,7 @@ public class SimpleAOPParser { | |||
private static void traverse(SimpleAOPParser sap, LightXMLParser xml) | |||
throws Exception { | |||
sap.startElement(xml.getName(), xml.getAttributes()); | |||
Iterable childrens = xml.getChildrens(); | |||
Iterable<LightXMLParser> childrens = xml.getChildrens(); | |||
for (Object children : childrens) { | |||
LightXMLParser child = (LightXMLParser) children; | |||
traverse(sap, child); |
@@ -177,17 +177,17 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld { | |||
return ReflectionWorld.resolve(this, aClass); | |||
} | |||
private static Map makeConcurrentMap() { | |||
private static Map<?, ?> makeConcurrentMap() { | |||
if (concurrentMapClass != null) { | |||
try { | |||
return (Map) concurrentMapClass.getDeclaredConstructor().newInstance(); | |||
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | InvocationTargetException ignored) {} | |||
// fall through if exceptions | |||
} | |||
return Collections.synchronizedMap(new HashMap()); | |||
return Collections.synchronizedMap(new HashMap<>()); | |||
} | |||
private static Class makeConcurrentMapClass() { | |||
private static Class<?> makeConcurrentMapClass() { | |||
String betterChoices[] = { "java.util.concurrent.ConcurrentHashMap", | |||
"edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap", | |||
"EDU.oswego.cs.dl.util.concurrent.ConcurrentHashMap" }; | |||
@@ -215,7 +215,7 @@ public class LTWWorld extends BcelWorld implements IReflectionWorld { | |||
// One type is completed at a time, if multiple need doing then they | |||
// are queued up | |||
private boolean typeCompletionInProgress = false; | |||
private List/* ResolvedType */typesForCompletion = new ArrayList(); | |||
private List<ResolvedType> typesForCompletion = new ArrayList<>(); | |||
@Override | |||
protected void completeBinaryType(ResolvedType ret) { |
@@ -165,7 +165,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { | |||
anns = bcelMethod.getAnnotations(); | |||
} | |||
} else if (onMember instanceof Constructor) { | |||
org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor) onMember); | |||
org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor<?>) onMember); | |||
anns = bcelCons.getAnnotations(); | |||
} else if (onMember instanceof Field) { | |||
org.aspectj.apache.bcel.classfile.Field bcelField = jc.getField((Field) onMember); | |||
@@ -235,7 +235,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { | |||
anns = bcelMethod.getAnnotations(); | |||
} | |||
} else if (onMember instanceof Constructor) { | |||
org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor) onMember); | |||
org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor<?>) onMember); | |||
anns = bcelCons.getAnnotations(); | |||
} else if (onMember instanceof Field) { | |||
org.aspectj.apache.bcel.classfile.Field bcelField = jc.getField((Field) onMember); | |||
@@ -311,7 +311,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { | |||
lvt = bcelMethod.getLocalVariableTable(); | |||
numVars = bcelMethod.getArgumentTypes().length; | |||
} else if (forMember instanceof Constructor) { | |||
org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor) forMember); | |||
org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor<?>) forMember); | |||
lvt = bcelCons.getLocalVariableTable(); | |||
numVars = bcelCons.getArgumentTypes().length; | |||
} | |||
@@ -361,7 +361,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { | |||
anns = bcelMethod.getParameterAnnotations(); | |||
} | |||
} else if (onMember instanceof Constructor) { | |||
org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor) onMember); | |||
org.aspectj.apache.bcel.classfile.Method bcelCons = jc.getMethod((Constructor<?>) onMember); | |||
anns = bcelCons.getParameterAnnotations(); | |||
} else if (onMember instanceof Field) { | |||
// anns = null; | |||
@@ -391,7 +391,7 @@ public class Java15AnnotationFinder implements AnnotationFinder, ArgNameFinder { | |||
if (onMember instanceof Method) { | |||
anns = ((Method) ao).getParameterAnnotations(); | |||
} else if (onMember instanceof Constructor) { | |||
anns = ((Constructor) ao).getParameterAnnotations(); | |||
anns = ((Constructor<?>) ao).getParameterAnnotations(); | |||
} else if (onMember instanceof Field) { | |||
// anns = null; | |||
} |
@@ -43,7 +43,7 @@ public class Java15GenericSignatureInformationProvider implements | |||
if (member instanceof Method) { | |||
pTypes = ((Method)member).getGenericParameterTypes(); | |||
} else if (member instanceof Constructor) { | |||
pTypes = ((Constructor)member).getGenericParameterTypes(); | |||
pTypes = ((Constructor<?>)member).getGenericParameterTypes(); | |||
} | |||
return typeConverter.fromTypes(pTypes); | |||
} | |||
@@ -60,7 +60,7 @@ public class Java15GenericSignatureInformationProvider implements | |||
} else if (member instanceof Method) { | |||
return typeConverter.fromType(((Method)member).getGenericReturnType()); | |||
} else if (member instanceof Constructor) { | |||
return typeConverter.fromType(((Constructor)member).getDeclaringClass()); | |||
return typeConverter.fromType(((Constructor<?>)member).getDeclaringClass()); | |||
} else { | |||
throw new IllegalStateException("unexpected member type: " + member); | |||
} | |||
@@ -86,7 +86,7 @@ public class Java15GenericSignatureInformationProvider implements | |||
if (member instanceof Method) { | |||
return ((Method)member).isVarArgs(); | |||
} else if (member instanceof Constructor) { | |||
return ((Constructor)member).isVarArgs(); | |||
return ((Constructor<?>)member).isVarArgs(); | |||
} else { | |||
return false; | |||
} |
@@ -235,7 +235,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends ReflectionBasedR | |||
return ret; | |||
} | |||
private ResolvedMember createGenericConstructorMember(Constructor forConstructor) { | |||
private ResolvedMember createGenericConstructorMember(Constructor<?> forConstructor) { | |||
ReflectionBasedResolvedMemberImpl ret = new ReflectionBasedResolvedMemberImpl(org.aspectj.weaver.Member.METHOD, | |||
getGenericResolvedType(), forConstructor.getModifiers(), | |||
// to return what BCEL returns the return type is void | |||
@@ -268,7 +268,7 @@ public class Java15ReflectionBasedReferenceTypeDelegate extends ReflectionBasedR | |||
} else { | |||
parser = new InternalUseOnlyPointcutParser(classLoaderReference.getClassLoader()); | |||
} | |||
Set additionalPointcutHandlers = world.getRegisteredPointcutHandlers(); | |||
Set<PointcutDesignatorHandler> additionalPointcutHandlers = world.getRegisteredPointcutHandlers(); | |||
for (Object additionalPointcutHandler : additionalPointcutHandlers) { | |||
PointcutDesignatorHandler handler = (PointcutDesignatorHandler) additionalPointcutHandler; | |||
parser.registerPointcutDesignatorHandler(handler); |
@@ -45,7 +45,7 @@ public class JavaLangTypeToResolvedTypeConverter { | |||
public ResolvedType fromType(Type type) { | |||
if (type instanceof Class) { | |||
Class clazz = (Class) type; | |||
Class<?> clazz = (Class<?>) type; | |||
String name = clazz.getName(); | |||
/** | |||
* getName() can return: | |||
@@ -87,7 +87,7 @@ public class JavaLangTypeToResolvedTypeConverter { | |||
if (inprogressVar != null) { | |||
return inprogressVar; | |||
} | |||
java.lang.reflect.TypeVariable tv = (java.lang.reflect.TypeVariable) type; | |||
java.lang.reflect.TypeVariable<?> tv = (java.lang.reflect.TypeVariable<?>) type; | |||
TypeVariable rt_tv = new TypeVariable(tv.getName()); | |||
TypeVariableReferenceType tvrt = new TypeVariableReferenceType(rt_tv, getWorld()); | |||
typeVariablesInProgress.put(type, tvrt); // record what we are working on, for recursion case |
@@ -566,7 +566,7 @@ public class WeavingAdaptor implements IMessageContext { | |||
return wcp.getBytes(); | |||
} | |||
private void registerAspectLibraries(List aspectPath) { | |||
private void registerAspectLibraries(List<String> aspectPath) { | |||
// System.err.println("? WeavingAdaptor.registerAspectLibraries(" + aspectPath + ")"); | |||
for (Object o : aspectPath) { | |||
String libName = (String) o; |