summaryrefslogtreecommitdiffstats
path: root/ajde
diff options
context:
space:
mode:
Diffstat (limited to 'ajde')
-rw-r--r--ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java4
-rw-r--r--ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java9
-rw-r--r--ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java2
-rw-r--r--ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java19
-rw-r--r--ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java2
-rw-r--r--ajde/testsrc/org/aspectj/ajde/ReweavableTestCase.java8
6 files changed, 24 insertions, 20 deletions
diff --git a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java
index f98e08c0e..26cfe8894 100644
--- a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java
+++ b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java
@@ -95,10 +95,10 @@ public class CompilerAdapter {
init();
try {
AjBuildConfig buildConfig = genBuildConfig(configFile);
- buildConfig.setGenerateModelMode(buildModel);
- if (null == buildConfig) {
+ if (buildConfig == null) {
return false;
}
+ buildConfig.setGenerateModelMode(buildModel);
currNotifier = new BuildNotifierAdapter(progressMonitor, buildManager);
buildManager.setProgressListener(currNotifier);
messageHandler.setBuildNotifierAdapter(currNotifier);
diff --git a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java
index dc87ccb79..443ef41dc 100644
--- a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java
+++ b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java
@@ -105,6 +105,7 @@ class LstBuildConfigFileUpdater {
fileContents.add(line.replace('\\', '/'));
line = reader.readLine();
}
+ reader.close();
return fileContents;
} catch (IOException ioe) {
Ajde.getDefault().getErrorHandler().handleError("Could not update build config file.", ioe);
@@ -193,13 +194,15 @@ class LstBuildConfigFileUpdater {
}
private void writeFile(String contents, String filePath) {
+ FileOutputStream fos = null;
try {
- FileOutputStream fos = new FileOutputStream(filePath, false);
+ fos = new FileOutputStream(filePath, false);
fos.write(contents.getBytes());
- fos.close();
} catch (IOException ioe) {
Ajde.getDefault().getErrorHandler().handleError("Could not update build config file: " + filePath, ioe);
- }
+ } finally {
+ if (fos!=null) try {fos.close();} catch (IOException ioe) {}
+ }
}
}
diff --git a/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java b/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java
index a0e1cf4bf..61ba5f9ee 100644
--- a/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java
+++ b/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java
@@ -166,7 +166,7 @@ public class StructureModelUtil {
List packages = new ArrayList();
IHierarchy model =
Ajde.getDefault().getStructureModelManager().getHierarchy();
- if (model.equals(IHierarchy.NO_STRUCTURE)) {
+ if (model.getRoot().equals(IHierarchy.NO_STRUCTURE)) {
return null;
} else {
return getPackagesHelper(
diff --git a/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java b/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java
index 1421a7a04..36c047bf4 100644
--- a/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java
+++ b/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java
@@ -55,15 +55,16 @@ public class StructureSearchManager {
matches.add(node);
}
}
-
- for (Iterator it = node.getChildren().iterator(); it.hasNext(); ) {
- IProgramElement nextNode = (IProgramElement)it.next();
- if (nextNode instanceof IProgramElement) {
- findMatchesHelper(
- (IProgramElement)nextNode,
- pattern,
- kind,
- matches);
+ if (node.getChildren() != null) {
+ for (Iterator it = node.getChildren().iterator(); it.hasNext(); ) {
+ IProgramElement nextNode = (IProgramElement)it.next();
+ if (nextNode instanceof IProgramElement) {
+ findMatchesHelper(
+ (IProgramElement)nextNode,
+ pattern,
+ kind,
+ matches);
+ }
}
}
diff --git a/ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java b/ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java
index e8866d985..ef1f32584 100644
--- a/ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java
+++ b/ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java
@@ -32,7 +32,7 @@ public class BuildOptionsPanel extends OptionsPanel {
+ "AspectJ compiler. The Document Outline View will fail to refresh correctly when\n"
+ "incremental mode is enabled. Submit any other bugs at http://eclipse.org/aspectj";
- protected static BuildOptionsPanel INSTANCE = new BuildOptionsPanel();
+ protected static final BuildOptionsPanel INSTANCE = new BuildOptionsPanel();
// private ButtonGroup compilerMode_buttonGroup = new ButtonGroup();
private TitledBorder titledBorder1;
diff --git a/ajde/testsrc/org/aspectj/ajde/ReweavableTestCase.java b/ajde/testsrc/org/aspectj/ajde/ReweavableTestCase.java
index c1a6c05c1..fd0ef0c73 100644
--- a/ajde/testsrc/org/aspectj/ajde/ReweavableTestCase.java
+++ b/ajde/testsrc/org/aspectj/ajde/ReweavableTestCase.java
@@ -34,10 +34,10 @@ public class ReweavableTestCase extends AjdeTestCase {
public static final String outjarName = "/bin/output.jar";
- public static int nonreweavesize_CalculatePI;
- public static int nonreweavesize_Logger;
- public static int reweavablesize_CalculatePI;
- public static int reweavablesize_Logger;
+ private static int nonreweavesize_CalculatePI;
+ private static int nonreweavesize_Logger;
+ private static int reweavablesize_CalculatePI;
+ private static int reweavablesize_Logger;
/**
* Constructor for JarResourceCopyTestCase.