aboutsummaryrefslogtreecommitdiffstats
path: root/weaver/src
diff options
context:
space:
mode:
authorLars Grefer <eclipse@larsgrefer.de>2020-08-17 01:19:52 +0200
committerLars Grefer <eclipse@larsgrefer.de>2020-08-17 01:19:52 +0200
commit85ad27ee704fa8c17345bbe46c959a3e6ccbd179 (patch)
tree64db483a4fd9027cb3ba862e371427538631b5dc /weaver/src
parentc5be7f17349f1e7ea5d3da4be09b5f3e964de19b (diff)
downloadaspectj-85ad27ee704fa8c17345bbe46c959a3e6ccbd179.tar.gz
aspectj-85ad27ee704fa8c17345bbe46c959a3e6ccbd179.zip
Remove unnecessary interface modifiers
Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
Diffstat (limited to 'weaver/src')
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.java36
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java16
-rw-r--r--weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java14
-rw-r--r--weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java72
4 files changed, 69 insertions, 69 deletions
diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.java
index 51b781e86..2a6523bb5 100644
--- a/weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.java
+++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/IWeavingContext.java
@@ -21,23 +21,23 @@ import org.aspectj.weaver.tools.WeavingAdaptor;
/**
* This class adds support to AspectJ for an OSGi environment
- *
+ *
* @author David Knibb
*/
public interface IWeavingContext {
-
+
/**
* Allows the standard ClassLoader.getResources() mechanisms to be
* replaced with a different implementation.
- * In an OSGi environment, this will allow for filtering to take
+ * In an OSGi environment, this will allow for filtering to take
* place on the results of ClassLoader.getResources(). In a non-OSGi
* environment, ClassLoader.getResources should be returned.
* @param name the name of the resource to search for
* @return an enumeration containing all of the matching resources found
* @throws IOException
*/
- public Enumeration<URL> getResources(String name) throws IOException;
-
+ Enumeration<URL> getResources(String name) throws IOException;
+
/**
* In an OSGi environment, determin which bundle a URL originated from.
* In a non-OSGi environment, implementors should return <code>null<code>.
@@ -45,30 +45,30 @@ public interface IWeavingContext {
* @return
* @deprecated use getFile() or getClassLoaderName()
*/
- public String getBundleIdFromURL(URL url);
-
+ String getBundleIdFromURL(URL url);
+
/**
* In an environment with multiple class loaders allows each to be
* identified using something safer and possibly shorter than toString
* @return name of the associated class loader
*/
- public String getClassLoaderName ();
+ String getClassLoaderName();
- public ClassLoader getClassLoader();
+ ClassLoader getClassLoader();
/**
* Format a URL
* @return filename
*/
- public String getFile(URL url);
-
+ String getFile(URL url);
+
/**
* In an environment with multiple class loaders allows messages
* to identified according to the weaving context
- * @return short name
+ * @return short name
*/
- public String getId ();
-
+ String getId();
+
/**
* Return true if the classloader associated with this weaving context
* is the one that will define the class with the specified name.
@@ -77,16 +77,16 @@ public interface IWeavingContext {
* @param classname name of the class, eg. "java.lang.String"
* @return true if the associated classloader will define the class
*/
- public boolean isLocallyDefined(String classname);
+ boolean isLocallyDefined(String classname);
/**
- * Allow custom parsing of aop.xml or alternative mechanism for providing
+ * Allow custom parsing of aop.xml or alternative mechanism for providing
* Definitions
- *
+ *
* @param loader
* @param adaptor
* @return List containing 0 or more Definition instances
*/
- public List<Definition> getDefinitions(final ClassLoader loader, WeavingAdaptor adaptor);
+ List<Definition> getDefinitions(final ClassLoader loader, WeavingAdaptor adaptor);
}
diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java
index bc0b678f4..8dada73f9 100644
--- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java
+++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/AsynchronousFileCacheBacking.java
@@ -41,11 +41,11 @@ import org.aspectj.weaver.tools.TraceFactory;
* The in-memory cache is updated so that subsequent calls to {@link #get(CachedClassReference)}
* will not return the mapped value.
* </LI>
- *
+ *
* <LI>
* An &quot;update index&quot {@link AsyncCommand} is posted to the background
* thread so that the newly mapped value will be persisted (eventually)
- * </LI>
+ * </LI>
* </UL>
* The actual persistence is implemented by the <U>concrete</U> classes
*/
@@ -161,7 +161,7 @@ public abstract class AsynchronousFileCacheBacking extends AbstractIndexedFileCa
logger.error("remove(" + getCacheDirectory() + ") Failed to post remove command for " + key);
}
}
-
+
if (entry != null) {
if (!key.equals(entry.key)) {
if ((logger != null) && logger.isTraceEnabled()) {
@@ -331,7 +331,7 @@ public abstract class AsynchronousFileCacheBacking extends AbstractIndexedFileCa
return commandsQ.offer(cmd);
}
- public static interface AsynchronousFileCacheBackingCreator<T extends AsynchronousFileCacheBacking> {
+ public interface AsynchronousFileCacheBackingCreator<T extends AsynchronousFileCacheBacking> {
T create (File cacheDir);
}
/**
@@ -339,7 +339,7 @@ public abstract class AsynchronousFileCacheBacking extends AbstractIndexedFileCa
* {@link AsynchronousFileCacheBacking} instance to be executed
* on it <U>asynchronously</U>
*/
- public static interface AsyncCommand {
+ public interface AsyncCommand {
/**
* @return The {@link AsynchronousFileCacheBacking} on which
* this command is supposed to be executed
@@ -359,7 +359,7 @@ public abstract class AsynchronousFileCacheBacking extends AbstractIndexedFileCa
public final AsynchronousFileCacheBacking getCache () {
return cache;
}
-
+
@Override
public String toString() {
return getClass().getSimpleName() + "[" + getCache() + "]";
@@ -385,7 +385,7 @@ public abstract class AsynchronousFileCacheBacking extends AbstractIndexedFileCa
private final String key;
protected KeyedCommand (AsynchronousFileCacheBacking cache, String keyValue) {
super(cache);
-
+
if (LangUtil.isEmpty(keyValue)) {
throw new IllegalStateException("No key value");
}
@@ -408,7 +408,7 @@ public abstract class AsynchronousFileCacheBacking extends AbstractIndexedFileCa
super(cache, keyValue);
}
}
-
+
public static class InsertCommand extends KeyedCommand {
private final byte[] bytes;
diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java
index bcf7c0b60..0a018d9c8 100644
--- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java
+++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/CacheBacking.java
@@ -28,36 +28,36 @@ public interface CacheBacking {
* @param regex
* @return
*/
- public String[] getKeys(String regex);
+ String[] getKeys(String regex);
/**
* Remove an entry from the cache
*
* @param ref
*/
- public void remove(CachedClassReference ref);
+ void remove(CachedClassReference ref);
/**
* Clear the entire cache
*/
- public void clear();
+ void clear();
/**
* Get a cache entry
*
* @param ref entry to retrieve
* @param originalBytes Pre-weaving class bytes - required in order to
- * ensure that the cached entry refers to the same original class
+ * ensure that the cached entry refers to the same original class
* @return the cached bytes or null, if the entry does not exist
*/
- public CachedClassEntry get(CachedClassReference ref, byte[] originalBytes);
+ CachedClassEntry get(CachedClassReference ref, byte[] originalBytes);
/**
* Put an entry in the cache
*
* @param entry key of the entry
* @param originalBytes Pre-weaving class bytes - required in order to
- * ensure that the cached entry refers to the same original class
+ * ensure that the cached entry refers to the same original class
*/
- public void put(CachedClassEntry entry, byte[] originalBytes);
+ void put(CachedClassEntry entry, byte[] originalBytes);
}
diff --git a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java
index ede4e26d1..1143f6d99 100644
--- a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java
+++ b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionWorldTest.java
@@ -1,10 +1,10 @@
/* *******************************************************************
* Copyright (c) 2005,2017 Contributors.
- * All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://eclipse.org/legal/epl-v10.html
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://eclipse.org/legal/epl-v10.html
* ******************************************************************/
package org.aspectj.weaver.reflect;
@@ -39,7 +39,7 @@ public class ReflectionWorldTest extends TestCase {
assertNotNull(rt);
assertEquals("Ljava/lang/Object;", rt.getSignature());
}
-
+
// Removed for now. In Spring the reflection worlds are customized by introducing new
// PCD handlers. It means more thought needs to be put into reusing worlds.
public void xtestReflectionWorldFactory() throws Exception {
@@ -53,31 +53,31 @@ public class ReflectionWorldTest extends TestCase {
ResolvedType stringClass1 = a.resolve(String.class);
assertNotNull(stringClass1);
-
+
ReflectionWorld b = ReflectionWorld.getReflectionWorldFor(wcl1);
-
+
// They should be the same because the classloader has not gone away
assertTrue(a==b);
-
+
cl1 = null;
for (int i=0;i<100;i++) {
System.gc(); // How robust is it that this should be causing the reference to be collected?
}
b = ReflectionWorld.getReflectionWorldFor(wcl1);
-
+
assertFalse(a==b);
-
+
cl1 = new URLClassLoader(new URL[] {}, parent);
wcl1 = new WeakClassLoaderReference(cl1);
a = ReflectionWorld.getReflectionWorldFor(wcl1);
b = ReflectionWorld.getReflectionWorldFor(wcl2);
assertFalse(a==b);
-
+
Field declaredField = ReflectionWorld.class.getDeclaredField("rworlds");
declaredField.setAccessible(true);
Map worlds = (Map)declaredField.get(null);
assertEquals(2, worlds.size());
-
+
cl2 = null;
for (int i=0;i<100;i++) {
System.gc(); // How robust is it that this should be causing the reference to be collected?
@@ -91,12 +91,12 @@ public class ReflectionWorldTest extends TestCase {
}
ReflectionWorld.getReflectionWorldFor(wcl1); // need to call this to trigger tidyup
assertEquals(0, worlds.size());
-
+
cl1 = new URLClassLoader(new URL[] {}, parent);
wcl1 = new WeakClassLoaderReference(cl1);
ReflectionWorld reflectionWorldFor = ReflectionWorld.getReflectionWorldFor(wcl1);
assertEquals(1, worlds.size());
- ReflectionWorld.cleanUpWorlds();
+ ReflectionWorld.cleanUpWorlds();
assertEquals(0, worlds.size());
}
@@ -112,10 +112,10 @@ public class ReflectionWorldTest extends TestCase {
assertEquals("int", UnresolvedType.INT, world.resolve(int.class));
assertEquals("void", UnresolvedType.VOID, world.resolve(void.class));
}
-
+
static class AbstractSuperClass<A,B> {}
- static interface InterfaceOne {}
- static interface InterfaceTwo<A> {}
+ interface InterfaceOne {}
+ interface InterfaceTwo<A> {}
static class ID {}
static abstract class AbstractTestClass<T> extends AbstractSuperClass<T,ID> implements InterfaceOne, InterfaceTwo<T> {
@@ -124,9 +124,9 @@ public class ReflectionWorldTest extends TestCase {
// static class ConcreteClass extends AbstractTestClass<TestType> {
static class ConcreteClass extends AbstractTestClass<List<TestType>> {
}
-
+
static class Bar extends ConcreteClass {}
-
+
public void testGenerics() {
ReflectionWorld world = new ReflectionWorld(getClass().getClassLoader());
// world.lookupOrCreateName(UnresolvedType.forName(AbstractTestClass.class.getName()));
@@ -145,14 +145,14 @@ public class ReflectionWorldTest extends TestCase {
assertEquals("java.lang.String",stringType.getTypeName());
ResolvedType stringResolvedType = converter.fromType(stringType);
assertEquals("java.lang.String",stringResolvedType.getName());
-
+
// public String m() { return ""; }
method = TestClass2.class.getDeclaredMethod("m");
stringType = method.getGenericReturnType();
assertEquals("java.lang.String",stringType.getTypeName());
stringResolvedType = converter.fromType(stringType);
assertEquals("java.lang.String",stringResolvedType.getName());
-
+
// Verify that the conversion process creates the same thing as the bcel unpacking
// Here the return type is a non-static inner of a generic class
@@ -165,13 +165,13 @@ public class ReflectionWorldTest extends TestCase {
assertEquals(UnresolvedType.TypeKind.SIMPLE,rType_Inner.getTypekind());
ResolvedType rType_Outer = rType_Inner.getOuterClass();
assertEquals("Lorg/aspectj/weaver/reflect/ReflectionWorldTest$TestClass2;",rType_Outer.getSignature());
-
+
BcelWorld bWorld = new BcelWorld(getClass().getClassLoader(), IMessageHandler.THROW, null);
bWorld.setBehaveInJava5Way(true);
UnresolvedType javaUtilHashMap = UnresolvedType.forName("java.util.HashMap");
ReferenceType rawType = (ReferenceType) bWorld.resolve(javaUtilHashMap);
assertNotNull(rawType);
-
+
// Now use bcel to resolve the same m2 method, and compare the signatures of the return types
ResolvedType bResolved_TestClass2 = bWorld.resolve(UnresolvedType.forName(TestClass2.class.getName()));
assertNotNull(bResolved_TestClass2);
@@ -185,17 +185,17 @@ public class ReflectionWorldTest extends TestCase {
assertEquals(bType_Inner.getSignature(),rType_Inner.getSignature());
assertEquals(bType_Outer.getSignature(),rType_Outer.getSignature());
}
-
+
public void xtestTypeConversions_509327_2() throws Exception {
ReflectionWorld world = new ReflectionWorld(getClass().getClassLoader());
JavaLangTypeToResolvedTypeConverter converter = new JavaLangTypeToResolvedTypeConverter(world);
BcelWorld bWorld = new BcelWorld(getClass().getClassLoader(), IMessageHandler.THROW, null);
bWorld.setBehaveInJava5Way(true);
-
+
// Slightly more advanced, now the method is returning a parameterized form of the outer
// generic class
-
+
// public TestClass2<String>.Inner m3() { return new TestClass2<String>.Inner("Foo"); }
Method method = TestClass2.class.getDeclaredMethod("m3");
Type type_ParameterizedInner = method.getGenericReturnType();
@@ -213,7 +213,7 @@ public class ReflectionWorldTest extends TestCase {
assertEquals(UnresolvedType.TypeKind.SIMPLE,bType_Inner.getTypekind());
ResolvedType bType_Outer = bType_Inner.getOuterClass();
-
+
// Fields seem to lose it too, although the backinggenericmember has the info
// ResolvedMember bField_f = findField(bResolved_TestClass2,"f");
// ResolvedMember backingGenericMember = bField_f.getBackingGenericMember();
@@ -223,29 +223,29 @@ public class ReflectionWorldTest extends TestCase {
// System.out.println(bField_f.getSignature());
// System.out.println(bField_f.getGenericReturnType());
}
-
+
// public void testbar() throws Exception {
// ReflectionWorld world = new ReflectionWorld(getClass().getClassLoader());
// JavaLangTypeToResolvedTypeConverter converter = new JavaLangTypeToResolvedTypeConverter(world);
-//
+//
// // public TestClass2<String>.Inner m3() { return new TestClass2<String>.Inner("Foo"); }
// Method method = TestClass2.class.getDeclaredMethod("m3");
// Type type_ParameterizedInner = method.getGenericReturnType();
// assertEquals("org.aspectj.weaver.reflect.ReflectionWorldTest.org.aspectj.weaver.reflect.ReflectionWorldTest$TestClass2<java.lang.String>.Inner",type_ParameterizedInner.getTypeName());
// ResolvedType rType_ParameterizedInner = converter.fromType(type_ParameterizedInner);
-// System.out.println(rType_ParameterizedInner);
+// System.out.println(rType_ParameterizedInner);
// System.out.println(type_ParameterizedInner.getTypeName());
// }
-//
+//
// public void testfoo() {
// ReflectionWorld world = new ReflectionWorld(getClass().getClassLoader());
// JavaLangTypeToResolvedTypeConverter converter = new JavaLangTypeToResolvedTypeConverter(world);
// BcelWorld bWorld = new BcelWorld(getClass().getClassLoader(), IMessageHandler.THROW, null);
// bWorld.setBehaveInJava5Way(true);
-//
+//
//
// ResolvedType bResolved_TestClass2 = bWorld.resolve(UnresolvedType.forName(TestClass2.class.getName()));
-// ResolvedMember bField_f = findField(bResolved_TestClass2,"f");
+// ResolvedMember bField_f = findField(bResolved_TestClass2,"f");
// System.out.println(bField_f);
// System.out.println(bField_f.getGenericReturnType());
// System.out.println(bField_f.getReturnType());
@@ -255,7 +255,7 @@ public class ReflectionWorldTest extends TestCase {
static class TestClass {
public String m() { return ""; }
}
-
+
static class TestClass2<T> {
class Inner {
T t;
@@ -277,7 +277,7 @@ public class ReflectionWorldTest extends TestCase {
}
return null;
}
-
+
private ResolvedMember findField(ResolvedType resolvedType, String fieldName) {
for (ResolvedMember field: resolvedType.getDeclaredFields()) {
if (field.getName().equals(fieldName)) {