*/
public AjType<? super T> getSupertype() {
Class<? super T> superclass = clazz.getSuperclass();
- return superclass==null ? null : (AjType<? super T>) new AjTypeImpl(superclass);
+ return superclass==null ? null : (AjType<? super T>) new AjTypeImpl<>(superclass);
}
/* (non-Javadoc)
*/
public AjType<?> getEnclosingType() {
Class<?> enc = clazz.getEnclosingClass();
- return enc != null ? new AjTypeImpl(enc) : null;
+ return enc != null ? new AjTypeImpl<>(enc) : null;
}
/* (non-Javadoc)
* @see org.aspectj.lang.reflect.AjType#getDeclaringType()
*/
public AjType<?> getDeclaringType() {
- Class dec = clazz.getDeclaringClass();
- return dec != null ? new AjTypeImpl(dec) : null;
+ Class<?> dec = clazz.getDeclaringClass();
+ return dec != null ? new AjTypeImpl<>(dec) : null;
}
public PerClause getPerClause() {
/* (non-Javadoc)
* @see org.aspectj.lang.reflect.AjType#getDeclaredAdvice(org.aspectj.lang.reflect.AdviceType)
*/
- private Advice[] getDeclaredAdvice(Set ofAdviceTypes) {
+ private Advice[] getDeclaredAdvice(Set<AdviceKind> ofAdviceTypes) {
if (declaredAdvice == null) initDeclaredAdvice();
List<Advice> adviceList = new ArrayList<>();
for (Advice a : declaredAdvice) {
/* (non-Javadoc)
* @see org.aspectj.lang.reflect.AjType#getDeclaredAdvice(org.aspectj.lang.reflect.AdviceType)
*/
- private Advice[] getAdvice(Set ofAdviceTypes) {
+ private Advice[] getAdvice(Set<AdviceKind> ofAdviceTypes) {
if (advice == null) initAdvice();
List<Advice> adviceList = new ArrayList<>();
for (Advice a : advice) {
@Override
public boolean equals(Object obj) {
if (!(obj instanceof AjTypeImpl)) return false;
- AjTypeImpl other = (AjTypeImpl) obj;
+ AjTypeImpl<?> other = (AjTypeImpl<?>) obj;
return other.clazz.equals(clazz);
}
private PointcutExpression pc;
private String msg;
private boolean isError;
- private AjType declaringType;
+ private AjType<?> declaringType;
public DeclareErrorOrWarningImpl(String pointcut, String message, boolean isError, AjType decType) {
this.pc = new PointcutExpressionImpl(pointcut);
private final String name;
private final PointcutExpression pc;
private final Method baseMethod;
- private final AjType declaringType;
+ private final AjType<?> declaringType;
private String[] parameterNames = new String[0];
protected PointcutImpl(String name, String pc, Method method, AjType declaringType, String pNames) {
} catch (ClassNotFoundException e) {
// could be a type variable
TypeVariable[] tVars = classScope.getTypeParameters();
- for (TypeVariable tVar : tVars) {
+ for (TypeVariable<?> tVar : tVars) {
if (tVar.getName().equals(typeName)) {
return tVar;
}
}
}
- private static Type makeParameterizedType(String typeName, Class classScope)
+ private static Type makeParameterizedType(String typeName, Class<?> classScope)
throws ClassNotFoundException {
int paramStart = typeName.indexOf('<');
String baseName = typeName.substring(0, paramStart);
- final Class baseClass = Class.forName(baseName,false,classScope.getClassLoader());
+ final Class<?> baseClass = Class.forName(baseName,false,classScope.getClassLoader());
int paramEnd = typeName.lastIndexOf('>');
String params = typeName.substring(paramStart+1,paramEnd);
final Type[] typeParams = commaSeparatedListToTypeArray(params,classScope);
// -- hasAspect
- private static Method getSingletonOrThreadHasAspect(Class aspectClass) throws NoSuchMethodException {
+ private static Method getSingletonOrThreadHasAspect(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(HASASPECT, EMPTY_CLASS_ARRAY);
return checkHasAspect(method, aspectClass);
}
- private static Method getPerObjectHasAspect(Class aspectClass) throws NoSuchMethodException {
+ private static Method getPerObjectHasAspect(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(HASASPECT, PEROBJECT_CLASS_ARRAY);
return checkHasAspect(method, aspectClass);
}
- private static Method getPerTypeWithinHasAspect(Class aspectClass) throws NoSuchMethodException {
+ private static Method getPerTypeWithinHasAspect(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(HASASPECT, PERTYPEWITHIN_CLASS_ARRAY);
return checkHasAspect(method, aspectClass);
}
- private static Method checkHasAspect(Method method, Class aspectClass) throws NoSuchMethodException {
+ private static Method checkHasAspect(Method method, Class<?> aspectClass) throws NoSuchMethodException {
method.setAccessible(true);
if (!method.isAccessible()
|| !Modifier.isPublic(method.getModifiers())
// -- aspectOf
- private static Method getSingletonOrThreadAspectOf(Class aspectClass) throws NoSuchMethodException {
+ private static Method getSingletonOrThreadAspectOf(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(ASPECTOF, EMPTY_CLASS_ARRAY);
return checkAspectOf(method, aspectClass);
}
- private static Method getPerObjectAspectOf(Class aspectClass) throws NoSuchMethodException {
+ private static Method getPerObjectAspectOf(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(ASPECTOF, PEROBJECT_CLASS_ARRAY);
return checkAspectOf(method, aspectClass);
}
- private static Method getPerTypeWithinAspectOf(Class aspectClass) throws NoSuchMethodException {
+ private static Method getPerTypeWithinAspectOf(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(ASPECTOF, PERTYPEWITHIN_CLASS_ARRAY);
return checkAspectOf(method, aspectClass);
}
- private static Method checkAspectOf(Method method, Class aspectClass) throws NoSuchMethodException {
+ private static Method checkAspectOf(Method method, Class<?> aspectClass) throws NoSuchMethodException {
method.setAccessible(true);
if (!method.isAccessible()
|| !Modifier.isPublic(method.getModifiers())
// -- hasAspect
- private static Method getSingletonOrThreadHasAspect(Class aspectClass) throws NoSuchMethodException {
+ private static Method getSingletonOrThreadHasAspect(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(HASASPECT, EMPTY_CLASS_ARRAY);
return checkHasAspect(method, aspectClass);
}
- private static Method getPerObjectHasAspect(Class aspectClass) throws NoSuchMethodException {
+ private static Method getPerObjectHasAspect(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(HASASPECT, PEROBJECT_CLASS_ARRAY);
return checkHasAspect(method, aspectClass);
}
- private static Method getPerTypeWithinHasAspect(Class aspectClass) throws NoSuchMethodException {
+ private static Method getPerTypeWithinHasAspect(Class<?> aspectClass) throws NoSuchMethodException {
Method method = aspectClass.getDeclaredMethod(HASASPECT, PERTYPEWITHIN_CLASS_ARRAY);
return checkHasAspect(method, aspectClass);
}
- private static Method checkHasAspect(Method method, Class aspectClass) throws NoSuchMethodException {
+ private static Method checkHasAspect(Method method, Class<?> aspectClass) throws NoSuchMethodException {
method.setAccessible(true);
if (!method.isAccessible()
|| !Modifier.isPublic(method.getModifiers())
}
public void pop() {
- Stack s = getThreadStack();
+ Stack<?> s = getThreadStack();
s.pop();
if (s.isEmpty()) {
stackProxy.removeThreadStack();
}
public Object peek() {
- Stack stack = getThreadStack();
+ Stack<?> stack = getThreadStack();
if (stack.isEmpty()) throw new org.aspectj.lang.NoAspectBoundException();
return (Object)stack.peek();
}
}
public CFlow peekCFlow() {
- Stack stack = getThreadStack();
+ Stack<?> stack = getThreadStack();
if (stack.isEmpty()) return null;
return (CFlow)stack.peek();
}
public CFlow peekTopCFlow() {
- Stack stack = getThreadStack();
+ Stack<?> stack = getThreadStack();
if (stack.isEmpty()) return null;
return (CFlow)stack.elementAt(0);
}
import java.util.Hashtable;
public class ThreadCounterImpl11 implements ThreadCounter {
- private Hashtable counters = new Hashtable();
+ private Hashtable<Thread, Counter> counters = new Hashtable<>();
private Thread cached_thread;
private Counter cached_counter;
// Collect more often if there are many threads, but not *too* often
int size = Math.max(1, counters.size()); // should be >1 b/c always live threads, but...
if (change_count > Math.max(MIN_COLLECT_AT, COLLECT_AT/size)) {
- List dead_stacks = new ArrayList();
- for (Enumeration e = counters.keys(); e.hasMoreElements(); ) {
+ List<Thread> dead_stacks = new ArrayList<>();
+ for (Enumeration<Thread> e = counters.keys(); e.hasMoreElements(); ) {
Thread t = (Thread)e.nextElement();
if (!t.isAlive()) dead_stacks.add(t);
}
public class ThreadStackFactoryImpl implements ThreadStackFactory {
- private static class ThreadStackImpl extends ThreadLocal implements ThreadStack {
- public Object initialValue() {
+ private static class ThreadStackImpl extends ThreadLocal<Stack> implements ThreadStack {
+ public Stack initialValue() {
return new Stack();
}
public Stack getThreadStack() {
return new ThreadStackImpl();
}
- private static class ThreadCounterImpl extends ThreadLocal implements ThreadCounter {
+ private static class ThreadCounterImpl extends ThreadLocal<ThreadCounterImpl.Counter> implements ThreadCounter {
- public Object initialValue() {
+ public Counter initialValue() {
return new Counter();
}
public Counter getThreadCounter() {
import java.util.Stack;
public class ThreadStackImpl11 implements ThreadStack {
- private Hashtable stacks = new Hashtable();
+ private Hashtable<Thread, Stack> stacks = new Hashtable<>();
private Thread cached_thread;
private Stack cached_stack;
private int change_count = 0;
public synchronized Stack getThreadStack() {
if (Thread.currentThread() != cached_thread) {
cached_thread = Thread.currentThread();
- cached_stack = (Stack)stacks.get(cached_thread);
+ cached_stack = (Stack<?>)stacks.get(cached_thread);
if (cached_stack == null) {
- cached_stack = new Stack();
+ cached_stack = new Stack<>();
stacks.put(cached_thread, cached_stack);
}
change_count++;
// Collect more often if there are many threads, but not *too* often
int size = Math.max(1, stacks.size()); // should be >1 b/c always live threads, but...
if (change_count > Math.max(MIN_COLLECT_AT, COLLECT_AT/size)) {
- Stack dead_stacks = new Stack();
- for (Enumeration e = stacks.keys(); e.hasMoreElements(); ) {
+ Stack<Thread> dead_stacks = new Stack<>();
+ for (Enumeration<Thread> e = stacks.keys(); e.hasMoreElements(); ) {
Thread t = (Thread)e.nextElement();
if (!t.isAlive()) dead_stacks.push(t);
}
- for (Enumeration e = dead_stacks.elements(); e.hasMoreElements(); ) {
+ for (Enumeration<Thread> e = dead_stacks.elements(); e.hasMoreElements(); ) {
Thread t = (Thread)e.nextElement();
stacks.remove(t);
}
import org.aspectj.lang.reflect.AdviceSignature;
class AdviceSignatureImpl extends CodeSignatureImpl implements AdviceSignature {
- Class returnType;
+ Class<?> returnType;
private Method adviceMethod = null;
- AdviceSignatureImpl(int modifiers, String name, Class declaringType,
+ AdviceSignatureImpl(int modifiers, String name, Class<?> declaringType,
Class[] parameterTypes, String[] parameterNames, Class[] exceptionTypes,
- Class returnType)
+ Class<?> returnType)
{
super(modifiers, name, declaringType, parameterTypes, parameterNames,
exceptionTypes);
import org.aspectj.lang.reflect.CatchClauseSignature;
class CatchClauseSignatureImpl extends SignatureImpl implements CatchClauseSignature {
- Class parameterType;
+ Class<?> parameterType;
String parameterName;
- CatchClauseSignatureImpl(Class declaringType,
- Class parameterType, String parameterName)
+ CatchClauseSignatureImpl(Class<?> declaringType,
+ Class<?> parameterType, String parameterName)
{
super(0, "catch", declaringType);
this.parameterType = parameterType;
String[] parameterNames;
Class[] exceptionTypes;
- CodeSignatureImpl(int modifiers, String name, Class declaringType,
+ CodeSignatureImpl(int modifiers, String name, Class<?> declaringType,
Class[] parameterTypes, String[] parameterNames, Class[] exceptionTypes)
{
super(modifiers, name, declaringType);
import org.aspectj.lang.reflect.ConstructorSignature;
class ConstructorSignatureImpl extends CodeSignatureImpl implements ConstructorSignature {
- private Constructor constructor;
+ private Constructor<?> constructor;
- ConstructorSignatureImpl(int modifiers, Class declaringType,
+ ConstructorSignatureImpl(int modifiers, Class<?> declaringType,
Class[] parameterTypes, String[] parameterNames, Class[] exceptionTypes)
{
super(modifiers, "<init>", declaringType, parameterTypes, parameterNames, exceptionTypes);
import org.aspectj.lang.reflect.UnlockSignature;
public final class Factory {
- Class lexicalClass;
+ Class<?> lexicalClass;
ClassLoader lookupClassLoader;
String filename;
int count;
private static final Class[] NO_TYPES = new Class[0];
private static final String[] NO_STRINGS = new String[0];
- static Hashtable prims = new Hashtable();
+ static Hashtable<String, Class<?>> prims = new Hashtable<>();
static {
prims.put("void", Void.TYPE);
prims.put("boolean", Boolean.TYPE);
prims.put("double", Double.TYPE);
}
- static Class makeClass(String s, ClassLoader loader) {
+ static Class<?> makeClass(String s, ClassLoader loader) {
if (s.equals("*"))
return null;
- Class ret = (Class)prims.get(s);
+ Class<?> ret = (Class)prims.get(s);
if (ret != null)
return ret;
try {
.getReturnType());
kind = JoinPoint.METHOD_EXECUTION;
} else if (member instanceof Constructor) {
- Constructor cons = (Constructor) member;
+ Constructor<?> cons = (Constructor<?>) member;
sig = new ConstructorSignatureImpl(cons.getModifiers(), cons.getDeclaringClass(), cons.getParameterTypes(),
new String[cons.getParameterTypes().length], cons.getExceptionTypes());
kind = JoinPoint.CONSTRUCTOR_EXECUTION;
public MethodSignature makeMethodSig(String modifiers, String methodName, String declaringType, String paramTypes,
String paramNames, String exceptionTypes, String returnType) {
- Class declaringTypeClass = makeClass(declaringType, lookupClassLoader);
+ Class<?> declaringTypeClass = makeClass(declaringType, lookupClassLoader);
return makeMethodSig(modifiers, methodName, declaringTypeClass, paramTypes, paramNames, exceptionTypes, returnType);
}
for (int i = 0; i < numParams; i++)
exceptionTypeClasses[i] = makeClass(st.nextToken(), lookupClassLoader);
- Class returnTypeClass = makeClass(returnType, lookupClassLoader);
+ Class<?> returnTypeClass = makeClass(returnType, lookupClassLoader);
MethodSignatureImpl ret = new MethodSignatureImpl(modifiersAsInt, methodName, declaringTypeClass, paramTypeClasses,
paramNamesArray, exceptionTypeClasses, returnTypeClass);
String exceptionTypes) {
int modifiersAsInt = Integer.parseInt(modifiers, 16);
- Class declaringTypeClass = makeClass(declaringType, lookupClassLoader);
+ Class<?> declaringTypeClass = makeClass(declaringType, lookupClassLoader);
StringTokenizer st = new StringTokenizer(paramTypes, ":");
int numParams = st.countTokens();
public FieldSignature makeFieldSig(String modifiers, String name, String declaringType, String fieldType) {
int modifiersAsInt = Integer.parseInt(modifiers, 16);
- Class declaringTypeClass = makeClass(declaringType, lookupClassLoader);
- Class fieldTypeClass = makeClass(fieldType, lookupClassLoader);
+ Class<?> declaringTypeClass = makeClass(declaringType, lookupClassLoader);
+ Class<?> fieldTypeClass = makeClass(fieldType, lookupClassLoader);
FieldSignatureImpl ret = new FieldSignatureImpl(modifiersAsInt, name, declaringTypeClass, fieldTypeClass);
ret.setLookupClassLoader(lookupClassLoader);
String exceptionTypes, String returnType) {
int modifiersAsInt = Integer.parseInt(modifiers, 16);
- Class declaringTypeClass = makeClass(declaringType, lookupClassLoader);
+ Class<?> declaringTypeClass = makeClass(declaringType, lookupClassLoader);
StringTokenizer st = new StringTokenizer(paramTypes, ":");
int numParams = st.countTokens();
exceptionTypeClasses[i] = makeClass(st.nextToken(), lookupClassLoader);
;
- Class returnTypeClass = makeClass(returnType, lookupClassLoader);
+ Class<?> returnTypeClass = makeClass(returnType, lookupClassLoader);
AdviceSignatureImpl ret = new AdviceSignatureImpl(modifiersAsInt, name, declaringTypeClass, paramTypeClasses,
paramNamesArray, exceptionTypeClasses, returnTypeClass);
public InitializerSignature makeInitializerSig(String modifiers, String declaringType) {
int modifiersAsInt = Integer.parseInt(modifiers, 16);
- Class declaringTypeClass = makeClass(declaringType, lookupClassLoader);
+ Class<?> declaringTypeClass = makeClass(declaringType, lookupClassLoader);
InitializerSignatureImpl ret = new InitializerSignatureImpl(modifiersAsInt, declaringTypeClass);
ret.setLookupClassLoader(lookupClassLoader);
}
public CatchClauseSignature makeCatchClauseSig(String declaringType, String parameterType, String parameterName) {
- Class declaringTypeClass = makeClass(declaringType, lookupClassLoader);
+ Class<?> declaringTypeClass = makeClass(declaringType, lookupClassLoader);
StringTokenizer st = new StringTokenizer(parameterType, ":");
- Class parameterTypeClass = makeClass(st.nextToken(), lookupClassLoader);
+ Class<?> parameterTypeClass = makeClass(st.nextToken(), lookupClassLoader);
st = new StringTokenizer(parameterName, ":");
String parameterNameForReturn = st.nextToken();
}
public LockSignature makeLockSig() {
- Class declaringTypeClass = makeClass("Ljava/lang/Object;", lookupClassLoader);
+ Class<?> declaringTypeClass = makeClass("Ljava/lang/Object;", lookupClassLoader);
LockSignatureImpl ret = new LockSignatureImpl(declaringTypeClass);
ret.setLookupClassLoader(lookupClassLoader);
return ret;
}
public UnlockSignature makeUnlockSig() {
- Class declaringTypeClass = makeClass("Ljava/lang/Object;", lookupClassLoader);
+ Class<?> declaringTypeClass = makeClass("Ljava/lang/Object;", lookupClassLoader);
UnlockSignatureImpl ret = new UnlockSignatureImpl(declaringTypeClass);
ret.setLookupClassLoader(lookupClassLoader);
return ret;
import org.aspectj.lang.reflect.FieldSignature;
public class FieldSignatureImpl extends MemberSignatureImpl implements FieldSignature {
- Class fieldType;
+ Class<?> fieldType;
private Field field;
- FieldSignatureImpl(int modifiers, String name, Class declaringType,
- Class fieldType)
+ FieldSignatureImpl(int modifiers, String name, Class<?> declaringType,
+ Class<?> fieldType)
{
super(modifiers, name, declaringType);
this.fieldType = fieldType;
import java.lang.reflect.Modifier;
class InitializerSignatureImpl extends CodeSignatureImpl implements InitializerSignature {
- private Constructor constructor;
+ private Constructor<?> constructor;
- InitializerSignatureImpl(int modifiers, Class declaringType) {
+ InitializerSignatureImpl(int modifiers, Class<?> declaringType) {
super(modifiers, Modifier.isStatic(modifiers) ? "<clinit>" : "<init>", declaringType, EMPTY_CLASS_ARRAY,
EMPTY_STRING_ARRAY, EMPTY_CLASS_ARRAY);
}
import org.aspectj.lang.reflect.LockSignature;
class LockSignatureImpl extends SignatureImpl implements LockSignature {
- private Class parameterType;
+ private Class<?> parameterType;
- LockSignatureImpl(Class c) {
+ LockSignatureImpl(Class<?> c) {
super(Modifier.STATIC, "lock", c);
parameterType = c;
}
return "lock("+sm.makeTypeName(parameterType)+")";
}
- public Class getParameterType() {
+ public Class<?> getParameterType() {
if (parameterType == null) parameterType = extractType(3);
return parameterType;
}
abstract class MemberSignatureImpl extends SignatureImpl implements MemberSignature {
- MemberSignatureImpl(int modifiers, String name, Class declaringType) {
+ MemberSignatureImpl(int modifiers, String name, Class<?> declaringType) {
super(modifiers, name, declaringType);
}
class MethodSignatureImpl extends CodeSignatureImpl implements MethodSignature {
private Method method;
- Class returnType;
+ Class<?> returnType;
- MethodSignatureImpl(int modifiers, String name, Class declaringType, Class[] parameterTypes, String[] parameterNames,
- Class[] exceptionTypes, Class returnType) {
+ MethodSignatureImpl(int modifiers, String name, Class<?> declaringType, Class[] parameterTypes, String[] parameterNames,
+ Class[] exceptionTypes, Class<?> returnType) {
super(modifiers, name, declaringType, parameterTypes, parameterNames, exceptionTypes);
this.returnType = returnType;
}
*/
public Method getMethod() {
if (method == null) {
- Class dtype = getDeclaringType();
+ Class<?> dtype = getDeclaringType();
try {
method = dtype.getDeclaredMethod(getName(), getParameterTypes());
} catch (NoSuchMethodException nsmEx) {
// pr154427 - search
- Set searched = new HashSet();
+ Set<Class<?>> searched = new HashSet<>();
searched.add(dtype); // avoids another getDeclaredMethod() on dtype
method = search(dtype, getName(), getParameterTypes(), searched);
}
* @param searched a set of types already searched to avoid looking at anything twice
* @return the method if found, or null if not found
*/
- private Method search(Class type, String name, Class[] params, Set searched) {
+ private Method search(Class<?> type, String name, Class[] params, Set<Class<?>> searched) {
if (type == null) {
return null;
}
}
Class[] superinterfaces = type.getInterfaces();
if (superinterfaces != null) {
- for (Class superinterface : superinterfaces) {
+ for (Class<?> superinterface : superinterfaces) {
m = search(superinterface, name, params, searched);
if (m != null) {
return m;
int modifiers = -1;
String name;
String declaringTypeName;
- Class declaringType;
+ Class<?> declaringType;
Cache stringCache;
- SignatureImpl(int modifiers, String name, Class declaringType) {
+ SignatureImpl(int modifiers, String name, Class<?> declaringType) {
this.modifiers = modifiers;
this.name = name;
this.declaringType = declaringType;
return declaringTypeName;
}
- String fullTypeName(Class type) {
+ String fullTypeName(Class<?> type) {
if (type == null) return "ANONYMOUS";
if (type.isArray()) return fullTypeName(type.getComponentType()) + "[]";
return type.getName().replace('$', '.');
return name.substring(dot+1);
}
- String shortTypeName(Class type) {
+ String shortTypeName(Class<?> type) {
if (type == null) return "ANONYMOUS";
if (type.isArray()) return shortTypeName(type.getComponentType()) + "[]";
return stripPackageName(type.getName()).replace('$', '.');
return Integer.parseInt(s, 16);
}
- Class extractType(int n) {
+ Class<?> extractType(int n) {
String s = extractString(n);
return Factory.makeClass(s,getLookupClassLoader());
}
// separate implementation so we don't need SoftReference to hold the field...
private static final class CacheImpl implements Cache {
- private java.lang.ref.SoftReference toStringCacheRef;
+ private java.lang.ref.SoftReference<String[]> toStringCacheRef;
public CacheImpl() {
makeCache();
private String[] makeCache() {
String[] array = new String[3];
- toStringCacheRef = new java.lang.ref.SoftReference(array);
+ toStringCacheRef = new java.lang.ref.SoftReference<>(array);
return array;
}
import org.aspectj.lang.reflect.SourceLocation;
class SourceLocationImpl implements SourceLocation {
- Class withinType;
+ Class<?> withinType;
String fileName;
int line;
- SourceLocationImpl(Class withinType, String fileName, int line) {
+ SourceLocationImpl(Class<?> withinType, String fileName, int line) {
this.withinType = withinType;
this.fileName = fileName;
this.line = line;
return name.substring(dot+1);
}
- String makeTypeName(Class type, String typeName, boolean shortName) {
+ String makeTypeName(Class<?> type, String typeName, boolean shortName) {
if (type == null) return "ANONYMOUS";
if (type.isArray()) {
- Class componentType = type.getComponentType();
+ Class<?> componentType = type.getComponentType();
return makeTypeName(componentType, componentType.getName(), shortName) + "[]";
}
if (shortName) {
}
}
- public String makeTypeName(Class type) {
+ public String makeTypeName(Class<?> type) {
return makeTypeName(type, type.getName(),shortTypeNames);
}
- public String makePrimaryTypeName(Class type, String typeName) {
+ public String makePrimaryTypeName(Class<?> type, String typeName) {
return makeTypeName(type, typeName, shortPrimaryTypeNames);
}
import org.aspectj.lang.reflect.UnlockSignature;
class UnlockSignatureImpl extends SignatureImpl implements UnlockSignature {
- private Class parameterType;
+ private Class<?> parameterType;
- UnlockSignatureImpl(Class c) {
+ UnlockSignatureImpl(Class<?> c) {
super(Modifier.STATIC, "unlock", c);
parameterType = c;
}