diff options
94 files changed, 586 insertions, 479 deletions
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<String> 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<String> 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<BuildConfigNode> files, List<BuildConfigNode> 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<String> includedFiles = new HashSet<>(); + for (Iterator<BuildConfigNode> 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<BuildConfigNode> 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<File> files = configParser.getFiles(); List<String> relativeFiles = new ArrayList<String>(); for (Iterator<File> 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<String> fileContents) { + Set<String> contentsSet = new TreeSet<>(fileContents); StringBuffer fileContentsSB = new StringBuffer(); - Iterator it = contentsSet.iterator(); + Iterator<String> 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<String> allBuildConfigFiles; private List<BuildConfigListener> listeners = new ArrayList<BuildConfigListener>(); 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<String> 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<String> 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<BuildConfigNode> nodesToRemove = new ArrayList<>(); - for (Iterator<BuildConfigNode> 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<BuildConfigNode> 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<BuildConfigNode> 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<BuildConfigNode> ALPHABETICAL_COMPARATOR = new Comparator<BuildConfigNode>() { + @Override public int compare(BuildConfigNode n1, BuildConfigNode n2) { return n1.getName().compareTo(n2.getName()); } }; + @Override public List<String> getAllBuildConfigFiles() { if (allBuildConfigFiles == null) { allBuildConfigFiles = new ArrayList<String>(); 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<IProgramElement> findMatches(String pattern, IProgramElement.Kind kind) { - List matches = new ArrayList(); + List<IProgramElement> 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<IProgramElement> findMatchesHelper(IProgramElement node, String pattern, IProgramElement.Kind kind, List<IProgramElement> 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<IProgramElement> 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<Accessibility> memberVisibility) { this.filteredMemberAccessibility = memberVisibility; } - public List getFilteredMemberAccessibility() { + public List<Accessibility> getFilteredMemberAccessibility() { return filteredMemberAccessibility; } @@ -78,11 +80,11 @@ public class StructureViewProperties { this.filteredMemberAccessibility.remove(accessibility); } - public List getFilteredMemberModifiers() { + public List<Modifiers> getFilteredMemberModifiers() { return filteredMemberModifiers; } - public void setFilteredMemberModifiers(List memberModifiers) { + public void setFilteredMemberModifiers(List<Modifiers> memberModifiers) { this.filteredMemberModifiers = memberModifiers; } @@ -102,11 +104,11 @@ public class StructureViewProperties { this.sorting = sorting; } - public List getFilteredMemberKinds() { + public List<IProgramElement.Kind> getFilteredMemberKinds() { return filteredMemberKinds; } - public void setFilteredMemberKinds(List memberKinds) { + public void setFilteredMemberKinds(List<IProgramElement.Kind> memberKinds) { this.filteredMemberKinds = memberKinds; } @@ -118,11 +120,11 @@ public class StructureViewProperties { this.filteredMemberKinds.remove(kind); } - public List getGrouping() { + public List<Grouping> getGrouping() { return grouping; } - public void setGrouping(List grouping) { + public void setGrouping(List<Grouping> 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 */ diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/CodeException.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/CodeException.java index 72b4d539e..85459d06a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/CodeException.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/CodeException.java @@ -1,5 +1,10 @@ package org.aspectj.apache.bcel.classfile; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.Serializable; + /* ==================================================================== * The Apache Software License, Version 1.1 * @@ -55,7 +60,6 @@ package org.aspectj.apache.bcel.classfile; */ import org.aspectj.apache.bcel.Constants; -import java.io.*; /** * This class represents an entry in the exception table of the <em>Code</em> diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapType.java index b1116abbe..5a8d16d72 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/StackMapType.java @@ -1,5 +1,9 @@ package org.aspectj.apache.bcel.classfile; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; + /* ==================================================================== * The Apache Software License, Version 1.1 * @@ -55,7 +59,6 @@ package org.aspectj.apache.bcel.classfile; */ import org.aspectj.apache.bcel.Constants; -import java.io.*; /** * This class represents the type of a local variable or item on stack diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisAnnos.java index a6b2e529f..9ec53978d 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisAnnos.java @@ -17,8 +17,8 @@ import java.io.IOException; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; -import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.ClassVisitor; +import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeInvisAnnos extends RuntimeAnnos { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisParamAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisParamAnnos.java index cb2eb8d7a..dd5d2a655 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisParamAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisParamAnnos.java @@ -16,8 +16,8 @@ import java.io.IOException; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; -import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.ClassVisitor; +import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeInvisParamAnnos extends RuntimeParamAnnos { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisTypeAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisTypeAnnos.java index 333ccbddd..335194840 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisTypeAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeInvisTypeAnnos.java @@ -15,8 +15,8 @@ import java.io.DataInputStream; import java.io.IOException; import org.aspectj.apache.bcel.Constants; -import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.ClassVisitor; +import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeInvisTypeAnnos extends RuntimeTypeAnnos { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisAnnos.java index 3b07cccc7..97512bd6a 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisAnnos.java @@ -17,8 +17,8 @@ import java.io.IOException; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; -import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.ClassVisitor; +import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeVisAnnos extends RuntimeAnnos { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisParamAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisParamAnnos.java index b47d8aac1..d8432732b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisParamAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisParamAnnos.java @@ -16,8 +16,8 @@ import java.io.IOException; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.classfile.Attribute; -import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.ClassVisitor; +import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeVisParamAnnos extends RuntimeParamAnnos { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisTypeAnnos.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisTypeAnnos.java index 59b77dabc..2bccc130e 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisTypeAnnos.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/classfile/annotation/RuntimeVisTypeAnnos.java @@ -15,8 +15,8 @@ import java.io.DataInputStream; import java.io.IOException; import org.aspectj.apache.bcel.Constants; -import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.ClassVisitor; +import org.aspectj.apache.bcel.classfile.ConstantPool; public class RuntimeVisTypeAnnos extends RuntimeTypeAnnos { diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReturnaddressType.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReturnaddressType.java index a38ffedfd..bccd83342 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReturnaddressType.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/ReturnaddressType.java @@ -54,7 +54,6 @@ package org.aspectj.apache.bcel.generic; * <http://www.apache.org/>. */ import org.aspectj.apache.bcel.Constants; -import org.aspectj.apache.bcel.generic.InstructionHandle; /** * Returnaddress, the type JSR or JSR_W instructions push upon the stack. diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TABLESWITCH.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TABLESWITCH.java index 5dc26346b..201e1e508 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TABLESWITCH.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/generic/TABLESWITCH.java @@ -59,8 +59,6 @@ import java.io.IOException; import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.util.ByteSequence; -import com.sun.org.apache.bcel.internal.generic.SWITCH; - /** * TABLESWITCH - Switch within given range of values, i.e., low..high * diff --git a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ByteSequence.java b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ByteSequence.java index 072a7ba52..37216344b 100644 --- a/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ByteSequence.java +++ b/bcel-builder/src/main/java/org/aspectj/apache/bcel/util/ByteSequence.java @@ -53,7 +53,8 @@ package org.aspectj.apache.bcel.util; * information on the Apache Software Foundation, please see * <http://www.apache.org/>. */ -import java.io.*; +import java.io.ByteArrayInputStream; +import java.io.DataInputStream; /** * Utility class that implements a sequence of bytes which can be read diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationAccessFlagTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationAccessFlagTest.java index 96dd9e765..abc6e8513 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationAccessFlagTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationAccessFlagTest.java @@ -14,13 +14,13 @@ package org.aspectj.apache.bcel.classfile.tests; import java.io.File; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; +import junit.framework.TestCase; + public class AnnotationAccessFlagTest extends TestCase { private boolean verbose = false; diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java index 901aa2ee7..426ebbea9 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/AnnotationGenTest.java @@ -24,8 +24,8 @@ import org.aspectj.apache.bcel.classfile.Attribute; import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.Utility; import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen; -import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.ElementValue; +import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.RuntimeAnnos; import org.aspectj.apache.bcel.classfile.annotation.RuntimeInvisAnnos; import org.aspectj.apache.bcel.classfile.annotation.RuntimeVisAnnos; diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java index ef4b8a9a7..7c7013f62 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/BcelTestCase.java @@ -16,21 +16,21 @@ import java.io.File; import java.util.ArrayList; import java.util.List; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.classfile.Attribute; import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.Field; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen; -import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.ElementValue; +import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.SimpleElementValue; import org.aspectj.apache.bcel.generic.ObjectType; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; +import junit.framework.TestCase; + /** * Super class for the Java5 tests, includes various helper methods. */ diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnumAccessFlagTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnumAccessFlagTest.java index a91947549..2909a391c 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnumAccessFlagTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/EnumAccessFlagTest.java @@ -14,13 +14,13 @@ package org.aspectj.apache.bcel.classfile.tests; import java.io.File; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.classfile.ConstantPool; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; +import junit.framework.TestCase; + public class EnumAccessFlagTest extends TestCase { private boolean verbose = false; diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java index 94e40d491..f7ab04d4a 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/GeneratingAnnotatedClassesTest.java @@ -21,8 +21,8 @@ import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.apache.bcel.classfile.annotation.AnnotationElementValue; import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen; import org.aspectj.apache.bcel.classfile.annotation.ArrayElementValue; -import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.ElementValue; +import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.SimpleElementValue; import org.aspectj.apache.bcel.generic.ArrayType; import org.aspectj.apache.bcel.generic.ClassGen; diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java index 4b7a14715..c8eda5d40 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/NonCachingClassLoaderRepositoryTest.java @@ -57,11 +57,11 @@ package org.aspectj.apache.bcel.classfile.tests; import java.util.ArrayList; import java.util.List; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.util.NonCachingClassLoaderRepository; +import junit.framework.TestCase; + /** * @author Kristian Rosenvold */ diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java index 093a4b6e4..0e9c4fadd 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/ParameterAnnotationsTest.java @@ -21,8 +21,8 @@ import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.apache.bcel.classfile.annotation.AnnotationElementValue; import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen; import org.aspectj.apache.bcel.classfile.annotation.ArrayElementValue; -import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.ElementValue; +import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.SimpleElementValue; import org.aspectj.apache.bcel.generic.ArrayType; import org.aspectj.apache.bcel.generic.ClassGen; diff --git a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java index 0f82b2059..669d942f5 100644 --- a/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java +++ b/bcel-builder/src/test/java/org/aspectj/apache/bcel/classfile/tests/RuntimeVisibleAnnotationAttributeTest.java @@ -26,9 +26,9 @@ import org.aspectj.apache.bcel.classfile.annotation.AnnotationElementValue; import org.aspectj.apache.bcel.classfile.annotation.AnnotationGen; import org.aspectj.apache.bcel.classfile.annotation.ArrayElementValue; import org.aspectj.apache.bcel.classfile.annotation.ClassElementValue; -import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.ElementValue; import org.aspectj.apache.bcel.classfile.annotation.EnumElementValue; +import org.aspectj.apache.bcel.classfile.annotation.NameValuePair; import org.aspectj.apache.bcel.classfile.annotation.RuntimeVisAnnos; import org.aspectj.apache.bcel.classfile.annotation.SimpleElementValue; import org.aspectj.apache.bcel.generic.ClassGen; diff --git a/loadtime/src/main/java/org/aspectj/weaver/loadtime/Agent.java b/loadtime/src/main/java/org/aspectj/weaver/loadtime/Agent.java index 6dbbf32db..9669a2c9d 100644 --- a/loadtime/src/main/java/org/aspectj/weaver/loadtime/Agent.java +++ b/loadtime/src/main/java/org/aspectj/weaver/loadtime/Agent.java @@ -11,8 +11,8 @@ *******************************************************************************/ package org.aspectj.weaver.loadtime; -import java.lang.instrument.Instrumentation; import java.lang.instrument.ClassFileTransformer; +import java.lang.instrument.Instrumentation; /** * Java 1.5 preMain agent to hook in the class pre processor diff --git a/loadtime/src/main/java/org/aspectj/weaver/loadtime/DefaultMessageHandler.java b/loadtime/src/main/java/org/aspectj/weaver/loadtime/DefaultMessageHandler.java index 6589663fd..a1f6902ee 100644 --- a/loadtime/src/main/java/org/aspectj/weaver/loadtime/DefaultMessageHandler.java +++ b/loadtime/src/main/java/org/aspectj/weaver/loadtime/DefaultMessageHandler.java @@ -11,9 +11,9 @@ *******************************************************************************/ package org.aspectj.weaver.loadtime; -import org.aspectj.bridge.IMessageHandler; -import org.aspectj.bridge.IMessage; import org.aspectj.bridge.AbortException; +import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.IMessageHandler; /** * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> diff --git a/loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java b/loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java index 0c9611e4f..4e60c7b86 100644 --- a/loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java +++ b/loadtime/src/main/java/org/aspectj/weaver/loadtime/Options.java @@ -23,7 +23,7 @@ import org.aspectj.util.LangUtil; /** * A class that hanldes LTW options. Note: AV - I choosed to not reuse AjCompilerOptions and alike since those implies too many * dependancies on jdt and ajdt modules. - * + * * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ public class Options { @@ -66,7 +66,7 @@ public class Options { if (arg.length() > OPTIONVALUED_messageHandler.length()) { String handlerClass = arg.substring(OPTIONVALUED_messageHandler.length()).trim(); try { - Class handler = Class.forName(handlerClass, false, laoder); + Class<?> handler = Class.forName(handlerClass, false, laoder); weaverOption.messageHandler = ((IMessageHandler) handler.newInstance()); } catch (Throwable t) { weaverOption.messageHandler.handleMessage(new Message("Cannot instantiate message handler " + handlerClass, @@ -78,7 +78,7 @@ public class Options { // configure the other options for (Iterator<String> iterator = flags.iterator(); iterator.hasNext();) { - String arg = (String) iterator.next(); + String arg = iterator.next(); if (arg.equals(OPTION_15)) { weaverOption.java5 = true; } else if (arg.equalsIgnoreCase(OPTION_lazyTjp)) { diff --git a/loadtime/src/test/java/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java b/loadtime/src/test/java/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java index 456fde121..3b2ee51e3 100644 --- a/loadtime/src/test/java/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java +++ b/loadtime/src/test/java/org/aspectj/weaver/loadtime/ClassLoaderWeavingAdaptorTest.java @@ -19,8 +19,6 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.util.ClassPath; import org.aspectj.apache.bcel.util.SyntheticRepository; @@ -31,6 +29,8 @@ import org.aspectj.weaver.bcel.BcelWorld; import org.aspectj.weaver.loadtime.definition.Definition; import org.aspectj.weaver.tools.WeavingAdaptor; +import junit.framework.TestCase; + public class ClassLoaderWeavingAdaptorTest extends TestCase { public void testClassLoaderWeavingAdaptor() { diff --git a/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java b/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java index 9ed540d17..1c5a8536c 100644 --- a/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java +++ b/loadtime/src/test/java/org/aspectj/weaver/loadtime/JRockitAgentTest.java @@ -27,11 +27,11 @@ import java.util.zip.ZipEntry; import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; -import junit.framework.TestCase; - import com.bea.jvm.ClassPreProcessor; import com.bea.jvm.JVMFactory; +import junit.framework.TestCase; + public class JRockitAgentTest extends TestCase { protected void setUp() throws Exception { diff --git a/loadtime/src/test/java/org/aspectj/weaver/loadtime/WeavingContextTest.java b/loadtime/src/test/java/org/aspectj/weaver/loadtime/WeavingContextTest.java index ea787dac8..9ef64a04b 100644 --- a/loadtime/src/test/java/org/aspectj/weaver/loadtime/WeavingContextTest.java +++ b/loadtime/src/test/java/org/aspectj/weaver/loadtime/WeavingContextTest.java @@ -17,10 +17,10 @@ import java.net.URLClassLoader; import java.util.Enumeration; import java.util.List; -import junit.framework.TestCase; - import org.aspectj.weaver.tools.WeavingAdaptor; +import junit.framework.TestCase; + public class WeavingContextTest extends TestCase { private boolean called; diff --git a/loadtime/src/test/java/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java b/loadtime/src/test/java/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java index 03b378ba2..406847eb2 100644 --- a/loadtime/src/test/java/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java +++ b/loadtime/src/test/java/org/aspectj/weaver/loadtime/WeavingURLClassLoaderTest.java @@ -15,19 +15,17 @@ package org.aspectj.weaver.loadtime; import java.io.File; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.net.URISyntaxException; import java.net.URL; import java.util.Enumeration; import java.util.Properties; -import junit.framework.TestCase; - import org.aspectj.bridge.AbortException; -import org.aspectj.testing.util.TestUtil; import org.aspectj.testing.util.TestUtil.TestError; import org.aspectj.util.FileUtil; import org.aspectj.weaver.tools.WeavingAdaptor; +import junit.framework.TestCase; + /** * @author websterm * diff --git a/loadtime/src/test/java/org/aspectj/weaver/loadtime/test/DocumentParserTest.java b/loadtime/src/test/java/org/aspectj/weaver/loadtime/test/DocumentParserTest.java index 92d35983f..b0b55d725 100644 --- a/loadtime/src/test/java/org/aspectj/weaver/loadtime/test/DocumentParserTest.java +++ b/loadtime/src/test/java/org/aspectj/weaver/loadtime/test/DocumentParserTest.java @@ -11,13 +11,13 @@ *******************************************************************************/ package org.aspectj.weaver.loadtime.test; -import junit.framework.TestCase; - import java.net.URL; import org.aspectj.weaver.loadtime.definition.Definition; import org.aspectj.weaver.loadtime.definition.DocumentParser; +import junit.framework.TestCase; + /** * @author <a href="mailto:alex AT gnilux DOT com">Alexandre Vasseur</a> */ diff --git a/testing-drivers/src/test/java/org/aspectj/testing/drivers/Harness.java b/testing-drivers/src/test/java/org/aspectj/testing/drivers/Harness.java index 09b8a7199..767444ce3 100644 --- a/testing-drivers/src/test/java/org/aspectj/testing/drivers/Harness.java +++ b/testing-drivers/src/test/java/org/aspectj/testing/drivers/Harness.java @@ -1,19 +1,41 @@ /* ******************************************************************* * Copyright (c) 2002 Palo Alto Research Center, Incorporated (PARC), * 2003 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 + * 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 * Wes Isberg 2003 changes. * ******************************************************************/ package org.aspectj.testing.drivers; +import java.io.BufferedReader; +import java.io.File; +import java.io.FileReader; +import java.io.IOException; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.text.DecimalFormat; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.StringTokenizer; + import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.MessageHandler; @@ -45,16 +67,6 @@ import org.aspectj.testing.xml.XMLWriter; import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; -import java.io.BufferedReader; -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.io.PrintStream; -import java.io.PrintWriter; -import java.text.DecimalFormat; -import java.text.SimpleDateFormat; -import java.util.*; - /** * Test harness for running AjcTest.Suite test suites. * This can be easily extended by subclassing. @@ -70,11 +82,11 @@ import java.util.*; * categories. */ public class Harness { - /** + /** * Spaces up to the width that an option should take in the syntax, * including the two-space leader */ - protected static final String SYNTAX_PAD = " "; + protected static final String SYNTAX_PAD = " "; protected static final String OPTION_DELIM = ";"; private static final String JAVA_VERSION; private static final String ASPECTJ_VERSION; @@ -83,22 +95,22 @@ public class Harness { try { version = System.getProperty("java.version", "UNKNOWN"); } catch (Throwable t) {} JAVA_VERSION = version; - + version = "UNKNOWN"; try { Class c = Class.forName("org.aspectj.bridge.Version"); - version = (String) c.getField("text").get(null); + version = (String) c.getField("text").get(null); } catch (Throwable t) { // ignore } ASPECTJ_VERSION = version; } - + /** factory for the subclass currently anointed as default */ public static Harness makeHarness() { return new FeatureHarness(); } - + /** @param args String[] like runMain(String[]) args */ public static void main(String[] args) throws Exception { if (LangUtil.isEmpty(args)) { @@ -129,9 +141,9 @@ public class Harness { /** * Read argFile contents into String[], * delimiting at any whitespace - */ + */ private static String[] readArgs(File argFile) { - ArrayList args = new ArrayList(); + ArrayList<String> args = new ArrayList<>(); // int lineNum = 0; try { @@ -146,24 +158,23 @@ public class Harness { } } catch (IOException e) { e.printStackTrace(System.err); - } - return (String[]) args.toArray(new String[0]); + } + return args.toArray(new String[0]); } - + /** aliases key="option" value="option{,option}" */ private static Properties optionAliases; - + /** be extra noisy if true */ private boolean verboseHarness; - + /** be extra quiet if true */ private boolean quietHarness; - + /** just don't say anything! */ protected boolean silentHarness; - /** map of feature names to features */ - private HashMap features; + private HashMap<String,Feature> features; /** if true, do not delete temporary files. */ private boolean keepTemp; @@ -173,38 +184,38 @@ public class Harness { /** if true, then log results in report(..) when done */ private boolean logResults; - + /** if true and there were failures, do System.exit({numFailures})*/ private boolean exitOnFailure; - + protected Harness() { - features = new HashMap(); + features = new HashMap<>(); } - - /** + + /** * Entry point for a test. - * This reads in the arguments, + * This reads in the arguments, * creates the test suite(s) from the input file(s), - * and for each suite does setup, run, report, and cleanup. + * and for each suite does setup, run, report, and cleanup. * When arguments are read, any option ending with "-" causes * option variants, a set of args with and another without the - * option. See {@link LangUtil.optionVariants(String[])} for + * option. See {@link LangUtil.optionVariants(String[])} for * more details. * @param args the String[] for the test suite - use -help to get options, * and use "-" suffixes for variants. - * @param resultList List for IRunStatus results - ignored if null + * @param resultList List for IRunStatus results - ignored if null */ public void runMain(String[] args, List resultList) { LangUtil.throwIaxIfFalse(!LangUtil.isEmpty(args), "empty args"); // read arguments - final ArrayList globals = new ArrayList(); - final ArrayList files = new ArrayList(); - final LinkedList argList = new LinkedList(); + final ArrayList<String> globals = new ArrayList<>(); + final ArrayList<String> files = new ArrayList<>(); + final LinkedList<String> argList = new LinkedList<>(); argList.addAll(Arrays.asList(args)); for (int i = 0; i < argList.size(); i++) { - String arg = (String) argList.get(i); - List aliases = aliasOptions(arg); + String arg = argList.get(i); + List<String> aliases = aliasOptions(arg); if (!LangUtil.isEmpty(aliases)) { argList.remove(i); argList.addAll(i, aliases); @@ -216,9 +227,9 @@ public class Harness { printSyntax(getLogStream()); return; } else if (isSuiteFile(arg)) { - files.add(arg); + files.add(arg); } else if (!acceptOption(arg)) { - globals.add(arg); + globals.add(arg); } // else our options absorbed } if (0 == files.size()) { @@ -227,13 +238,13 @@ public class Harness { printSyntax(getLogStream()); return; } - String[] globalOptions = (String[]) globals.toArray(new String[0]); + String[] globalOptions = globals.toArray(new String[0]); String[][] globalOptionVariants = optionVariants(globalOptions); AbstractRunSpec.RT runtime = new AbstractRunSpec.RT(); if (verboseHarness) { runtime.setVerbose(true); } - + // run suites read from each file AjcTest.Suite.Spec spec; for (Iterator iter = files.iterator(); iter.hasNext();) { @@ -251,7 +262,7 @@ public class Harness { for (int i = 0; i < globalOptionVariants.length; i++) { runtime.setOptions(globalOptionVariants[i]); holder.init(); - boolean skip = !spec.adoptParentValues(runtime, holder); + boolean skip = !spec.adoptParentValues(runtime, holder); // awful/brittle assumption about number of skips == number of skip messages final List skipList = MessageUtil.getMessages(holder, IMessage.INFO, false, "skip"); if ((verboseHarness || skip || (0 < skipList.size()))) { @@ -272,17 +283,17 @@ public class Harness { } } if (!skip) { - doStartSuite(suiteFile); + doStartSuite(suiteFile); long elapsed = 0; RunResult result = null; - try { + try { final long startTime = System.currentTimeMillis(); result = run(spec); if (null != resultList) { resultList.add(result); } - elapsed = System.currentTimeMillis() - startTime; - report(result.status, skipList.size(), result.numIncomplete, elapsed); + elapsed = System.currentTimeMillis() - startTime; + report(result.status, skipList.size(), result.numIncomplete, elapsed); } finally { doEndSuite(suiteFile,elapsed); } @@ -292,7 +303,7 @@ public class Harness { System.exit(numFailures); } Object value = result.status.getResult(); - if ((value instanceof Boolean) + if ((value instanceof Boolean) && !((Boolean) value).booleanValue()) { System.exit(-1); } @@ -300,8 +311,8 @@ public class Harness { } } } - } - + } + /** * Tell all IRunListeners that we are about to start a test suite @@ -315,7 +326,7 @@ public class Harness { if (element.listener instanceof TestCompleteListener) { ((TestCompleteListener)element.listener).doEndSuite(suiteFile,elapsed); } - } + } } /** * Generate variants of String[] options by creating an extra set for @@ -328,7 +339,7 @@ public class Harness { */ public static String[][] optionVariants(String[] options) { if ((null == options) || (0 == options.length)) { - return new String[][] { new String[0]}; + return new String[][] { new String[0]}; } // be nice, don't stomp input String[] temp = new String[options.length]; @@ -336,7 +347,7 @@ public class Harness { options = temp; boolean[] dup = new boolean[options.length]; int numDups = 0; - + for (int i = 0; i < options.length; i++) { String option = options[i]; if (LangUtil.isEmpty(option)) { @@ -352,23 +363,23 @@ public class Harness { final int variants = exp(2, numDups); final String[][] result = new String[variants][]; // variant is a bitmap wrt doing extra value when dup[k]=true - for (int variant = 0; variant < variants; variant++) { - ArrayList next = new ArrayList(); + for (int variant = 0; variant < variants; variant++) { + ArrayList<String> next = new ArrayList<>(); int nextOption = 0; for (int k = 0; k < options.length; k++) { if (!dup[k] || (0 != (variant & (1 << (nextOption++))))) { next.add(options[k]); - } + } } - result[variant] = (String[]) next.toArray(NONE); + result[variant] = next.toArray(NONE); } return result; } - + private static int exp(int base, int power) { // not in Math? if (0 > power) { throw new IllegalArgumentException("negative power: " + power); - } + } int result = 1; while (0 < power--) { result *= base; @@ -386,7 +397,7 @@ public class Harness { if (element.listener instanceof TestCompleteListener) { ((TestCompleteListener)element.listener).doStartSuite(suiteFile); } - } + } } /** Run the test suite specified by the spec */ @@ -395,13 +406,13 @@ public class Harness { /* * For each run, initialize the runner and validator, * create a new set of IRun{Iterator} tests, - * and run them. + * and run them. * Delete all temp files when done. */ Runner runner = new Runner(); if (0 != features.size()) { - for (Iterator iter = features.entrySet().iterator(); iter.hasNext();) { - Feature feature = (Feature) ((Map.Entry) iter.next()).getValue(); + for (Iterator<Map.Entry<String,Feature>> iter = features.entrySet().iterator(); iter.hasNext();) { + Feature feature = iter.next().getValue(); runner.registerListener(feature.clazz, feature.listener); } } @@ -432,8 +443,8 @@ public class Harness { } return new RunResult(status, numIncomplete); } - - /** + + /** * Report the results of a test run after it is completed. * Clients should be able to identify the number of: * <ul> @@ -443,27 +454,27 @@ public class Harness { * <li>tests skipped, i.e., test definition read and found incompatible with * the current configuration.</li> * <ul> - * + * * @param status returned from the run - * @param numSkipped int tests that were skipped because of + * @param numSkipped int tests that were skipped because of * configuration incompatibilities * @param numIncomplete int tests that failed during setup, * usually indicating a test definition or configuration error. * @param msElapsed elapsed time in milliseconds * */ - protected void report(IRunStatus status, int numSkipped, int numIncomplete, + protected void report(IRunStatus status, int numSkipped, int numIncomplete, long msElapsed ) { if (logResults) { RunUtils.AJCSUITE_PRINTER.printRunStatus(getLogStream(), status); } else if (!(quietHarness || silentHarness) && (0 < status.numMessages(null, true))) { if (!silentHarness) { - MessageUtil.print(getLogStream(), status, ""); + MessageUtil.print(getLogStream(), status, ""); } } - - logln(BridgeUtil.childString(status, numSkipped, numIncomplete) + + logln(BridgeUtil.childString(status, numSkipped, numIncomplete) + " " + (msElapsed/1000) + " seconds"); - + } // --------------- delegate methods @@ -472,25 +483,25 @@ public class Harness { getLogStream().println(s); } } - + protected PrintStream getLogStream() { return System.out; } - + protected boolean isSuiteFile(String arg) { - return ((null != arg) + return ((null != arg) && (arg.endsWith(".txt") || arg.endsWith(".xml")) && new File(arg).canRead()); } - - /** + + /** * Get the options that the input option is an alias for. * Subclasses may add options directly to the getFeatureAliases result * or override this. * @return null if the input is not an alias for other options, - * or a non-empty List (String) of options that this option is an alias for + * or a non-empty List (String) of options that this option is an alias for */ - protected List aliasOptions(String option) { + protected List<String> aliasOptions(String option) { Properties aliases = Harness.getOptionAliases(); if (null != aliases) { String args = aliases.getProperty(option); @@ -501,7 +512,7 @@ public class Harness { return null; } - /** + /** * Read and implement any of our options. * Options other than this and suite files will be * passed down as parent options through the test spec hierarchy. @@ -518,20 +529,20 @@ public class Harness { } else if ("-silentHarness".equals(option)) { silentHarness = true; } else if ("-keepTemp".equals(option)) { - keepTemp = true; + keepTemp = true; } else if ("-killTemp".equals(option)) { - killTemp = true; + killTemp = true; } else if ("-logResults".equals(option)) { - logResults = true; + logResults = true; } else if ("-exitOnFailure".equals(option)) { - exitOnFailure = true; + exitOnFailure = true; } else { return false; } - return true; - } - - /** + return true; + } + + /** * Read a test suite file. * This implementation knows how to read .txt and .xml files * and logs any errors. @@ -555,7 +566,7 @@ public class Harness { } return null; } - + /** Add feature to take effect during the next runMain(..) invocation. * @param feature the Feature to add, using feature.name as key. */ @@ -564,14 +575,14 @@ public class Harness { features.put(feature.name, feature); } } - + /** remove feature by name (same as feature.name) */ protected void removeFeature(String name) { if (!LangUtil.isEmpty(name)) { features.remove(name); } } - + /** @return unmodifiable Set of feature names */ protected Set listFeatureNames() { return Collections.unmodifiableSet(features.keySet()); @@ -611,7 +622,7 @@ public class Harness { out.println(alias + entry.getValue()); } } - + /** result struct for run(AjcTest.Spec) */ public static class RunResult { public final IRunStatus status; @@ -625,13 +636,13 @@ public class Harness { public static class Feature { /** never null, always assignable to IRun */ public final Class clazz; - + /** never null */ public final IRunListener listener; - + /** never null or empty */ public final String name; - + /** @throws IllegalArgumentException if any is null/empty or clazz is * not assignable to IRun */ @@ -644,12 +655,12 @@ public class Harness { } LangUtil.throwIaxIfNull(listener, "listener"); LangUtil.throwIaxIfNull(name, "name"); - LangUtil.throwIaxIfFalse(0 < name.length(), "empty name"); + LangUtil.throwIaxIfFalse(0 < name.length(), "empty name"); this.clazz = clazz; this.listener = listener; this.name = name; } - + /** @return feature name */ public String toString() { return name; @@ -658,32 +669,32 @@ public class Harness { } -/** +/** * Harness with features for controlling output * (logging results and hiding streams). * Use -help to get a list of feature options. */ class FeatureHarness extends Harness { - private static final String[] ALIASES = new String[] - { "-hideStreams", - "-hideCompilerStreams" + private static final String[] ALIASES = new String[] + { "-hideStreams", + "-hideCompilerStreams" + OPTION_DELIM + "-hideRunStreams", - "-jim", - "-logMinFail" + "-jim", + "-logMinFail" + OPTION_DELIM + "-hideStreams", - "-loud", + "-loud", "-verboseHarness", - "-baseline", - "-verboseHarness" - + OPTION_DELIM + "-traceTestsMin" + "-baseline", + "-verboseHarness" + + OPTION_DELIM + "-traceTestsMin" + OPTION_DELIM + "-hideStreams", - "-release", - "-baseline" + "-release", + "-baseline" + OPTION_DELIM + "-ajctestSkipKeywords=knownLimitation,purejava", "-junit", "-silentHarness" + OPTION_DELIM + "-logJUnit" + OPTION_DELIM + - "-hideStreams", + "-hideStreams", "-cruisecontrol", "-junit" + OPTION_DELIM + "-ajctestSkipKeywords=knownLimitation,purejava" }; @@ -697,17 +708,17 @@ class FeatureHarness extends Harness { } /** controller for suppressing and sniffing error and output streams. */ - StreamsHandler streamsHandler; + StreamsHandler streamsHandler; /** facility of hiding-streams may be applied in many features */ IRunListener streamHider; /** facility of capture/log may be applied in many features */ IRunListener captureLogger; - + /** when making tests, do not run them */ TestMaker testMaker; - + public FeatureHarness() { super(); streamsHandler = new StreamsHandler(false, true); @@ -769,12 +780,12 @@ class FeatureHarness extends Harness { if (null == option) { return false; } - + final StreamsHandler streams = streamsHandler; final IRunValidator validator = RunValidator.NORMAL; - final RunUtils.IRunStatusPrinter verbose + final RunUtils.IRunStatusPrinter verbose = RunUtils.VERBOSE_PRINTER; - final RunUtils.IRunStatusPrinter terse + final RunUtils.IRunStatusPrinter terse = RunUtils.TERSE_PRINTER; // final boolean LOGPASS = true; // final boolean LOGFAIL = true; @@ -782,11 +793,11 @@ class FeatureHarness extends Harness { // final boolean SKIPFAIL = false; // final boolean LOGSTREAMS = true; final boolean SKIPSTREAMS = false; - + Feature feature = null; if (super.acceptOption(option)) { // ok, result returned below - + } else if ("-XmakeTests".equals(option)) { testMaker = TestMaker.ME; } else if (option.startsWith("-traceTestsMin")) { @@ -794,43 +805,43 @@ class FeatureHarness extends Harness { } else if (option.startsWith("-traceTests")) { feature = new Feature(option, AjcTest.class,new TestTraceLogger(streams, true)); } else if (option.startsWith("-logMin")) { - feature = new Feature(option, AjcTest.class, + feature = new Feature(option, AjcTest.class, new RunLogger(option, SKIPSTREAMS, streams, validator, terse)); } else if (option.startsWith("-logXML")) { - feature = new Feature(option, AjcTest.class, + feature = new Feature(option, AjcTest.class, new XmlLogger(option, streams, validator)); } else if (option.startsWith("-logJUnit")) { feature = new Feature(option, AjcTest.class, new JUnitXMLLogger(option,streams,validator)); } else if (option.startsWith("-log")) { - feature = new Feature(option, AjcTest.class, + feature = new Feature(option, AjcTest.class, new RunLogger(option, SKIPSTREAMS, streams, validator, verbose)); } else if ("-hideRunStreams".equals(option)) { - feature = new Feature(option, JavaRun.class, getStreamHider()); + feature = new Feature(option, JavaRun.class, getStreamHider()); } else if ("-hideCompilerStreams".equals(option)) { - addFeature(new Feature(option, IncCompilerRun.class, getStreamHider())); // hmmm - feature = new Feature(option, CompilerRun.class, getStreamHider()); + addFeature(new Feature(option, IncCompilerRun.class, getStreamHider())); // hmmm + feature = new Feature(option, CompilerRun.class, getStreamHider()); } else if ("-progressDots".equals(option)) { IRunListener listener = new RunListener() { public void runCompleted(IRunStatus run) { streamsHandler.log((validator.runPassed(run) ? "." : "!")); } }; - feature = new Feature(option, AjcTest.class, listener); + feature = new Feature(option, AjcTest.class, listener); } else if (option.startsWith("-XlogPublicType")) { String label = option + TestCompleteListener.PASS; // print when validator true - feature = new Feature(option, AjcTest.class, + feature = new Feature(option, AjcTest.class, new XmlLogger(label, streams, MessageRunValidator.PUBLIC_TYPE_ERROR)); } else if (option.startsWith("-XlogSourceIn")) { String input = option.substring("-XlogSourceIn=".length()); LangUtil.throwIaxIfFalse(0 < input.length(), option); String label = "-XlogSourceIn=" + TestCompleteListener.PASS; // print when validator true StringRunner sr = new SubstringRunner(input, false); - feature = new Feature(option, AjcTest.class, + feature = new Feature(option, AjcTest.class, new XmlLogger(label, streams, new SourcePathValidator(sr))); } else { return false; - } + } addFeature(feature); return true; } @@ -854,9 +865,9 @@ class FeatureHarness extends Harness { /** Generate any needed test case files for any test. */ class TestMaker { - + static TestMaker ME = new TestMaker(); - + /** @throws Error if unable to make dir */ static void mkdirs(File dir) { if (null != dir && !dir.exists()) { @@ -881,7 +892,7 @@ class TestMaker { sb.append("package " + pack + ";"); } final String EOL = "\n"; // XXX find discovered EOL - sb.append( EOL + sb.append( EOL + EOL + "import org.aspectj.testing.Tester;" + EOL + "" + EOL + "/** @testcase " + label + " */" @@ -890,12 +901,12 @@ class TestMaker { + EOL + "\t\tTester.check(null != args, \"null args\"); " + EOL + "\t}" + EOL + "}" - + EOL + + EOL ); - + return sb.toString(); } - + /** create a minimal source file for a test */ static void createSrcFile(File baseDir, File file, String testName) { if (file.exists()) { @@ -907,7 +918,7 @@ class TestMaker { throw new Error(error); } } - + /** create an empty arg file for a test */ static void createArgFile(File baseDir, File file, String testName) { if (file.exists()) { @@ -919,18 +930,18 @@ class TestMaker { throw new Error(error); } } - + public Harness.RunResult run(AjcTest.Suite.Spec spec) { ArrayList kids = spec.getChildren(); for (Iterator iter = kids.iterator(); iter.hasNext();) { - makeTest( (AjcTest.Spec) iter.next()); + makeTest( (AjcTest.Spec) iter.next()); } IRunStatus status = new RunStatus(new MessageHandler(), new Runner()); status.start(); status.finish(IRunStatus.PASS); return new Harness.RunResult(status, 0); } - + private void makeTest(AjcTest.Spec spec) { CompilerRun.Spec compileSpec = AjcTest.unwrapCompilerRunSpec(spec); if (null == spec) { @@ -956,25 +967,25 @@ class TestMaker { if (0 < pr) { testName.append("PR#" + pr + " "); } - + testName.append(spec.getDescription()); final String label = testName.toString(); final File[] srcFiles = FileUtil.getBaseDirFiles(dir, compileSpec.getPathsArray()); if (!LangUtil.isEmpty(srcFiles)) { for (int i = 0; i < srcFiles.length; i++) { - TestMaker.createSrcFile(dir, srcFiles[i], label); + TestMaker.createSrcFile(dir, srcFiles[i], label); } } final File[] argFiles = FileUtil.getBaseDirFiles(dir, compileSpec.getArgfilesArray()); if (!LangUtil.isEmpty(argFiles)) { for (int i = 0; i < argFiles.length; i++) { - TestMaker.createArgFile(dir, argFiles[i], label); + TestMaker.createArgFile(dir, argFiles[i], label); } } - + } - - /** @return "Testmaker()" */ + + /** @return "Testmaker()" */ public String toString() { return "TestMaker()"; } @@ -990,7 +1001,7 @@ interface StringRunner { */ class SubstringRunner implements StringRunner { private static String[] extractSubstrings( - String substrings, + String substrings, boolean caseSensitive) { if (null == substrings) { return null; @@ -1006,10 +1017,10 @@ class SubstringRunner implements StringRunner { } return result; } - + private final String[] substrings; private final boolean caseSensitive; - + /** * @param substrings the String containing comma-separated substrings * to find in input - if null, any input accepted @@ -1018,9 +1029,9 @@ class SubstringRunner implements StringRunner { */ SubstringRunner(String substrings, boolean caseSensitive) { this.caseSensitive = caseSensitive; - this.substrings = extractSubstrings(substrings, caseSensitive); + this.substrings = extractSubstrings(substrings, caseSensitive); } - + public boolean accept(String input) { if (null == substrings) { return true; @@ -1028,7 +1039,7 @@ class SubstringRunner implements StringRunner { if (null == input) { return false; } - + if (!caseSensitive) { input = input.toLowerCase(); } @@ -1041,7 +1052,7 @@ class SubstringRunner implements StringRunner { } } -/** +/** * Signal whether run "passed" based on validating absolute source paths. * (Static evaluation - no run necessary) */ @@ -1050,7 +1061,7 @@ class SourcePathValidator implements IRunValidator { // static - no run needed // XXX hoist common SourcePathValidator(StringRunner validator) { LangUtil.throwIaxIfNull(validator, "validator"); - this.validator = validator; + this.validator = validator; } /** * @return true if any source files in compile spec are @@ -1072,20 +1083,20 @@ class SourcePathValidator implements IRunValidator { // static - no run needed } return false; } - + } /** Signal whether run "passed" based on message kind and content */ class MessageRunValidator implements IRunValidator { - + /** signals "passed" if any error contains "public type" */ - static final IRunValidator PUBLIC_TYPE_ERROR + static final IRunValidator PUBLIC_TYPE_ERROR = new MessageRunValidator("public type", IMessage.ERROR, false); - + private final IMessage.Kind kind; private final String sought; private final boolean orGreater; - + /** * @param sought the String to seek anywhere in any message of the right kind * if null, accept any message of the right kind. @@ -1096,12 +1107,12 @@ class MessageRunValidator implements IRunValidator { this.kind = kind; this.orGreater = orGreater; } - + /** @return true if this run has messages of the right kind and text */ public boolean runPassed(IRunStatus run) { return gotMessage(new IRunStatus[] {run}); } - + /** * Search these children and their children recursively * for messages of the right kind and content. @@ -1140,7 +1151,7 @@ class MessageRunValidator implements IRunValidator { } } -/** +/** * Base class for listeners that run depending on pass/fail status of input. * Template method runCompleted handled whether to run. * Subclasses implement doRunCompleted(..). @@ -1154,14 +1165,14 @@ abstract class TestCompleteListener extends RunListener { /** label suffix indicating pass */ public static final String PASS = "Pass"; - + /** runValidator determines if a given run passed */ protected final IRunValidator runValidator; /** label for this listener */ final String label; - + /** if trun and run passed, then run doRunCompleted(..) */ final boolean logOnPass; @@ -1170,16 +1181,16 @@ abstract class TestCompleteListener extends RunListener { /** may be null */ protected final StreamsHandler streamsHandler; - + /** true if the last run evaluation was ok */ boolean lastRunOk; - + /** last run evaluated */ IRunStatus lastRun; // XXX small memory leak - cache hashcode instead? - + /** @param label endsWith PASS || FAIL || ALL */ protected TestCompleteListener( - String label, + String label, IRunValidator runValidator, StreamsHandler streamsHandler) { if (null == runValidator) { @@ -1191,22 +1202,22 @@ abstract class TestCompleteListener extends RunListener { this.runValidator = runValidator; this.streamsHandler = streamsHandler; } - + public void runStarted(IRunStatus run) { if (null != streamsHandler) { streamsHandler.startListening(); } } - + /** subclasses implement this to do some per-test initialization */ protected void doRunStarted(IRunStatus run) { } - - + + /** subclasses implement this to do some per-suite initialization */ protected void doStartSuite(File suite) { } - + /** subclasses implement this to do end-of-suite processing */ protected void doEndSuite(File suite, long duration) { } @@ -1233,49 +1244,49 @@ abstract class TestCompleteListener extends RunListener { return lastRunOk; } - /** @return "{classname}({pass}{,fail})" indicating when this runs */ + /** @return "{classname}({pass}{,fail})" indicating when this runs */ public String toString() { // XXX add label? return LangUtil.unqualifiedClassName(this) - + "(" + (logOnPass ? (logOnNotPass ? "pass, fail)" : "pass)") + + "(" + (logOnPass ? (logOnNotPass ? "pass, fail)" : "pass)") : (logOnNotPass ? "fail)" : ")")); } - /** - * Subclasses implement this to do some completion action + /** + * Subclasses implement this to do some completion action * @param run the IRunStatus for this completed run * @param result the StreamsHandler.Result (if any - may be null) */ public abstract void doRunCompleted(IRunStatus run, StreamsHandler.Result result); } -/** +/** * Write XML for any test passed and/or failed. * Must register with Runner for RunSpecIterator.class, * most sensibly AjcTest.class. */ class XmlLogger extends TestCompleteListener { - /** + /** * @param printer the component that prints any status - not null * @param runValidator if null, use RunValidator.NORMAL */ public XmlLogger( String label, - StreamsHandler streamsHandler, + StreamsHandler streamsHandler, IRunValidator runValidator) { super(label, runValidator, streamsHandler); } - + public void doRunCompleted(IRunStatus run, StreamsHandler.Result result) { PrintStream out = streamsHandler.getLogStream(); out.println(""); XMLWriter writer = new XMLWriter(new PrintWriter(out, true)); Object id = run.getIdentifier(); - if (!(id instanceof Runner.IteratorWrapper)) { - out.println(this + " not IteratorWrapper: " + if (!(id instanceof Runner.IteratorWrapper)) { + out.println(this + " not IteratorWrapper: " + id.getClass().getName() + ": " + id); return; } IRunIterator iter = ((Runner.IteratorWrapper) id).iterator; - if (!(iter instanceof RunSpecIterator)) { + if (!(iter instanceof RunSpecIterator)) { out.println(this + " not RunSpecIterator: " + iter.getClass().getName() + ": " + iter); return; @@ -1283,7 +1294,7 @@ class XmlLogger extends TestCompleteListener { ((RunSpecIterator) iter).spec.writeXml(writer); out.flush(); } - + } /** @@ -1308,18 +1319,18 @@ class JUnitXMLLogger extends TestCompleteListener { private int numFails = 0; private DecimalFormat timeFormatter = new DecimalFormat("#.##"); - public JUnitXMLLogger( + public JUnitXMLLogger( String label, - StreamsHandler streamsHandler, + StreamsHandler streamsHandler, IRunValidator runValidator) { super(label + ALL, runValidator, streamsHandler); - junitOutput = new StringBuffer(); + junitOutput = new StringBuffer(); } - + /* (non-Javadoc) * @see org.aspectj.testing.drivers.TestCompleteListener#doRunCompleted(org.aspectj.testing.run.IRunStatus, org.aspectj.testing.util.StreamsHandler.Result) */ - public void doRunCompleted(IRunStatus run, Result result) { + public void doRunCompleted(IRunStatus run, Result result) { long duration = System.currentTimeMillis() - startTimeMillis; numTests++; junitOutput.append("<testcase name=\"" + run.getIdentifier() + "\" "); @@ -1340,7 +1351,7 @@ class JUnitXMLLogger extends TestCompleteListener { * @see org.aspectj.testing.drivers.TestCompleteListener#runStarted(org.aspectj.testing.run.IRunStatus) */ public void runStarting(IRunStatus run) { - super.runStarting(run); + super.runStarting(run); startTimeMillis = System.currentTimeMillis(); } @@ -1354,12 +1365,12 @@ class JUnitXMLLogger extends TestCompleteListener { suiteName = suiteName.substring(0,suiteName.indexOf('.')); PrintStream out = streamsHandler.getLogStream(); out.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); - String timeStr = new DecimalFormat("#.##").format(duration/1000.0); + String timeStr = new DecimalFormat("#.##").format(duration/1000.0); out.print("<testsuite errors=\"" + numFails + "\" failures=\"0\" "); out.print("name=\"" + suite.getName() + "\" " ); out.println("tests=\"" + numTests + "\" time=\"" + timeStr + "\">"); out.print(junitOutput.toString()); - out.println("</testsuite>"); + out.println("</testsuite>"); } /* (non-Javadoc) @@ -1380,7 +1391,7 @@ class RunLogger extends TestCompleteListener { final boolean logStreams; final RunUtils.IRunStatusPrinter printer; - /** + /** * @param printer the component that prints any status - not null * @param runValidator if null, use RunValidator.NORMAL */ @@ -1403,11 +1414,11 @@ class RunLogger extends TestCompleteListener { if (logStreams) { if (!LangUtil.isEmpty(result.err)) { out.println("--- error"); - out.println(result.err); + out.println(result.err); } if (!LangUtil.isEmpty(result.out)) { out.println("--- ouput"); - out.println(result.out); + out.println(result.out); } } out.println(""); @@ -1420,7 +1431,7 @@ class TestTraceLogger extends TestCompleteListener { private long startTime; private long startMemoryFree; private final boolean verbose; - + public TestTraceLogger(StreamsHandler handler) { this(handler, true); } @@ -1431,9 +1442,9 @@ class TestTraceLogger extends TestCompleteListener { public void runStarting(IRunStatus run) { super.runStarting(run); startTime = System.currentTimeMillis(); - startMemoryFree = runtime.freeMemory(); + startMemoryFree = runtime.freeMemory(); } - + public void doRunCompleted(IRunStatus run, StreamsHandler.Result result) { long elapsed = System.currentTimeMillis() - startTime; long free = runtime.freeMemory(); @@ -1449,19 +1460,19 @@ class TestTraceLogger extends TestCompleteListener { } out.println(label + renderId(run)); } - + /** @return true - always trace tests */ protected boolean isFailLabel(String label) { return true; } - + /** @return true - always trace tests */ protected boolean isPassLabel(String label) { return true; } /** - * This implementation returns run identifier toString(). + * This implementation returns run identifier toString(). * Subclasses override this to render id as message suffix. */ protected String renderId(IRunStatus run) { @@ -1477,7 +1488,7 @@ class TestTraceLogger extends TestCompleteListener { // StringBuffer sb = new StringBuffer(); // for (Iterator iter = files.iterator(); iter.hasNext();) { // File file = (File) iter.next(); -// sb.append(" " + file.getPath().replace('\\','/').substring(2)); +// sb.append(" " + file.getPath().replace('\\','/').substring(2)); // } // out.println("files: " + sb); // } diff --git a/util/src/main/java/org/aspectj/util/Reflection.java b/util/src/main/java/org/aspectj/util/Reflection.java index 83ceaac23..3650962cc 100644 --- a/util/src/main/java/org/aspectj/util/Reflection.java +++ b/util/src/main/java/org/aspectj/util/Reflection.java @@ -14,7 +14,7 @@ package org.aspectj.util; import java.io.File; -import java.lang.reflect.*; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.net.URL; import java.util.ArrayList; diff --git a/util/src/main/java/org/aspectj/util/SoftHashMap.java b/util/src/main/java/org/aspectj/util/SoftHashMap.java index 94ae83441..7660525d1 100644 --- a/util/src/main/java/org/aspectj/util/SoftHashMap.java +++ b/util/src/main/java/org/aspectj/util/SoftHashMap.java @@ -7,8 +7,12 @@ * http://www.eclipse.org/legal/epl-v10.html * ******************************************************************/package org.aspectj.util; -import java.lang.ref.*; -import java.util.*; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.SoftReference; +import java.util.AbstractMap; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; public class SoftHashMap<K,V> extends AbstractMap<K,V> { private Map<K, SpecialValue> map; diff --git a/util/src/test/java/org/aspectj/util/UtilModuleTests.java b/util/src/test/java/org/aspectj/util/UtilModuleTests.java index 91afd3857..73cb4b77f 100644 --- a/util/src/test/java/org/aspectj/util/UtilModuleTests.java +++ b/util/src/test/java/org/aspectj/util/UtilModuleTests.java @@ -12,8 +12,9 @@ * ******************************************************************/ package org.aspectj.util; -import junit.framework.*; import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; public class UtilModuleTests extends TestCase { diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelRenderer.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelRenderer.java index e1f99439f..a18047812 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelRenderer.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelRenderer.java @@ -12,8 +12,6 @@ package org.aspectj.weaver.bcel; -import java.lang.reflect.Modifier; - import org.aspectj.apache.bcel.Constants; import org.aspectj.apache.bcel.generic.InstructionFactory; import org.aspectj.apache.bcel.generic.InstructionHandle; diff --git a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java index f83a79379..1b68d27d5 100644 --- a/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java +++ b/weaver/src/main/java/org/aspectj/weaver/bcel/BcelWeaver.java @@ -53,7 +53,6 @@ import org.aspectj.util.FileUtil; import org.aspectj.util.FuzzyBoolean; import org.aspectj.weaver.Advice; import org.aspectj.weaver.AdviceKind; -import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; import org.aspectj.weaver.AnnotationAJ; import org.aspectj.weaver.AnnotationOnTypeMunger; import org.aspectj.weaver.BCException; diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java index 7ff275fd7..bfef1244b 100644 --- a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java +++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/DocumentParser.java @@ -22,7 +22,6 @@ import javax.xml.parsers.SAXParserFactory; import org.aspectj.util.LangUtil; import org.aspectj.weaver.loadtime.definition.Definition.AdviceKind; -import org.aspectj.weaver.loadtime.definition.Definition.DeclareAnnotation; import org.aspectj.weaver.loadtime.definition.Definition.DeclareAnnotationKind; import org.xml.sax.Attributes; import org.xml.sax.InputSource; diff --git a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java index bcd6ddcd0..55166f737 100644 --- a/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java +++ b/weaver/src/main/java/org/aspectj/weaver/loadtime/definition/SimpleAOPParser.java @@ -17,7 +17,6 @@ import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.Map; -import java.util.Set; import org.aspectj.util.LangUtil; import org.aspectj.weaver.loadtime.definition.Definition.AdviceKind; diff --git a/weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java b/weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java index b281d412f..8e18dadde 100644 --- a/weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java +++ b/weaver/src/main/java/org/aspectj/weaver/tools/cache/WeavedClassCache.java @@ -13,15 +13,15 @@ package org.aspectj.weaver.tools.cache; +import java.util.LinkedList; +import java.util.List; + import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHandler; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageUtil; import org.aspectj.weaver.tools.GeneratedClassHandler; -import java.util.LinkedList; -import java.util.List; - /** * Manages a cache of weaved and generated classes similar to Eclipse Equinox, * except designed to operate across multiple restarts of the JVM and with one diff --git a/weaver/src/test/java/org/aspectj/weaver/AbstractTraceTest.java b/weaver/src/test/java/org/aspectj/weaver/AbstractTraceTest.java index 334690b62..1f54c6791 100644 --- a/weaver/src/test/java/org/aspectj/weaver/AbstractTraceTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/AbstractTraceTest.java @@ -12,12 +12,12 @@ package org.aspectj.weaver; import java.util.ArrayList; -import junit.framework.TestCase; - import org.aspectj.weaver.tools.AbstractTrace; import org.aspectj.weaver.tools.DefaultTrace; import org.aspectj.weaver.tools.Traceable; +import junit.framework.TestCase; + public abstract class AbstractTraceTest extends TestCase { protected AbstractTrace trace; diff --git a/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java index 403b2ecb1..0db381439 100644 --- a/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/BoundedReferenceTypeTestCase.java @@ -11,10 +11,10 @@ * ******************************************************************/ package org.aspectj.weaver; -import junit.framework.TestCase; - import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + public class BoundedReferenceTypeTestCase extends TestCase { ReferenceType javaLangClass; diff --git a/weaver/src/test/java/org/aspectj/weaver/CommonsTraceFactoryTest.java b/weaver/src/test/java/org/aspectj/weaver/CommonsTraceFactoryTest.java index ecdaf63de..b8b451329 100644 --- a/weaver/src/test/java/org/aspectj/weaver/CommonsTraceFactoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/CommonsTraceFactoryTest.java @@ -10,11 +10,11 @@ *******************************************************************************/ package org.aspectj.weaver; -import junit.framework.TestCase; - import org.aspectj.weaver.tools.CommonsTraceFactory; import org.aspectj.weaver.tools.Trace; +import junit.framework.TestCase; + public class CommonsTraceFactoryTest extends TestCase { public void testGetTraceFactory() { diff --git a/weaver/src/test/java/org/aspectj/weaver/DumpTestCase.java b/weaver/src/test/java/org/aspectj/weaver/DumpTestCase.java index affd39c2c..752473533 100644 --- a/weaver/src/test/java/org/aspectj/weaver/DumpTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/DumpTestCase.java @@ -15,13 +15,13 @@ import java.io.File; import java.io.FileReader; import java.io.IOException; -import junit.framework.TestCase; - import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessageHolder; import org.aspectj.bridge.Message; import org.aspectj.bridge.MessageHandler; +import junit.framework.TestCase; + /** * @author websterm * diff --git a/weaver/src/test/java/org/aspectj/weaver/GenericSignatureParserTest.java b/weaver/src/test/java/org/aspectj/weaver/GenericSignatureParserTest.java index e5948eb40..433eb2c1f 100644 --- a/weaver/src/test/java/org/aspectj/weaver/GenericSignatureParserTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/GenericSignatureParserTest.java @@ -10,13 +10,13 @@ * ******************************************************************/ package org.aspectj.weaver; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.Method; import org.aspectj.apache.bcel.util.SyntheticRepository; import org.aspectj.util.GenericSignatureParser; +import junit.framework.TestCase; + /** * @author Adrian Colyer * @author Andy Clement diff --git a/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceFactoryTest.java b/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceFactoryTest.java index cec4d6a3d..a6ef8f91c 100644 --- a/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceFactoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/Jdk14TraceFactoryTest.java @@ -10,11 +10,11 @@ *******************************************************************************/ package org.aspectj.weaver; -import junit.framework.TestCase; - import org.aspectj.weaver.tools.Jdk14TraceFactory; import org.aspectj.weaver.tools.Trace; +import junit.framework.TestCase; + public class Jdk14TraceFactoryTest extends TestCase { public void testJdk14TraceFactory() { diff --git a/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java b/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java index 143de7333..30d653b89 100644 --- a/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/JoinPointSignatureIteratorTest.java @@ -17,10 +17,10 @@ import java.util.Iterator; import java.util.List; import java.util.Map; -import junit.framework.TestCase; - import org.aspectj.weaver.reflect.ReflectionWorld; +import junit.framework.TestCase; + /** * @author Andy Clement */ diff --git a/weaver/src/test/java/org/aspectj/weaver/LocaleTest.java b/weaver/src/test/java/org/aspectj/weaver/LocaleTest.java index e69a4df93..a79afef72 100644 --- a/weaver/src/test/java/org/aspectj/weaver/LocaleTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/LocaleTest.java @@ -13,11 +13,11 @@ package org.aspectj.weaver; import java.io.IOException; import java.util.Locale; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.generic.Instruction; import org.aspectj.apache.bcel.util.ByteSequence; +import junit.framework.TestCase; + public class LocaleTest extends TestCase { public LocaleTest(String name) { diff --git a/weaver/src/test/java/org/aspectj/weaver/MemberTestCase.java b/weaver/src/test/java/org/aspectj/weaver/MemberTestCase.java index c4755a3db..9b5171a3f 100644 --- a/weaver/src/test/java/org/aspectj/weaver/MemberTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/MemberTestCase.java @@ -16,10 +16,10 @@ package org.aspectj.weaver; import java.lang.reflect.Modifier; -import junit.framework.TestCase; - import org.aspectj.testing.util.TestUtil; +import junit.framework.TestCase; + /** * This is a test case for all the portions of Member that don't require a world. */ diff --git a/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java index 5fbc530e7..d4ed852d2 100644 --- a/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/ReferenceTypeTestCase.java @@ -16,11 +16,11 @@ import java.util.ArrayList; import java.util.List; import java.util.Random; -import junit.framework.TestCase; - import org.aspectj.util.PartialOrder; import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + // test cases for Adrian's additions to ReferenceType // XXX - couldn't find any unit test cases for the rest of the ReferenceType class public class ReferenceTypeTestCase extends TestCase { diff --git a/weaver/src/test/java/org/aspectj/weaver/TypeVariableReferenceTypeTestCase.java b/weaver/src/test/java/org/aspectj/weaver/TypeVariableReferenceTypeTestCase.java index 367a4fc93..d746b302c 100644 --- a/weaver/src/test/java/org/aspectj/weaver/TypeVariableReferenceTypeTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/TypeVariableReferenceTypeTestCase.java @@ -11,10 +11,10 @@ * ******************************************************************/ package org.aspectj.weaver; -import junit.framework.TestCase; - import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + /** * @author colyer * diff --git a/weaver/src/test/java/org/aspectj/weaver/TypeVariableTestCase.java b/weaver/src/test/java/org/aspectj/weaver/TypeVariableTestCase.java index 8ef8f70c1..8a9e63740 100644 --- a/weaver/src/test/java/org/aspectj/weaver/TypeVariableTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/TypeVariableTestCase.java @@ -11,10 +11,10 @@ * ******************************************************************/ package org.aspectj.weaver; -import junit.framework.TestCase; - import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + public class TypeVariableTestCase extends TestCase { private UnresolvedType javaLangNumber; diff --git a/weaver/src/test/java/org/aspectj/weaver/TypeXTestCase.java b/weaver/src/test/java/org/aspectj/weaver/TypeXTestCase.java index dc4c2e3d1..d6b60eb5f 100644 --- a/weaver/src/test/java/org/aspectj/weaver/TypeXTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/TypeXTestCase.java @@ -13,12 +13,12 @@ package org.aspectj.weaver; -import junit.framework.TestCase; - import org.aspectj.testing.util.TestUtil; import org.aspectj.util.LangUtil; import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + /** * This is a test case for all the portions of UnresolvedType that don't require a world. */ diff --git a/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java b/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java index ffbe329df..78566e523 100644 --- a/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java +++ b/weaver/src/test/java/org/aspectj/weaver/WeaverModuleTests.java @@ -13,12 +13,58 @@ package org.aspectj.weaver; import org.aspectj.matcher.tools.ReflectionWorldAdvancedPointcutExpressionTest; import org.aspectj.util.LangUtil; -import org.aspectj.weaver.bcel.*; -import org.aspectj.weaver.patterns.*; -import org.aspectj.weaver.patterns.bcel.*; -import org.aspectj.weaver.reflect.*; -import org.aspectj.weaver.tools.*; -import org.aspectj.weaver.tools.cache.*; +import org.aspectj.weaver.bcel.AfterReturningWeaveTestCase; +import org.aspectj.weaver.bcel.AfterThrowingWeaveTestCase; +import org.aspectj.weaver.bcel.AfterWeaveTestCase; +import org.aspectj.weaver.bcel.ArgsWeaveTestCase; +import org.aspectj.weaver.bcel.AroundArgsWeaveTestCase; +import org.aspectj.weaver.bcel.AroundWeaveTestCase; +import org.aspectj.weaver.bcel.BcelGenericSignatureToTypeXTestCase; +import org.aspectj.weaver.bcel.BcelWorldReferenceTypeTest; +import org.aspectj.weaver.bcel.BeforeWeaveTestCase; +import org.aspectj.weaver.bcel.CheckerTestCase; +import org.aspectj.weaver.bcel.ClassLoaderRepositoryTest; +import org.aspectj.weaver.bcel.FieldSetTestCase; +import org.aspectj.weaver.bcel.HierarchyDependsTestCase; +import org.aspectj.weaver.bcel.IdWeaveTestCase; +import org.aspectj.weaver.bcel.JImageTestCase; +import org.aspectj.weaver.bcel.MegaZipTestCase; +import org.aspectj.weaver.bcel.MoveInstructionsWeaveTestCase; +import org.aspectj.weaver.bcel.NonstaticWeaveTestCase; +import org.aspectj.weaver.bcel.PatternWeaveTestCase; +import org.aspectj.weaver.bcel.PointcutResidueTestCase; +import org.aspectj.weaver.bcel.TjpWeaveTestCase; +import org.aspectj.weaver.bcel.TraceJarWeaveTestCase; +import org.aspectj.weaver.bcel.UtilityTestCase; +import org.aspectj.weaver.bcel.WeaveOrderTestCase; +import org.aspectj.weaver.bcel.WorldTestCase; +import org.aspectj.weaver.bcel.ZipTestCase; +import org.aspectj.weaver.patterns.AnnotationPatternMatchingTestCase; +import org.aspectj.weaver.patterns.AnnotationPatternTestCase; +import org.aspectj.weaver.patterns.ConcretizationTestCase; +import org.aspectj.weaver.patterns.WildTypePatternResolutionTestCase; +import org.aspectj.weaver.patterns.bcel.BcelAndOrNotTestCase; +import org.aspectj.weaver.patterns.bcel.BcelBindingTestCase; +import org.aspectj.weaver.patterns.bcel.BcelModifiersPatternTestCase; +import org.aspectj.weaver.patterns.bcel.BcelParserTestCase; +import org.aspectj.weaver.patterns.bcel.BcelSignaturePatternTestCase; +import org.aspectj.weaver.patterns.bcel.BcelTypePatternListTestCase; +import org.aspectj.weaver.patterns.bcel.BcelTypePatternTestCase; +import org.aspectj.weaver.patterns.bcel.BcelWithinTestCase; +import org.aspectj.weaver.reflect.ReflectionWorldReferenceTypeTest; +import org.aspectj.weaver.reflect.ReflectionWorldTest; +import org.aspectj.weaver.tools.Java15PointcutExpressionTest; +import org.aspectj.weaver.tools.PointcutDesignatorHandlerTest; +import org.aspectj.weaver.tools.PointcutExpressionTest; +import org.aspectj.weaver.tools.PointcutParserTest; +import org.aspectj.weaver.tools.ReadingAttributesTest; +import org.aspectj.weaver.tools.TypePatternMatcherTest; +import org.aspectj.weaver.tools.cache.DefaultCacheKeyResolverTest; +import org.aspectj.weaver.tools.cache.DefaultFileCacheBackingTest; +import org.aspectj.weaver.tools.cache.FlatFileCacheBackingTest; +import org.aspectj.weaver.tools.cache.SimpleClassCacheTest; +import org.aspectj.weaver.tools.cache.WeavedClassCacheTest; +import org.aspectj.weaver.tools.cache.ZippedFileCacheBackingTest; import junit.framework.Test; import junit.framework.TestCase; diff --git a/weaver/src/test/java/org/aspectj/weaver/WeaverTestCase.java b/weaver/src/test/java/org/aspectj/weaver/WeaverTestCase.java index 152cae782..6cbc8e7ee 100644 --- a/weaver/src/test/java/org/aspectj/weaver/WeaverTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/WeaverTestCase.java @@ -14,12 +14,10 @@ package org.aspectj.weaver; import java.io.File; -import junit.framework.Test; -import junit.framework.TestCase; -import junit.framework.TestSuite; - import org.aspectj.util.FileUtil; +import junit.framework.TestCase; + public abstract class WeaverTestCase extends TestCase { public static final String TESTDATA_PATH = "../weaver/testdata"; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/AfterWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/AfterWeaveTestCase.java index a51c69b9a..04c68afde 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/AfterWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/AfterWeaveTestCase.java @@ -13,7 +13,7 @@ package org.aspectj.weaver.bcel; -import java.io.*; +import java.io.IOException; public class AfterWeaveTestCase extends WeaveTestCase { { diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java index 03ded4f6d..5e44c0080 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/BcelGenericSignatureToTypeXTestCase.java @@ -11,19 +11,19 @@ * ******************************************************************/ package org.aspectj.weaver.bcel; -import junit.framework.TestCase; - import java.util.Arrays; import org.aspectj.apache.bcel.Repository; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.Signature; import org.aspectj.util.GenericSignature; +import org.aspectj.util.GenericSignature.ClassSignature; import org.aspectj.util.GenericSignatureParser; import org.aspectj.util.LangUtil; -import org.aspectj.util.GenericSignature.ClassSignature; import org.aspectj.weaver.UnresolvedType; +import junit.framework.TestCase; + /** * @author colyer * diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/CheckerTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/CheckerTestCase.java index b503e9593..7ec480c87 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/CheckerTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/CheckerTestCase.java @@ -15,10 +15,10 @@ package org.aspectj.weaver.bcel; import java.io.IOException; +import org.aspectj.bridge.IMessage; +import org.aspectj.bridge.MessageHandler; import org.aspectj.weaver.Checker; import org.aspectj.weaver.patterns.DeclareErrorOrWarning; -import org.aspectj.bridge.*; -import org.aspectj.bridge.MessageHandler; public class CheckerTestCase extends WeaveTestCase { { diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java b/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java index 2af341d22..a65a25c54 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/ClassLoaderRepositoryTest.java @@ -23,10 +23,10 @@ import java.util.Map; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.util.ClassLoaderRepository; +import junit.framework.TestCase; + /** NOT YET INCLUDED IN A FULL TEST RUN - WORK IN PROGRESS CHECKING CLASSLOADERREPOSITORY OPTIMIZATIONS */ public class ClassLoaderRepositoryTest extends TestCase { private File f; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.java index ba71761b4..4e24bb555 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/MegaZipTestCase.java @@ -19,12 +19,12 @@ import java.util.ArrayList; import java.util.List; import org.aspectj.weaver.AdviceKind; -import org.aspectj.weaver.WeaverTestCase; import org.aspectj.weaver.Member; import org.aspectj.weaver.MemberImpl; import org.aspectj.weaver.Shadow; import org.aspectj.weaver.ShadowMunger; import org.aspectj.weaver.UnresolvedType; +import org.aspectj.weaver.WeaverTestCase; public class MegaZipTestCase extends WeaveTestCase { diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/NonstaticWeaveTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/NonstaticWeaveTestCase.java index 1f67a6249..29e1ac8d7 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/NonstaticWeaveTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/NonstaticWeaveTestCase.java @@ -15,8 +15,13 @@ package org.aspectj.weaver.bcel; import java.io.IOException; -import org.aspectj.weaver.*; -import org.aspectj.weaver.patterns.*; +import org.aspectj.weaver.CrosscuttingMembers; +import org.aspectj.weaver.ResolvedType; +import org.aspectj.weaver.ShadowMunger; +import org.aspectj.weaver.patterns.PatternParser; +import org.aspectj.weaver.patterns.PerClause; +import org.aspectj.weaver.patterns.PerSingleton; +import org.aspectj.weaver.patterns.TestScope; public class NonstaticWeaveTestCase extends WeaveTestCase { { diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/UtilityTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/UtilityTestCase.java index 8083c1532..4fe6fb661 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/UtilityTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/UtilityTestCase.java @@ -12,7 +12,7 @@ package org.aspectj.weaver.bcel; -import java.io.*; +import java.io.IOException; import junit.framework.TestCase; diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveOrderTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveOrderTestCase.java index f22805f11..6847fb9d2 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveOrderTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/WeaveOrderTestCase.java @@ -13,8 +13,14 @@ package org.aspectj.weaver.bcel; -import org.aspectj.weaver.patterns.*; -import org.aspectj.weaver.*; +import org.aspectj.weaver.Advice; +import org.aspectj.weaver.AdviceKind; +import org.aspectj.weaver.CrosscuttingMembers; +import org.aspectj.weaver.MemberImpl; +import org.aspectj.weaver.ResolvedType; +import org.aspectj.weaver.UnresolvedType; +import org.aspectj.weaver.patterns.Declare; +import org.aspectj.weaver.patterns.PatternParser; /**. */ diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/WorldTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/WorldTestCase.java index 65d079543..8e7aa1448 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/WorldTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/WorldTestCase.java @@ -15,7 +15,6 @@ package org.aspectj.weaver.bcel; import java.lang.reflect.Modifier; import org.aspectj.weaver.Advice; -import org.aspectj.weaver.WeaverTestCase; import org.aspectj.weaver.CommonWorldTests; import org.aspectj.weaver.Member; import org.aspectj.weaver.MemberImpl; @@ -24,6 +23,7 @@ import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.ShadowMunger; import org.aspectj.weaver.TestUtils; import org.aspectj.weaver.UnresolvedType; +import org.aspectj.weaver.WeaverTestCase; import org.aspectj.weaver.World; /** diff --git a/weaver/src/test/java/org/aspectj/weaver/bcel/ZipTestCase.java b/weaver/src/test/java/org/aspectj/weaver/bcel/ZipTestCase.java index 71f3bc926..bf1453a49 100644 --- a/weaver/src/test/java/org/aspectj/weaver/bcel/ZipTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/bcel/ZipTestCase.java @@ -16,10 +16,10 @@ import java.io.File; import java.io.IOException; import java.util.Collection; -import junit.framework.TestCase; - import org.aspectj.weaver.WeaverTestCase; +import junit.framework.TestCase; + public class ZipTestCase extends TestCase { File outDir; diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java index 753e7a6b0..6852da6b7 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternMatchingTestCase.java @@ -14,18 +14,18 @@ package org.aspectj.weaver.patterns; import java.util.ArrayList; import java.util.List; -import junit.framework.TestCase; - import org.aspectj.bridge.AbortException; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessage.Kind; import org.aspectj.bridge.IMessageHandler; import org.aspectj.util.LangUtil; -import org.aspectj.weaver.WeaverTestCase; import org.aspectj.weaver.ResolvedMember; import org.aspectj.weaver.ResolvedType; +import org.aspectj.weaver.WeaverTestCase; import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + /* * Sample types that this program uses are: diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java index 899b40b8e..fdf8d5424 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/AnnotationPatternTestCase.java @@ -9,17 +9,17 @@ * ******************************************************************/ package org.aspectj.weaver.patterns; -import junit.framework.TestCase; - import org.aspectj.bridge.AbortException; import org.aspectj.util.LangUtil; import org.aspectj.weaver.AnnotatedElement; import org.aspectj.weaver.AnnotationAJ; -import org.aspectj.weaver.WeaverTestCase; import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.UnresolvedType; +import org.aspectj.weaver.WeaverTestCase; import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + public class AnnotationPatternTestCase extends TestCase { public void testParseSimpleAnnotationPattern() { diff --git a/weaver/src/test/java/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java b/weaver/src/test/java/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java index 5eda5d577..73f4854af 100644 --- a/weaver/src/test/java/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java +++ b/weaver/src/test/java/org/aspectj/weaver/patterns/WildTypePatternResolutionTestCase.java @@ -15,8 +15,7 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; -import junit.framework.TestCase; - +import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; import org.aspectj.weaver.BoundedReferenceType; import org.aspectj.weaver.CompressingDataOutputStream; import org.aspectj.weaver.ResolvedType; @@ -24,9 +23,10 @@ import org.aspectj.weaver.TypeFactory; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.World; -import org.aspectj.weaver.AjAttribute.WeaverVersionInfo; import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + // TODO write test cases for instanceof matching public class WildTypePatternResolutionTestCase extends TestCase { diff --git a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java index 72c7c85f7..a0465b34a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/reflect/ReflectionBasedReferenceTypeDelegateTest.java @@ -15,8 +15,6 @@ import java.lang.reflect.Method; import java.util.HashSet; import java.util.Set; -import junit.framework.TestCase; - import org.aspectj.bridge.IMessageHandler; import org.aspectj.weaver.ReferenceType; import org.aspectj.weaver.ResolvedMember; @@ -24,6 +22,8 @@ import org.aspectj.weaver.ResolvedType; import org.aspectj.weaver.UnresolvedType; import org.aspectj.weaver.bcel.BcelWorld; +import junit.framework.TestCase; + public abstract class ReflectionBasedReferenceTypeDelegateTest extends TestCase { protected ReflectionWorld world; diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java index f651a2f29..e1a140803 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java @@ -39,12 +39,11 @@ import org.aspectj.weaver.patterns.TypePattern; import org.aspectj.weaver.patterns.TypePatternList; import org.aspectj.weaver.patterns.WildAnnotationTypePattern; -import test.A1AnnotatedType; -import test.A2AnnotatedType; - import junit.framework.Test; import junit.framework.TestCase; import junit.framework.TestSuite; +import test.A1AnnotatedType; +import test.A2AnnotatedType; /** * Test parameter pointcut parsing. Extended by Andy Clement to cover parameter annotation matching. diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutDesignatorHandlerTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutDesignatorHandlerTest.java index 83d7b461d..ca9835c29 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutDesignatorHandlerTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutDesignatorHandlerTest.java @@ -11,10 +11,10 @@ * ******************************************************************/ package org.aspectj.weaver.tools; -import junit.framework.TestCase; - import org.aspectj.util.LangUtil; +import junit.framework.TestCase; + /** * @author Adrian Colyer * diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutExpressionTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutExpressionTest.java index 46189fd32..ab7762525 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutExpressionTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutExpressionTest.java @@ -14,10 +14,10 @@ import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; -import junit.framework.TestCase; - import org.aspectj.util.LangUtil; +import junit.framework.TestCase; + public class PointcutExpressionTest extends TestCase { PointcutParser p; diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java index 4654b049d..9488a5e90 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/PointcutParserTest.java @@ -13,9 +13,6 @@ import java.util.HashSet; import java.util.Properties; import java.util.Set; -import junit.framework.Assert; -import junit.framework.TestCase; - import org.aspectj.bridge.AbortException; import org.aspectj.bridge.IMessage; import org.aspectj.bridge.IMessage.Kind; @@ -25,6 +22,9 @@ import org.aspectj.weaver.patterns.PatternParser; import org.aspectj.weaver.patterns.Pointcut; import org.aspectj.weaver.patterns.PointcutRewriter; +import junit.framework.Assert; +import junit.framework.TestCase; + /** * Test cases for the PointcutParser class */ diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/ReadingAttributesTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/ReadingAttributesTest.java index 5814aa90f..11f74ebc1 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/ReadingAttributesTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/ReadingAttributesTest.java @@ -15,8 +15,6 @@ import java.io.ByteArrayInputStream; import java.io.File; import java.io.IOException; -import junit.framework.TestCase; - import org.aspectj.apache.bcel.classfile.Attribute; import org.aspectj.apache.bcel.classfile.JavaClass; import org.aspectj.apache.bcel.classfile.Unknown; @@ -25,6 +23,8 @@ import org.aspectj.apache.bcel.util.SyntheticRepository; import org.aspectj.weaver.VersionedDataInputStream; import org.aspectj.weaver.WeaverStateInfo; +import junit.framework.TestCase; + public class ReadingAttributesTest extends TestCase { public void testSkip() {} // Review what to do about these tests diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/AbstractCacheBackingTestSupport.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/AbstractCacheBackingTestSupport.java index d66626f5c..3539ede2a 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/AbstractCacheBackingTestSupport.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/AbstractCacheBackingTestSupport.java @@ -27,12 +27,12 @@ import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import junit.framework.TestCase; - import org.aspectj.util.FileUtil; import org.aspectj.util.LangUtil; import org.aspectj.weaver.tools.cache.AbstractIndexedFileCacheBacking.IndexEntry; +import junit.framework.TestCase; + /** */ public abstract class AbstractCacheBackingTestSupport extends TestCase { diff --git a/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java b/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java index 139488b3c..1e240eee3 100644 --- a/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java +++ b/weaver/src/test/java/org/aspectj/weaver/tools/cache/DefaultCacheKeyResolverTest.java @@ -12,13 +12,13 @@ package org.aspectj.weaver.tools.cache; -import junit.framework.TestCase; - import java.net.URL; import java.net.URLClassLoader; import java.util.Arrays; import java.util.Collections; +import junit.framework.TestCase; + /** */ public class DefaultCacheKeyResolverTest extends TestCase { diff --git a/weaver/src/test/java/test/A3.java b/weaver/src/test/java/test/A3.java index ab54388ae..71678c531 100644 --- a/weaver/src/test/java/test/A3.java +++ b/weaver/src/test/java/test/A3.java @@ -11,7 +11,8 @@ * ******************************************************************/ package test; -import java.lang.annotation.*; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; @Retention(RetentionPolicy.RUNTIME) public @interface A3 { |