Browse Source

spring cleaning in advance of 1.2 enhancements:

removed unused imports, local variables, and private methods
(still there, just commented out).
tags/v_preCompileLoopAlteration
acolyer 20 years ago
parent
commit
305b0d18b1
30 changed files with 377 additions and 377 deletions
  1. 1
    1
      ajde/src/org/aspectj/ajde/Ajde.java
  2. 6
    6
      ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java
  3. 2
    2
      ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java
  4. 1
    1
      ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java
  5. 11
    11
      ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java
  6. 10
    10
      ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java
  7. 6
    6
      ajde/src/org/aspectj/ajde/ui/BuildConfigNode.java
  8. 54
    54
      ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java
  9. 1
    1
      ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java
  10. 1
    1
      ajde/src/org/aspectj/ajde/ui/StructureViewManager.java
  11. 59
    59
      ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java
  12. 2
    2
      ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java
  13. 12
    12
      ajde/src/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java
  14. 8
    8
      ajde/src/org/aspectj/ajde/ui/swing/BrowserViewManager.java
  15. 9
    9
      ajde/src/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java
  16. 2
    2
      ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java
  17. 4
    4
      ajde/src/org/aspectj/ajde/ui/swing/OptionsFrame.java
  18. 90
    90
      ajde/src/org/aspectj/ajde/ui/swing/PointcutWizard.java
  19. 1
    1
      ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java
  20. 1
    1
      ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java
  21. 1
    1
      ajde/src/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java
  22. 2
    2
      ajde/src/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java
  23. 4
    4
      ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java
  24. 2
    2
      ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java
  25. 2
    2
      ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java
  26. 1
    1
      ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java
  27. 48
    48
      ajde/testsrc/org/aspectj/ajde/InpathTestcase.java
  28. 1
    1
      ajde/testsrc/org/aspectj/ajde/TestBuildListener.java
  29. 33
    33
      ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java
  30. 2
    2
      ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java

+ 1
- 1
ajde/src/org/aspectj/ajde/Ajde.java View File

@@ -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();
}

+ 6
- 6
ajde/src/org/aspectj/ajde/internal/AspectJBuildManager.java View File

@@ -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() {

+ 2
- 2
ajde/src/org/aspectj/ajde/internal/BuildNotifierAdapter.java View File

@@ -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

+ 1
- 1
ajde/src/org/aspectj/ajde/internal/CompilerAdapter.java View File

@@ -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;

+ 11
- 11
ajde/src/org/aspectj/ajde/internal/LstBuildConfigFileUpdater.java View File

@@ -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('\\', '/');

+ 10
- 10
ajde/src/org/aspectj/ajde/internal/LstBuildConfigManager.java View File

@@ -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);

+ 6
- 6
ajde/src/org/aspectj/ajde/ui/BuildConfigNode.java View File

@@ -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;

+ 54
- 54
ajde/src/org/aspectj/ajde/ui/StructureModelUtil.java View File

@@ -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

+ 1
- 1
ajde/src/org/aspectj/ajde/ui/StructureSearchManager.java View File

@@ -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

+ 1
- 1
ajde/src/org/aspectj/ajde/ui/StructureViewManager.java View File

@@ -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();

+ 59
- 59
ajde/src/org/aspectj/ajde/ui/internal/TreeStructureViewBuilder.java View File

@@ -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.

+ 2
- 2
ajde/src/org/aspectj/ajde/ui/swing/AjdeUIManager.java View File

@@ -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;

+ 12
- 12
ajde/src/org/aspectj/ajde/ui/swing/BrowserStructureViewToolPanel.java View File

@@ -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) {


+ 8
- 8
ajde/src/org/aspectj/ajde/ui/swing/BrowserViewManager.java View File

@@ -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;

+ 9
- 9
ajde/src/org/aspectj/ajde/ui/swing/BrowserViewTreeListener.java View File

@@ -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));

+ 2
- 2
ajde/src/org/aspectj/ajde/ui/swing/BuildOptionsPanel.java View File

@@ -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();

+ 4
- 4
ajde/src/org/aspectj/ajde/ui/swing/OptionsFrame.java View File

@@ -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;

+ 90
- 90
ajde/src/org/aspectj/ajde/ui/swing/PointcutWizard.java View File

@@ -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;
// }
}


+ 1
- 1
ajde/src/org/aspectj/ajde/ui/swing/StructureTreeManager.java View File

@@ -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 {

+ 1
- 1
ajde/src/org/aspectj/ajde/ui/swing/SwingTreeViewNode.java View File

@@ -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.*;

/**

+ 1
- 1
ajde/src/org/aspectj/ajde/ui/swing/TreeViewBuildConfigEditor.java View File

@@ -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();

+ 2
- 2
ajde/src/org/aspectj/ajde/ui/swing/UpdateConfigurationDialog.java View File

@@ -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();
}


+ 4
- 4
ajde/testsrc/org/aspectj/ajde/AsmDeclarationsTest.java View File

@@ -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);

+ 2
- 2
ajde/testsrc/org/aspectj/ajde/AsmRelationshipsTest.java View File

@@ -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;

+ 2
- 2
ajde/testsrc/org/aspectj/ajde/BuildConfigurationTests.java View File

@@ -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,

+ 1
- 1
ajde/testsrc/org/aspectj/ajde/CompilerMessagesTest.java View File

@@ -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;

/**

+ 48
- 48
ajde/testsrc/org/aspectj/ajde/InpathTestcase.java View File

@@ -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() {

+ 1
- 1
ajde/testsrc/org/aspectj/ajde/TestBuildListener.java View File

@@ -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;
}

+ 33
- 33
ajde/testsrc/org/aspectj/ajde/internal/LstBuildConfigManagerTest.java View File

@@ -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;

+ 2
- 2
ajde/testsrc/org/aspectj/ajde/ui/StructureSearchManagerTest.java View File

@@ -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
);

Loading…
Cancel
Save