();
+ this.capacity = cacheCapacity;
+
+ }
+
+ public boolean containsKey(Object key) {
+ return (memoryMap.containsKey(key) || hdReferencesMap.containsKey(key));
+ }
+
+ public Object get(Object key) {
+ if (memoryMap.containsKey(key)) {
+ return memoryMap.get(key);
+ } else if (hdReferencesMap.containsKey(key)) {
+ return fromDisk(key.toString());
+ } else {
+ return null;
+ }
+ }
+
+ public Object put(Object key, Object value) {
+ return memoryMap.put(key, value);
+ }
+
+ public void clear() {
+ memoryMap.clear();
+ hdReferencesMap.clear();
+ }
+
+ public boolean containsValue(Object value) {
+ throw new RuntimeException("Operation not supported");
+ }
+
+ public Set entrySet() {
+ throw new RuntimeException("Operation not supported");
+
+ }
+
+ public boolean isEmpty() {
+ return (memoryMap.isEmpty() && hdReferencesMap.isEmpty());
+ }
+
+ public Set keySet() {
+ throw new RuntimeException("Operation not supported");
+
+ }
+
+ public void putAll(Map m) {
+ throw new RuntimeException("Operation not supported");
+
+ }
+
+ public Object remove(Object key) {
+ if (memoryMap.containsKey(key)) {
+ return memoryMap.remove(key);
+ } else if (hdReferencesMap.containsKey(key)) {
+ Object removed = fromDisk(key.toString());
+ hdReferencesMap.remove(key);
+ return removed;
+ } else {
+ return null;
+ }
+ }
+
+ public int size() {
+ return memoryMap.size() + hdReferencesMap.size();
+ }
+
+ public Collection values() {
+ throw new RuntimeException("Operation not supported");
+ }
+
+ private Object fromDisk(String key) {
+ FileInputStream fis = null;
+ try {
+ fis = new FileInputStream(hdReferencesMap.get(key).toString());
+ ObjectInputStream ois = new ObjectInputStream(fis);
+ Object object = ois.readObject();
+ hdReferencesMap.remove(key);
+ return memoryMap.put(key, object);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ return null;
+ } finally {
+ try {
+ fis.close();
+ } catch (Exception e) {
+ // This is not and empty block ;) No worries nothing to do
+ // just a best effort close.
+ }
+ }
+
+ }
+
+ class Cache extends LinkedHashMap {
+
+ public Cache(int cacheCapacity) {
+ super(cacheCapacity + 1, 1.1f, true);
+ }
+
+ @Override
+ protected boolean removeEldestEntry(Map.Entry eldest) {
+ if (size() > capacity) {
+ try {
+ toDisk(eldest.getKey().toString(), eldest.getValue());
+ } catch (IOException e) {
+ e.printStackTrace();
+ // little trick to avoid getting the in memory being stuck because one element can not be serialized:
+ this.get(eldest.getKey());
+ return false;
+ }
+ this.remove(eldest.getKey());
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ private void toDisk(String key, Object value) throws IOException {
+ FileOutputStream fos = null;
+ ObjectOutputStream oos = null;
+ File temp = null;
+ try {
+ temp= File.createTempFile(key, "luc");
+ fos = new FileOutputStream(temp);
+ oos = new ObjectOutputStream(fos);
+ oos.writeUnshared(value);
+ hdReferencesMap.put(key, temp.getAbsolutePath());
+ } finally {
+ try {
+ oos.close();
+ fos.close();
+ } catch (Exception e) {
+ // This is not and empty block ;) No worries nothing to do
+ // just a best effort close.
+ }
+ }
+
+ }
+
+ }
+}
\ No newline at end of file
#P org.aspectj.matcher
Index: src/org/aspectj/weaver/AjAttribute.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/AjAttribute.java,v
retrieving revision 1.11
diff -u -r1.11 AjAttribute.java
--- src/org/aspectj/weaver/AjAttribute.java 8 Jun 2010 22:56:43 -0000 1.11
+++ src/org/aspectj/weaver/AjAttribute.java 1 Nov 2010 20:23:46 -0000
@@ -17,6 +17,7 @@
import java.io.DataOutputStream;
import java.io.EOFException;
import java.io.IOException;
+import java.io.Serializable;
import org.aspectj.bridge.MessageUtil;
import org.aspectj.bridge.Version;
@@ -36,8 +37,9 @@
*
* @author Erik Hilsdale
* @author Jim Hugunin
+ * @authro Abraham Nevado
*/
-public abstract class AjAttribute {
+public abstract class AjAttribute implements Serializable{
public static final String AttributePrefix = "org.aspectj.weaver";
@@ -214,7 +216,7 @@
}
}
- public static class WeaverVersionInfo extends AjAttribute {
+ public static class WeaverVersionInfo extends AjAttribute {
public static final String AttributeName = "org.aspectj.weaver.WeaverVersion";
// If you change the format of an AspectJ class file, you have two
Index: src/org/aspectj/weaver/TypeVariableDeclaringElement.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/TypeVariableDeclaringElement.java,v
retrieving revision 1.2
diff -u -r1.2 TypeVariableDeclaringElement.java
--- src/org/aspectj/weaver/TypeVariableDeclaringElement.java 26 Sep 2009 00:53:15 -0000 1.2
+++ src/org/aspectj/weaver/TypeVariableDeclaringElement.java 1 Nov 2010 20:23:50 -0000
@@ -8,14 +8,17 @@
*
* Contributors:
* Andy Clement Initial implementation
+ * Abraham Nevado Serializable implementation
* ******************************************************************/
package org.aspectj.weaver;
+import java.io.Serializable;
+
/**
* Tag interface - methods and types can be declaring elements for type variables. See the TypeVariable class which holds onto the
* declaring element
*/
-public interface TypeVariableDeclaringElement {
+public interface TypeVariableDeclaringElement extends Serializable{
public TypeVariable getTypeVariableNamed(String name);
}
Index: src/org/aspectj/weaver/ShadowMunger.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/ShadowMunger.java,v
retrieving revision 1.15
diff -u -r1.15 ShadowMunger.java
--- src/org/aspectj/weaver/ShadowMunger.java 7 Jul 2010 18:24:53 -0000 1.15
+++ src/org/aspectj/weaver/ShadowMunger.java 1 Nov 2010 20:23:50 -0000
@@ -8,12 +8,14 @@
*
* Contributors:
* PARC initial implementation
+ * Abraham Nevado Serialition issues
* ******************************************************************/
package org.aspectj.weaver;
import java.io.File;
import java.io.IOException;
+import java.io.Serializable;
import java.util.Collection;
import java.util.HashSet;
import java.util.Map;
@@ -37,7 +39,7 @@
* For every shadow munger, for every shadow, first match is called, then (if match returned true) the shadow munger is specialized
* for the shadow, which may modify state. Then implement is called.
*/
-public abstract class ShadowMunger implements PartialOrder.PartialComparable, IHasPosition {
+public abstract class ShadowMunger implements PartialOrder.PartialComparable, IHasPosition, Serializable {
public static final ShadowMunger[] NONE = new ShadowMunger[0];
Index: src/org/aspectj/weaver/CrosscuttingMembers.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembers.java,v
retrieving revision 1.14
diff -u -r1.14 CrosscuttingMembers.java
--- src/org/aspectj/weaver/CrosscuttingMembers.java 13 Aug 2010 17:39:31 -0000 1.14
+++ src/org/aspectj/weaver/CrosscuttingMembers.java 1 Nov 2010 20:23:47 -0000
@@ -7,10 +7,12 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * PARC initial implementation
+ * PARC initial implementation
+ * Abraham Nevado Serializable
* ******************************************************************/
package org.aspectj.weaver;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
@@ -42,8 +44,9 @@
* All members are concrete.
*
* @author Jim Hugunin
+ * @author Abraham Nevado
*/
-public class CrosscuttingMembers {
+public class CrosscuttingMembers implements Serializable{
private final ResolvedType inAspect;
private final World world;
Index: src/org/aspectj/weaver/AnnotationAJ.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/AnnotationAJ.java,v
retrieving revision 1.3
diff -u -r1.3 AnnotationAJ.java
--- src/org/aspectj/weaver/AnnotationAJ.java 14 Jul 2010 23:19:20 -0000 1.3
+++ src/org/aspectj/weaver/AnnotationAJ.java 1 Nov 2010 20:23:47 -0000
@@ -9,14 +9,16 @@
* ******************************************************************/
package org.aspectj.weaver;
+import java.io.Serializable;
import java.util.Set;
/**
* Simple representation of an annotation that the weaver can work with.
*
* @author AndyClement
+ * @author Abraham Nevado
*/
-public interface AnnotationAJ {
+public interface AnnotationAJ extends Serializable {
public static final AnnotationAJ[] EMPTY_ARRAY = new AnnotationAJ[0];
Index: src/org/aspectj/weaver/UnresolvedType.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/UnresolvedType.java,v
retrieving revision 1.12
diff -u -r1.12 UnresolvedType.java
--- src/org/aspectj/weaver/UnresolvedType.java 13 Aug 2010 15:43:14 -0000 1.12
+++ src/org/aspectj/weaver/UnresolvedType.java 1 Nov 2010 20:23:51 -0000
@@ -10,12 +10,14 @@
* PARC initial implementation
* Andy Clement start of generics upgrade...
* Adrian Colyer - overhaul
+ * Abraham Nevado - Serializable
* ******************************************************************/
package org.aspectj.weaver;
import java.io.DataInputStream;
import java.io.IOException;
+import java.io.Serializable;
import java.util.Map;
import org.aspectj.util.GenericSignature;
@@ -32,7 +34,7 @@
*
* Every UnresolvedType has a signature, the unique key for the type in the world.
*/
-public class UnresolvedType implements Traceable, TypeVariableDeclaringElement {
+public class UnresolvedType implements Traceable, TypeVariableDeclaringElement, Serializable {
// common type structures
public static final UnresolvedType[] NONE = new UnresolvedType[0];
@@ -821,7 +823,7 @@
return typeVariables;
}
- public static class TypeKind {
+ public static class TypeKind implements Serializable {
// Note: It is not sufficient to say that a parameterized type with no type parameters in fact
// represents a raw type - a parameterized type with no type parameters can represent
// an inner type of a parameterized type that specifies no type parameters of its own.
Index: src/org/aspectj/weaver/World.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/World.java,v
retrieving revision 1.42
diff -u -r1.42 World.java
--- src/org/aspectj/weaver/World.java 25 Aug 2010 01:46:42 -0000 1.42
+++ src/org/aspectj/weaver/World.java 1 Nov 2010 20:23:53 -0000
@@ -9,11 +9,13 @@
*
* Contributors:
* PARC initial implementation
- * Adrian Colyer, Andy Clement, overhaul for generics, Abraham Nevado
+ * Adrian Colyer, Andy Clement, overhaul for generics
+ * Abraham Nevado Serialization
* ******************************************************************/
package org.aspectj.weaver;
+import java.io.Serializable;
import java.lang.ref.Reference;
import java.lang.ref.ReferenceQueue;
import java.lang.ref.SoftReference;
@@ -53,7 +55,7 @@
/**
* A World is a collection of known types and crosscutting members.
*/
-public abstract class World implements Dump.INode {
+public abstract class World implements Dump.INode, Serializable {
/** handler for any messages produced during resolution etc. */
private IMessageHandler messageHandler = IMessageHandler.SYSTEM_ERR;
@@ -141,7 +143,7 @@
// Minimal Model controls whether model entities that are not involved in relationships are deleted post-build
private boolean minimalModel = false;
private boolean targettingRuntime1_6_10 = false;
-
+
private boolean completeBinaryTypes = false;
private boolean overWeaving = false;
public boolean forDEBUG_structuralChangesCode = false;
@@ -152,7 +154,7 @@
public int infoMessagesEnabled = 0; // 0=uninitialized, 1=no, 2=yes
- private static Trace trace = TraceFactory.getTraceFactory().getTrace(World.class);
+ private transient static Trace trace = TraceFactory.getTraceFactory().getTrace(World.class);
private long errorThreshold;
private long warningThreshold;
@@ -815,7 +817,7 @@
ensureAdvancedConfigurationProcessed();
return targettingRuntime1_6_10;
}
-
+
public void setBehaveInJava5Way(boolean b) {
behaveInJava5Way = b;
}
@@ -987,7 +989,7 @@
* Map of types in the world, can have 'references' to expendable ones which can be garbage collected to recover memory. An
* expendable type is a reference type that is not exposed to the weaver (ie just pulled in for type resolution purposes).
*/
- public static class TypeMap {
+ public static class TypeMap implements Serializable {
// Strategy for entries in the expendable map
public final static int DONT_USE_REFS = 0; // Hang around forever
@@ -1008,7 +1010,7 @@
final Map tMap = new HashMap();
// Map of types that may be ejected from the cache if we need space
- final Map> expendableMap = Collections
+ final transient Map> expendableMap = Collections
.synchronizedMap(new WeakHashMap>());
private final World w;
@@ -1347,7 +1349,7 @@
/**
* This class is used to compute and store precedence relationships between aspects.
*/
- private static class AspectPrecedenceCalculator {
+ private static class AspectPrecedenceCalculator implements Serializable{
private final World world;
private final Map cachedResults;
@@ -1516,7 +1518,7 @@
if (s.equalsIgnoreCase("true")) {
targettingRuntime1_6_10 = true;
}
-
+
s = p.getProperty(xsetFAST_PACK_METHODS, "true");
fastMethodPacking = s.equalsIgnoreCase("true");
Index: src/org/aspectj/weaver/WeaverStateInfo.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/WeaverStateInfo.java,v
retrieving revision 1.7
diff -u -r1.7 WeaverStateInfo.java
--- src/org/aspectj/weaver/WeaverStateInfo.java 13 Aug 2010 16:47:00 -0000 1.7
+++ src/org/aspectj/weaver/WeaverStateInfo.java 1 Nov 2010 20:23:52 -0000
@@ -8,6 +8,7 @@
*
* Contributors:
* PARC initial implementation
+ * Lucierna serialization
* ******************************************************************/
package org.aspectj.weaver;
@@ -17,6 +18,7 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -39,7 +41,7 @@
* previously woven The fully qualified name of each type Int: Length of class file data (i.e. the unwovenclassfile)
* Byte[]: The class file data, compressed if REWEAVABLE_COMPRESSION_BIT set.
*/
-public class WeaverStateInfo {
+public class WeaverStateInfo implements Serializable{
private List typeMungers;
private boolean oldStyle;
Index: src/org/aspectj/weaver/ReferenceType.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/ReferenceType.java,v
retrieving revision 1.27
diff -u -r1.27 ReferenceType.java
--- src/org/aspectj/weaver/ReferenceType.java 25 Aug 2010 16:41:33 -0000 1.27
+++ src/org/aspectj/weaver/ReferenceType.java 1 Nov 2010 20:23:49 -0000
@@ -51,7 +51,7 @@
ResolvedMember[] parameterizedMethods = null;
ResolvedMember[] parameterizedFields = null;
ResolvedMember[] parameterizedPointcuts = null;
- WeakReference parameterizedInterfaces = new WeakReference(null);
+ transient WeakReference parameterizedInterfaces = new WeakReference(null);
Collection parameterizedDeclares = null;
// Collection parameterizedTypeMungers = null;
@@ -884,7 +884,7 @@
return getDelegate().getModifiers();
}
- WeakReference superclassReference = new WeakReference(null);
+ transient WeakReference superclassReference = new WeakReference(null);
@Override
public ResolvedType getSuperclass() {
Index: src/org/aspectj/weaver/ICrossReferenceHandler.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/ICrossReferenceHandler.java,v
retrieving revision 1.1
diff -u -r1.1 ICrossReferenceHandler.java
--- src/org/aspectj/weaver/ICrossReferenceHandler.java 22 Oct 2008 05:45:54 -0000 1.1
+++ src/org/aspectj/weaver/ICrossReferenceHandler.java 1 Nov 2010 20:23:48 -0000
@@ -7,16 +7,19 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Abraham Nevado - Serializable implementation
*******************************************************************************/
package org.aspectj.weaver;
+import java.io.Serializable;
+
import org.aspectj.bridge.ISourceLocation;
/**
* Clients can pass a single cross-reference handler to the weaver on construction of a BcelWorld. Any cross-references detected
* during munging will be notified to the handler.
*/
-public interface ICrossReferenceHandler {
+public interface ICrossReferenceHandler extends Serializable {
void addCrossReference(ISourceLocation from, ISourceLocation to, String kind, boolean runtimeTest);
Index: src/org/aspectj/weaver/CrosscuttingMembersSet.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/CrosscuttingMembersSet.java,v
retrieving revision 1.13
diff -u -r1.13 CrosscuttingMembersSet.java
--- src/org/aspectj/weaver/CrosscuttingMembersSet.java 16 Jun 2010 18:09:45 -0000 1.13
+++ src/org/aspectj/weaver/CrosscuttingMembersSet.java 1 Nov 2010 20:23:48 -0000
@@ -13,6 +13,7 @@
package org.aspectj.weaver;
import java.io.IOException;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -36,10 +37,11 @@
*
* @author Jim Hugunin
* @author Andy Clement
+ * @author Abraham Nevado
*/
-public class CrosscuttingMembersSet {
+public class CrosscuttingMembersSet implements Serializable {
- private static Trace trace = TraceFactory.getTraceFactory().getTrace(CrosscuttingMembersSet.class);
+ private transient static Trace trace = TraceFactory.getTraceFactory().getTrace(CrosscuttingMembersSet.class);
private transient World world;
Index: src/org/aspectj/weaver/WeakClassLoaderReference.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/WeakClassLoaderReference.java,v
retrieving revision 1.1
diff -u -r1.1 WeakClassLoaderReference.java
--- src/org/aspectj/weaver/WeakClassLoaderReference.java 22 Oct 2008 05:45:53 -0000 1.1
+++ src/org/aspectj/weaver/WeakClassLoaderReference.java 1 Nov 2010 20:23:51 -0000
@@ -32,7 +32,7 @@
*
* @author Andy Clement
*/
-public class WeakClassLoaderReference {
+public class WeakClassLoaderReference{
protected final int hashcode;
Index: src/org/aspectj/weaver/ConcreteTypeMunger.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/ConcreteTypeMunger.java,v
retrieving revision 1.5
diff -u -r1.5 ConcreteTypeMunger.java
--- src/org/aspectj/weaver/ConcreteTypeMunger.java 13 Aug 2010 17:39:31 -0000 1.5
+++ src/org/aspectj/weaver/ConcreteTypeMunger.java 1 Nov 2010 20:23:47 -0000
@@ -12,12 +12,13 @@
package org.aspectj.weaver;
+import java.io.Serializable;
import java.util.Map;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.util.PartialOrder;
-public abstract class ConcreteTypeMunger implements PartialOrder.PartialComparable {
+public abstract class ConcreteTypeMunger implements PartialOrder.PartialComparable,Serializable {
protected ResolvedTypeMunger munger;
protected ResolvedType aspectType;
Index: src/org/aspectj/weaver/ResolvedTypeMunger.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/ResolvedTypeMunger.java,v
retrieving revision 1.11
diff -u -r1.11 ResolvedTypeMunger.java
--- src/org/aspectj/weaver/ResolvedTypeMunger.java 30 Jul 2010 03:51:57 -0000 1.11
+++ src/org/aspectj/weaver/ResolvedTypeMunger.java 1 Nov 2010 20:23:50 -0000
@@ -20,6 +20,7 @@
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
@@ -35,7 +36,7 @@
* This is an abstraction over method/field introduction. It might not have the chops to handle other inter-type declarations. This
* is the thing that is used on the eclipse side and serialized into a ConcreteTypeMunger.
*/
-public abstract class ResolvedTypeMunger {
+public abstract class ResolvedTypeMunger implements Serializable {
protected Kind kind;
protected ResolvedMember signature;
@@ -276,7 +277,7 @@
return kind;
}
- public static class Kind extends TypeSafeEnum {
+ public static class Kind extends TypeSafeEnum implements Serializable{
/* private */Kind(String name, int key) {
super(name, key);
}
Index: src/org/aspectj/weaver/ISourceContext.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/ISourceContext.java,v
retrieving revision 1.2
diff -u -r1.2 ISourceContext.java
--- src/org/aspectj/weaver/ISourceContext.java 25 Aug 2009 17:00:52 -0000 1.2
+++ src/org/aspectj/weaver/ISourceContext.java 1 Nov 2010 20:23:48 -0000
@@ -8,13 +8,16 @@
*
* Contributors:
* PARC initial implementation
+ * Abraham Nevado Serializable
* ******************************************************************/
package org.aspectj.weaver;
+import java.io.Serializable;
+
import org.aspectj.bridge.ISourceLocation;
-public interface ISourceContext {
+public interface ISourceContext extends Serializable{
public ISourceLocation makeSourceLocation(IHasPosition position);
public ISourceLocation makeSourceLocation(int line, int offset);
Index: src/org/aspectj/weaver/Lint.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/Lint.java,v
retrieving revision 1.7
diff -u -r1.7 Lint.java
--- src/org/aspectj/weaver/Lint.java 13 Aug 2010 17:39:31 -0000 1.7
+++ src/org/aspectj/weaver/Lint.java 1 Nov 2010 20:23:48 -0000
@@ -16,6 +16,7 @@
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.io.Serializable;
import java.text.MessageFormat;
import java.util.Collection;
import java.util.HashMap;
@@ -29,7 +30,7 @@
import org.aspectj.weaver.tools.Trace;
import org.aspectj.weaver.tools.TraceFactory;
-public class Lint {
+public class Lint implements Serializable{
Map kinds = new HashMap();
/* private */World world;
@@ -136,7 +137,7 @@
public final Kind missingAspectForReweaving = new Kind("missingAspectForReweaving",
"aspect {0} cannot be found when reweaving {1}");
- private static Trace trace = TraceFactory.getTraceFactory().getTrace(Lint.class);
+ private transient static Trace trace = TraceFactory.getTraceFactory().getTrace(Lint.class);
public Lint(World world) {
if (trace.isTraceEnabled()) {
@@ -278,7 +279,7 @@
return kinds.get(lintkey);
}
- public class Kind {
+ public class Kind implements Serializable{
private final String name;
private final String message;
private IMessage.Kind kind = IMessage.WARNING;
Index: src/org/aspectj/weaver/patterns/TypePattern.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/patterns/TypePattern.java,v
retrieving revision 1.9
diff -u -r1.9 TypePattern.java
--- src/org/aspectj/weaver/patterns/TypePattern.java 31 May 2010 17:38:07 -0000 1.9
+++ src/org/aspectj/weaver/patterns/TypePattern.java 1 Nov 2010 20:23:54 -0000
@@ -13,6 +13,7 @@
package org.aspectj.weaver.patterns;
import java.io.IOException;
+import java.io.Serializable;
import java.lang.reflect.Modifier;
import java.util.Iterator;
import java.util.Map;
@@ -38,9 +39,10 @@
*
* @author Erik Hilsdale
* @author Jim Hugunin
+ * @auther Abraham Nevado
*/
-public abstract class TypePattern extends PatternNode {
- public static class MatchKind {
+public abstract class TypePattern extends PatternNode {
+ public static class MatchKind implements Serializable {
private String name;
public MatchKind(String name) {
Index: src/org/aspectj/weaver/patterns/IScope.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/patterns/IScope.java,v
retrieving revision 1.2
diff -u -r1.2 IScope.java
--- src/org/aspectj/weaver/patterns/IScope.java 29 Jun 2010 00:12:05 -0000 1.2
+++ src/org/aspectj/weaver/patterns/IScope.java 1 Nov 2010 20:23:54 -0000
@@ -7,11 +7,14 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- * PARC initial implementation
+ * PARC initial implementation
+ * Abraham Nevado serializable
* ******************************************************************/
package org.aspectj.weaver.patterns;
+import java.io.Serializable;
+
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.weaver.IHasPosition;
@@ -19,7 +22,7 @@
import org.aspectj.weaver.UnresolvedType;
import org.aspectj.weaver.World;
-public interface IScope {
+public interface IScope extends Serializable{
/**
* @return the type corresponding to the name in this scope, or ResolvedType.MISSING if no such type exists
Index: src/org/aspectj/weaver/patterns/PatternNode.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/patterns/PatternNode.java,v
retrieving revision 1.2
diff -u -r1.2 PatternNode.java
--- src/org/aspectj/weaver/patterns/PatternNode.java 18 May 2010 16:20:12 -0000 1.2
+++ src/org/aspectj/weaver/patterns/PatternNode.java 1 Nov 2010 20:23:54 -0000
@@ -15,13 +15,14 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.io.Serializable;
import org.aspectj.bridge.ISourceLocation;
import org.aspectj.weaver.CompressingDataOutputStream;
import org.aspectj.weaver.IHasSourceLocation;
import org.aspectj.weaver.ISourceContext;
-public abstract class PatternNode implements IHasSourceLocation {
+public abstract class PatternNode implements IHasSourceLocation,Serializable {
protected int start, end;
protected ISourceContext sourceContext;
Index: src/org/aspectj/weaver/patterns/ExposedState.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/patterns/ExposedState.java,v
retrieving revision 1.2
diff -u -r1.2 ExposedState.java
--- src/org/aspectj/weaver/patterns/ExposedState.java 24 Feb 2010 18:33:20 -0000 1.2
+++ src/org/aspectj/weaver/patterns/ExposedState.java 1 Nov 2010 20:23:54 -0000
@@ -12,6 +12,7 @@
package org.aspectj.weaver.patterns;
+import java.io.Serializable;
import java.util.Arrays;
import org.aspectj.weaver.Member;
@@ -20,7 +21,7 @@
import org.aspectj.weaver.ast.Expr;
import org.aspectj.weaver.ast.Var;
-public class ExposedState {
+public class ExposedState implements Serializable {
public static final boolean[] NO_ERRONEOUS_VARS = new boolean[0];
public Var[] vars;
private boolean[] erroneousVars;
Index: src/org/aspectj/weaver/patterns/FormalBinding.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/patterns/FormalBinding.java,v
retrieving revision 1.1
diff -u -r1.1 FormalBinding.java
--- src/org/aspectj/weaver/patterns/FormalBinding.java 22 Oct 2008 05:45:52 -0000 1.1
+++ src/org/aspectj/weaver/patterns/FormalBinding.java 1 Nov 2010 20:23:54 -0000
@@ -8,14 +8,17 @@
*
* Contributors:
* PARC initial implementation
+ * Abraham Nevado serializable
* ******************************************************************/
package org.aspectj.weaver.patterns;
+import java.io.Serializable;
+
import org.aspectj.weaver.IHasPosition;
import org.aspectj.weaver.UnresolvedType;
-public class FormalBinding implements IHasPosition {
+public class FormalBinding implements IHasPosition,Serializable {
private final UnresolvedType type;
private final String name;
private final int index;
Index: src/org/aspectj/weaver/ast/ASTNode.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/ast/ASTNode.java,v
retrieving revision 1.1
diff -u -r1.1 ASTNode.java
--- src/org/aspectj/weaver/ast/ASTNode.java 22 Oct 2008 05:45:55 -0000 1.1
+++ src/org/aspectj/weaver/ast/ASTNode.java 1 Nov 2010 20:23:54 -0000
@@ -13,7 +13,9 @@
package org.aspectj.weaver.ast;
-public abstract class ASTNode {
+import java.io.Serializable;
+
+public abstract class ASTNode implements Serializable {
public ASTNode() {
super();
Index: src/org/aspectj/weaver/tools/PointcutDesignatorHandler.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/org.aspectj.matcher/src/org/aspectj/weaver/tools/PointcutDesignatorHandler.java,v
retrieving revision 1.1
diff -u -r1.1 PointcutDesignatorHandler.java
--- src/org/aspectj/weaver/tools/PointcutDesignatorHandler.java 22 Oct 2008 05:45:55 -0000 1.1
+++ src/org/aspectj/weaver/tools/PointcutDesignatorHandler.java 1 Nov 2010 20:23:54 -0000
@@ -8,9 +8,12 @@
*
* Contributors:
* Adrian Colyer Initial implementation
+ * Abraham Nevado Serializable implementation
* ******************************************************************/
package org.aspectj.weaver.tools;
+import java.io.Serializable;
+
/**
* The PointcutDesignator interface allows extension of the
@@ -22,7 +25,7 @@
* A pointcut designator can only be used for matching, not for
* binding.
*/
-public interface PointcutDesignatorHandler {
+public interface PointcutDesignatorHandler extends Serializable {
/**
* The name of this pointcut designator. For example,
#P util
Index: src/org/aspectj/util/GenericSignature.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/util/src/org/aspectj/util/GenericSignature.java,v
retrieving revision 1.2
diff -u -r1.2 GenericSignature.java
--- src/org/aspectj/util/GenericSignature.java 24 Feb 2010 18:34:16 -0000 1.2
+++ src/org/aspectj/util/GenericSignature.java 1 Nov 2010 20:23:57 -0000
@@ -10,18 +10,21 @@
* ******************************************************************/
package org.aspectj.util;
+import java.io.Serializable;
+
/**
* Encapsulate generic signature parsing
*
* @author Adrian Colyer
* @author Andy Clement
+ * @author Abraham Nevado
*/
public class GenericSignature {
/**
* structure holding a parsed class signature
*/
- public static class ClassSignature {
+ public static class ClassSignature implements Serializable {
public FormalTypeParameter[] formalTypeParameters = FormalTypeParameter.NONE;
public ClassTypeSignature superclassSignature;
public ClassTypeSignature[] superInterfaceSignatures = ClassTypeSignature.NONE;
@@ -77,7 +80,7 @@
/**
* structure capturing a FormalTypeParameter from the Signature grammar
*/
- public static class FormalTypeParameter {
+ public static class FormalTypeParameter implements Serializable{
public static final FormalTypeParameter[] NONE = new FormalTypeParameter[0];
public String identifier;
public FieldTypeSignature classBound;
@@ -97,7 +100,7 @@
}
}
- public static abstract class TypeSignature {
+ public static abstract class TypeSignature implements Serializable{
public boolean isBaseType() {
return false;
}
Index: src/org/aspectj/util/FuzzyBoolean.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/util/src/org/aspectj/util/FuzzyBoolean.java,v
retrieving revision 1.4
diff -u -r1.4 FuzzyBoolean.java
--- src/org/aspectj/util/FuzzyBoolean.java 27 Aug 2008 00:38:45 -0000 1.4
+++ src/org/aspectj/util/FuzzyBoolean.java 1 Nov 2010 20:23:57 -0000
@@ -9,13 +9,16 @@
*
* Contributors:
* Xerox/PARC initial implementation
+ * Lucierna Serialization
* ******************************************************************/
package org.aspectj.util;
+import java.io.Serializable;
+
/**
* This class implements boolean that include a "maybe"
*/
-public abstract class FuzzyBoolean {
+public abstract class FuzzyBoolean implements Serializable{
public abstract boolean alwaysTrue();
public abstract boolean alwaysFalse();
public abstract boolean maybeTrue();
Index: src/org/aspectj/util/IStructureModel.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/util/src/org/aspectj/util/IStructureModel.java,v
retrieving revision 1.1
diff -u -r1.1 IStructureModel.java
--- src/org/aspectj/util/IStructureModel.java 20 Oct 2008 23:34:31 -0000 1.1
+++ src/org/aspectj/util/IStructureModel.java 1 Nov 2010 20:23:57 -0000
@@ -8,14 +8,18 @@
*
* Contributors:
* Andy Clement
+ * Abraham Nevado
* ******************************************************************/
package org.aspectj.util;
+import java.io.Serializable;
+
/**
* Abstraction of a structure model
*
* @author Andy Clement
+ * @author Abraham Nevado
*/
-public interface IStructureModel {
+public interface IStructureModel extends Serializable{
}
Index: src/org/aspectj/util/TypeSafeEnum.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/util/src/org/aspectj/util/TypeSafeEnum.java,v
retrieving revision 1.3
diff -u -r1.3 TypeSafeEnum.java
--- src/org/aspectj/util/TypeSafeEnum.java 18 May 2010 16:31:03 -0000 1.3
+++ src/org/aspectj/util/TypeSafeEnum.java 1 Nov 2010 20:23:57 -0000
@@ -8,13 +8,14 @@
*
* Contributors:
* Xerox/PARC initial implementation
+ * Lucierna serializable
* ******************************************************************/
package org.aspectj.util;
import java.io.*;
-public class TypeSafeEnum {
+public class TypeSafeEnum implements Serializable {
private byte key;
private String name;
#P bridge
Index: src/org/aspectj/bridge/IMessageHolder.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bridge/src/org/aspectj/bridge/IMessageHolder.java,v
retrieving revision 1.3
diff -u -r1.3 IMessageHolder.java
--- src/org/aspectj/bridge/IMessageHolder.java 14 Jul 2010 23:19:53 -0000 1.3
+++ src/org/aspectj/bridge/IMessageHolder.java 1 Nov 2010 20:23:59 -0000
@@ -9,16 +9,18 @@
*
* Contributors:
* Xerox/PARC initial implementation
+ * Lucierna serialization optimization
* ******************************************************************/
package org.aspectj.bridge;
+import java.io.Serializable;
import java.util.List;
/**
* Hold and query a collection of messages.
*/
-public interface IMessageHolder extends IMessageHandler { // XXX do not extend - mix instead
+public interface IMessageHolder extends IMessageHandler,Serializable { // XXX do not extend - mix instead
// XXX go to LT EQ GT GE LE rather than simple orGreater
/** value for orGreater parameter */
public static final boolean ORGREATER = true;
Index: src/org/aspectj/bridge/IMessage.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bridge/src/org/aspectj/bridge/IMessage.java,v
retrieving revision 1.13
diff -u -r1.13 IMessage.java
--- src/org/aspectj/bridge/IMessage.java 14 Jul 2010 23:19:53 -0000 1.13
+++ src/org/aspectj/bridge/IMessage.java 1 Nov 2010 20:23:59 -0000
@@ -9,10 +9,12 @@
*
* Contributors:
* Xerox/PARC initial implementation
+ * Lucierna serialization
* ******************************************************************/
package org.aspectj.bridge;
+import java.io.Serializable;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
@@ -21,7 +23,7 @@
/**
* Wrap message with any associated throwable or source location.
*/
-public interface IMessage {
+public interface IMessage extends Serializable{
/** no messages */
public static final IMessage[] RA_IMessage = new IMessage[0];
@@ -90,7 +92,7 @@
/** @return source location associated with this message, or null if none */
ISourceLocation getSourceLocation();
- public static final class Kind implements Comparable {
+ public static final class Kind implements Serializable, Comparable {
public static final Comparator COMPARATOR = new Comparator() {
public int compare(IMessage.Kind one, IMessage.Kind two) {
if (null == one) {
#P bcel-builder
Index: src/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java,v
retrieving revision 1.8
diff -u -r1.8 ElementValue.java
--- src/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java 15 Sep 2009 19:40:09 -0000 1.8
+++ src/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java 1 Nov 2010 20:24:02 -0000
@@ -15,10 +15,11 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.io.Serializable;
import org.aspectj.apache.bcel.classfile.ConstantPool;
-public abstract class ElementValue {
+public abstract class ElementValue implements Serializable{
public static final int STRING = 's';
public static final int ENUM_CONSTANT = 'e';
Index: src/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java,v
retrieving revision 1.1
diff -u -r1.1 NameValuePair.java
--- src/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java 15 Sep 2009 19:40:12 -0000 1.1
+++ src/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java 1 Nov 2010 20:24:02 -0000
@@ -14,10 +14,11 @@
import java.io.DataOutputStream;
import java.io.IOException;
+import java.io.Serializable;
import org.aspectj.apache.bcel.classfile.ConstantPool;
-public class NameValuePair {
+public class NameValuePair implements Serializable {
private int nameIdx;
private ElementValue value;
private ConstantPool cpool;
Index: src/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bcel-builder/src/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java,v
retrieving revision 1.7
diff -u -r1.7 AnnotationGen.java
--- src/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java 15 Sep 2009 19:40:12 -0000 1.7
+++ src/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java 1 Nov 2010 20:24:02 -0000
@@ -15,6 +15,7 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -24,7 +25,7 @@
import org.aspectj.apache.bcel.classfile.Utility;
import org.aspectj.apache.bcel.generic.ObjectType;
-public class AnnotationGen {
+public class AnnotationGen implements Serializable {
public static final AnnotationGen[] NO_ANNOTATIONS = new AnnotationGen[0];
private int typeIndex;
Index: src/org/aspectj/apache/bcel/classfile/FieldOrMethod.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bcel-builder/src/org/aspectj/apache/bcel/classfile/FieldOrMethod.java,v
retrieving revision 1.12
diff -u -r1.12 FieldOrMethod.java
--- src/org/aspectj/apache/bcel/classfile/FieldOrMethod.java 15 Sep 2009 19:40:12 -0000 1.12
+++ src/org/aspectj/apache/bcel/classfile/FieldOrMethod.java 1 Nov 2010 20:24:01 -0000
@@ -56,6 +56,7 @@
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;
Index: src/org/aspectj/apache/bcel/classfile/Node.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bcel-builder/src/org/aspectj/apache/bcel/classfile/Node.java,v
retrieving revision 1.3
diff -u -r1.3 Node.java
--- src/org/aspectj/apache/bcel/classfile/Node.java 28 May 2008 23:53:01 -0000 1.3
+++ src/org/aspectj/apache/bcel/classfile/Node.java 1 Nov 2010 20:24:02 -0000
@@ -1,5 +1,7 @@
package org.aspectj.apache.bcel.classfile;
+import java.io.Serializable;
+
/* ====================================================================
* The Apache Software License, Version 1.1
*
@@ -60,6 +62,6 @@
* @version $Id: Node.java,v 1.3 2008/05/28 23:53:01 aclement Exp $
* @author M. Dahm
*/
-public interface Node {
+public interface Node extends Serializable {
public void accept(ClassVisitor obj);
}
Index: src/org/aspectj/apache/bcel/classfile/Modifiers.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bcel-builder/src/org/aspectj/apache/bcel/classfile/Modifiers.java,v
retrieving revision 1.2
diff -u -r1.2 Modifiers.java
--- src/org/aspectj/apache/bcel/classfile/Modifiers.java 28 May 2008 23:53:01 -0000 1.2
+++ src/org/aspectj/apache/bcel/classfile/Modifiers.java 1 Nov 2010 20:24:02 -0000
@@ -54,6 +54,8 @@
* .
*/
+import java.io.Serializable;
+
import org.aspectj.apache.bcel.Constants;
/**
@@ -64,7 +66,7 @@
* @version $Id: Modifiers.java,v 1.2 2008/05/28 23:53:01 aclement Exp $
* @author M. Dahm
*/
-public abstract class Modifiers {
+public abstract class Modifiers implements Serializable {
protected int modifiers;
Index: src/org/aspectj/apache/bcel/classfile/Field.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bcel-builder/src/org/aspectj/apache/bcel/classfile/Field.java,v
retrieving revision 1.6
diff -u -r1.6 Field.java
--- src/org/aspectj/apache/bcel/classfile/Field.java 15 Sep 2009 03:33:52 -0000 1.6
+++ src/org/aspectj/apache/bcel/classfile/Field.java 1 Nov 2010 20:24:01 -0000
@@ -55,6 +55,7 @@
*/
import java.io.DataInputStream;
import java.io.IOException;
+import java.io.Serializable;
import org.aspectj.apache.bcel.generic.Type;
@@ -65,11 +66,12 @@
* @version $Id: Field.java,v 1.6 2009/09/15 03:33:52 aclement Exp $
* @author M. Dahm
*/
-public final class Field extends FieldOrMethod {
+public class Field extends FieldOrMethod {
public static final Field[] NoFields = new Field[0];
private Type fieldType = null; // lazily initialized
+
private Field() {
}
Index: src/org/aspectj/apache/bcel/generic/Type.java
===================================================================
RCS file: /cvsroot/tools/org.aspectj/modules/bcel-builder/src/org/aspectj/apache/bcel/generic/Type.java,v
retrieving revision 1.13
diff -u -r1.13 Type.java
--- src/org/aspectj/apache/bcel/generic/Type.java 5 Oct 2009 17:35:36 -0000 1.13
+++ src/org/aspectj/apache/bcel/generic/Type.java 1 Nov 2010 20:24:03 -0000
@@ -54,6 +54,7 @@
* .
*/
+import java.io.Serializable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@@ -71,8 +72,9 @@
* @author M. Dahm
*
* modified: AndyClement 2-mar-05: Removed unnecessary static and optimized
+ * modified: AbrahamNevado 7-oct-10: implements Serializable
*/
-public abstract class Type {
+public abstract class Type implements Serializable {
protected byte type;
protected String signature;