aboutsummaryrefslogtreecommitdiffstats
path: root/org.aspectj.ajdt.core
diff options
context:
space:
mode:
authoraclement <aclement>2008-05-07 22:08:01 +0000
committeraclement <aclement>2008-05-07 22:08:01 +0000
commitd3c3e32b533cbfa15120ad0414d07c5dbeec4296 (patch)
tree909685bf147c7427c5b2ef4bad558d990c5cb8d4 /org.aspectj.ajdt.core
parent5f97d461c819a42c52aa772499f0046db8fa1dda (diff)
downloadaspectj-d3c3e32b533cbfa15120ad0414d07c5dbeec4296.tar.gz
aspectj-d3c3e32b533cbfa15120ad0414d07c5dbeec4296.zip
209372: guard for -1 source line when no line numbers in class file
Diffstat (limited to 'org.aspectj.ajdt.core')
-rw-r--r--org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java16
1 files changed, 12 insertions, 4 deletions
diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java
index a9c853bec..62cfaa7f4 100644
--- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java
+++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/EclipseAdapterUtils.java
@@ -131,11 +131,19 @@ public class EclipseAdapterUtils {
public static IMessage makeMessage(ICompilationUnit unit, IProblem problem, World world) {
ISourceLocation sourceLocation = makeSourceLocation(unit, problem);
IProblem[] seeAlso = problem.seeAlso();
- ISourceLocation[] seeAlsoLocations = new ISourceLocation[seeAlso.length];
+ // If the user has turned off classfile line number gen, then we may not be able to tell them
+ // about all secondary locations (pr209372)
+ int validPlaces = 0;
+ for (int ii=0;ii<seeAlso.length;ii++) {
+ if (seeAlso[ii].getSourceLineNumber()>=0) validPlaces++;
+ }
+ ISourceLocation[] seeAlsoLocations = new ISourceLocation[validPlaces];
+ int pos = 0;
for (int i = 0; i < seeAlso.length; i++) {
- seeAlsoLocations[i] = new SourceLocation(new File(new String(seeAlso[i].getOriginatingFileName())),
- seeAlso[i].getSourceLineNumber());
-
+ if (seeAlso[i].getSourceLineNumber()>=0) {
+ seeAlsoLocations[pos++] = new SourceLocation(new File(new String(seeAlso[i].getOriginatingFileName())),
+ seeAlso[i].getSourceLineNumber());
+ }
}
// We transform messages from AJ types to eclipse IProblems
// and back to AJ types. During their time as eclipse problems,