import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.IMessageHandler;
import org.aspectj.bridge.ISourceLocation;
+import org.aspectj.bridge.SourceLocation;
import org.aspectj.bridge.IMessage.Kind;
import org.aspectj.org.eclipse.jdt.core.compiler.IProblem;
import org.aspectj.org.eclipse.jdt.internal.compiler.CompilationResult;
// throw new RuntimeException("Primary source location must match the file we are currently processing!");
}
}
+ // bug 128618 - want to do a similar thing as in bug 62073 above, however
+ // we're not an EclipseSourceLocation we're a SourceLocation.
+ if (sLoc instanceof SourceLocation) {
+ SourceLocation sl = (SourceLocation)sLoc;
+ if (currentlyWeaving != null && sl.getSourceFile() != null) {
+ if (!String.valueOf(currentlyWeaving.getFileName()).equals( sl.getSourceFile().getAbsolutePath())) {
+ return sink.handleMessage(message);
+ //throw new RuntimeException("Primary source location must match the file we are currently processing!");
+ }
+ }
+ }
CompilationResult problemSource = currentlyWeaving;
if (problemSource == null) {
--- /dev/null
+package ras;
+
+public abstract aspect FFDC {
+
+ protected abstract pointcut ffdcScope ();
+
+ before() : ffdcScope() {
+
+ }
+
+}
--- /dev/null
+package mainpackage;
+
+public class MainClass {
+
+ public void amethod() {
+ }
+
+}
--- /dev/null
+package ras.concrete;
+
+import ras.FFDC;
+
+public aspect SubFFDCAspect extends FFDC {
+
+ protected pointcut ffdcScope() : execution(* somemethod(..));
+
+}
--- /dev/null
+package mainpackage;
+
+public class MainClass {
+
+ public void amethod() {
+ }
+
+ public void anotherMethod() {
+
+ }
+}
assertTrue("Should be no errors, but got "+MyTaskListManager.getErrorMessages(),MyTaskListManager.getErrorMessages().size()==0);
}
+ public void testPr128618() {
+ initialiseProject("PR128618_1");
+ initialiseProject("PR128618_2");
+ configureNewProjectDependency("PR128618_2","PR128618_1");
+ assertTrue("there should be no warning messages before we start",
+ MyTaskListManager.getWarningMessages().isEmpty());
+ build("PR128618_1");
+ build("PR128618_2");
+ IMessage msg = (IMessage)(MyTaskListManager.getWarningMessages().get(0));
+ assertEquals("warning should be against the FFDC.aj resource","FFDC.aj",msg.getSourceLocation().getSourceFile().getName());
+ alter("PR128618_2","inc1");
+ build("PR128618_2");
+ checkWasntFullBuild();
+ IMessage msg2 = (IMessage)(MyTaskListManager.getWarningMessages().get(0));
+ assertEquals("warning should be against the FFDC.aj resource","FFDC.aj",msg2.getSourceLocation().getSourceFile().getName());
+ assertFalse("a new warning message should have been generated", msg.equals(msg2));
+ }
+
public void testPr92837() {
initialiseProject("PR92837");
build("PR92837");