From: mkersten Date: Fri, 28 Feb 2003 02:55:14 +0000 (+0000) Subject: Fixed setting runnable bit on structure nodes. X-Git-Tag: V_1_1_b5~9 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=2484d6b39f2534171863ecbf731ce99e4b1dde4a;p=aspectj.git Fixed setting runnable bit on structure nodes. Fixed failing incremental test. --- diff --git a/ajde/testsrc/org/aspectj/ajde/NullIdeTaskListManager.java b/ajde/testsrc/org/aspectj/ajde/NullIdeTaskListManager.java index 44566ff32..fc840a8d1 100644 --- a/ajde/testsrc/org/aspectj/ajde/NullIdeTaskListManager.java +++ b/ajde/testsrc/org/aspectj/ajde/NullIdeTaskListManager.java @@ -23,16 +23,16 @@ import org.aspectj.bridge.*; public class NullIdeTaskListManager implements TaskListManager { public void addSourcelineTask(String message, ISourceLocation sourceLocation, IMessage.Kind kind) { - System.out.println("> added sourceline task: " + message + ", file: " + sourceLocation.getSourceFile().getAbsolutePath() - + ": " + sourceLocation.getLine()); +// System.out.println("> added sourceline task: " + message + ", file: " + sourceLocation.getSourceFile().getAbsolutePath() +// + ": " + sourceLocation.getLine()); } public void addProjectTask(String message, IMessage.Kind kind) { - System.out.println("> added project task: " + message + ", kind: " + kind); +// System.out.println("> added project task: " + message + ", kind: " + kind); } public void clearTasks() { - System.out.println("> cleared tasks"); +// System.out.println("> cleared tasks"); } } diff --git a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java index adf926665..5e7fc0596 100644 --- a/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java +++ b/ajde/testsrc/org/aspectj/ajde/StructureModelTest.java @@ -43,6 +43,7 @@ public class StructureModelTest extends AjdeTestCase { return result; } +// XXX this should work // public void testFieldInitializerCorrespondence() throws IOException { // File testFile = createFile("testdata/examples/figures-coverage/figures/Figure.java"); // StructureNode node = Ajde.getDefault().getStructureModelManager().getStructureModel().findNodeForSourceLine( diff --git a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmBuilder.java b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmBuilder.java index 5824f2b2f..8709904ba 100644 --- a/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmBuilder.java +++ b/org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AsmBuilder.java @@ -249,8 +249,9 @@ public class AsmBuilder extends AbstractSyntaxTreeVisitorAdapter { new ArrayList()); if (kind == ProgramElementNode.Kind.METHOD) { + // !! should probably discriminate more if (label.equals("main")) { - peNode.setRunnable(true); + ((ProgramElementNode)stack.peek()).setRunnable(true); } } diff --git a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java index e01d2c0e7..d5c0c7f6a 100644 --- a/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java +++ b/org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/ajc/AjdtCommandTestCase.java @@ -57,10 +57,10 @@ public class AjdtCommandTestCase extends TestCase { config = command.genBuildConfig( new String[] { "-incremental", "testdata/src1/Hello.java" }, messageWriter); - + assertTrue( "specified a file", - outputWriter.getContents().indexOf("can not directly specify files") != -1); ; + outputWriter.getContents().indexOf("incremental mode only handles source files using -sourceroots") != -1); ; } public void testBadOptionAndUsagePrinting() throws InvalidInputException {