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();
return true;
}
- private Pointcut findFirstPointcutIn(Pointcut toSearch, Class toLookFor) {
+ private Pointcut findFirstPointcutIn(Pointcut toSearch, Class<?> toLookFor) {
if (toSearch instanceof NotPointcut) {
return null;
}
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);
}
// 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) {
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);
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;
public LightXMLParser() {
this.name = null;
this.attributes = new HashMap<>();
- this.children = new ArrayList();
+ this.children = new ArrayList<>();
}
public ArrayList getChildrens() {
this.pushedBackChar = NULL_CHAR;
this.attributes = new HashMap<>();
this.name = null;
- this.children = new ArrayList();
+ this.children = new ArrayList<>();
this.reader = reader;
while (true) {
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
}
}
- private String getWithinAttribute(Map attributes) {
+ private String getWithinAttribute(Map<String, Object> attributes) {
return replaceXmlAnd((String) attributes.get(WITHIN_ATTRIBUTE));
}
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);
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" };
// 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) {
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);
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);
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;
}
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;
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;
}
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);
}
} 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);
}
if (member instanceof Method) {
return ((Method)member).isVarArgs();
} else if (member instanceof Constructor) {
- return ((Constructor)member).isVarArgs();
+ return ((Constructor<?>)member).isVarArgs();
} else {
return false;
}
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
} 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);
public ResolvedType fromType(Type type) {
if (type instanceof Class) {
- Class clazz = (Class) type;
+ Class<?> clazz = (Class<?>) type;
String name = clazz.getName();
/**
* getName() can return:
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
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;