View | Details | Raw Unified | Return to bug 166246
Collapse All | Expand All

(-)src/org/aspectj/weaver/loadtime/definition/Definition.java (-3 / +5 lines)
Lines 8-16 Link Here
8
 *
8
 *
9
 * Contributors:
9
 * Contributors:
10
 *   Alexandre Vasseur         initial implementation
10
 *   Alexandre Vasseur         initial implementation
11
 *   Abraham Nevado - lucierna	serialization
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.aspectj.weaver.loadtime.definition;
13
package org.aspectj.weaver.loadtime.definition;
13
14
15
import java.io.Serializable;
14
import java.util.ArrayList;
16
import java.util.ArrayList;
15
import java.util.HashMap;
17
import java.util.HashMap;
16
import java.util.List;
18
import java.util.List;
Lines 107-113 Link Here
107
		return concreteAspects;
109
		return concreteAspects;
108
	}
110
	}
109
111
110
	public static class ConcreteAspect {
112
	public static class ConcreteAspect  implements Serializable{
111
		public final String name;
113
		public final String name;
112
		public final String extend;
114
		public final String extend;
113
		public final String precedence;
115
		public final String precedence;
Lines 137-143 Link Here
137
		}
139
		}
138
	}
140
	}
139
141
140
	public static class Pointcut {
142
	public static class Pointcut implements Serializable{
141
		public final String name;
143
		public final String name;
142
		public final String expression;
144
		public final String expression;
143
145
Lines 147-153 Link Here
147
		}
149
		}
148
	}
150
	}
149
151
150
	public static class DeclareErrorOrWarning {
152
	public static class DeclareErrorOrWarning implements Serializable {
151
		public final boolean isError;
153
		public final boolean isError;
152
		public final String pointcut;
154
		public final String pointcut;
153
		public final String message;
155
		public final String message;
(-)src/org/aspectj/weaver/loadtime/definition/DocumentParser.java (-3 / +18 lines)
Lines 8-13 Link Here
8
 *
8
 *
9
 * Contributors:
9
 * Contributors:
10
 *   Alexandre Vasseur         initial implementation
10
 *   Alexandre Vasseur         initial implementation
11
 *   Abraham Nevado - Lucierna simple caching strategy
11
 *******************************************************************************/
12
 *******************************************************************************/
12
package org.aspectj.weaver.loadtime.definition;
13
package org.aspectj.weaver.loadtime.definition;
13
14
Lines 26-38 Link Here
26
import org.xml.sax.helpers.DefaultHandler;
27
import org.xml.sax.helpers.DefaultHandler;
27
import org.xml.sax.helpers.XMLReaderFactory;
28
import org.xml.sax.helpers.XMLReaderFactory;
28
29
30
import java.util.Hashtable;
31
29
/**
32
/**
30
 * FIXME AV - doc, concrete aspect
33
 * FIXME AV - doc, concrete aspect
31
 * 
34
 * 
32
 * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
35
 * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a>
36
 * @author A. Nevado
33
 */
37
 */
34
public class DocumentParser extends DefaultHandler {
38
public class DocumentParser extends DefaultHandler {
35
36
	/**
39
	/**
37
	 * The current DTD public id. The matching dtd will be searched as a resource.
40
	 * The current DTD public id. The matching dtd will be searched as a resource.
38
	 */
41
	 */
Lines 72-84 Link Here
72
75
73
	private Definition.ConcreteAspect m_lastConcreteAspect;
76
	private Definition.ConcreteAspect m_lastConcreteAspect;
74
77
78
	
79
	private static Hashtable parsedFiles = new Hashtable();
80
	private static final boolean CACHE = System.getProperty("org.aspectj.weaver.loadtime.configuration.cache", "false").equalsIgnoreCase("true");
81
	
75
	private DocumentParser() {
82
	private DocumentParser() {
76
		m_definition = new Definition();
83
		m_definition = new Definition();
77
	}
84
	}
78
85
	
79
	public static Definition parse(final URL url) throws Exception {
86
	public static Definition parse(final URL url) throws Exception {
80
		InputStream in = null;
87
		InputStream in = null;
81
		try {
88
		try {
89
			if(CACHE && parsedFiles.containsKey(url.toString())){
90
				return (Definition) parsedFiles.get(url.toString());
91
			}
92
			
82
			DocumentParser parser = new DocumentParser();
93
			DocumentParser parser = new DocumentParser();
83
94
84
			XMLReader xmlReader = getXMLReader();
95
			XMLReader xmlReader = getXMLReader();
Lines 104-109 Link Here
104
			xmlReader.setEntityResolver(parser);
115
			xmlReader.setEntityResolver(parser);
105
			in = url.openStream();
116
			in = url.openStream();
106
			xmlReader.parse(new InputSource(in));
117
			xmlReader.parse(new InputSource(in));
118
119
			if(CACHE && parser.m_definition.getAspectClassNames().size()>0){
120
				parsedFiles.put(url.toString(), parser.m_definition);
121
			}
122
			
107
			return parser.m_definition;
123
			return parser.m_definition;
108
		} finally {
124
		} finally {
109
			try {
125
			try {
Lines 116-122 Link Here
116
132
117
	private static XMLReader getXMLReader() throws SAXException, ParserConfigurationException {
133
	private static XMLReader getXMLReader() throws SAXException, ParserConfigurationException {
118
		XMLReader xmlReader = null;
134
		XMLReader xmlReader = null;
119
120
		/* Try this first for Java 5 */
135
		/* Try this first for Java 5 */
121
		try {
136
		try {
122
			xmlReader = XMLReaderFactory.createXMLReader();
137
			xmlReader = XMLReaderFactory.createXMLReader();
(-)src/org/aspectj/weaver/loadtime/IWeavingContext.java (-1 / +2 lines)
Lines 12-17 Link Here
12
package org.aspectj.weaver.loadtime;
12
package org.aspectj.weaver.loadtime;
13
13
14
import java.io.IOException;
14
import java.io.IOException;
15
import java.io.Serializable;
15
import java.net.URL;
16
import java.net.URL;
16
import java.util.Enumeration;
17
import java.util.Enumeration;
17
import java.util.List;
18
import java.util.List;
Lines 23-29 Link Here
23
 * 
24
 * 
24
 * @author David Knibb
25
 * @author David Knibb
25
 */
26
 */
26
public interface IWeavingContext {
27
public interface IWeavingContext extends Serializable {
27
	
28
	
28
	/**
29
	/**
29
	 * Allows the standard ClassLoader.getResources() mechanisms to be
30
	 * Allows the standard ClassLoader.getResources() mechanisms to be
(-)src/org/aspectj/weaver/bcel/BcelMethod.java (-1 / +1 lines)
Lines 61-67 Link Here
61
	private AjAttribute.EffectiveSignatureAttribute effectiveSignature;
61
	private AjAttribute.EffectiveSignatureAttribute effectiveSignature;
62
62
63
	private AjAttribute.MethodDeclarationLineNumberAttribute declarationLineNumber;
63
	private AjAttribute.MethodDeclarationLineNumberAttribute declarationLineNumber;
64
	private final BcelObjectType bcelObjectType;
64
	private final transient BcelObjectType bcelObjectType;
65
65
66
	private int bitflags;
66
	private int bitflags;
67
	private static final int KNOW_IF_SYNTHETIC = 0x0001;
67
	private static final int KNOW_IF_SYNTHETIC = 0x0001;
(-)src/org/aspectj/weaver/bcel/BcelAccessForInlineMunger.java (-1 / +1 lines)
Lines 59-65 Link Here
59
	/**
59
	/**
60
	 * The aspect we act for
60
	 * The aspect we act for
61
	 */
61
	 */
62
	private LazyClassGen m_aspectGen;
62
	private transient LazyClassGen m_aspectGen;
63
63
64
	/**
64
	/**
65
	 * The wrapper method we need to add. Those are added at the end of the munging
65
	 * The wrapper method we need to add. Those are added at the end of the munging
(-)src/org/aspectj/weaver/bcel/BcelObjectType.java (-5 / +7 lines)
Lines 9-19 Link Here
9
 * Contributors: 
9
 * Contributors: 
10
 *     PARC     initial implementation 
10
 *     PARC     initial implementation 
11
 *     RonBodkin/AndyClement optimizations for memory consumption/speed
11
 *     RonBodkin/AndyClement optimizations for memory consumption/speed
12
 *     Abraham Nevado Serialization for memory optimization
12
 * ******************************************************************/
13
 * ******************************************************************/
13
14
14
package org.aspectj.weaver.bcel;
15
package org.aspectj.weaver.bcel;
15
16
16
import java.io.PrintStream;
17
import java.io.PrintStream;
18
import java.io.Serializable;
17
import java.lang.ref.WeakReference;
19
import java.lang.ref.WeakReference;
18
import java.lang.reflect.Modifier;
20
import java.lang.reflect.Modifier;
19
import java.util.ArrayList;
21
import java.util.ArrayList;
Lines 67-76 Link Here
67
import org.aspectj.weaver.patterns.IScope;
69
import org.aspectj.weaver.patterns.IScope;
68
import org.aspectj.weaver.patterns.PerClause;
70
import org.aspectj.weaver.patterns.PerClause;
69
71
70
public class BcelObjectType extends AbstractReferenceTypeDelegate {
72
public class BcelObjectType extends AbstractReferenceTypeDelegate implements Serializable{
71
	public JavaClass javaClass;
73
	public transient JavaClass javaClass;
72
	private boolean artificial; // Was the BcelObject built from an artificial set of bytes? Or from the real ondisk stuff?
74
	private boolean artificial; // Was the BcelObject built from an artificial set of bytes? Or from the real ondisk stuff?
73
	private LazyClassGen lazyClassGen = null; // set lazily if it's an aspect
75
	private transient LazyClassGen lazyClassGen = null; // set lazily if it's an aspect
74
76
75
	private int modifiers;
77
	private int modifiers;
76
	private String className;
78
	private String className;
Lines 111-118 Link Here
111
	private boolean isCodeStyleAspect = false; // not redundant with field
113
	private boolean isCodeStyleAspect = false; // not redundant with field
112
	// above!
114
	// above!
113
115
114
	private WeakReference<ResolvedType> superTypeReference = new WeakReference<ResolvedType>(null);
116
	private transient WeakReference<ResolvedType> superTypeReference = new WeakReference<ResolvedType>(null);
115
	private WeakReference<ResolvedType[]> superInterfaceReferences = new WeakReference<ResolvedType[]>(null);
117
	private transient WeakReference<ResolvedType[]> superInterfaceReferences = new WeakReference<ResolvedType[]>(null);
116
118
117
	private int bitflag = 0x0000;
119
	private int bitflag = 0x0000;
118
120
(-)src/org/aspectj/weaver/bcel/BcelClassWeaver.java (-1 / +1 lines)
Lines 102-108 Link Here
102
102
103
	// --------------------------------------------
103
	// --------------------------------------------
104
104
105
	private final LazyClassGen clazz;
105
	private final transient LazyClassGen clazz;
106
	private final List<ShadowMunger> shadowMungers;
106
	private final List<ShadowMunger> shadowMungers;
107
	private final List<ConcreteTypeMunger> typeMungers;
107
	private final List<ConcreteTypeMunger> typeMungers;
108
	private final List<ConcreteTypeMunger> lateTypeMungers;
108
	private final List<ConcreteTypeMunger> lateTypeMungers;
(-)src/org/aspectj/weaver/bcel/BcelWeakClassLoaderReference.java (-3 / +24 lines)
Lines 8-16 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *     Andy Clement     initial implementation 
10
 *     Andy Clement     initial implementation 
11
 *     Abraham Nevado   added some special serialization support
11
 * ******************************************************************/
12
 * ******************************************************************/
12
package org.aspectj.weaver.bcel;
13
package org.aspectj.weaver.bcel;
13
14
15
import java.io.Serializable;
16
import java.util.HashMap;
17
14
import org.aspectj.apache.bcel.util.ClassLoaderReference;
18
import org.aspectj.apache.bcel.util.ClassLoaderReference;
15
import org.aspectj.weaver.WeakClassLoaderReference;
19
import org.aspectj.weaver.WeakClassLoaderReference;
16
20
Lines 32-49 Link Here
32
 * 
36
 * 
33
 * 
37
 * 
34
 * @author Andy Clement
38
 * @author Andy Clement
39
 * @uthor Abraham Nevado
35
 */
40
 */
36
public class BcelWeakClassLoaderReference extends WeakClassLoaderReference implements ClassLoaderReference {
41
public class BcelWeakClassLoaderReference implements ClassLoaderReference,Serializable { // extends WeakClassLoaderReference implements ClassLoaderReference {
37
42
43
	private transient WeakClassLoaderReference myRef;
44
	private static transient HashMap referencesMap = new HashMap();
45
	private String key;
46
	
47
	public BcelWeakClassLoaderReference() {
48
		myRef =  (WeakClassLoaderReference) referencesMap.get(key);
49
	}
50
	
38
	public BcelWeakClassLoaderReference(ClassLoader loader) {
51
	public BcelWeakClassLoaderReference(ClassLoader loader) {
39
		super(loader);
52
		myRef = new WeakClassLoaderReference(loader);
53
		key = String.valueOf(myRef.hashCode());
54
		referencesMap.put(key, myRef);
40
	}
55
	}
41
56
42
	public boolean equals(Object obj) {
57
	public boolean equals(Object obj) {
43
		if (!(obj instanceof BcelWeakClassLoaderReference))
58
		if (!(obj instanceof BcelWeakClassLoaderReference))
44
			return false;
59
			return false;
45
		BcelWeakClassLoaderReference other = (BcelWeakClassLoaderReference) obj;
60
		BcelWeakClassLoaderReference other = (BcelWeakClassLoaderReference) obj;
46
		return (other.hashcode == hashcode);
61
		return (other.hashCode() == myRef.hashCode());
62
	}
63
64
	@Override
65
	public ClassLoader getClassLoader() {
66
		// TODO Auto-generated method stub
67
		return myRef.getClassLoader();
47
	}
68
	}
48
69
49
}
70
}
(-)src/org/aspectj/weaver/tools/HybridHDMemoryHashMap.java (+165 lines)
Added Link Here
1
package org.aspectj.weaver.tools;
2
3
import java.io.File;
4
import java.io.FileInputStream;
5
import java.io.FileOutputStream;
6
import java.io.IOException;
7
import java.io.ObjectInputStream;
8
import java.io.ObjectOutputStream;
9
import java.util.Collection;
10
import java.util.HashMap;
11
import java.util.LinkedHashMap;
12
import java.util.Map;
13
import java.util.Set;
14
15
public class HybridHDMemoryHashMap implements Map {
16
17
	// private Cache cache;
18
	private Map<String, String> hdReferencesMap;
19
	private Map memoryMap;
20
21
	private final int capacity;
22
23
	public HybridHDMemoryHashMap(int cacheCapacity) {
24
		memoryMap = new Cache(cacheCapacity);
25
		hdReferencesMap = new HashMap<String, String>();
26
		this.capacity = cacheCapacity;
27
28
	}
29
30
	public boolean containsKey(Object key) {
31
		return (memoryMap.containsKey(key) || hdReferencesMap.containsKey(key));
32
	}
33
34
	public Object get(Object key) {
35
		if (memoryMap.containsKey(key)) {
36
			return memoryMap.get(key);
37
		} else if (hdReferencesMap.containsKey(key)) {
38
			return fromDisk(key.toString());
39
		} else {
40
			return null;
41
		}
42
	}
43
44
	public Object put(Object key, Object value) {
45
		return memoryMap.put(key, value);
46
	}
47
48
	public void clear() {
49
		memoryMap.clear();
50
		hdReferencesMap.clear();
51
	}
52
53
	public boolean containsValue(Object value) {
54
		throw new RuntimeException("Operation not supported");
55
	}
56
57
	public Set entrySet() {
58
		throw new RuntimeException("Operation not supported");
59
60
	}
61
62
	public boolean isEmpty() {
63
		return (memoryMap.isEmpty() && hdReferencesMap.isEmpty());
64
	}
65
66
	public Set keySet() {
67
		throw new RuntimeException("Operation not supported");
68
69
	}
70
71
	public void putAll(Map m) {
72
		throw new RuntimeException("Operation not supported");
73
74
	}
75
76
	public Object remove(Object key) {
77
		if (memoryMap.containsKey(key)) {
78
			return memoryMap.remove(key);
79
		} else if (hdReferencesMap.containsKey(key)) {
80
			Object removed =  fromDisk(key.toString());
81
			hdReferencesMap.remove(key);
82
			return removed;
83
		} else {
84
			return null;
85
		}
86
	}
87
88
	public int size() {
89
		return memoryMap.size() + hdReferencesMap.size();
90
	}
91
92
	public Collection values() {
93
		throw new RuntimeException("Operation not supported");
94
	}
95
96
	private Object fromDisk(String key) {
97
		FileInputStream fis = null;
98
		try {
99
			fis = new FileInputStream(hdReferencesMap.get(key).toString());
100
			ObjectInputStream ois = new ObjectInputStream(fis);
101
			Object object = ois.readObject();
102
			hdReferencesMap.remove(key);
103
			return memoryMap.put(key, object);
104
		} catch (Throwable e) {
105
			e.printStackTrace();
106
			return null;
107
		} finally {
108
			try {
109
				fis.close();
110
			} catch (Exception e) {
111
				// This is not and empty block ;) No worries nothing to do
112
				// just a best effort close.
113
			}
114
		}
115
		
116
	}
117
118
	class Cache extends LinkedHashMap {
119
120
		public Cache(int cacheCapacity) {
121
			super(cacheCapacity + 1, 1.1f, true);
122
		}
123
124
		@Override
125
		protected boolean removeEldestEntry(Map.Entry eldest) {
126
			if (size() > capacity) {
127
				try {
128
					toDisk(eldest.getKey().toString(), eldest.getValue());
129
				} catch (IOException e) {
130
					e.printStackTrace();
131
					// little trick to avoid getting the in memory being stuck because one element can not be serialized:
132
					this.get(eldest.getKey());
133
					return false;
134
				}
135
				this.remove(eldest.getKey());
136
				return true;
137
			} else {
138
				return false;
139
			}
140
		}
141
142
		private void toDisk(String key, Object value) throws IOException {
143
			FileOutputStream fos = null;
144
			ObjectOutputStream oos = null;
145
			File temp = null;
146
			try {
147
				temp= File.createTempFile(key, "luc");
148
				fos = new FileOutputStream(temp);
149
				 oos = new ObjectOutputStream(fos);
150
				oos.writeUnshared(value);
151
				hdReferencesMap.put(key, temp.getAbsolutePath());
152
			} finally {
153
				try {
154
					oos.close();
155
					fos.close();
156
				} catch (Exception e) {
157
					// This is not and empty block ;) No worries nothing to do
158
					// just a best effort close.
159
				}
160
			}
161
162
		}
163
164
	}
165
}
(-)src/org/aspectj/weaver/AjAttribute.java (-2 / +4 lines)
Lines 17-22 Link Here
17
import java.io.DataOutputStream;
17
import java.io.DataOutputStream;
18
import java.io.EOFException;
18
import java.io.EOFException;
19
import java.io.IOException;
19
import java.io.IOException;
20
import java.io.Serializable;
20
21
21
import org.aspectj.bridge.MessageUtil;
22
import org.aspectj.bridge.MessageUtil;
22
import org.aspectj.bridge.Version;
23
import org.aspectj.bridge.Version;
Lines 36-43 Link Here
36
 * 
37
 * 
37
 * @author Erik Hilsdale
38
 * @author Erik Hilsdale
38
 * @author Jim Hugunin
39
 * @author Jim Hugunin
40
 * @authro Abraham Nevado
39
 */
41
 */
40
public abstract class AjAttribute {
42
public abstract class AjAttribute  implements Serializable{
41
43
42
	public static final String AttributePrefix = "org.aspectj.weaver";
44
	public static final String AttributePrefix = "org.aspectj.weaver";
43
45
Lines 214-220 Link Here
214
		}
216
		}
215
	}
217
	}
216
218
217
	public static class WeaverVersionInfo extends AjAttribute {
219
	public static class WeaverVersionInfo extends AjAttribute  {
218
		public static final String AttributeName = "org.aspectj.weaver.WeaverVersion";
220
		public static final String AttributeName = "org.aspectj.weaver.WeaverVersion";
219
221
220
		// If you change the format of an AspectJ class file, you have two
222
		// If you change the format of an AspectJ class file, you have two
(-)src/org/aspectj/weaver/TypeVariableDeclaringElement.java (-1 / +4 lines)
Lines 8-21 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *   Andy Clement			Initial implementation
10
 *   Andy Clement			Initial implementation
11
 *   Abraham Nevado			Serializable implementation
11
 * ******************************************************************/
12
 * ******************************************************************/
12
13
13
package org.aspectj.weaver;
14
package org.aspectj.weaver;
14
15
16
import java.io.Serializable;
17
15
/**
18
/**
16
 * Tag interface - methods and types can be declaring elements for type variables. See the TypeVariable class which holds onto the
19
 * Tag interface - methods and types can be declaring elements for type variables. See the TypeVariable class which holds onto the
17
 * declaring element
20
 * declaring element
18
 */
21
 */
19
public interface TypeVariableDeclaringElement {
22
public interface TypeVariableDeclaringElement  extends Serializable{
20
	public TypeVariable getTypeVariableNamed(String name);
23
	public TypeVariable getTypeVariableNamed(String name);
21
}
24
}
(-)src/org/aspectj/weaver/ShadowMunger.java (-1 / +3 lines)
Lines 8-19 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *     PARC     initial implementation 
10
 *     PARC     initial implementation 
11
 *     Abraham Nevado Serialition issues
11
 * ******************************************************************/
12
 * ******************************************************************/
12
13
13
package org.aspectj.weaver;
14
package org.aspectj.weaver;
14
15
15
import java.io.File;
16
import java.io.File;
16
import java.io.IOException;
17
import java.io.IOException;
18
import java.io.Serializable;
17
import java.util.Collection;
19
import java.util.Collection;
18
import java.util.HashSet;
20
import java.util.HashSet;
19
import java.util.Map;
21
import java.util.Map;
Lines 37-43 Link Here
37
 * For every shadow munger, for every shadow, first match is called, then (if match returned true) the shadow munger is specialized
39
 * For every shadow munger, for every shadow, first match is called, then (if match returned true) the shadow munger is specialized
38
 * for the shadow, which may modify state. Then implement is called.
40
 * for the shadow, which may modify state. Then implement is called.
39
 */
41
 */
40
public abstract class ShadowMunger implements PartialOrder.PartialComparable, IHasPosition {
42
public abstract class ShadowMunger implements PartialOrder.PartialComparable, IHasPosition, Serializable {
41
43
42
	public static final ShadowMunger[] NONE = new ShadowMunger[0];
44
	public static final ShadowMunger[] NONE = new ShadowMunger[0];
43
45
(-)src/org/aspectj/weaver/CrosscuttingMembers.java (-2 / +5 lines)
Lines 7-16 Link Here
7
 * http://www.eclipse.org/legal/epl-v10.html 
7
 * http://www.eclipse.org/legal/epl-v10.html 
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *     PARC     initial implementation 
10
 *     PARC     initial implementation
11
 *     Abraham Nevado    Serializable 
11
 * ******************************************************************/
12
 * ******************************************************************/
12
package org.aspectj.weaver;
13
package org.aspectj.weaver;
13
14
15
import java.io.Serializable;
14
import java.util.ArrayList;
16
import java.util.ArrayList;
15
import java.util.Collection;
17
import java.util.Collection;
16
import java.util.HashSet;
18
import java.util.HashSet;
Lines 42-49 Link Here
42
 * All members are concrete.
44
 * All members are concrete.
43
 * 
45
 * 
44
 * @author Jim Hugunin
46
 * @author Jim Hugunin
47
 * @author Abraham Nevado
45
 */
48
 */
46
public class CrosscuttingMembers {
49
public class CrosscuttingMembers implements Serializable{
47
	private final ResolvedType inAspect;
50
	private final ResolvedType inAspect;
48
	private final World world;
51
	private final World world;
49
52
(-)src/org/aspectj/weaver/AnnotationAJ.java (-1 / +3 lines)
Lines 9-22 Link Here
9
 * ******************************************************************/
9
 * ******************************************************************/
10
package org.aspectj.weaver;
10
package org.aspectj.weaver;
11
11
12
import java.io.Serializable;
12
import java.util.Set;
13
import java.util.Set;
13
14
14
/**
15
/**
15
 * Simple representation of an annotation that the weaver can work with.
16
 * Simple representation of an annotation that the weaver can work with.
16
 * 
17
 * 
17
 * @author AndyClement
18
 * @author AndyClement
19
 * @author Abraham Nevado
18
 */
20
 */
19
public interface AnnotationAJ {
21
public interface AnnotationAJ extends Serializable {
20
22
21
	public static final AnnotationAJ[] EMPTY_ARRAY = new AnnotationAJ[0];
23
	public static final AnnotationAJ[] EMPTY_ARRAY = new AnnotationAJ[0];
22
24
(-)src/org/aspectj/weaver/UnresolvedType.java (-2 / +4 lines)
Lines 10-21 Link Here
10
 *     PARC     initial implementation 
10
 *     PARC     initial implementation 
11
 *     Andy Clement  start of generics upgrade...
11
 *     Andy Clement  start of generics upgrade...
12
 *     Adrian Colyer - overhaul
12
 *     Adrian Colyer - overhaul
13
 *     Abraham Nevado - Serializable
13
 * ******************************************************************/
14
 * ******************************************************************/
14
15
15
package org.aspectj.weaver;
16
package org.aspectj.weaver;
16
17
17
import java.io.DataInputStream;
18
import java.io.DataInputStream;
18
import java.io.IOException;
19
import java.io.IOException;
20
import java.io.Serializable;
19
import java.util.Map;
21
import java.util.Map;
20
22
21
import org.aspectj.util.GenericSignature;
23
import org.aspectj.util.GenericSignature;
Lines 32-38 Link Here
32
 * <p>
34
 * <p>
33
 * Every UnresolvedType has a signature, the unique key for the type in the world.
35
 * Every UnresolvedType has a signature, the unique key for the type in the world.
34
 */
36
 */
35
public class UnresolvedType implements Traceable, TypeVariableDeclaringElement {
37
public class UnresolvedType implements Traceable, TypeVariableDeclaringElement, Serializable {
36
38
37
	// common type structures
39
	// common type structures
38
	public static final UnresolvedType[] NONE = new UnresolvedType[0];
40
	public static final UnresolvedType[] NONE = new UnresolvedType[0];
Lines 821-827 Link Here
821
		return typeVariables;
823
		return typeVariables;
822
	}
824
	}
823
825
824
	public static class TypeKind {
826
	public static class TypeKind implements Serializable {
825
		// Note: It is not sufficient to say that a parameterized type with no type parameters in fact
827
		// Note: It is not sufficient to say that a parameterized type with no type parameters in fact
826
		// represents a raw type - a parameterized type with no type parameters can represent
828
		// represents a raw type - a parameterized type with no type parameters can represent
827
		// an inner type of a parameterized type that specifies no type parameters of its own.
829
		// an inner type of a parameterized type that specifies no type parameters of its own.
(-)src/org/aspectj/weaver/World.java (-9 / +11 lines)
Lines 9-19 Link Here
9
 *  
9
 *  
10
 * Contributors: 
10
 * Contributors: 
11
 *     PARC     initial implementation
11
 *     PARC     initial implementation
12
 *     Adrian Colyer, Andy Clement, overhaul for generics, Abraham Nevado 
12
 *     Adrian Colyer, Andy Clement, overhaul for generics
13
 *     Abraham Nevado Serialization
13
 * ******************************************************************/
14
 * ******************************************************************/
14
15
15
package org.aspectj.weaver;
16
package org.aspectj.weaver;
16
17
18
import java.io.Serializable;
17
import java.lang.ref.Reference;
19
import java.lang.ref.Reference;
18
import java.lang.ref.ReferenceQueue;
20
import java.lang.ref.ReferenceQueue;
19
import java.lang.ref.SoftReference;
21
import java.lang.ref.SoftReference;
Lines 53-59 Link Here
53
/**
55
/**
54
 * A World is a collection of known types and crosscutting members.
56
 * A World is a collection of known types and crosscutting members.
55
 */
57
 */
56
public abstract class World implements Dump.INode {
58
public abstract class World implements Dump.INode, Serializable {
57
	/** handler for any messages produced during resolution etc. */
59
	/** handler for any messages produced during resolution etc. */
58
	private IMessageHandler messageHandler = IMessageHandler.SYSTEM_ERR;
60
	private IMessageHandler messageHandler = IMessageHandler.SYSTEM_ERR;
59
61
Lines 141-147 Link Here
141
	// Minimal Model controls whether model entities that are not involved in relationships are deleted post-build
143
	// Minimal Model controls whether model entities that are not involved in relationships are deleted post-build
142
	private boolean minimalModel = false;
144
	private boolean minimalModel = false;
143
	private boolean targettingRuntime1_6_10 = false;
145
	private boolean targettingRuntime1_6_10 = false;
144
146
	
145
	private boolean completeBinaryTypes = false;
147
	private boolean completeBinaryTypes = false;
146
	private boolean overWeaving = false;
148
	private boolean overWeaving = false;
147
	public boolean forDEBUG_structuralChangesCode = false;
149
	public boolean forDEBUG_structuralChangesCode = false;
Lines 152-158 Link Here
152
154
153
	public int infoMessagesEnabled = 0; // 0=uninitialized, 1=no, 2=yes
155
	public int infoMessagesEnabled = 0; // 0=uninitialized, 1=no, 2=yes
154
156
155
	private static Trace trace = TraceFactory.getTraceFactory().getTrace(World.class);
157
	private transient static Trace trace = TraceFactory.getTraceFactory().getTrace(World.class);
156
158
157
	private long errorThreshold;
159
	private long errorThreshold;
158
	private long warningThreshold;
160
	private long warningThreshold;
Lines 815-821 Link Here
815
		ensureAdvancedConfigurationProcessed();
817
		ensureAdvancedConfigurationProcessed();
816
		return targettingRuntime1_6_10;
818
		return targettingRuntime1_6_10;
817
	}
819
	}
818
820
	
819
	public void setBehaveInJava5Way(boolean b) {
821
	public void setBehaveInJava5Way(boolean b) {
820
		behaveInJava5Way = b;
822
		behaveInJava5Way = b;
821
	}
823
	}
Lines 987-993 Link Here
987
	 * Map of types in the world, can have 'references' to expendable ones which can be garbage collected to recover memory. An
989
	 * Map of types in the world, can have 'references' to expendable ones which can be garbage collected to recover memory. An
988
	 * expendable type is a reference type that is not exposed to the weaver (ie just pulled in for type resolution purposes).
990
	 * expendable type is a reference type that is not exposed to the weaver (ie just pulled in for type resolution purposes).
989
	 */
991
	 */
990
	public static class TypeMap {
992
	public static class TypeMap implements Serializable {
991
993
992
		// Strategy for entries in the expendable map
994
		// Strategy for entries in the expendable map
993
		public final static int DONT_USE_REFS = 0; // Hang around forever
995
		public final static int DONT_USE_REFS = 0; // Hang around forever
Lines 1008-1014 Link Here
1008
		final Map<String, ResolvedType> tMap = new HashMap<String, ResolvedType>();
1010
		final Map<String, ResolvedType> tMap = new HashMap<String, ResolvedType>();
1009
1011
1010
		// Map of types that may be ejected from the cache if we need space
1012
		// Map of types that may be ejected from the cache if we need space
1011
		final Map<String, Reference<ResolvedType>> expendableMap = Collections
1013
		final transient Map<String, Reference<ResolvedType>> expendableMap = Collections
1012
				.synchronizedMap(new WeakHashMap<String, Reference<ResolvedType>>());
1014
				.synchronizedMap(new WeakHashMap<String, Reference<ResolvedType>>());
1013
1015
1014
		private final World w;
1016
		private final World w;
Lines 1347-1353 Link Here
1347
	/**
1349
	/**
1348
	 * This class is used to compute and store precedence relationships between aspects.
1350
	 * This class is used to compute and store precedence relationships between aspects.
1349
	 */
1351
	 */
1350
	private static class AspectPrecedenceCalculator {
1352
	private static class AspectPrecedenceCalculator  implements Serializable{
1351
1353
1352
		private final World world;
1354
		private final World world;
1353
		private final Map<PrecedenceCacheKey, Integer> cachedResults;
1355
		private final Map<PrecedenceCacheKey, Integer> cachedResults;
Lines 1516-1522 Link Here
1516
				if (s.equalsIgnoreCase("true")) {
1518
				if (s.equalsIgnoreCase("true")) {
1517
					targettingRuntime1_6_10 = true;
1519
					targettingRuntime1_6_10 = true;
1518
				}
1520
				}
1519
1521
				
1520
				s = p.getProperty(xsetFAST_PACK_METHODS, "true");
1522
				s = p.getProperty(xsetFAST_PACK_METHODS, "true");
1521
				fastMethodPacking = s.equalsIgnoreCase("true");
1523
				fastMethodPacking = s.equalsIgnoreCase("true");
1522
1524
(-)src/org/aspectj/weaver/WeaverStateInfo.java (-1 / +3 lines)
Lines 8-13 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *     PARC     initial implementation 
10
 *     PARC     initial implementation 
11
 *     Lucierna	serialization
11
 * ******************************************************************/
12
 * ******************************************************************/
12
13
13
package org.aspectj.weaver;
14
package org.aspectj.weaver;
Lines 17-22 Link Here
17
import java.io.DataInputStream;
18
import java.io.DataInputStream;
18
import java.io.DataOutputStream;
19
import java.io.DataOutputStream;
19
import java.io.IOException;
20
import java.io.IOException;
21
import java.io.Serializable;
20
import java.util.ArrayList;
22
import java.util.ArrayList;
21
import java.util.Collection;
23
import java.util.Collection;
22
import java.util.Collections;
24
import java.util.Collections;
Lines 39-45 Link Here
39
 * previously woven <String> The fully qualified name of each type Int: Length of class file data (i.e. the unwovenclassfile)
41
 * previously woven <String> The fully qualified name of each type Int: Length of class file data (i.e. the unwovenclassfile)
40
 * Byte[]: The class file data, compressed if REWEAVABLE_COMPRESSION_BIT set.
42
 * Byte[]: The class file data, compressed if REWEAVABLE_COMPRESSION_BIT set.
41
 */
43
 */
42
public class WeaverStateInfo {
44
public class WeaverStateInfo implements Serializable{
43
	private List<Entry> typeMungers;
45
	private List<Entry> typeMungers;
44
	private boolean oldStyle;
46
	private boolean oldStyle;
45
47
(-)src/org/aspectj/weaver/ReferenceType.java (-2 / +2 lines)
Lines 51-57 Link Here
51
	ResolvedMember[] parameterizedMethods = null;
51
	ResolvedMember[] parameterizedMethods = null;
52
	ResolvedMember[] parameterizedFields = null;
52
	ResolvedMember[] parameterizedFields = null;
53
	ResolvedMember[] parameterizedPointcuts = null;
53
	ResolvedMember[] parameterizedPointcuts = null;
54
	WeakReference<ResolvedType[]> parameterizedInterfaces = new WeakReference<ResolvedType[]>(null);
54
	transient WeakReference<ResolvedType[]> parameterizedInterfaces = new WeakReference<ResolvedType[]>(null);
55
	Collection<Declare> parameterizedDeclares = null;
55
	Collection<Declare> parameterizedDeclares = null;
56
	// Collection parameterizedTypeMungers = null;
56
	// Collection parameterizedTypeMungers = null;
57
57
Lines 884-890 Link Here
884
		return getDelegate().getModifiers();
884
		return getDelegate().getModifiers();
885
	}
885
	}
886
886
887
	WeakReference<ResolvedType> superclassReference = new WeakReference<ResolvedType>(null);
887
	transient WeakReference<ResolvedType> superclassReference = new WeakReference<ResolvedType>(null);
888
888
889
	@Override
889
	@Override
890
	public ResolvedType getSuperclass() {
890
	public ResolvedType getSuperclass() {
(-)src/org/aspectj/weaver/ICrossReferenceHandler.java (-1 / +4 lines)
Lines 7-22 Link Here
7
 * 
7
 * 
8
 * Contributors:
8
 * Contributors:
9
 *     IBM Corporation - initial API and implementation
9
 *     IBM Corporation - initial API and implementation
10
 *     Abraham Nevado - Serializable implementation
10
 *******************************************************************************/
11
 *******************************************************************************/
11
package org.aspectj.weaver;
12
package org.aspectj.weaver;
12
13
14
import java.io.Serializable;
15
13
import org.aspectj.bridge.ISourceLocation;
16
import org.aspectj.bridge.ISourceLocation;
14
17
15
/**
18
/**
16
 * Clients can pass a single cross-reference handler to the weaver on construction of a BcelWorld. Any cross-references detected
19
 * Clients can pass a single cross-reference handler to the weaver on construction of a BcelWorld. Any cross-references detected
17
 * during munging will be notified to the handler.
20
 * during munging will be notified to the handler.
18
 */
21
 */
19
public interface ICrossReferenceHandler {
22
public interface ICrossReferenceHandler extends Serializable {
20
23
21
	void addCrossReference(ISourceLocation from, ISourceLocation to, String kind, boolean runtimeTest);
24
	void addCrossReference(ISourceLocation from, ISourceLocation to, String kind, boolean runtimeTest);
22
25
(-)src/org/aspectj/weaver/CrosscuttingMembersSet.java (-2 / +4 lines)
Lines 13-18 Link Here
13
package org.aspectj.weaver;
13
package org.aspectj.weaver;
14
14
15
import java.io.IOException;
15
import java.io.IOException;
16
import java.io.Serializable;
16
import java.util.ArrayList;
17
import java.util.ArrayList;
17
import java.util.Collections;
18
import java.util.Collections;
18
import java.util.HashMap;
19
import java.util.HashMap;
Lines 36-45 Link Here
36
 * 
37
 * 
37
 * @author Jim Hugunin
38
 * @author Jim Hugunin
38
 * @author Andy Clement
39
 * @author Andy Clement
40
 * @author Abraham Nevado
39
 */
41
 */
40
public class CrosscuttingMembersSet {
42
public class CrosscuttingMembersSet implements Serializable {
41
43
42
	private static Trace trace = TraceFactory.getTraceFactory().getTrace(CrosscuttingMembersSet.class);
44
	private transient  static Trace trace = TraceFactory.getTraceFactory().getTrace(CrosscuttingMembersSet.class);
43
45
44
	private transient World world;
46
	private transient World world;
45
47
(-)src/org/aspectj/weaver/WeakClassLoaderReference.java (-1 / +1 lines)
Lines 32-38 Link Here
32
 * 
32
 * 
33
 * @author Andy Clement
33
 * @author Andy Clement
34
 */
34
 */
35
public class WeakClassLoaderReference {
35
public class WeakClassLoaderReference{
36
36
37
	protected final int hashcode;
37
	protected final int hashcode;
38
38
(-)src/org/aspectj/weaver/ConcreteTypeMunger.java (-1 / +2 lines)
Lines 12-23 Link Here
12
12
13
package org.aspectj.weaver;
13
package org.aspectj.weaver;
14
14
15
import java.io.Serializable;
15
import java.util.Map;
16
import java.util.Map;
16
17
17
import org.aspectj.bridge.ISourceLocation;
18
import org.aspectj.bridge.ISourceLocation;
18
import org.aspectj.util.PartialOrder;
19
import org.aspectj.util.PartialOrder;
19
20
20
public abstract class ConcreteTypeMunger implements PartialOrder.PartialComparable {
21
public abstract class ConcreteTypeMunger implements PartialOrder.PartialComparable,Serializable {
21
	protected ResolvedTypeMunger munger;
22
	protected ResolvedTypeMunger munger;
22
	protected ResolvedType aspectType;
23
	protected ResolvedType aspectType;
23
24
(-)src/org/aspectj/weaver/ResolvedTypeMunger.java (-2 / +3 lines)
Lines 20-25 Link Here
20
import java.io.IOException;
20
import java.io.IOException;
21
import java.io.ObjectInputStream;
21
import java.io.ObjectInputStream;
22
import java.io.ObjectOutputStream;
22
import java.io.ObjectOutputStream;
23
import java.io.Serializable;
23
import java.util.ArrayList;
24
import java.util.ArrayList;
24
import java.util.Collections;
25
import java.util.Collections;
25
import java.util.HashSet;
26
import java.util.HashSet;
Lines 35-41 Link Here
35
 * This is an abstraction over method/field introduction. It might not have the chops to handle other inter-type declarations. This
36
 * This is an abstraction over method/field introduction. It might not have the chops to handle other inter-type declarations. This
36
 * is the thing that is used on the eclipse side and serialized into a ConcreteTypeMunger.
37
 * is the thing that is used on the eclipse side and serialized into a ConcreteTypeMunger.
37
 */
38
 */
38
public abstract class ResolvedTypeMunger {
39
public abstract class ResolvedTypeMunger implements Serializable {
39
40
40
	protected Kind kind;
41
	protected Kind kind;
41
	protected ResolvedMember signature;
42
	protected ResolvedMember signature;
Lines 276-282 Link Here
276
		return kind;
277
		return kind;
277
	}
278
	}
278
279
279
	public static class Kind extends TypeSafeEnum {
280
	public static class Kind extends TypeSafeEnum  implements Serializable{
280
		/* private */Kind(String name, int key) {
281
		/* private */Kind(String name, int key) {
281
			super(name, key);
282
			super(name, key);
282
		}
283
		}
(-)src/org/aspectj/weaver/ISourceContext.java (-1 / +4 lines)
Lines 8-20 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *     PARC     initial implementation 
10
 *     PARC     initial implementation 
11
 *     Abraham Nevado  Serializable
11
 * ******************************************************************/
12
 * ******************************************************************/
12
13
13
package org.aspectj.weaver;
14
package org.aspectj.weaver;
14
15
16
import java.io.Serializable;
17
15
import org.aspectj.bridge.ISourceLocation;
18
import org.aspectj.bridge.ISourceLocation;
16
19
17
public interface ISourceContext {
20
public interface ISourceContext  extends Serializable{
18
	public ISourceLocation makeSourceLocation(IHasPosition position);
21
	public ISourceLocation makeSourceLocation(IHasPosition position);
19
22
20
	public ISourceLocation makeSourceLocation(int line, int offset);
23
	public ISourceLocation makeSourceLocation(int line, int offset);
(-)src/org/aspectj/weaver/Lint.java (-3 / +4 lines)
Lines 16-21 Link Here
16
import java.io.FileInputStream;
16
import java.io.FileInputStream;
17
import java.io.IOException;
17
import java.io.IOException;
18
import java.io.InputStream;
18
import java.io.InputStream;
19
import java.io.Serializable;
19
import java.text.MessageFormat;
20
import java.text.MessageFormat;
20
import java.util.Collection;
21
import java.util.Collection;
21
import java.util.HashMap;
22
import java.util.HashMap;
Lines 29-35 Link Here
29
import org.aspectj.weaver.tools.Trace;
30
import org.aspectj.weaver.tools.Trace;
30
import org.aspectj.weaver.tools.TraceFactory;
31
import org.aspectj.weaver.tools.TraceFactory;
31
32
32
public class Lint {
33
public class Lint implements Serializable{
33
	Map<String, Lint.Kind> kinds = new HashMap<String, Lint.Kind>();
34
	Map<String, Lint.Kind> kinds = new HashMap<String, Lint.Kind>();
34
	/* private */World world;
35
	/* private */World world;
35
36
Lines 136-142 Link Here
136
	public final Kind missingAspectForReweaving = new Kind("missingAspectForReweaving",
137
	public final Kind missingAspectForReweaving = new Kind("missingAspectForReweaving",
137
			"aspect {0} cannot be found when reweaving {1}");
138
			"aspect {0} cannot be found when reweaving {1}");
138
139
139
	private static Trace trace = TraceFactory.getTraceFactory().getTrace(Lint.class);
140
	private transient static Trace trace = TraceFactory.getTraceFactory().getTrace(Lint.class);
140
141
141
	public Lint(World world) {
142
	public Lint(World world) {
142
		if (trace.isTraceEnabled()) {
143
		if (trace.isTraceEnabled()) {
Lines 278-284 Link Here
278
		return kinds.get(lintkey);
279
		return kinds.get(lintkey);
279
	}
280
	}
280
281
281
	public class Kind {
282
	public class Kind implements Serializable{
282
		private final String name;
283
		private final String name;
283
		private final String message;
284
		private final String message;
284
		private IMessage.Kind kind = IMessage.WARNING;
285
		private IMessage.Kind kind = IMessage.WARNING;
(-)src/org/aspectj/weaver/patterns/TypePattern.java (-2 / +4 lines)
Lines 13-18 Link Here
13
package org.aspectj.weaver.patterns;
13
package org.aspectj.weaver.patterns;
14
14
15
import java.io.IOException;
15
import java.io.IOException;
16
import java.io.Serializable;
16
import java.lang.reflect.Modifier;
17
import java.lang.reflect.Modifier;
17
import java.util.Iterator;
18
import java.util.Iterator;
18
import java.util.Map;
19
import java.util.Map;
Lines 38-46 Link Here
38
 * 
39
 * 
39
 * @author Erik Hilsdale
40
 * @author Erik Hilsdale
40
 * @author Jim Hugunin
41
 * @author Jim Hugunin
42
 * @auther Abraham Nevado
41
 */
43
 */
42
public abstract class TypePattern extends PatternNode {
44
public abstract class TypePattern extends PatternNode  {
43
	public static class MatchKind {
45
	public static class MatchKind implements Serializable {
44
		private String name;
46
		private String name;
45
47
46
		public MatchKind(String name) {
48
		public MatchKind(String name) {
(-)src/org/aspectj/weaver/patterns/IScope.java (-2 / +5 lines)
Lines 7-17 Link Here
7
 * http://www.eclipse.org/legal/epl-v10.html 
7
 * http://www.eclipse.org/legal/epl-v10.html 
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *     PARC     initial implementation 
10
 *     PARC     initial implementation
11
 *     Abraham Nevado serializable 
11
 * ******************************************************************/
12
 * ******************************************************************/
12
13
13
package org.aspectj.weaver.patterns;
14
package org.aspectj.weaver.patterns;
14
15
16
import java.io.Serializable;
17
15
import org.aspectj.bridge.IMessage;
18
import org.aspectj.bridge.IMessage;
16
import org.aspectj.bridge.IMessageHandler;
19
import org.aspectj.bridge.IMessageHandler;
17
import org.aspectj.weaver.IHasPosition;
20
import org.aspectj.weaver.IHasPosition;
Lines 19-25 Link Here
19
import org.aspectj.weaver.UnresolvedType;
22
import org.aspectj.weaver.UnresolvedType;
20
import org.aspectj.weaver.World;
23
import org.aspectj.weaver.World;
21
24
22
public interface IScope {
25
public interface IScope extends Serializable{
23
26
24
	/**
27
	/**
25
	 * @return the type corresponding to the name in this scope, or ResolvedType.MISSING if no such type exists
28
	 * @return the type corresponding to the name in this scope, or ResolvedType.MISSING if no such type exists
(-)src/org/aspectj/weaver/patterns/PatternNode.java (-1 / +2 lines)
Lines 15-27 Link Here
15
import java.io.DataInputStream;
15
import java.io.DataInputStream;
16
import java.io.DataOutputStream;
16
import java.io.DataOutputStream;
17
import java.io.IOException;
17
import java.io.IOException;
18
import java.io.Serializable;
18
19
19
import org.aspectj.bridge.ISourceLocation;
20
import org.aspectj.bridge.ISourceLocation;
20
import org.aspectj.weaver.CompressingDataOutputStream;
21
import org.aspectj.weaver.CompressingDataOutputStream;
21
import org.aspectj.weaver.IHasSourceLocation;
22
import org.aspectj.weaver.IHasSourceLocation;
22
import org.aspectj.weaver.ISourceContext;
23
import org.aspectj.weaver.ISourceContext;
23
24
24
public abstract class PatternNode implements IHasSourceLocation {
25
public abstract class PatternNode implements IHasSourceLocation,Serializable {
25
	protected int start, end;
26
	protected int start, end;
26
	protected ISourceContext sourceContext;
27
	protected ISourceContext sourceContext;
27
28
(-)src/org/aspectj/weaver/patterns/ExposedState.java (-1 / +2 lines)
Lines 12-17 Link Here
12
12
13
package org.aspectj.weaver.patterns;
13
package org.aspectj.weaver.patterns;
14
14
15
import java.io.Serializable;
15
import java.util.Arrays;
16
import java.util.Arrays;
16
17
17
import org.aspectj.weaver.Member;
18
import org.aspectj.weaver.Member;
Lines 20-26 Link Here
20
import org.aspectj.weaver.ast.Expr;
21
import org.aspectj.weaver.ast.Expr;
21
import org.aspectj.weaver.ast.Var;
22
import org.aspectj.weaver.ast.Var;
22
23
23
public class ExposedState {
24
public class ExposedState implements Serializable {
24
	public static final boolean[] NO_ERRONEOUS_VARS = new boolean[0];
25
	public static final boolean[] NO_ERRONEOUS_VARS = new boolean[0];
25
	public Var[] vars;
26
	public Var[] vars;
26
	private boolean[] erroneousVars;
27
	private boolean[] erroneousVars;
(-)src/org/aspectj/weaver/patterns/FormalBinding.java (-1 / +4 lines)
Lines 8-21 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *     PARC     initial implementation 
10
 *     PARC     initial implementation 
11
 *     Abraham Nevado serializable
11
 * ******************************************************************/
12
 * ******************************************************************/
12
13
13
package org.aspectj.weaver.patterns;
14
package org.aspectj.weaver.patterns;
14
15
16
import java.io.Serializable;
17
15
import org.aspectj.weaver.IHasPosition;
18
import org.aspectj.weaver.IHasPosition;
16
import org.aspectj.weaver.UnresolvedType;
19
import org.aspectj.weaver.UnresolvedType;
17
20
18
public class FormalBinding implements IHasPosition {
21
public class FormalBinding implements IHasPosition,Serializable {
19
	private final UnresolvedType type;
22
	private final UnresolvedType type;
20
	private final String name;
23
	private final String name;
21
	private final int index;
24
	private final int index;
(-)src/org/aspectj/weaver/ast/ASTNode.java (-1 / +3 lines)
Lines 13-19 Link Here
13
13
14
package org.aspectj.weaver.ast;
14
package org.aspectj.weaver.ast;
15
15
16
public abstract class ASTNode {
16
import java.io.Serializable;
17
18
public abstract class ASTNode implements Serializable {
17
19
18
    public ASTNode() {
20
    public ASTNode() {
19
        super();
21
        super();
(-)src/org/aspectj/weaver/tools/PointcutDesignatorHandler.java (-1 / +4 lines)
Lines 8-16 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *   Adrian Colyer			Initial implementation
10
 *   Adrian Colyer			Initial implementation
11
 *   Abraham Nevado			Serializable implementation
11
 * ******************************************************************/
12
 * ******************************************************************/
12
package org.aspectj.weaver.tools;
13
package org.aspectj.weaver.tools;
13
14
15
import java.io.Serializable;
16
14
17
15
/**
18
/**
16
 * The PointcutDesignator interface allows extension of the
19
 * The PointcutDesignator interface allows extension of the
Lines 22-28 Link Here
22
 * A pointcut designator can only be used for matching, not for
25
 * A pointcut designator can only be used for matching, not for
23
 * binding.
26
 * binding.
24
 */
27
 */
25
public interface PointcutDesignatorHandler {
28
public interface PointcutDesignatorHandler extends Serializable {
26
29
27
	/**
30
	/**
28
	 * The name of this pointcut designator. For example,
31
	 * The name of this pointcut designator. For example,
(-)src/org/aspectj/util/GenericSignature.java (-3 / +6 lines)
Lines 10-27 Link Here
10
 * ******************************************************************/
10
 * ******************************************************************/
11
package org.aspectj.util;
11
package org.aspectj.util;
12
12
13
import java.io.Serializable;
14
13
/**
15
/**
14
 * Encapsulate generic signature parsing
16
 * Encapsulate generic signature parsing
15
 * 
17
 * 
16
 * @author Adrian Colyer
18
 * @author Adrian Colyer
17
 * @author Andy Clement
19
 * @author Andy Clement
20
 * @author Abraham Nevado
18
 */
21
 */
19
public class GenericSignature {
22
public class GenericSignature {
20
23
21
	/**
24
	/**
22
	 * structure holding a parsed class signature
25
	 * structure holding a parsed class signature
23
	 */
26
	 */
24
	public static class ClassSignature {
27
	public static class ClassSignature implements Serializable {
25
		public FormalTypeParameter[] formalTypeParameters = FormalTypeParameter.NONE;
28
		public FormalTypeParameter[] formalTypeParameters = FormalTypeParameter.NONE;
26
		public ClassTypeSignature superclassSignature;
29
		public ClassTypeSignature superclassSignature;
27
		public ClassTypeSignature[] superInterfaceSignatures = ClassTypeSignature.NONE;
30
		public ClassTypeSignature[] superInterfaceSignatures = ClassTypeSignature.NONE;
Lines 77-83 Link Here
77
	/**
80
	/**
78
	 * structure capturing a FormalTypeParameter from the Signature grammar
81
	 * structure capturing a FormalTypeParameter from the Signature grammar
79
	 */
82
	 */
80
	public static class FormalTypeParameter {
83
	public static class FormalTypeParameter implements Serializable{
81
		public static final FormalTypeParameter[] NONE = new FormalTypeParameter[0];
84
		public static final FormalTypeParameter[] NONE = new FormalTypeParameter[0];
82
		public String identifier;
85
		public String identifier;
83
		public FieldTypeSignature classBound;
86
		public FieldTypeSignature classBound;
Lines 97-103 Link Here
97
		}
100
		}
98
	}
101
	}
99
102
100
	public static abstract class TypeSignature {
103
	public static abstract class TypeSignature  implements Serializable{
101
		public boolean isBaseType() {
104
		public boolean isBaseType() {
102
			return false;
105
			return false;
103
		}
106
		}
(-)src/org/aspectj/util/FuzzyBoolean.java (-1 / +4 lines)
Lines 9-21 Link Here
9
 *  
9
 *  
10
 * Contributors: 
10
 * Contributors: 
11
 *     Xerox/PARC     initial implementation 
11
 *     Xerox/PARC     initial implementation 
12
 *     Lucierna		  Serialization
12
 * ******************************************************************/
13
 * ******************************************************************/
13
package org.aspectj.util;
14
package org.aspectj.util;
14
15
16
import java.io.Serializable;
17
15
/** 
18
/** 
16
 * This class implements boolean that include a "maybe"
19
 * This class implements boolean that include a "maybe"
17
 */
20
 */
18
public abstract class FuzzyBoolean {
21
public abstract class FuzzyBoolean implements Serializable{
19
    public abstract boolean alwaysTrue();
22
    public abstract boolean alwaysTrue();
20
    public abstract boolean alwaysFalse();
23
    public abstract boolean alwaysFalse();
21
    public abstract boolean maybeTrue();
24
    public abstract boolean maybeTrue();
(-)src/org/aspectj/util/IStructureModel.java (-1 / +5 lines)
Lines 8-21 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *   Andy Clement
10
 *   Andy Clement
11
 *   Abraham Nevado
11
 * ******************************************************************/
12
 * ******************************************************************/
12
package org.aspectj.util;
13
package org.aspectj.util;
13
14
15
import java.io.Serializable;
16
14
/**
17
/**
15
 * Abstraction of a structure model
18
 * Abstraction of a structure model
16
 * 
19
 * 
17
 * @author Andy Clement
20
 * @author Andy Clement
21
 * @author Abraham Nevado
18
 */
22
 */
19
public interface IStructureModel {
23
public interface IStructureModel extends Serializable{
20
24
21
}
25
}
(-)src/org/aspectj/util/TypeSafeEnum.java (-1 / +2 lines)
Lines 8-20 Link Here
8
 *  
8
 *  
9
 * Contributors: 
9
 * Contributors: 
10
 *     Xerox/PARC     initial implementation 
10
 *     Xerox/PARC     initial implementation 
11
 *     Lucierna		  serializable
11
 * ******************************************************************/
12
 * ******************************************************************/
12
13
13
package org.aspectj.util;
14
package org.aspectj.util;
14
15
15
import java.io.*;
16
import java.io.*;
16
17
17
public class TypeSafeEnum {
18
public class TypeSafeEnum implements Serializable {
18
	private byte key;
19
	private byte key;
19
	private String name;
20
	private String name;
20
21
(-)src/org/aspectj/bridge/IMessageHolder.java (-1 / +3 lines)
Lines 9-24 Link Here
9
 *  
9
 *  
10
 * Contributors: 
10
 * Contributors: 
11
 *     Xerox/PARC     initial implementation 
11
 *     Xerox/PARC     initial implementation 
12
 *     Lucierna		  serialization optimization
12
 * ******************************************************************/
13
 * ******************************************************************/
13
14
14
package org.aspectj.bridge;
15
package org.aspectj.bridge;
15
16
17
import java.io.Serializable;
16
import java.util.List;
18
import java.util.List;
17
19
18
/**
20
/**
19
 * Hold and query a collection of messages.
21
 * Hold and query a collection of messages.
20
 */
22
 */
21
public interface IMessageHolder extends IMessageHandler { // XXX do not extend - mix instead
23
public interface IMessageHolder extends IMessageHandler,Serializable { // XXX do not extend - mix instead
22
	// XXX go to LT EQ GT GE LE rather than simple orGreater
24
	// XXX go to LT EQ GT GE LE rather than simple orGreater
23
	/** value for orGreater parameter */
25
	/** value for orGreater parameter */
24
	public static final boolean ORGREATER = true;
26
	public static final boolean ORGREATER = true;
(-)src/org/aspectj/bridge/IMessage.java (-2 / +4 lines)
Lines 9-18 Link Here
9
 *  
9
 *  
10
 * Contributors: 
10
 * Contributors: 
11
 *     Xerox/PARC     initial implementation 
11
 *     Xerox/PARC     initial implementation 
12
 *     Lucierna		  serialization
12
 * ******************************************************************/
13
 * ******************************************************************/
13
14
14
package org.aspectj.bridge;
15
package org.aspectj.bridge;
15
16
17
import java.io.Serializable;
16
import java.util.Arrays;
18
import java.util.Arrays;
17
import java.util.Collections;
19
import java.util.Collections;
18
import java.util.Comparator;
20
import java.util.Comparator;
Lines 21-27 Link Here
21
/**
23
/**
22
 * Wrap message with any associated throwable or source location.
24
 * Wrap message with any associated throwable or source location.
23
 */
25
 */
24
public interface IMessage {
26
public interface IMessage  extends Serializable{
25
	/** no messages */
27
	/** no messages */
26
	public static final IMessage[] RA_IMessage = new IMessage[0];
28
	public static final IMessage[] RA_IMessage = new IMessage[0];
27
29
Lines 90-96 Link Here
90
	/** @return source location associated with this message, or null if none */
92
	/** @return source location associated with this message, or null if none */
91
	ISourceLocation getSourceLocation();
93
	ISourceLocation getSourceLocation();
92
94
93
	public static final class Kind implements Comparable<IMessage.Kind> {
95
	public static final class Kind implements Serializable, Comparable<IMessage.Kind> {
94
		public static final Comparator<IMessage.Kind> COMPARATOR = new Comparator<IMessage.Kind>() {
96
		public static final Comparator<IMessage.Kind> COMPARATOR = new Comparator<IMessage.Kind>() {
95
			public int compare(IMessage.Kind one, IMessage.Kind two) {
97
			public int compare(IMessage.Kind one, IMessage.Kind two) {
96
				if (null == one) {
98
				if (null == one) {
(-)src/org/aspectj/apache/bcel/classfile/annotation/ElementValue.java (-1 / +2 lines)
Lines 15-24 Link Here
15
import java.io.DataInputStream;
15
import java.io.DataInputStream;
16
import java.io.DataOutputStream;
16
import java.io.DataOutputStream;
17
import java.io.IOException;
17
import java.io.IOException;
18
import java.io.Serializable;
18
19
19
import org.aspectj.apache.bcel.classfile.ConstantPool;
20
import org.aspectj.apache.bcel.classfile.ConstantPool;
20
21
21
public abstract class ElementValue {
22
public abstract class ElementValue  implements Serializable{
22
23
23
	public static final int STRING = 's';
24
	public static final int STRING = 's';
24
	public static final int ENUM_CONSTANT = 'e';
25
	public static final int ENUM_CONSTANT = 'e';
(-)src/org/aspectj/apache/bcel/classfile/annotation/NameValuePair.java (-1 / +2 lines)
Lines 14-23 Link Here
14
14
15
import java.io.DataOutputStream;
15
import java.io.DataOutputStream;
16
import java.io.IOException;
16
import java.io.IOException;
17
import java.io.Serializable;
17
18
18
import org.aspectj.apache.bcel.classfile.ConstantPool;
19
import org.aspectj.apache.bcel.classfile.ConstantPool;
19
20
20
public class NameValuePair {
21
public class NameValuePair implements Serializable {
21
	private int nameIdx;
22
	private int nameIdx;
22
	private ElementValue value;
23
	private ElementValue value;
23
	private ConstantPool cpool;
24
	private ConstantPool cpool;
(-)src/org/aspectj/apache/bcel/classfile/annotation/AnnotationGen.java (-1 / +2 lines)
Lines 15-20 Link Here
15
import java.io.DataInputStream;
15
import java.io.DataInputStream;
16
import java.io.DataOutputStream;
16
import java.io.DataOutputStream;
17
import java.io.IOException;
17
import java.io.IOException;
18
import java.io.Serializable;
18
import java.util.ArrayList;
19
import java.util.ArrayList;
19
import java.util.Collections;
20
import java.util.Collections;
20
import java.util.List;
21
import java.util.List;
Lines 24-30 Link Here
24
import org.aspectj.apache.bcel.classfile.Utility;
25
import org.aspectj.apache.bcel.classfile.Utility;
25
import org.aspectj.apache.bcel.generic.ObjectType;
26
import org.aspectj.apache.bcel.generic.ObjectType;
26
27
27
public class AnnotationGen {
28
public class AnnotationGen implements Serializable {
28
	public static final AnnotationGen[] NO_ANNOTATIONS = new AnnotationGen[0];
29
	public static final AnnotationGen[] NO_ANNOTATIONS = new AnnotationGen[0];
29
30
30
	private int typeIndex;
31
	private int typeIndex;
(-)src/org/aspectj/apache/bcel/classfile/FieldOrMethod.java (+1 lines)
Lines 56-61 Link Here
56
import java.io.DataInputStream;
56
import java.io.DataInputStream;
57
import java.io.DataOutputStream;
57
import java.io.DataOutputStream;
58
import java.io.IOException;
58
import java.io.IOException;
59
import java.io.Serializable;
59
import java.util.ArrayList;
60
import java.util.ArrayList;
60
import java.util.List;
61
import java.util.List;
61
62
(-)src/org/aspectj/apache/bcel/classfile/Node.java (-1 / +3 lines)
Lines 1-5 Link Here
1
package org.aspectj.apache.bcel.classfile;
1
package org.aspectj.apache.bcel.classfile;
2
2
3
import java.io.Serializable;
4
3
/* ====================================================================
5
/* ====================================================================
4
 * The Apache Software License, Version 1.1
6
 * The Apache Software License, Version 1.1
5
 *
7
 *
Lines 60-65 Link Here
60
 * @version $Id: Node.java,v 1.3 2008/05/28 23:53:01 aclement Exp $
62
 * @version $Id: Node.java,v 1.3 2008/05/28 23:53:01 aclement Exp $
61
 * @author  <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
63
 * @author  <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
62
 */
64
 */
63
public interface Node {
65
public interface Node extends Serializable {
64
  public void accept(ClassVisitor obj);    
66
  public void accept(ClassVisitor obj);    
65
}
67
}
(-)src/org/aspectj/apache/bcel/classfile/Modifiers.java (-1 / +3 lines)
Lines 54-59 Link Here
54
 * <http://www.apache.org/>.
54
 * <http://www.apache.org/>.
55
 */
55
 */
56
56
57
import java.io.Serializable;
58
57
import org.aspectj.apache.bcel.Constants;
59
import org.aspectj.apache.bcel.Constants;
58
60
59
/**
61
/**
Lines 64-70 Link Here
64
 * @version $Id: Modifiers.java,v 1.2 2008/05/28 23:53:01 aclement Exp $
66
 * @version $Id: Modifiers.java,v 1.2 2008/05/28 23:53:01 aclement Exp $
65
 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
67
 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
66
 */
68
 */
67
public abstract class Modifiers {
69
public abstract class Modifiers implements Serializable {
68
70
69
	protected int modifiers;
71
	protected int modifiers;
70
72
(-)src/org/aspectj/apache/bcel/classfile/Field.java (-1 / +3 lines)
Lines 55-60 Link Here
55
 */
55
 */
56
import java.io.DataInputStream;
56
import java.io.DataInputStream;
57
import java.io.IOException;
57
import java.io.IOException;
58
import java.io.Serializable;
58
59
59
import org.aspectj.apache.bcel.generic.Type;
60
import org.aspectj.apache.bcel.generic.Type;
60
61
Lines 65-75 Link Here
65
 * @version $Id: Field.java,v 1.6 2009/09/15 03:33:52 aclement Exp $
66
 * @version $Id: Field.java,v 1.6 2009/09/15 03:33:52 aclement Exp $
66
 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
67
 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
67
 */
68
 */
68
public final class Field extends FieldOrMethod {
69
public class Field extends FieldOrMethod {
69
70
70
	public static final Field[] NoFields = new Field[0];
71
	public static final Field[] NoFields = new Field[0];
71
72
72
	private Type fieldType = null; // lazily initialized
73
	private Type fieldType = null; // lazily initialized
74
	
73
75
74
	private Field() {
76
	private Field() {
75
	}
77
	}
(-)src/org/aspectj/apache/bcel/generic/Type.java (-1 / +3 lines)
Lines 54-59 Link Here
54
 * <http://www.apache.org/>.
54
 * <http://www.apache.org/>.
55
 */
55
 */
56
56
57
import java.io.Serializable;
57
import java.util.ArrayList;
58
import java.util.ArrayList;
58
import java.util.HashMap;
59
import java.util.HashMap;
59
import java.util.List;
60
import java.util.List;
Lines 71-78 Link Here
71
 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
72
 * @author <A HREF="mailto:markus.dahm@berlin.de">M. Dahm</A>
72
 * 
73
 * 
73
 *         modified: AndyClement 2-mar-05: Removed unnecessary static and optimized
74
 *         modified: AndyClement 2-mar-05: Removed unnecessary static and optimized
75
 *         modified: AbrahamNevado  7-oct-10: implements Serializable
74
 */
76
 */
75
public abstract class Type {
77
public abstract class Type implements Serializable {
76
	protected byte type;
78
	protected byte type;
77
	protected String signature;
79
	protected String signature;
78
80

Return to bug 166246