}
public void saveContents() throws IOException {
- if (filePath != NO_FILE && filePath != "" && editorPane.getText() != "") {
+ if (!filePath.equals(NO_FILE) && !filePath.equals("") && !editorPane.getText().equals("")) {
BufferedWriter writer = new BufferedWriter(new FileWriter(filePath));
writer.write(editorPane.getText());
- writer.flush();
+ writer.close();
}
}
contents.append('\n');
line = reader.readLine();
}
+ reader.close();
return contents.toString();
} catch (IOException ioe) {
return "ERROR: could not read file \"" + filePath + "\", make sure that you have mounted /project/aop on X:\\";
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);
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);
}
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) {}
+ }
}
}
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(
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);
+ }
}
}
+ "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;
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.
outDir = BcweaverTests.getOutdir();
outDirPath = outDir.getAbsolutePath();
}
- public void tearDown() {
+ public void tearDown() throws Exception {
+ super.tearDown();
BcweaverTests.removeOutDir();
outDir = null;
outDirPath = null;
super(name);
}
- String[] none = new String[0];
+ // String[] none = new String[0];