From 305b0d18b1ac1b2d938005bcc2c5ff5ea651dd8c Mon Sep 17 00:00:00 2001 From: acolyer Date: Fri, 23 Jan 2004 10:29:35 +0000 Subject: [PATCH] spring cleaning in advance of 1.2 enhancements: removed unused imports, local variables, and private methods (still there, just commented out). --- ajde/src/org/aspectj/ajde/Ajde.java | 2 +- .../ajde/internal/AspectJBuildManager.java | 12 +- .../ajde/internal/BuildNotifierAdapter.java | 4 +- .../ajde/internal/CompilerAdapter.java | 2 +- .../internal/LstBuildConfigFileUpdater.java | 22 +-- .../ajde/internal/LstBuildConfigManager.java | 20 +- .../org/aspectj/ajde/ui/BuildConfigNode.java | 12 +- .../aspectj/ajde/ui/StructureModelUtil.java | 108 +++++------ .../ajde/ui/StructureSearchManager.java | 2 +- .../aspectj/ajde/ui/StructureViewManager.java | 2 +- .../ui/internal/TreeStructureViewBuilder.java | 118 ++++++------ .../aspectj/ajde/ui/swing/AjdeUIManager.java | 4 +- .../swing/BrowserStructureViewToolPanel.java | 24 +-- .../ajde/ui/swing/BrowserViewManager.java | 16 +- .../ui/swing/BrowserViewTreeListener.java | 18 +- .../ajde/ui/swing/BuildOptionsPanel.java | 4 +- .../aspectj/ajde/ui/swing/OptionsFrame.java | 8 +- .../aspectj/ajde/ui/swing/PointcutWizard.java | 180 +++++++++--------- .../ajde/ui/swing/StructureTreeManager.java | 2 +- .../ajde/ui/swing/SwingTreeViewNode.java | 2 +- .../ui/swing/TreeViewBuildConfigEditor.java | 2 +- .../ui/swing/UpdateConfigurationDialog.java | 4 +- .../org/aspectj/ajde/AsmDeclarationsTest.java | 8 +- .../aspectj/ajde/AsmRelationshipsTest.java | 4 +- .../aspectj/ajde/BuildConfigurationTests.java | 4 +- .../aspectj/ajde/CompilerMessagesTest.java | 2 +- .../org/aspectj/ajde/InpathTestcase.java | 96 +++++----- .../org/aspectj/ajde/TestBuildListener.java | 2 +- .../internal/LstBuildConfigManagerTest.java | 66 +++---- .../ajde/ui/StructureSearchManagerTest.java | 4 +- 30 files changed, 377 insertions(+), 377 deletions(-) diff --git a/ajde/src/org/aspectj/ajde/Ajde.java b/ajde/src/org/aspectj/ajde/Ajde.java index 687f8bbbd..644f1c11d 100644 --- a/ajde/src/org/aspectj/ajde/Ajde.java +++ b/ajde/src/org/aspectj/ajde/Ajde.java @@ -308,7 +308,7 @@ public class Ajde { * The strucutre model is annotated with error messages after an unsuccessful compile. */ public void compileFinished(String buildConfig, int buildTime, boolean succeeded, boolean warnings) { - String configFilePath = projectProperties.getDefaultBuildConfigFile(); +// String configFilePath = projectProperties.getDefaultBuildConfigFile(); if (!succeeded) { AsmManager.getDefault().fireModelUpdated(); } diff --git a/ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java b/ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java index 8006af593..2b6179831 100644 --- a/ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java +++ b/ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java @@ -35,7 +35,7 @@ public class AspectJBuildManager implements BuildManager { private String configFile = ""; private String lastConfigFile = null; private int lastCompileTime = 50; - private boolean buildStructureOnly = false; +// private boolean buildStructureOnly = false; private boolean buildModelMode = true; public AspectJBuildManager( @@ -134,11 +134,11 @@ public class AspectJBuildManager implements BuildManager { } } - private void notifyCompileAborted(String configFile, String message) { - for (Iterator it = compilerListeners.iterator(); it.hasNext(); ) { - ((BuildListener)it.next()).compileAborted(configFile, message); - } - } +// private void notifyCompileAborted(String configFile, String message) { +// for (Iterator it = compilerListeners.iterator(); it.hasNext(); ) { +// ((BuildListener)it.next()).compileAborted(configFile, message); +// } +// } public BuildOptionsAdapter getBuildOptions() { diff --git a/ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java b/ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java index 95c490baa..98c15040b 100644 --- a/ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java +++ b/ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java @@ -20,8 +20,8 @@ import org.aspectj.bridge.IProgressListener; public class BuildNotifierAdapter implements IProgressListener { private BuildProgressMonitor progressMonitor; - private int numCompilationUnitPasses = 1; - private int completedPasses = 0; +// private int numCompilationUnitPasses = 1; +// private int completedPasses = 0; private boolean cancelled = false; // ??? get rid of project coupling diff --git a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java index 1b09aee8e..54e709410 100644 --- a/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java +++ b/ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java @@ -29,7 +29,7 @@ import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; public class CompilerAdapter { - private Map optionsMap; +// private Map optionsMap; private AjBuildManager buildManager = null; private MessageHandlerAdapter messageHandler = null; private BuildNotifierAdapter currNotifier = null; diff --git a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java index 72a0b1d11..dc87ccb79 100644 --- a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java +++ b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java @@ -154,17 +154,17 @@ class LstBuildConfigFileUpdater { } } - private synchronized List getUniqueFileList(List list, Set set) { - List uniqueList = new ArrayList(); - for (Iterator it = list.iterator(); it.hasNext(); ) { - BuildConfigNode node = (BuildConfigNode)it.next(); - String file1 = node.getResourcePath(); - if (set.contains(file1) && !uniqueList.contains(file1)) { - uniqueList.add(file1); - } - } - return uniqueList; - } +// private synchronized List getUniqueFileList(List list, Set set) { +// List uniqueList = new ArrayList(); +// for (Iterator it = list.iterator(); it.hasNext(); ) { +// BuildConfigNode node = (BuildConfigNode)it.next(); +// String file1 = node.getResourcePath(); +// if (set.contains(file1) && !uniqueList.contains(file1)) { +// uniqueList.add(file1); +// } +// } +// return uniqueList; +// } public String relativizePath(String path, String rootPath) { path = path.replace('\\', '/'); diff --git a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java index 779a8350e..c1b0a3789 100644 --- a/ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java +++ b/ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java @@ -27,7 +27,7 @@ import org.aspectj.util.ConfigParser; */ public class LstBuildConfigManager implements BuildConfigManager { - private List configFiles = new ArrayList(); +// private List configFiles = new ArrayList(); private List listeners = new ArrayList(); private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater(); protected String currConfigFilePath = null; @@ -163,11 +163,11 @@ public class LstBuildConfigManager implements BuildConfigManager { } } node.addChild(dir); - boolean foundMatch = false; +// boolean foundMatch = false; for (Iterator it = importedFiles.iterator(); it.hasNext(); ) { File importedFile = (File)it.next(); if (importedFile.getParentFile().getAbsolutePath().equals(dirs[i].getAbsolutePath())) { - foundMatch = true; +// foundMatch = true; BuildConfigNode importedFileNode = new BuildConfigNode( importedFile.getName(), BuildConfigNode.Kind.FILE_LST, @@ -219,7 +219,7 @@ public class LstBuildConfigManager implements BuildConfigManager { node.setActive(true); upPath.addChild(node); } else if (!(new File(path).isAbsolute())) { - String name = new File(path).getName(); +// String name = new File(path).getName(); BuildConfigNode existingNode = model.getNodeForPath(path); existingNode.setActive(true); } else { @@ -277,12 +277,12 @@ public class LstBuildConfigManager implements BuildConfigManager { } } - private void notifyConfigsListUpdated() { - for (Iterator it = listeners.iterator(); it.hasNext(); ) { - ((BuildConfigListener)it.next()).configsListUpdated(configFiles); - } - } - +// private void notifyConfigsListUpdated() { +// for (Iterator it = listeners.iterator(); it.hasNext(); ) { +// ((BuildConfigListener)it.next()).configsListUpdated(configFiles); +// } +// } +// private void sortModel(BuildConfigNode node, Comparator comparator) { if (node == null || node.getChildren() == null) return; Collections.sort(node.getChildren(), comparator); diff --git a/ajde/src/org/aspectj/ajde/ui/BuildConfigNode.java b/ajde/src/org/aspectj/ajde/ui/BuildConfigNode.java index eff97262b..417e0e795 100644 --- a/ajde/src/org/aspectj/ajde/ui/BuildConfigNode.java +++ b/ajde/src/org/aspectj/ajde/ui/BuildConfigNode.java @@ -135,12 +135,12 @@ public class BuildConfigNode { this.parent = parent; } - private void setParents() { - if (children == null) return; - for (Iterator it = children.iterator(); it.hasNext(); ) { - ((BuildConfigNode)it.next()).setParent(this); - } - } +// private void setParents() { +// if (children == null) return; +// for (Iterator it = children.iterator(); it.hasNext(); ) { +// ((BuildConfigNode)it.next()).setParent(this); +// } +// } public void setName(String string) { name = string; diff --git a/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java b/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java index 0923caa79..fcc039e21 100644 --- a/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java +++ b/ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java @@ -18,7 +18,7 @@ import java.util.*; import org.aspectj.ajde.Ajde; import org.aspectj.asm.*; -import org.aspectj.asm.internal.*; +//import org.aspectj.asm.internal.*; /** * Prototype functionality for package view clients. @@ -37,14 +37,14 @@ public class StructureModelUtil { */ public static Map getLinesToAspectMap(String sourceFilePath) { - Map annotationsMap = - AsmManager.getDefault().getInlineAnnotations( - sourceFilePath, - true, - true); +// Map annotationsMap = +// AsmManager.getDefault().getInlineAnnotations( +// sourceFilePath, +// true, +// true); Map aspectMap = new HashMap(); - Set keys = annotationsMap.keySet(); +// Set keys = annotationsMap.keySet(); // for (Iterator it = keys.iterator(); it.hasNext();) { // Object key = it.next(); // List annotations = (List) annotationsMap.get(key); @@ -164,54 +164,54 @@ public class StructureModelUtil { /** * Helper function sorts a list of resources into alphabetical order */ - private List sortElements(List oldElements) { - Object[] temp = oldElements.toArray(); - SortingComparator comparator = new SortingComparator(); - - Arrays.sort(temp, comparator); - - List newResources = Arrays.asList(temp); - - return newResources; - } - - private static List sortArray(List oldElements) { - Object[] temp = oldElements.toArray(); - SortArrayComparator comparator = new SortArrayComparator(); - - Arrays.sort(temp, comparator); - - List newElements = Arrays.asList(temp); - - return newElements; - } - - private class SortingComparator implements Comparator { - public int compare(Object o1, Object o2) { - IProgramElement p1 = (IProgramElement) o1; - IProgramElement p2 = (IProgramElement) o2; - - String name1 = p1.getName(); - String name2 = p2.getName(); - - return name1.compareTo(name2); - } - } - - private static class SortArrayComparator implements Comparator { - public int compare(Object o1, Object o2) { - Object[] array1 = (Object[]) o1; - Object[] array2 = (Object[]) o2; - - IProgramElement p1 = (IProgramElement) array1[1]; - IProgramElement p2 = (IProgramElement) array2[1]; - - String name1 = p1.getName(); - String name2 = p2.getName(); +// private List sortElements(List oldElements) { +// Object[] temp = oldElements.toArray(); +// SortingComparator comparator = new SortingComparator(); +// +// Arrays.sort(temp, comparator); +// +// List newResources = Arrays.asList(temp); +// +// return newResources; +// } +// +// private static List sortArray(List oldElements) { +// Object[] temp = oldElements.toArray(); +// SortArrayComparator comparator = new SortArrayComparator(); +// +// Arrays.sort(temp, comparator); +// +// List newElements = Arrays.asList(temp); +// +// return newElements; +// } - return name1.compareTo(name2); - } - } +// private class SortingComparator implements Comparator { +// public int compare(Object o1, Object o2) { +// IProgramElement p1 = (IProgramElement) o1; +// IProgramElement p2 = (IProgramElement) o2; +// +// String name1 = p1.getName(); +// String name2 = p2.getName(); +// +// return name1.compareTo(name2); +// } +// } +// +// private static class SortArrayComparator implements Comparator { +// public int compare(Object o1, Object o2) { +// Object[] array1 = (Object[]) o1; +// Object[] array2 = (Object[]) o2; +// +// IProgramElement p1 = (IProgramElement) array1[1]; +// IProgramElement p2 = (IProgramElement) array2[1]; +// +// String name1 = p1.getName(); +// String name2 = p2.getName(); +// +// return name1.compareTo(name2); +// } +// } /** * @return all of the AspectJ and Java source files in a package diff --git a/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java b/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java index 835ccc5be..1421a7a04 100644 --- a/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java +++ b/ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java @@ -18,7 +18,7 @@ import java.util.*; import org.aspectj.ajde.Ajde; import org.aspectj.asm.*; -import org.aspectj.asm.internal.*; +//import org.aspectj.asm.internal.*; /** * @author Mik Kersten diff --git a/ajde/src/org/aspectj/ajde/ui/StructureViewManager.java b/ajde/src/org/aspectj/ajde/ui/StructureViewManager.java index 69113a331..c8e040b2a 100644 --- a/ajde/src/org/aspectj/ajde/ui/StructureViewManager.java +++ b/ajde/src/org/aspectj/ajde/ui/StructureViewManager.java @@ -27,7 +27,7 @@ import org.aspectj.asm.internal.*; public class StructureViewManager { private TreeStructureViewBuilder treeViewBuilder; - private String buildConfigFilePath = null; +// private String buildConfigFilePath = null; private NavigationHistoryModel historyModel = new NavigationHistoryModel(); private ArrayList structureViews = new ArrayList(); diff --git a/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java b/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java index b4039f354..99ca19f08 100644 --- a/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java +++ b/ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java @@ -18,8 +18,8 @@ import java.util.*; import org.aspectj.ajde.ui.*; import org.aspectj.asm.*; -import org.aspectj.asm.internal.*; -import org.aspectj.asm.internal.ProgramElement; +//import org.aspectj.asm.internal.*; +//import org.aspectj.asm.internal.ProgramElement; /** * @author Mik Kersten @@ -36,14 +36,14 @@ public class TreeStructureViewBuilder { * @todo get rid of instanceof tests */ public void buildView(StructureView view, IHierarchy model) { - StructureViewProperties properties = view.getViewProperties(); +// StructureViewProperties properties = view.getViewProperties(); IProgramElement modelRoot = null; - boolean noStructure = false; +// boolean noStructure = false; if (isFileView(view)) { FileStructureView fileView = (FileStructureView)view; if (fileView.getSourceFile() == null) { modelRoot = IHierarchy.NO_STRUCTURE; - noStructure = true; +// noStructure = true; } else { modelRoot = model.findElementForSourceFile(fileView.getSourceFile()); } @@ -258,8 +258,8 @@ public class TreeStructureViewBuilder { } private IStructureViewNode getInheritanceChildren(IProgramElement node, List associations) { - IStructureViewNode treeNode = nodeFactory.createNode(node); - //StructureViewNode treeNode = new StructureViewNodeAdapter(node); +// IStructureViewNode treeNode = nodeFactory.createNode(node); +// //StructureViewNode treeNode = new StructureViewNodeAdapter(node); // List relations = ((IProgramElement)node).getRelations(); throw new RuntimeException("unimplemented"); // if (relations != null) { @@ -314,10 +314,10 @@ public class TreeStructureViewBuilder { // return treeNode; } - private IStructureViewNode buildTree(IProgramElement node, List associations) { - //StructureViewNode treeNode = new StructureViewNodeAdapter(node); - IStructureViewNode treeNode = nodeFactory.createNode(node); -// if (node instanceof IProgramElement) { +// private IStructureViewNode buildTree(IProgramElement node, List associations) { +// //StructureViewNode treeNode = new StructureViewNodeAdapter(node); +// IStructureViewNode treeNode = nodeFactory.createNode(node); +//// if (node instanceof IProgramElement) { // List relations = ((IProgramElement)node).getRelations(); // if (relations != null) { // for (Iterator it = relations.iterator(); it.hasNext(); ) { @@ -328,56 +328,56 @@ public class TreeStructureViewBuilder { // } // } // } - if (node != null) { - List children = null; - children = node.getChildren(); - if (children != null) { - List childList = new ArrayList(); - for (Iterator itt = children.iterator(); itt.hasNext(); ) { - IProgramElement child = (IProgramElement)itt.next(); - if (child instanceof IProgramElement) { - IProgramElement progNode = (IProgramElement)child; -// if (progNode.getKind() != IProgramElement.Kind.CODE) { - childList.add(buildTree(child, associations)); -// } - } else { - childList.add(buildTree(child, associations)); - } - } - //sortNodes(childList); - for (Iterator it = childList.iterator(); it.hasNext(); ) { - treeNode.add((IStructureViewNode)it.next()); - } - } - - } - return treeNode; - } - - private IStructureViewNode getRelations(IRelationship node) { - return null; - //StructureViewNode treeNode = new StructureViewNode(node); -// IStructureViewNode treeNode = nodeFactory.c(node); -// for (Iterator it = node.getTargets().iterator(); it.hasNext(); ) { -// treeNode.add( -// nodeFactory.createNode((IProgramElement)it.next()) -// ); -// } +// if (node != null) { +// List children = null; +// children = node.getChildren(); +// if (children != null) { +// List childList = new ArrayList(); +// for (Iterator itt = children.iterator(); itt.hasNext(); ) { +// IProgramElement child = (IProgramElement)itt.next(); +// if (child instanceof IProgramElement) { +// IProgramElement progNode = (IProgramElement)child; +//// if (progNode.getKind() != IProgramElement.Kind.CODE) { +// childList.add(buildTree(child, associations)); +//// } +// } else { +// childList.add(buildTree(child, associations)); +// } +// } +// //sortNodes(childList); +// for (Iterator it = childList.iterator(); it.hasNext(); ) { +// treeNode.add((IStructureViewNode)it.next()); +// } +// } +// +// } // return treeNode; - } +// } - /** - * For debugging only. - */ - private void dumpView(IStructureViewNode root, int level) { - System.out.println(root.getStructureNode()); - for (Iterator it = root.getChildren().iterator(); it.hasNext(); ) { - dumpView((IStructureViewNode)it.next(), level++); - } - for (int i = 0; i < level; i++) { - System.out.print(' '); - } - } +// private IStructureViewNode getRelations(IRelationship node) { +// return null; +// //StructureViewNode treeNode = new StructureViewNode(node); +//// IStructureViewNode treeNode = nodeFactory.c(node); +//// for (Iterator it = node.getTargets().iterator(); it.hasNext(); ) { +//// treeNode.add( +//// nodeFactory.createNode((IProgramElement)it.next()) +//// ); +//// } +//// return treeNode; +// } +// +// /** +// * For debugging only. +// */ +// private void dumpView(IStructureViewNode root, int level) { +// System.out.println(root.getStructureNode()); +// for (Iterator it = root.getChildren().iterator(); it.hasNext(); ) { +// dumpView((IStructureViewNode)it.next(), level++); +// } +// for (int i = 0; i < level; i++) { +// System.out.print(' '); +// } +// } /** * Does not sort imports alphabetically. diff --git a/ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java b/ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java index 583ce0539..fc4f43470 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java @@ -35,8 +35,8 @@ public class AjdeUIManager { protected static final AjdeUIManager INSTANCE = new AjdeUIManager(); private BrowserViewManager viewManager = null; - private BuildProgressMonitor buildProgressMonitor = null; - private ErrorHandler errorHandler = null; +// private BuildProgressMonitor buildProgressMonitor = null; +// private ErrorHandler errorHandler = null; private UserPreferencesAdapter userPreferencesAdapter = null; private AjcBuildOptions buildOptionsAdapter = null; private IdeUIAdapter ideUIAdapter = null; diff --git a/ajde/src/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java b/ajde/src/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java index 2ea14436a..e28438b02 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java @@ -285,11 +285,11 @@ public class BrowserStructureViewToolPanel extends JPanel { // treeManager.navigationAction(node, true, true); // } - private void order_comboBox_actionPerformed(ActionEvent e) { - Ajde.getDefault().getStructureViewManager().refreshView( - currentView - ); - } +// private void order_comboBox_actionPerformed(ActionEvent e) { +// Ajde.getDefault().getStructureViewManager().refreshView( +// currentView +// ); +// } private void jbInit() throws Exception { this.setLayout(borderLayout2); @@ -314,13 +314,13 @@ public class BrowserStructureViewToolPanel extends JPanel { } - private void order_button_actionPerformed(ActionEvent e) { - - } - - private void orderPopup_button_actionPerformed(ActionEvent e) { - - } +// private void order_button_actionPerformed(ActionEvent e) { +// +// } +// +// private void orderPopup_button_actionPerformed(ActionEvent e) { +// +// } void separator_button_actionPerformed(ActionEvent e) { diff --git a/ajde/src/org/aspectj/ajde/ui/swing/BrowserViewManager.java b/ajde/src/org/aspectj/ajde/ui/swing/BrowserViewManager.java index 7763573d2..e5cbc342f 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/BrowserViewManager.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/BrowserViewManager.java @@ -18,7 +18,7 @@ import java.util.*; import org.aspectj.ajde.Ajde; import org.aspectj.ajde.ui.*; -import org.aspectj.asm.*; +//import org.aspectj.asm.*; /** * Responsible for displaying and controlling the configuration and output of a @@ -29,13 +29,13 @@ import org.aspectj.asm.*; public class BrowserViewManager { private StructureViewPanel browserPanel = null; - private boolean globalMode = true; - private boolean splitViewMode = false; - private IconRegistry icons; - - private Stack backHistory = new Stack(); - private Stack forwardHistory = new Stack(); - private IProgramElement currNode = null; +// private boolean globalMode = true; +// private boolean splitViewMode = false; +// private IconRegistry icons; +// +// private Stack backHistory = new Stack(); +// private Stack forwardHistory = new Stack(); +// private IProgramElement currNode = null; private final GlobalStructureView DECLARATION_VIEW; private final GlobalStructureView CROSSCUTTING_VIEW; diff --git a/ajde/src/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java b/ajde/src/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java index 9dfd6bb50..ecc403fd6 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java @@ -19,7 +19,7 @@ import java.util.*; import javax.swing.*; import javax.swing.event.*; -import javax.swing.tree.TreePath; +//import javax.swing.tree.TreePath; import org.aspectj.asm.IProgramElement; @@ -71,7 +71,7 @@ class BrowserViewTreeListener implements TreeSelectionListener, MouseListener { } public void doubleClickNavigation(MouseEvent e) { - int clickCount = e.getClickCount(); +// int clickCount = e.getClickCount(); SwingTreeViewNode treeNode = (SwingTreeViewNode)tree.getLastSelectedPathComponent(); if (treeNode != null) { IProgramElement currNode = (IProgramElement)treeNode.getUserObject(); @@ -97,14 +97,14 @@ class BrowserViewTreeListener implements TreeSelectionListener, MouseListener { */ private void maybeShowPopup(MouseEvent e) { if (e.getModifiers() == InputEvent.BUTTON3_MASK && tree.getSelectionCount() > 0) { - TreePath[] selectionPaths = tree.getSelectionPaths(); +// TreePath[] selectionPaths = tree.getSelectionPaths(); final List signatures = new ArrayList(); - for (int i = 0; i < selectionPaths.length; i++) { - IProgramElement currNode = (IProgramElement)((SwingTreeViewNode)selectionPaths[i].getLastPathComponent()).getUserObject(); -// if (currNode instanceof LinkNode || currNode instanceof IProgramElement) { -// signatures.add(currNode); -// } - } +// for (int i = 0; i < selectionPaths.length; i++) { +// IProgramElement currNode = (IProgramElement)((SwingTreeViewNode)selectionPaths[i].getLastPathComponent()).getUserObject(); +//// if (currNode instanceof LinkNode || currNode instanceof IProgramElement) { +//// signatures.add(currNode); +//// } +// } JPopupMenu popup = new JPopupMenu(); JMenuItem showSourcesItem = new JMenuItem("Display sources", AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(IProgramElement.Kind.CODE)); diff --git a/ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java b/ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java index dabe3514a..e8866d985 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java @@ -34,12 +34,12 @@ public class BuildOptionsPanel extends OptionsPanel { protected static BuildOptionsPanel INSTANCE = new BuildOptionsPanel(); - private ButtonGroup compilerMode_buttonGroup = new ButtonGroup(); +// private ButtonGroup compilerMode_buttonGroup = new ButtonGroup(); private TitledBorder titledBorder1; private Border border3; private Border border4; // private TitledBorder titledBorder2; - private Border border5; +// private Border border5; private Border border1; private Border border2; private JPanel jPanel3 = new JPanel(); diff --git a/ajde/src/org/aspectj/ajde/ui/swing/OptionsFrame.java b/ajde/src/org/aspectj/ajde/ui/swing/OptionsFrame.java index c9b38c67f..d05889bc0 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/OptionsFrame.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/OptionsFrame.java @@ -23,8 +23,8 @@ import java.io.IOException; import java.util.Date; import javax.swing.BorderFactory; -import javax.swing.Box; -import javax.swing.ButtonGroup; +//import javax.swing.Box; +//import javax.swing.ButtonGroup; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JFrame; @@ -75,7 +75,7 @@ public class OptionsFrame extends JFrame { private TitledBorder titledBorder5; private Border border2; private TitledBorder titledBorder6; - private Box temp_box = Box.createVerticalBox(); +// private Box temp_box = Box.createVerticalBox(); private Border border3; private TitledBorder titledBorder7; private Border border4; @@ -84,7 +84,7 @@ public class OptionsFrame extends JFrame { private TitledBorder titledBorder9; private Border border6; private TitledBorder titledBorder10; - private ButtonGroup views_buttonGroup = new ButtonGroup(); +// private ButtonGroup views_buttonGroup = new ButtonGroup(); private Border border7; private TitledBorder titledBorder11; private Border border8; diff --git a/ajde/src/org/aspectj/ajde/ui/swing/PointcutWizard.java b/ajde/src/org/aspectj/ajde/ui/swing/PointcutWizard.java index 33bcfc18e..e6acc1979 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/PointcutWizard.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/PointcutWizard.java @@ -15,13 +15,13 @@ package org.aspectj.ajde.ui.swing; import java.awt.*; -import java.awt.event.ActionEvent; +//import java.awt.event.ActionEvent; import java.util.*; import javax.swing.*; import org.aspectj.ajde.ui.*; -import org.aspectj.asm.IRelationship; +//import org.aspectj.asm.IRelationship; /** * @author Mik Kersten @@ -66,95 +66,95 @@ class PointcutWizard extends JFrame { // this.setIconImage(((ImageIcon)AjdeUIManager.getDefault().getIconRegistry().getStructureSwingIcon(ProgramElementNode.Kind.POINTCUT)).getImage()); } - private Map getViewProperties() { - Map views = new HashMap(); - GlobalViewProperties INHERITANCE_VIEW = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE); -// INHERITANCE_VIEW.addRelation(IRelationship.Kind.INHERITANCE); -// views.put(INHERITANCE_VIEW.toString(), INHERITANCE_VIEW); - return views; - } - - private void jbInit() throws Exception { - jLabel1.setFont(new java.awt.Font("Dialog", 0, 11)); - jLabel1.setText("Generate pointcut designator for corresponding joinpoints:"); - jPanel1.setLayout(borderLayout1); - jPanel4.setLayout(borderLayout2); - jPanel2.setLayout(borderLayout3); - jLabel4.setText("Select the target type that will host the generated pointcut:"); - jLabel4.setFont(new java.awt.Font("Dialog", 0, 11)); - jLabel4.setToolTipText(""); - jPanel3.setMaximumSize(new Dimension(32767, 34)); - jCheckBox5.setEnabled(false); - jCheckBox5.setFont(new java.awt.Font("Dialog", 0, 11)); - jCheckBox5.setSelected(true); - jCheckBox5.setText("call"); - jCheckBox4.setEnabled(false); - jCheckBox4.setFont(new java.awt.Font("Dialog", 0, 11)); - jCheckBox4.setText("execution"); - jCheckBox3.setEnabled(false); - jCheckBox3.setFont(new java.awt.Font("Dialog", 0, 11)); - jCheckBox3.setText("initialization"); - jCheckBox2.setEnabled(false); - jCheckBox2.setFont(new java.awt.Font("Dialog", 0, 11)); - jCheckBox2.setText("static initialization"); - jCheckBox1.setEnabled(false); - jCheckBox1.setFont(new java.awt.Font("Dialog", 0, 11)); - jCheckBox1.setText("field get/set"); - cancel_button.setFont(new java.awt.Font("Dialog", 0, 11)); - cancel_button.setText("Cancel"); - cancel_button.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { - cancel_button_actionPerformed(e); - } - }); - ok_button.setText("OK"); - ok_button.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { - ok_button_actionPerformed(e); - } - }); - ok_button.setFont(new java.awt.Font("Dialog", 0, 11)); - this.setTitle("Pointcut Wizard"); - this.getContentPane().add(jPanel1, BorderLayout.CENTER); - jPanel1.add(jPanel4, BorderLayout.NORTH); - jPanel4.add(jLabel1, BorderLayout.NORTH); - jPanel4.add(jPanel3, BorderLayout.CENTER); - jPanel3.add(jCheckBox5, null); - jPanel3.add(jCheckBox4, null); - jPanel3.add(jCheckBox3, null); - jPanel3.add(jCheckBox2, null); - jPanel3.add(jCheckBox1, null); - jPanel1.add(jPanel2, BorderLayout.CENTER); - jPanel2.add(jLabel4, BorderLayout.NORTH); - jPanel2.add(typeTreeView, BorderLayout.CENTER); - jPanel1.add(jPanel5, BorderLayout.SOUTH); - jPanel5.add(ok_button, null); - jPanel5.add(cancel_button, null); - } +// private Map getViewProperties() { +// Map views = new HashMap(); +// GlobalViewProperties INHERITANCE_VIEW = new GlobalViewProperties(StructureViewProperties.Hierarchy.INHERITANCE); +//// INHERITANCE_VIEW.addRelation(IRelationship.Kind.INHERITANCE); +//// views.put(INHERITANCE_VIEW.toString(), INHERITANCE_VIEW); +// return views; +// } +// +// private void jbInit() throws Exception { +// jLabel1.setFont(new java.awt.Font("Dialog", 0, 11)); +// jLabel1.setText("Generate pointcut designator for corresponding joinpoints:"); +// jPanel1.setLayout(borderLayout1); +// jPanel4.setLayout(borderLayout2); +// jPanel2.setLayout(borderLayout3); +// jLabel4.setText("Select the target type that will host the generated pointcut:"); +// jLabel4.setFont(new java.awt.Font("Dialog", 0, 11)); +// jLabel4.setToolTipText(""); +// jPanel3.setMaximumSize(new Dimension(32767, 34)); +// jCheckBox5.setEnabled(false); +// jCheckBox5.setFont(new java.awt.Font("Dialog", 0, 11)); +// jCheckBox5.setSelected(true); +// jCheckBox5.setText("call"); +// jCheckBox4.setEnabled(false); +// jCheckBox4.setFont(new java.awt.Font("Dialog", 0, 11)); +// jCheckBox4.setText("execution"); +// jCheckBox3.setEnabled(false); +// jCheckBox3.setFont(new java.awt.Font("Dialog", 0, 11)); +// jCheckBox3.setText("initialization"); +// jCheckBox2.setEnabled(false); +// jCheckBox2.setFont(new java.awt.Font("Dialog", 0, 11)); +// jCheckBox2.setText("static initialization"); +// jCheckBox1.setEnabled(false); +// jCheckBox1.setFont(new java.awt.Font("Dialog", 0, 11)); +// jCheckBox1.setText("field get/set"); +// cancel_button.setFont(new java.awt.Font("Dialog", 0, 11)); +// cancel_button.setText("Cancel"); +// cancel_button.addActionListener(new java.awt.event.ActionListener() { +// public void actionPerformed(ActionEvent e) { +// cancel_button_actionPerformed(e); +// } +// }); +// ok_button.setText("OK"); +// ok_button.addActionListener(new java.awt.event.ActionListener() { +// public void actionPerformed(ActionEvent e) { +// ok_button_actionPerformed(e); +// } +// }); +// ok_button.setFont(new java.awt.Font("Dialog", 0, 11)); +// this.setTitle("Pointcut Wizard"); +// this.getContentPane().add(jPanel1, BorderLayout.CENTER); +// jPanel1.add(jPanel4, BorderLayout.NORTH); +// jPanel4.add(jLabel1, BorderLayout.NORTH); +// jPanel4.add(jPanel3, BorderLayout.CENTER); +// jPanel3.add(jCheckBox5, null); +// jPanel3.add(jCheckBox4, null); +// jPanel3.add(jCheckBox3, null); +// jPanel3.add(jCheckBox2, null); +// jPanel3.add(jCheckBox1, null); +// jPanel1.add(jPanel2, BorderLayout.CENTER); +// jPanel2.add(jLabel4, BorderLayout.NORTH); +// jPanel2.add(typeTreeView, BorderLayout.CENTER); +// jPanel1.add(jPanel5, BorderLayout.SOUTH); +// jPanel5.add(ok_button, null); +// jPanel5.add(cancel_button, null); +// } - private void ok_button_actionPerformed(ActionEvent e) { - throw new RuntimeException("unimplemented, can't paste"); -// Ajde.getDefault().getEditorManager().pasteToCaretPos(generatePcd()); +// private void ok_button_actionPerformed(ActionEvent e) { +// throw new RuntimeException("unimplemented, can't paste"); +//// Ajde.getDefault().getEditorManager().pasteToCaretPos(generatePcd()); +//// this.dispose(); +// } +// +// private void cancel_button_actionPerformed(ActionEvent e) { // this.dispose(); - } - - private void cancel_button_actionPerformed(ActionEvent e) { - this.dispose(); - } - - private String generatePcd() { - String pcd = "\n\n" + - " pointcut temp(): \n"; - for (Iterator it = signatures.iterator(); it.hasNext(); ) { - pcd += " call(* " + it.next() + ")"; - if (it.hasNext()) { - pcd += " ||"; - } else { - pcd += ";"; - } - pcd += "\n"; - } - return pcd; - } +// } +// +// private String generatePcd() { +// String pcd = "\n\n" + +// " pointcut temp(): \n"; +// for (Iterator it = signatures.iterator(); it.hasNext(); ) { +// pcd += " call(* " + it.next() + ")"; +// if (it.hasNext()) { +// pcd += " ||"; +// } else { +// pcd += ";"; +// } +// pcd += "\n"; +// } +// return pcd; +// } } diff --git a/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java b/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java index 3143b06c1..643f92cb3 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java @@ -95,7 +95,7 @@ class StructureTreeManager { Runnable update = new Runnable() { public void run() { structureTree.removeAll(); - SwingTreeViewNode currNode; +// SwingTreeViewNode currNode; if (structureView.getRootNode() == null) { structureTree.setModel(NO_STRUCTURE_MODEL); } else { diff --git a/ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java b/ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java index 5fc5ae9b0..cfa899f11 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java @@ -19,7 +19,7 @@ import java.util.*; import javax.swing.tree.DefaultMutableTreeNode; import org.aspectj.ajde.ui.*; -import org.aspectj.ajde.ui.IStructureViewNode.Kind; +//import org.aspectj.ajde.ui.IStructureViewNode.Kind; import org.aspectj.asm.*; /** diff --git a/ajde/src/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java b/ajde/src/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java index 3282f2040..6ce787200 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java @@ -56,7 +56,7 @@ import org.aspectj.asm.IProgramElement; public class TreeViewBuildConfigEditor extends JPanel implements BuildConfigEditor { private ConfigTreeNode root; - private ConfigTreeNode currNode; +// private ConfigTreeNode currNode; private BuildConfigModel model = null; private static java.util.List selectedEntries = new ArrayList(); diff --git a/ajde/src/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java b/ajde/src/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java index f25ad7c9d..9ae470295 100644 --- a/ajde/src/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java +++ b/ajde/src/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java @@ -113,8 +113,8 @@ public class UpdateConfigurationDialog extends JFrame { this.dispose(); } void ok_button_actionPerformed(ActionEvent e) { - Object[] selected = buildConfigList.getSelectedValues(); - //LstBuildConfigFileUpdater.updateBuildConfigFiles(buildConfigFiles, filesToUpdate, addToConfiguration); +// Object[] selected = buildConfigList.getSelectedValues(); +// //LstBuildConfigFileUpdater.updateBuildConfigFiles(buildConfigFiles, filesToUpdate, addToConfiguration); this.dispose(); } diff --git a/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java b/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java index e637a29e8..d5902854b 100644 --- a/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java +++ b/ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java @@ -10,11 +10,11 @@ package org.aspectj.ajde; -import java.util.Iterator; +//import java.util.Iterator; -import org.aspectj.ajdt.internal.core.builder.AsmElementFormatter; +//import org.aspectj.ajdt.internal.core.builder.AsmElementFormatter; import org.aspectj.asm.*; -import org.aspectj.asm.IProgramElement.Kind; +//import org.aspectj.asm.IProgramElement.Kind; // TODO: add tests for java kinds, expand coverage @@ -22,7 +22,7 @@ public class AsmDeclarationsTest extends AjdeTestCase { private IHierarchy model = null; private static final String CONFIG_FILE_PATH = "../examples/coverage/coverage.lst"; - private static final int DEC_MESSAGE_LENGTH = AsmElementFormatter.MAX_MESSAGE_LENGTH; +// private static final int DEC_MESSAGE_LENGTH = AsmElementFormatter.MAX_MESSAGE_LENGTH; public AsmDeclarationsTest(String name) { super(name); diff --git a/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java b/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java index f4b41a846..3f16c6264 100644 --- a/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java +++ b/ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java @@ -120,9 +120,9 @@ public class AsmRelationshipsTest extends AjdeTestCase { IProgramElement clazz = AsmManager.getDefault().getHierarchy().findElementForType(null, toType); assertNotNull(clazz); - String set = to; +// String set = to; IRelationship rel2 = manager.getRelationshipMap().get(clazz, IRelationship.Kind.DECLARE_INTER_TYPE, backRelName); - String handle2 = (String)rel2.getTargets().get(0); +// String handle2 = (String)rel2.getTargets().get(0); for (Iterator it = rel2.getTargets().iterator(); it.hasNext(); ) { String currHandle = (String)it.next(); if (manager.getHierarchy().findElementForHandle(currHandle).toLabelString().equals(from)) return; diff --git a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java index f08fe199b..1223b865d 100644 --- a/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java +++ b/ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java @@ -349,7 +349,7 @@ public class BuildConfigurationTests extends AjdeTestCase { buildOptions.setNoImportError( true ); buildConfig = compilerAdapter.genBuildConfig( configFile ); assertTrue(configFile + " failed", null != buildConfig); - Map options = buildConfig.getJavaOptions(); +// Map options = buildConfig.getJavaOptions(); // String noImport = (String) options.get( CompilerOptions.OPTION_ReportInvalidImport ); // assertEquals( "no import", CompilerOptions.WARNING, noImport ); // buildOptions.setNoImportError( false ); @@ -508,7 +508,7 @@ public class BuildConfigurationTests extends AjdeTestCase { }; try { - String s = null; +// String s = null; Ajde.init( null, null, diff --git a/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java b/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java index 836a2eaae..6181efa18 100644 --- a/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java +++ b/ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java @@ -15,7 +15,7 @@ package org.aspectj.ajde; import java.io.IOException; import java.util.List; -import org.aspectj.bridge.*; +//import org.aspectj.bridge.*; import org.aspectj.bridge.IMessage; /** diff --git a/ajde/testsrc/org/aspectj/ajde/InpathTestcase.java b/ajde/testsrc/org/aspectj/ajde/InpathTestcase.java index 9ec9f2cf2..36d4b2a09 100644 --- a/ajde/testsrc/org/aspectj/ajde/InpathTestcase.java +++ b/ajde/testsrc/org/aspectj/ajde/InpathTestcase.java @@ -344,7 +344,7 @@ public class InpathTestcase extends AjdeTestCase { String outdirName, Set expectedOutdirContents) { - byte[] inManifest = null; +// byte[] inManifest = null; File binBase = openFile(outdirName); String[] toResources = FileUtil.listFiles(binBase); @@ -364,13 +364,13 @@ public class InpathTestcase extends AjdeTestCase { /** * @param resources */ - private void dumpResources(HashSet resources) { - System.err.println("Dump: " + resources.size() + " resources"); - for (Iterator iter = resources.iterator(); iter.hasNext();) { - Object element = (Object) iter.next(); - System.err.println(" Resource: " + element); - } - } +// private void dumpResources(HashSet resources) { +// System.err.println("Dump: " + resources.size() + " resources"); +// for (Iterator iter = resources.iterator(); iter.hasNext();) { +// Object element = (Object) iter.next(); +// System.err.println(" Resource: " + element); +// } +// } private void listSourceResources(String indirName, Set resources) { File srcBase = openFile(indirName); @@ -387,46 +387,46 @@ public class InpathTestcase extends AjdeTestCase { } } - private byte[] listDirResources(File directory, Set resources) { - return listDirResources( - directory.getAbsolutePath(), - directory, - resources); - } - - private byte[] listDirResources( - String prefix, - File directory, - Set resources) { - byte[] manifest = null; - - File[] resourceFiles = directory.listFiles(new FileFilter() { - public boolean accept(File arg0) { - boolean accept = - !arg0.getName().endsWith(".class") && !arg0.isDirectory(); - return accept; - } - }); - for (int i = 0; i < resourceFiles.length; i++) { - File f = resourceFiles[i]; - String name = f.getAbsolutePath(); - if (f.getAbsolutePath().startsWith(prefix)) - name = name.substring(prefix.length()); - name = name.replace('\\', '/'); - - resources.add(resourceFiles[i]); - } - File[] subdirs = directory.listFiles(new FileFilter() { - public boolean accept(File arg0) { - return arg0.isDirectory(); - } - }); - for (int i = 0; i < subdirs.length; i++) { - listDirResources(prefix, subdirs[i], resources); - } - - return manifest; - } +// private byte[] listDirResources(File directory, Set resources) { +// return listDirResources( +// directory.getAbsolutePath(), +// directory, +// resources); +// } + +// private byte[] listDirResources( +// String prefix, +// File directory, +// Set resources) { +// byte[] manifest = null; +// +// File[] resourceFiles = directory.listFiles(new FileFilter() { +// public boolean accept(File arg0) { +// boolean accept = +// !arg0.getName().endsWith(".class") && !arg0.isDirectory(); +// return accept; +// } +// }); +// for (int i = 0; i < resourceFiles.length; i++) { +// File f = resourceFiles[i]; +// String name = f.getAbsolutePath(); +// if (f.getAbsolutePath().startsWith(prefix)) +// name = name.substring(prefix.length()); +// name = name.replace('\\', '/'); +// +// resources.add(resourceFiles[i]); +// } +// File[] subdirs = directory.listFiles(new FileFilter() { +// public boolean accept(File arg0) { +// return arg0.isDirectory(); +// } +// }); +// for (int i = 0; i < subdirs.length; i++) { +// listDirResources(prefix, subdirs[i], resources); +// } +// +// return manifest; +// } public static final FileFilter aspectjResourceFileFilter = new FileFilter() { diff --git a/ajde/testsrc/org/aspectj/ajde/TestBuildListener.java b/ajde/testsrc/org/aspectj/ajde/TestBuildListener.java index c53feed45..64fc6228e 100644 --- a/ajde/testsrc/org/aspectj/ajde/TestBuildListener.java +++ b/ajde/testsrc/org/aspectj/ajde/TestBuildListener.java @@ -26,7 +26,7 @@ public class TestBuildListener implements BuildListener { public void compileStarted(String buildConfigFile) { } public void compileFinished(String buildConfigFile, int buildTime, boolean succeeded, boolean warnings) { - int timeInSeconds = buildTime/1000; +// int timeInSeconds = buildTime/1000; buildSucceeded = succeeded; buildFinished = true; } diff --git a/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java b/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java index 3d1a04cf3..8e67517d8 100644 --- a/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java +++ b/ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java @@ -21,14 +21,14 @@ import junit.framework.TestSuite; import org.aspectj.ajde.*; import org.aspectj.ajde.NullIdeTaskListManager.SourceLineTask; import org.aspectj.ajde.ui.BuildConfigModel; -import org.aspectj.ajde.ui.internal.AjcBuildOptions; -import org.aspectj.bridge.Message; +//import org.aspectj.ajde.ui.internal.AjcBuildOptions; +//import org.aspectj.bridge.Message; public class LstBuildConfigManagerTest extends AjdeTestCase { - private AjcBuildOptions buildOptions = null; +// private AjcBuildOptions buildOptions = null; private BuildConfigManager buildConfigManager = new LstBuildConfigManager(); - private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater(); +// private LstBuildConfigFileUpdater fileUpdater = new LstBuildConfigFileUpdater(); public LstBuildConfigManagerTest(String name) { super(name); @@ -76,35 +76,35 @@ public class LstBuildConfigManagerTest extends AjdeTestCase { public void testFileRelativePathSameDir() throws IOException { File file = openFile("file-relPath-sameDir.lst"); - BuildConfigModel model = buildConfigManager.buildModel(file.getCanonicalPath()); + buildConfigManager.buildModel(file.getCanonicalPath()); assertTrue("single file", true); } - private void verifyFile(String configFile, String fileContents) { - StringTokenizer st = new StringTokenizer(fileContents, ";"); - BuildConfigModel model1 = buildConfigManager.buildModel(configFile); - File testFile = new File(configFile + "-test.lst"); - model1.setSourceFile(testFile.getPath()); - buildConfigManager.writeModel(model1); - List newList = fileUpdater.readConfigFile(testFile.getPath()); - testFile.delete(); - - assertTrue("contents: " + newList, verifyLists(st, newList)); - } - - private boolean verifyLists(StringTokenizer st, List list) { - Iterator it = list.iterator(); - while (st.hasMoreElements()) { - String s1 = (String)st.nextElement(); - String s2 = (String)it.next(); - if (!s1.equals(s2)) return false; - } - if (it.hasNext()) { - return false; - } else { - return true; - } - } +// private void verifyFile(String configFile, String fileContents) { +// StringTokenizer st = new StringTokenizer(fileContents, ";"); +// BuildConfigModel model1 = buildConfigManager.buildModel(configFile); +// File testFile = new File(configFile + "-test.lst"); +// model1.setSourceFile(testFile.getPath()); +// buildConfigManager.writeModel(model1); +// List newList = fileUpdater.readConfigFile(testFile.getPath()); +// testFile.delete(); +// +// assertTrue("contents: " + newList, verifyLists(st, newList)); +// } +// +// private boolean verifyLists(StringTokenizer st, List list) { +// Iterator it = list.iterator(); +// while (st.hasMoreElements()) { +// String s1 = (String)st.nextElement(); +// String s2 = (String)it.next(); +// if (!s1.equals(s2)) return false; +// } +// if (it.hasNext()) { +// return false; +// } else { +// return true; +// } +// } protected void setUp() throws Exception { super.setUp("LstBuildConfigManagerTest"); @@ -114,9 +114,9 @@ public class LstBuildConfigManagerTest extends AjdeTestCase { super.tearDown(); } - private static final String WILDCARDS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-config.lst"; - private static final String BAD_PATHS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-error.lst"; - private static final String INCLUDES_FILE = "C:/Dev/aspectj/tests/ajde/examples/spacewar/spacewar/demo.lst"; +// private static final String WILDCARDS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-config.lst"; +// private static final String BAD_PATHS_FILE = "C:/Dev/aspectj/tests/ajde/examples/figures-coverage/test-error.lst"; +// private static final String INCLUDES_FILE = "C:/Dev/aspectj/tests/ajde/examples/spacewar/spacewar/demo.lst"; private static final String WILDCARDS_FILE_CONTENTS; private static final String BAD_PATHS_FILE_CONTENTS; diff --git a/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java b/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java index 70763dfd5..417a14b7f 100644 --- a/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java +++ b/ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java @@ -43,7 +43,7 @@ public class StructureSearchManagerTest extends AjdeTestCase { } public void testFindPatternMatch() { - List matches = Ajde.getDefault().getStructureSearchManager().findMatches( + Ajde.getDefault().getStructureSearchManager().findMatches( "Point", null ); @@ -51,7 +51,7 @@ public class StructureSearchManagerTest extends AjdeTestCase { } public void testFindPatternAndKindMatch() { - List matches = Ajde.getDefault().getStructureSearchManager().findMatches( + Ajde.getDefault().getStructureSearchManager().findMatches( "Point", IProgramElement.Kind.CONSTRUCTOR ); -- 2.39.5