summaryrefslogtreecommitdiffstats
path: root/bridge/pr107313-SourceLocation.patch
blob: 8c8742c005df7faff007277677ccc87d883a2144 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Index: src/org/aspectj/bridge/Message.java
===================================================================
RCS file: /home/technology/org.aspectj/modules/bridge/src/org/aspectj/bridge/Message.java,v
retrieving revision 1.12
diff -u -r1.12 Message.java
--- src/org/aspectj/bridge/Message.java	5 May 2005 10:36:02 -0000	1.12
+++ src/org/aspectj/bridge/Message.java	2 Sep 2005 07:39:19 -0000
@@ -110,6 +110,26 @@
           this(message, "", kind, sourceLocation, thrown, null );              
     }
     
+    
+    /**
+     * Create a copy of the source message, but with the locations updated
+     * @param source
+     * @param newLocation
+     * @param newExtraLocations
+     */
+    public Message(IMessage source, ISourceLocation newLocation, List newExtraLocations) {
+    	this.id = source.getID();
+    	this.kind = source.getKind();
+    	this.message = source.getMessage();
+    	this.sourceEnd = source.getSourceEnd();
+    	this.sourceStart = source.getSourceStart();
+    	this.thrown = source.getThrown();
+    	this.details = source.getDetails();
+    	this.declared  =source.getDeclared();
+    	this.sourceLocation = newLocation;
+    	this.extraSourceLocations = newExtraLocations;
+    }
+    
     /** @return the kind of this message */
     public IMessage.Kind getKind() {
         return kind;
Index: src/org/aspectj/bridge/SourceLocation.java
===================================================================
RCS file: /home/technology/org.aspectj/modules/bridge/src/org/aspectj/bridge/SourceLocation.java,v
retrieving revision 1.9
diff -u -r1.9 SourceLocation.java
--- src/org/aspectj/bridge/SourceLocation.java	5 Jul 2005 11:46:21 -0000	1.9
+++ src/org/aspectj/bridge/SourceLocation.java	2 Sep 2005 07:39:19 -0000
@@ -101,6 +101,16 @@
         this.context = context;
     }
     
+    // return a clone of the source location, with the source file updated
+    public SourceLocation(ISourceLocation source, File newSourceFile) {
+    	this.sourceFile = newSourceFile;
+    	this.column = source.getColumn();
+    	this.context = source.getContext();
+    	this.endLine = source.getEndLine();
+    	this.startLine = source.getLine();
+    	this.offset = source.getOffset();
+    }
+    
     public File getSourceFile() {
         return sourceFile;
     }