From 7f993999d7e16bfeccfe01e280db46636596ca52 Mon Sep 17 00:00:00 2001 From: aclement Date: Tue, 16 Aug 2011 16:32:53 +0000 Subject: [PATCH] generics --- ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java | 2 +- .../ajbrowser/core/BrowserCompilerConfiguration.java | 12 ++++++------ .../ajbrowser/core/BrowserOutputLocationManager.java | 9 ++++----- .../aspectj/tools/ajbrowser/ui/EditorManager.java | 9 ++++----- 4 files changed, 15 insertions(+), 17 deletions(-) diff --git a/ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java b/ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java index 37c8eb62d..76c1b50e2 100644 --- a/ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java +++ b/ajbrowser/src/org/aspectj/tools/ajbrowser/Main.java @@ -49,7 +49,7 @@ public class Main { } if (numConfigFiles != args.length) { try { - Class ajc = Class.forName("org.aspectj.tools.ajc.Main"); + Class ajc = Class.forName("org.aspectj.tools.ajc.Main"); Method main = ajc.getMethod("main", new Class[] { String[].class }); main.invoke(null, new Object[] { args }); return true; diff --git a/ajbrowser/src/org/aspectj/tools/ajbrowser/core/BrowserCompilerConfiguration.java b/ajbrowser/src/org/aspectj/tools/ajbrowser/core/BrowserCompilerConfiguration.java index 11bea920f..974705c3e 100644 --- a/ajbrowser/src/org/aspectj/tools/ajbrowser/core/BrowserCompilerConfiguration.java +++ b/ajbrowser/src/org/aspectj/tools/ajbrowser/core/BrowserCompilerConfiguration.java @@ -42,8 +42,8 @@ public class BrowserCompilerConfiguration implements ICompilerConfiguration { if (userPath != null && userPath.trim().length() != 0) { classpath.append(userPath); } - List outputDirs = getOutputLocationManager().getAllOutputLocations(); - for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) { + List outputDirs = getOutputLocationManager().getAllOutputLocations(); + for (Iterator iterator = outputDirs.iterator(); iterator.hasNext();) { File dir = (File) iterator.next(); classpath.append(File.pathSeparator + dir.getAbsolutePath() + File.pathSeparator); } @@ -67,7 +67,7 @@ public class BrowserCompilerConfiguration implements ICompilerConfiguration { return locationManager; } - public List getProjectSourceFiles() { + public List getProjectSourceFiles() { // unimplemented in AjBrowser (uses BuildConfigManager instead) return null; } @@ -87,7 +87,7 @@ public class BrowserCompilerConfiguration implements ICompilerConfiguration { return null; } - public Set getInpath() { + public Set getInpath() { // unimplemented in AjBrowser return null; } @@ -108,8 +108,8 @@ public class BrowserCompilerConfiguration implements ICompilerConfiguration { return null; } - public List getProjectXmlConfigFiles() { - return Collections.EMPTY_LIST; + public List getProjectXmlConfigFiles() { + return Collections.emptyList(); } public String getProjectEncoding() { diff --git a/ajbrowser/src/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java b/ajbrowser/src/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java index 34ef3cff5..1b754d2f1 100644 --- a/ajbrowser/src/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java +++ b/ajbrowser/src/org/aspectj/tools/ajbrowser/core/BrowserOutputLocationManager.java @@ -46,8 +46,8 @@ public class BrowserOutputLocationManager implements IOutputLocationManager { return outputPath; } - public List getAllOutputLocations() { - List outputDirs = new ArrayList(); + public List getAllOutputLocations() { + List outputDirs = new ArrayList(); outputDirs.add(new File(getCommonOutputDir())); return outputDirs; } @@ -67,12 +67,11 @@ public class BrowserOutputLocationManager implements IOutputLocationManager { } public int discoverChangesSince(File dir, long buildtime) { - // TODO Auto-generated method stub return 0; } - public Map getInpathMap() { - return Collections.EMPTY_MAP; + public Map getInpathMap() { + return Collections.emptyMap(); } } diff --git a/ajbrowser/src/org/aspectj/tools/ajbrowser/ui/EditorManager.java b/ajbrowser/src/org/aspectj/tools/ajbrowser/ui/EditorManager.java index 8a717a860..12a7f8938 100644 --- a/ajbrowser/src/org/aspectj/tools/ajbrowser/ui/EditorManager.java +++ b/ajbrowser/src/org/aspectj/tools/ajbrowser/ui/EditorManager.java @@ -17,7 +17,6 @@ import java.awt.BorderLayout; import java.awt.event.KeyEvent; import java.io.IOException; import java.util.ArrayList; -import java.util.Iterator; import java.util.Vector; import javax.swing.Box; @@ -71,8 +70,8 @@ public class EditorManager { } public void notifyCurrentFileChanged(String filePath) { - for (Iterator it = editorListeners.iterator(); it.hasNext();) { - ((EditorListener) it.next()).currentFileChanged(filePath); + for (EditorListener editorListener : editorListeners) { + editorListener.currentFileChanged(filePath); } } @@ -149,8 +148,8 @@ public class EditorManager { public void saveContents() { try { - for (Iterator it = editors.iterator(); it.hasNext();) { - ((EditorAdapter) it.next()).saveContents(); + for (EditorAdapter editorAdapter : editors) { + editorAdapter.saveContents(); } } catch (IOException ioe) { BrowserErrorHandler.handleError("Editor could not save the current file.", ioe); -- 2.39.5