From c3c07fdb4b93cc483317d8a314233f0b9dcf4d8b Mon Sep 17 00:00:00 2001 From: Andy Clement Date: Fri, 29 Nov 2019 07:51:50 -0800 Subject: polish --- .../main/java/org/aspectj/ajde/IconRegistry.java | 8 ++- .../aspectj/ajde/internal/BuildConfigManager.java | 16 +++--- .../ajde/internal/LstBuildConfigFileUpdater.java | 44 +++++++-------- .../ajde/internal/LstBuildConfigManager.java | 65 +++++++++++++--------- .../org/aspectj/ajde/ui/AbstractIconRegistry.java | 3 +- .../java/org/aspectj/ajde/ui/BuildConfigModel.java | 37 ++++++------ .../org/aspectj/ajde/ui/IStructureViewNode.java | 3 +- .../aspectj/ajde/ui/StructureSearchManager.java | 30 +++++----- .../aspectj/ajde/ui/StructureViewProperties.java | 18 +++--- .../ajde/ui/internal/TreeStructureViewBuilder.java | 16 +++++- .../JavaCompilerWarningsOptionsPanel.java | 2 +- .../ui/javaoptions/JavaComplianceOptionsPanel.java | 2 +- .../ajde/ui/javaoptions/JavaDebugOptionsPanel.java | 2 +- .../org/aspectj/ajde/ui/swing/PointcutWizard.java | 12 ++-- .../aspectj/ajde/ui/swing/SwingTreeViewNode.java | 11 +++- .../ajde/ui/swing/SwingTreeViewNodeFactory.java | 7 ++- .../test/java/org/aspectj/ajde/AjdeTestCase.java | 7 +-- .../ajde/internal/AspectJBuildManagerTest.java | 7 ++- .../ajde/internal/LstBuildConfigManagerTest.java | 4 +- .../ajde/ui/StructureSearchManagerTest.java | 4 +- .../aspectj/ajde/ui/StructureViewManagerTest.java | 4 +- 21 files changed, 170 insertions(+), 132 deletions(-) (limited to 'ajde') diff --git a/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java b/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java index c5a2202ec..8169f2735 100644 --- a/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java +++ b/ajde/src/main/java/org/aspectj/ajde/IconRegistry.java @@ -16,11 +16,13 @@ package org.aspectj.ajde; import java.net.URL; -import javax.swing.*; +import javax.swing.Icon; +import javax.swing.ImageIcon; -import org.aspectj.ajde.ui.*; -import org.aspectj.asm.*; +import org.aspectj.ajde.ui.AbstractIcon; +import org.aspectj.ajde.ui.AbstractIconRegistry; import org.aspectj.asm.IProgramElement; +import org.aspectj.asm.IRelationship; /** * Default icons. Override behavior for custom icons. diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java b/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java index 390ebbead..fdee90e03 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java @@ -46,18 +46,18 @@ public interface BuildConfigManager { /** * Add a listner that will be notified of build configuration change events */ - public void addListener(BuildConfigListener configurationListener); + public void addListener(BuildConfigListener configurationListener); /** * Remove a configuration listener. */ - public void removeListener(BuildConfigListener configurationListener); + public void removeListener(BuildConfigListener configurationListener); - /** - * Build a model for the corresponding configuration file. - * - * @param full path to the file - */ + /** + * Build a model for the corresponding configuration file. + * + * @param full path to the file + */ public BuildConfigModel buildModel(String configFilePath); /** @@ -69,7 +69,7 @@ public interface BuildConfigManager { * Write a list of source files into a configuration file. File paths will be * written relative to the path of the configuration file. */ - public void writePaths(String configFilePath, List paths); + public void writePaths(String configFilePath, List paths); /** * Add files to a configuration. diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java index 24e264d70..ac6264436 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java @@ -1,14 +1,14 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Xerox/PARC initial implementation * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ @@ -34,7 +34,7 @@ import org.aspectj.bridge.Message; /** * Used for reading and writing build configuration (".lst") files. - * + * * @author Mik Kersten */ class LstBuildConfigFileUpdater { @@ -43,7 +43,7 @@ class LstBuildConfigFileUpdater { * Adds an entry to a build configuration file. */ public void updateBuildConfigFile(String buildConfigFile, String update, boolean addToConfiguration) { - List fileContents = readConfigFile(buildConfigFile); + List fileContents = readConfigFile(buildConfigFile); if (addToConfiguration) { fileContents.add(update); } else { @@ -117,21 +117,21 @@ class LstBuildConfigFileUpdater { return null; } - public void writeConfigFile(String filePath, List files, List importedNodes) { + public void writeConfigFile(String filePath, List files, List importedNodes) { // Set contentsSet = new TreeSet(fileContents); String fileContentsString = ""; // List filesToWrite = null; - Set includedFiles = new HashSet(); - for (Iterator it = importedNodes.iterator(); it.hasNext();) { - BuildConfigNode node = (BuildConfigNode) it.next(); + Set includedFiles = new HashSet<>(); + for (Iterator it = importedNodes.iterator(); it.hasNext();) { + BuildConfigNode node = it.next(); fileContentsString += '@' + node.getResourcePath() + "\n"; String parentPath = new File(filePath).getParent(); String importedFilePath = parentPath + File.separator + node.getResourcePath(); includedFiles.addAll(getIncludedFiles(importedFilePath, parentPath)); } - for (Iterator it = files.iterator(); it.hasNext();) { - BuildConfigNode node = (BuildConfigNode) it.next(); + for (Iterator it = files.iterator(); it.hasNext();) { + BuildConfigNode node = it.next(); if (node.getName().endsWith(".lst") && !node.getResourcePath().startsWith("..")) { fileContentsString += '@'; fileContentsString += node.getResourcePath() + "\n"; @@ -151,7 +151,7 @@ class LstBuildConfigFileUpdater { List files = configParser.getFiles(); List relativeFiles = new ArrayList(); for (Iterator it = files.iterator(); it.hasNext();) { - relativeFiles.add(relativizePath(((File) it.next()).getPath(), rootPath)); + relativeFiles.add(relativizePath(it.next().getPath(), rootPath)); } return relativeFiles; } catch (ConfigParser.ParseException pe) { @@ -184,13 +184,13 @@ class LstBuildConfigFileUpdater { /** * Sorts and does not write duplicates. - * + * * @param fileContents full paths representing file entries */ - public void writeConfigFile(String filePath, List fileContents) { - Set contentsSet = new TreeSet(fileContents); + public void writeConfigFile(String filePath, List fileContents) { + Set contentsSet = new TreeSet<>(fileContents); StringBuffer fileContentsSB = new StringBuffer(); - Iterator it = contentsSet.iterator(); + Iterator it = contentsSet.iterator(); while (it.hasNext()) { fileContentsSB.append(it.next().toString()); fileContentsSB.append("\n"); diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java index 5a30bbcc7..6bd0c23da 100644 --- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java @@ -37,23 +37,27 @@ import org.aspectj.util.FileUtil; */ public class LstBuildConfigManager implements BuildConfigManager { + private List allBuildConfigFiles; private List listeners = new ArrayList(); private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater(); protected String currConfigFilePath = null; private static final FilenameFilter SOURCE_FILE_FILTER = new FilenameFilter() { + @Override public boolean accept(File dir, String name) { return FileUtil.hasSourceSuffix(name) || name.endsWith(".lst"); } }; private static final FileFilter DIR_FILTER = new FileFilter() { + @Override public boolean accept(File file) { return file.isDirectory(); } }; + @Override public BuildConfigModel buildModel(String configFilePath) { File configFile = new File(configFilePath); String rootPath = configFile.getParent(); @@ -89,12 +93,13 @@ public class LstBuildConfigManager implements BuildConfigManager { return model; } - private void addProblemEntries(BuildConfigNode root, List badEntries) { - for (Iterator it = badEntries.iterator(); it.hasNext();) { - root.addChild(new BuildConfigNode(it.next().toString(), BuildConfigNode.Kind.ERROR, null)); + private void addProblemEntries(BuildConfigNode root, List badEntries) { + for (String string : badEntries) { + root.addChild(new BuildConfigNode(string.toString(), BuildConfigNode.Kind.ERROR, null)); } } + @Override public void writeModel(BuildConfigModel model) { // final List paths = new ArrayList(); // StructureWalker walker = new StructureWalker() { @@ -113,14 +118,17 @@ public class LstBuildConfigManager implements BuildConfigManager { fileUpdater.writeConfigFile(model.getSourceFile(), activeSourceFiles, activeImportedFiles); } - public void writePaths(String configFilePath, List files) { + @Override + public void writePaths(String configFilePath, List files) { fileUpdater.writeConfigFile(configFilePath, files); } + @Override public void addFilesToConfig(String configFilePath, List paths) { } + @Override public void removeFilesFromConfig(String configFilePath, List files) { } @@ -148,16 +156,16 @@ public class LstBuildConfigManager implements BuildConfigManager { File[] dirs = new File(node.getResourcePath()).listFiles(DIR_FILTER); if (dirs == null) return; - for (int i = 0; i < dirs.length; i++) { - BuildConfigNode dir = new BuildConfigNode(dirs[i].getName(), BuildConfigNode.Kind.DIRECTORY, dirs[i].getPath()); - File[] files = dirs[i].listFiles(SOURCE_FILE_FILTER); - for (int j = 0; j < files.length; j++) { - if (files[j] != null) {// && !files[j].getName().endsWith(".lst")) { - String filePath = fileUpdater.relativizePath(files[j].getPath(), rootPath); + for (File dir2 : dirs) { + BuildConfigNode dir = new BuildConfigNode(dir2.getName(), BuildConfigNode.Kind.DIRECTORY, dir2.getPath()); + File[] files = dir2.listFiles(SOURCE_FILE_FILTER); + for (File file2 : files) { + if (file2 != null) {// && !files[j].getName().endsWith(".lst")) { + String filePath = fileUpdater.relativizePath(file2.getPath(), rootPath); BuildConfigNode.Kind kind = BuildConfigNode.Kind.FILE_JAVA; - if (!files[j].getName().endsWith(".lst")) { + if (!file2.getName().endsWith(".lst")) { // kind = BuildConfigNode.Kind.FILE_LST; - BuildConfigNode file = new BuildConfigNode(files[j].getName(), kind, filePath); + BuildConfigNode file = new BuildConfigNode(file2.getName(), kind, filePath); file.setActive(false); dir.addChild(file); } @@ -167,15 +175,15 @@ public class LstBuildConfigManager implements BuildConfigManager { // boolean foundMatch = false; for (Iterator it = importedFiles.iterator(); it.hasNext();) { File importedFile = (File) it.next(); - if (importedFile.getParentFile().getAbsolutePath().equals(dirs[i].getAbsolutePath())) { + if (importedFile.getParentFile().getAbsolutePath().equals(dir2.getAbsolutePath())) { // foundMatch = true; BuildConfigNode importedFileNode = new BuildConfigNode(importedFile.getName(), BuildConfigNode.Kind.FILE_LST, fileUpdater.relativizePath(importedFile.getPath(), rootPath)); importedFileNode.setActive(true); // dir.getChildren().clear(); boolean found = false; - for (Iterator it2 = dir.getChildren().iterator(); it2.hasNext();) { - if (((BuildConfigNode) it2.next()).getName().equals(importedFile.getName())) { + for (BuildConfigNode buildConfigNode : dir.getChildren()) { + if (buildConfigNode.getName().equals(importedFile.getName())) { found = true; } } @@ -192,13 +200,13 @@ public class LstBuildConfigManager implements BuildConfigManager { File[] files = new File(rootPath).listFiles(SOURCE_FILE_FILTER); if (files == null) return; - for (int i = 0; i < files.length; i++) { - if (files[i] != null && !files[i].getName().equals(configFileName)) {// && !files[i].getName().endsWith(".lst")) { + for (File file2 : files) { + if (file2 != null && !file2.getName().equals(configFileName)) {// && !files[i].getName().endsWith(".lst")) { BuildConfigNode.Kind kind = BuildConfigNode.Kind.FILE_JAVA; - if (files[i].getName().endsWith(".lst")) { + if (file2.getName().endsWith(".lst")) { kind = BuildConfigNode.Kind.FILE_LST; } - BuildConfigNode file = new BuildConfigNode(files[i].getName(), kind, files[i].getName()); + BuildConfigNode file = new BuildConfigNode(file2.getName(), kind, file2.getName()); file.setActive(false); node.addChild(file); } @@ -232,25 +240,25 @@ public class LstBuildConfigManager implements BuildConfigManager { private boolean pruneEmptyDirs(BuildConfigNode node) { List nodesToRemove = new ArrayList<>(); - for (Iterator it = node.getChildren().iterator(); it.hasNext();) { - BuildConfigNode currNode = it.next(); + for (BuildConfigNode currNode : node.getChildren()) { boolean hasValidChildren = pruneEmptyDirs(currNode); if (!currNode.isValidResource() && !hasValidChildren) { nodesToRemove.add(currNode); } } - for (Iterator it = nodesToRemove.iterator(); it.hasNext();) { - BuildConfigNode currNode = it.next(); + for (BuildConfigNode currNode : nodesToRemove) { node.removeChild(currNode); } return node.getChildren().size() > 0; } + @Override public String getActiveConfigFile() { return currConfigFilePath; } + @Override public void setActiveConfigFile(String currConfigFilePath) { if (currConfigFilePath == null) return; @@ -258,17 +266,19 @@ public class LstBuildConfigManager implements BuildConfigManager { notifyConfigChanged(); } + @Override public void addListener(BuildConfigListener configurationListener) { listeners.add(configurationListener); } + @Override public void removeListener(BuildConfigListener configurationListener) { listeners.remove(configurationListener); } private void notifyConfigChanged() { - for (Iterator it = listeners.iterator(); it.hasNext();) { - ((BuildConfigListener) it.next()).currConfigChanged(currConfigFilePath); + for (Object element : listeners) { + ((BuildConfigListener) element).currConfigChanged(currConfigFilePath); } } @@ -282,19 +292,20 @@ public class LstBuildConfigManager implements BuildConfigManager { if (node == null || node.getChildren() == null) return; Collections.sort(node.getChildren(), comparator); - for (Iterator it = node.getChildren().iterator(); it.hasNext();) { - BuildConfigNode nextNode = it.next(); + for (BuildConfigNode nextNode : node.getChildren()) { if (nextNode != null) sortModel(nextNode, comparator); } } private static final Comparator ALPHABETICAL_COMPARATOR = new Comparator() { + @Override public int compare(BuildConfigNode n1, BuildConfigNode n2) { return n1.getName().compareTo(n2.getName()); } }; + @Override public List getAllBuildConfigFiles() { if (allBuildConfigFiles == null) { allBuildConfigFiles = new ArrayList(); diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIconRegistry.java b/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIconRegistry.java index 742cc1a6b..a81485ca7 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIconRegistry.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/AbstractIconRegistry.java @@ -14,7 +14,8 @@ package org.aspectj.ajde.ui; -import org.aspectj.asm.*; +import org.aspectj.asm.IProgramElement; +import org.aspectj.asm.IRelationship; /** * Uses the factory pattern. diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java index 717818034..560766bf6 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/BuildConfigModel.java @@ -1,27 +1,26 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * Xerox/PARC initial implementation + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Xerox/PARC initial implementation * ******************************************************************/ package org.aspectj.ajde.ui; import java.io.IOException; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; import java.util.StringTokenizer; /** * TODO: we have schitzophrenia between BuildConfigNode(s) and IProgramElement(s), fix. - * + * * @author Mik Kersten */ public class BuildConfigModel { @@ -59,9 +58,9 @@ public class BuildConfigModel { private BuildConfigNode getNodeForPathHelper(StringTokenizer st, BuildConfigNode node) { BuildConfigNode parent = node; while (st.hasMoreElements()) { - String pathItem = (String) st.nextElement(); - for (Iterator it = node.getChildren().iterator(); it.hasNext();) { - node = (BuildConfigNode) it.next(); + String pathItem = st.nextToken(); + for (BuildConfigNode element : node.getChildren()) { + node = element; String childName = node.getName(); if (childName.equals(pathItem)) { return getNodeForPathHelper(st, node); @@ -113,8 +112,8 @@ public class BuildConfigModel { } if (node != null && node.getChildren() != null) { - for (Iterator it = node.getChildren().iterator(); it.hasNext();) { - BuildConfigNode foundNode = findNodeForSourceLineHelper((BuildConfigNode) it.next(), sourceFilePath, lineNumber); + for (Object element : node.getChildren()) { + BuildConfigNode foundNode = findNodeForSourceLineHelper((BuildConfigNode) element, sourceFilePath, lineNumber); if (foundNode != null) return foundNode; } @@ -134,10 +133,10 @@ public class BuildConfigModel { } private boolean hasMoreSpecificChild(BuildConfigNode node, String sourceFilePath, int lineNumber) { - for (Iterator it = node.getChildren().iterator(); it.hasNext();) { - BuildConfigNode child = (BuildConfigNode) it.next(); - if (matches(child, sourceFilePath, lineNumber)) + for (BuildConfigNode child : node.getChildren()) { + if (matches(child, sourceFilePath, lineNumber)) { return true; + } } return false; } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/IStructureViewNode.java b/ajde/src/main/java/org/aspectj/ajde/ui/IStructureViewNode.java index 312a4a688..59a44f127 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/IStructureViewNode.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/IStructureViewNode.java @@ -14,7 +14,8 @@ package org.aspectj.ajde.ui; -import java.io.*; +import java.io.ObjectStreamException; +import java.io.Serializable; import java.util.List; import org.aspectj.asm.IProgramElement; diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureSearchManager.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureSearchManager.java index a8fa324bf..b6631b3a8 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureSearchManager.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureSearchManager.java @@ -1,15 +1,15 @@ /* ******************************************************************* - * Copyright (c) 1999-2001 Xerox Corporation, + * Copyright (c) 1999-2001 Xerox Corporation, * 2002 Palo Alto Research Center, Incorporated (PARC). - * All rights reserved. - * This program and the accompanying materials are made available - * under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: + * All rights reserved. + * This program and the accompanying materials are made available + * under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: * Xerox/PARC initial implementation - * Helen Hawkins Converted to new interface (bug 148190) + * Helen Hawkins Converted to new interface (bug 148190) * ******************************************************************/ package org.aspectj.ajde.ui; @@ -29,12 +29,12 @@ public class StructureSearchManager { /** * @param pattern case-sensitive substring of node name - * + * * @return null if a corresponding node was not found */ - public List findMatches(String pattern, IProgramElement.Kind kind) { + public List findMatches(String pattern, IProgramElement.Kind kind) { - List matches = new ArrayList(); + List matches = new ArrayList<>(); IHierarchy model = AsmManager.lastActiveStructureModel.getHierarchy(); if (model.getRoot().equals(IHierarchy.NO_STRUCTURE)) { return null; @@ -43,7 +43,7 @@ public class StructureSearchManager { } } - private List findMatchesHelper(IProgramElement node, String pattern, IProgramElement.Kind kind, List matches) { + private List findMatchesHelper(IProgramElement node, String pattern, IProgramElement.Kind kind, List matches) { if (node != null && node.getName().indexOf(pattern) != -1) { if (kind == null || node.getKind().equals(kind)) { @@ -51,8 +51,8 @@ public class StructureSearchManager { } } if (node != null && node.getChildren() != null) { - for (Iterator it = node.getChildren().iterator(); it.hasNext();) { - IProgramElement nextNode = (IProgramElement) it.next(); + for (Iterator it = node.getChildren().iterator(); it.hasNext();) { + IProgramElement nextNode = it.next(); if (nextNode != null) { findMatchesHelper(nextNode, pattern, kind, matches); } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java index 2e44d399e..a6604abd6 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java @@ -19,6 +19,8 @@ import java.util.ArrayList; import java.util.List; import org.aspectj.asm.IProgramElement; +import org.aspectj.asm.IProgramElement.Accessibility; +import org.aspectj.asm.IProgramElement.Modifiers; import org.aspectj.asm.IRelationship; /** @@ -62,11 +64,11 @@ public class StructureViewProperties { relations.remove(kind); } - public void setFilteredMemberAccessibility(List memberVisibility) { + public void setFilteredMemberAccessibility(List memberVisibility) { this.filteredMemberAccessibility = memberVisibility; } - public List getFilteredMemberAccessibility() { + public List getFilteredMemberAccessibility() { return filteredMemberAccessibility; } @@ -78,11 +80,11 @@ public class StructureViewProperties { this.filteredMemberAccessibility.remove(accessibility); } - public List getFilteredMemberModifiers() { + public List getFilteredMemberModifiers() { return filteredMemberModifiers; } - public void setFilteredMemberModifiers(List memberModifiers) { + public void setFilteredMemberModifiers(List memberModifiers) { this.filteredMemberModifiers = memberModifiers; } @@ -102,11 +104,11 @@ public class StructureViewProperties { this.sorting = sorting; } - public List getFilteredMemberKinds() { + public List getFilteredMemberKinds() { return filteredMemberKinds; } - public void setFilteredMemberKinds(List memberKinds) { + public void setFilteredMemberKinds(List memberKinds) { this.filteredMemberKinds = memberKinds; } @@ -118,11 +120,11 @@ public class StructureViewProperties { this.filteredMemberKinds.remove(kind); } - public List getGrouping() { + public List getGrouping() { return grouping; } - public void setGrouping(List grouping) { + public void setGrouping(List grouping) { this.grouping = grouping; } diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java b/ajde/src/main/java/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java index af1a2477f..9021cbfe7 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java @@ -14,12 +14,22 @@ package org.aspectj.ajde.ui.internal; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; -import org.aspectj.ajde.ui.*; -import org.aspectj.asm.*; +import org.aspectj.ajde.ui.FileStructureView; +import org.aspectj.ajde.ui.GlobalStructureView; +import org.aspectj.ajde.ui.IStructureViewNode; +import org.aspectj.ajde.ui.StructureView; +import org.aspectj.ajde.ui.StructureViewNodeFactory; +import org.aspectj.ajde.ui.StructureViewProperties; //import org.aspectj.asm.internal.*; //import org.aspectj.asm.internal.ProgramElement; +import org.aspectj.asm.IHierarchy; +import org.aspectj.asm.IProgramElement; /** * @author Mik Kersten diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java index f34ace5df..09d76afc8 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaCompilerWarningsOptionsPanel.java @@ -16,8 +16,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import javax.swing.BorderFactory; import javax.swing.Box; diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaComplianceOptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaComplianceOptionsPanel.java index 09eabe901..1d8dba958 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaComplianceOptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaComplianceOptionsPanel.java @@ -16,8 +16,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import javax.swing.BorderFactory; import javax.swing.Box; diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java index 7d19d6a08..9678e3a0d 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/javaoptions/JavaDebugOptionsPanel.java @@ -16,8 +16,8 @@ import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.Set; import java.util.Map.Entry; +import java.util.Set; import javax.swing.BorderFactory; import javax.swing.Box; diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/PointcutWizard.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/PointcutWizard.java index ed7235186..fb461d132 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/PointcutWizard.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/PointcutWizard.java @@ -14,14 +14,18 @@ package org.aspectj.ajde.ui.swing; -import java.awt.*; +import java.awt.BorderLayout; //import java.awt.event.ActionEvent; -import java.util.*; +import java.util.ArrayList; -import javax.swing.*; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; -import org.aspectj.ajde.ui.*; //import org.aspectj.asm.IRelationship; +import org.aspectj.ajde.ui.StructureViewProperties; /** * @author Mik Kersten diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java index 253ea359e..3e3f08935 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java @@ -14,13 +14,18 @@ package org.aspectj.ajde.ui.swing; -import java.util.*; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; import javax.swing.tree.DefaultMutableTreeNode; -import org.aspectj.ajde.ui.*; +import org.aspectj.ajde.ui.AbstractIcon; +import org.aspectj.ajde.ui.IStructureViewNode; +import org.aspectj.ajde.ui.StructureViewNodeFactory; //import org.aspectj.ajde.ui.IStructureViewNode.Kind; -import org.aspectj.asm.*; +import org.aspectj.asm.IProgramElement; +import org.aspectj.asm.IRelationship; /** * @author Mik Kersten diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeFactory.java b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeFactory.java index 02b8ba52c..32aa3708a 100644 --- a/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeFactory.java +++ b/ajde/src/main/java/org/aspectj/ajde/ui/swing/SwingTreeViewNodeFactory.java @@ -18,8 +18,11 @@ package org.aspectj.ajde.ui.swing; import java.util.List; import org.aspectj.ajde.IconRegistry; -import org.aspectj.ajde.ui.*; -import org.aspectj.asm.*; +import org.aspectj.ajde.ui.AbstractIcon; +import org.aspectj.ajde.ui.IStructureViewNode; +import org.aspectj.ajde.ui.StructureViewNodeFactory; +import org.aspectj.asm.IProgramElement; +import org.aspectj.asm.IRelationship; /** * @author Mik Kersten diff --git a/ajde/src/test/java/org/aspectj/ajde/AjdeTestCase.java b/ajde/src/test/java/org/aspectj/ajde/AjdeTestCase.java index 3ff7712eb..0c5c5c306 100644 --- a/ajde/src/test/java/org/aspectj/ajde/AjdeTestCase.java +++ b/ajde/src/test/java/org/aspectj/ajde/AjdeTestCase.java @@ -17,9 +17,6 @@ import java.io.File; import java.io.IOException; import java.util.List; -import junit.framework.AssertionFailedError; -import junit.framework.TestCase; - import org.aspectj.ajde.core.AjCompiler; import org.aspectj.ajde.ui.utils.TestBuildProgressMonitor; import org.aspectj.ajde.ui.utils.TestCompilerConfiguration; @@ -28,7 +25,9 @@ import org.aspectj.ajde.ui.utils.TestIdeUIAdapter; import org.aspectj.ajde.ui.utils.TestMessageHandler; import org.aspectj.ajde.ui.utils.TestRuntimeProperties; import org.aspectj.testing.util.TestUtil; -import org.aspectj.tools.ajc.Ajc; + +import junit.framework.AssertionFailedError; +import junit.framework.TestCase; public abstract class AjdeTestCase extends TestCase { diff --git a/ajde/src/test/java/org/aspectj/ajde/internal/AspectJBuildManagerTest.java b/ajde/src/test/java/org/aspectj/ajde/internal/AspectJBuildManagerTest.java index 41c2aec9f..4382dfe7d 100644 --- a/ajde/src/test/java/org/aspectj/ajde/internal/AspectJBuildManagerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/internal/AspectJBuildManagerTest.java @@ -14,11 +14,12 @@ package org.aspectj.ajde.internal; -import junit.framework.*; -import org.aspectj.ajde.*; +import java.io.File; + +import org.aspectj.ajde.AjdeTestCase; import org.aspectj.asm.AsmManager; -import java.io.*; +import junit.framework.TestSuite; /** * @author Mik Kersten diff --git a/ajde/src/test/java/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java b/ajde/src/test/java/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java index 902c34d62..c80f33bb6 100644 --- a/ajde/src/test/java/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java @@ -18,12 +18,12 @@ import java.io.File; import java.io.IOException; import java.util.List; -import junit.framework.TestSuite; - import org.aspectj.ajde.AjdeTestCase; import org.aspectj.ajde.ui.BuildConfigModel; import org.aspectj.ajde.ui.utils.TestMessageHandler.TestMessage; +import junit.framework.TestSuite; + public class LstBuildConfigManagerTest extends AjdeTestCase { private BuildConfigManager buildConfigManager = new LstBuildConfigManager(); diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/StructureSearchManagerTest.java b/ajde/src/test/java/org/aspectj/ajde/ui/StructureSearchManagerTest.java index f25262424..1dc3d9928 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/StructureSearchManagerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/StructureSearchManagerTest.java @@ -16,12 +16,12 @@ package org.aspectj.ajde.ui; import java.util.List; -import junit.framework.TestSuite; - import org.aspectj.ajde.Ajde; import org.aspectj.ajde.AjdeTestCase; import org.aspectj.asm.IProgramElement; +import junit.framework.TestSuite; + /** * @author Mik Kersten */ diff --git a/ajde/src/test/java/org/aspectj/ajde/ui/StructureViewManagerTest.java b/ajde/src/test/java/org/aspectj/ajde/ui/StructureViewManagerTest.java index 8e407f48d..0c1aa53ef 100644 --- a/ajde/src/test/java/org/aspectj/ajde/ui/StructureViewManagerTest.java +++ b/ajde/src/test/java/org/aspectj/ajde/ui/StructureViewManagerTest.java @@ -16,14 +16,14 @@ package org.aspectj.ajde.ui; import java.io.File; import java.util.Iterator; -import junit.framework.TestSuite; - import org.aspectj.ajde.Ajde; import org.aspectj.ajde.AjdeTestCase; import org.aspectj.asm.AsmManager; import org.aspectj.asm.IHierarchy; import org.aspectj.asm.IProgramElement; +import junit.framework.TestSuite; + /** * @author Mik Kersten */ -- cgit v1.2.3