aboutsummaryrefslogtreecommitdiffstats
path: root/ajde
diff options
context:
space:
mode:
authorAndy Clement <aclement@pivotal.io>2019-06-03 10:03:51 -0700
committerAndy Clement <aclement@pivotal.io>2019-06-03 10:03:51 -0700
commit01f7d8ba8e3ff34ffacb95ae25787b0f0ce9f1d8 (patch)
tree66d8b8c86978297ddd3f56aa1f8fe7e4b9b885cd /ajde
parent7aa5fe4edc27b77b2d23d1dc72fe761cbef38313 (diff)
downloadaspectj-01f7d8ba8e3ff34ffacb95ae25787b0f0ce9f1d8.tar.gz
aspectj-01f7d8ba8e3ff34ffacb95ae25787b0f0ce9f1d8.zip
Update to 1.9.5.BUILD-SNAPSHOT in poms
Diffstat (limited to 'ajde')
-rw-r--r--ajde/pom.xml2
-rw-r--r--ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java66
-rw-r--r--ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java44
-rw-r--r--ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java130
4 files changed, 120 insertions, 122 deletions
diff --git a/ajde/pom.xml b/ajde/pom.xml
index 17f6eb9c2..5e6ba954c 100644
--- a/ajde/pom.xml
+++ b/ajde/pom.xml
@@ -6,7 +6,7 @@
<parent>
<groupId>org.aspectj</groupId>
<artifactId>aspectj-parent</artifactId>
- <version>1.9.4</version>
+ <version>1.9.5.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java b/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java
index f049357c5..390ebbead 100644
--- a/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java
+++ b/ajde/src/main/java/org/aspectj/ajde/internal/BuildConfigManager.java
@@ -1,44 +1,44 @@
/* *******************************************************************
- * Copyright (c) 1999-2001 Xerox Corporation,
+ * Copyright (c) 1999-2001 Xerox Corporation,
* 2002 Palo Alto Research Center, Incorporated (PARC).
- * All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Xerox/PARC initial implementation
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Xerox/PARC initial implementation
* ******************************************************************/
-
+
package org.aspectj.ajde.internal;
import java.util.List;
import org.aspectj.ajde.ui.BuildConfigModel;
-/**
+/**
* @author Mik Kersten
*/
public interface BuildConfigManager {
-
+
public static final String CONFIG_FILE_SUFFIX = ".lst";
-
+
public static final String DEFAULT_CONFIG_LABEL = "<all project files>";
-
+
/**
- * Returns the currently active build configuration file. The current active
- * build configuration file that is set in this class is used for building and
+ * Returns the currently active build configuration file. The current active
+ * build configuration file that is set in this class is used for building and
* for updating the structure model.
- *
+ *
* @return full path to the file
*/
public String getActiveConfigFile();
-
+
/**
* Sets the currently active build configuration file.
- *
+ *
* @param full path to the file
*/
public void setActiveConfigFile(String currConfigFilePath);
@@ -52,28 +52,28 @@ public interface BuildConfigManager {
* Remove a configuration listener.
*/
public void removeListener(BuildConfigListener configurationListener);
-
+
/**
* Build a model for the corresponding configuration file.
- *
+ *
* @param full path to the file
- */
+ */
public BuildConfigModel buildModel(String configFilePath);
-
+
/**
* Save the given configuration model to the file that it was generated from.
*/
public void writeModel(BuildConfigModel model);
-
+
/**
* Write a list of source files into a configuration file. File paths will be
* written relative to the path of the configuration file.
- */
+ */
public void writePaths(String configFilePath, List paths);
-
+
/**
* Add files to a configuration.
- *
+ *
* @param configFilePath full path to the configuration file
* @param files list of full paths to the files to be added
*/
@@ -81,19 +81,17 @@ public interface BuildConfigManager {
/**
* Remove files from a configuration.
- *
+ *
* @param configFilePath full path to the configuration file
* @param files list of full paths to the files to be removed
- */
+ */
public void removeFilesFromConfig(String configFilePath, List files);
-
-
+
+
/**
* @return list (of Strings) of all build configuration files
* found so far
*/
public List /*String*/ getAllBuildConfigFiles();
-
-}
-
+}
diff --git a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java
index 05c4cc2a0..5a30bbcc7 100644
--- a/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java
+++ b/ajde/src/main/java/org/aspectj/ajde/internal/LstBuildConfigManager.java
@@ -1,14 +1,14 @@
/* *******************************************************************
- * Copyright (c) 1999-2001 Xerox Corporation,
+ * Copyright (c) 1999-2001 Xerox Corporation,
* 2002 Palo Alto Research Center, Incorporated (PARC).
- * All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Xerox/PARC initial implementation
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Xerox/PARC initial implementation
* Helen Hawkins Converted to new interface (bug 148190)
* ******************************************************************/
@@ -107,9 +107,9 @@ public class LstBuildConfigManager implements BuildConfigManager {
// };
// model.getRoot().walk(walker);
- List activeSourceFiles = model.getActiveNodes(BuildConfigNode.Kind.FILE_ASPECTJ);
+ List<BuildConfigNode> activeSourceFiles = model.getActiveNodes(BuildConfigNode.Kind.FILE_ASPECTJ);
activeSourceFiles.addAll(model.getActiveNodes(BuildConfigNode.Kind.FILE_JAVA));
- List activeImportedFiles = model.getActiveNodes(BuildConfigNode.Kind.FILE_LST);
+ List<BuildConfigNode> activeImportedFiles = model.getActiveNodes(BuildConfigNode.Kind.FILE_LST);
fileUpdater.writeConfigFile(model.getSourceFile(), activeSourceFiles, activeImportedFiles);
}
@@ -231,17 +231,17 @@ public class LstBuildConfigManager implements BuildConfigManager {
}
private boolean pruneEmptyDirs(BuildConfigNode node) {
- List nodesToRemove = new ArrayList();
- for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
- BuildConfigNode currNode = (BuildConfigNode) it.next();
+ List<BuildConfigNode> nodesToRemove = new ArrayList<>();
+ for (Iterator<BuildConfigNode> it = node.getChildren().iterator(); it.hasNext();) {
+ BuildConfigNode currNode = it.next();
boolean hasValidChildren = pruneEmptyDirs(currNode);
if (!currNode.isValidResource() && !hasValidChildren) {
nodesToRemove.add(currNode);
}
}
- for (Iterator it = nodesToRemove.iterator(); it.hasNext();) {
- BuildConfigNode currNode = (BuildConfigNode) it.next();
+ for (Iterator<BuildConfigNode> it = nodesToRemove.iterator(); it.hasNext();) {
+ BuildConfigNode currNode = it.next();
node.removeChild(currNode);
}
return node.getChildren().size() > 0;
@@ -278,21 +278,19 @@ public class LstBuildConfigManager implements BuildConfigManager {
// }
// }
//
- private void sortModel(BuildConfigNode node, Comparator comparator) {
+ private void sortModel(BuildConfigNode node, Comparator<BuildConfigNode> comparator) {
if (node == null || node.getChildren() == null)
return;
Collections.sort(node.getChildren(), comparator);
- for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
- BuildConfigNode nextNode = (BuildConfigNode) it.next();
+ for (Iterator<BuildConfigNode> it = node.getChildren().iterator(); it.hasNext();) {
+ BuildConfigNode nextNode = it.next();
if (nextNode != null)
sortModel(nextNode, comparator);
}
}
- private static final Comparator ALPHABETICAL_COMPARATOR = new Comparator() {
- public int compare(Object o1, Object o2) {
- BuildConfigNode n1 = (BuildConfigNode) o1;
- BuildConfigNode n2 = (BuildConfigNode) o2;
+ private static final Comparator<BuildConfigNode> ALPHABETICAL_COMPARATOR = new Comparator<BuildConfigNode>() {
+ public int compare(BuildConfigNode n1, BuildConfigNode n2) {
return n1.getName().compareTo(n2.getName());
}
};
diff --git a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java
index 5351803d4..2e44d399e 100644
--- a/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java
+++ b/ajde/src/main/java/org/aspectj/ajde/ui/StructureViewProperties.java
@@ -1,55 +1,57 @@
/* *******************************************************************
- * Copyright (c) 1999-2001 Xerox Corporation,
+ * Copyright (c) 1999-2001 Xerox Corporation,
* 2002 Palo Alto Research Center, Incorporated (PARC).
- * All rights reserved.
- * This program and the accompanying materials are made available
- * under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Xerox/PARC initial implementation
+ * All rights reserved.
+ * This program and the accompanying materials are made available
+ * under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Xerox/PARC initial implementation
* ******************************************************************/
package org.aspectj.ajde.ui;
import java.io.ObjectStreamException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.List;
-import org.aspectj.asm.*;
+import org.aspectj.asm.IProgramElement;
+import org.aspectj.asm.IRelationship;
-/**
+/**
* Nested properties use the typesafe enum pattern.
- *
+ *
* @author Mik Kersten
*/
public class StructureViewProperties {
-
+
/**
* @deprecated
*/
public static final String SORT_DECLARATIONAL = StructureViewProperties.Sorting.DECLARATIONAL.toString();
-
+
/**
* @deprecated
- */
+ */
public void setSorting(String sorting) { }
-
- private List relations = new ArrayList();
- private List filteredMemberAccessibility = new ArrayList();
- private List filteredMemberModifiers = new ArrayList();
- private List filteredMemberKinds = new ArrayList();
- private List grouping = new ArrayList();
+
+ private List<IRelationship.Kind> relations = new ArrayList<>();
+ private List<IProgramElement.Accessibility> filteredMemberAccessibility = new ArrayList<>();
+ private List<IProgramElement.Modifiers> filteredMemberModifiers = new ArrayList<>();
+ private List<IProgramElement.Kind> filteredMemberKinds = new ArrayList<>();
+ private List<Grouping> grouping = new ArrayList<>();
private Sorting sorting = Sorting.DECLARATIONAL;
private Granularity granularity = StructureViewProperties.Granularity.DECLARED_ELEMENTS;
public List getRelations() {
return relations;
}
-
+
public void setRelations(List relations) {
- this.relations = relations;
+ this.relations = relations;
}
public void addRelation(IRelationship.Kind kind) {
@@ -71,9 +73,9 @@ public class StructureViewProperties {
public void addFilteredMemberAccessibility(IProgramElement.Accessibility accessibility) {
this.filteredMemberAccessibility.add(accessibility);
}
-
+
public void removeFilteredMemberAccessibility(IProgramElement.Accessibility accessibility) {
- this.filteredMemberAccessibility.remove(accessibility);
+ this.filteredMemberAccessibility.remove(accessibility);
}
public List getFilteredMemberModifiers() {
@@ -83,15 +85,15 @@ public class StructureViewProperties {
public void setFilteredMemberModifiers(List memberModifiers) {
this.filteredMemberModifiers = memberModifiers;
}
-
+
public void addFilteredMemberModifiers(IProgramElement.Modifiers modifiers) {
this.filteredMemberModifiers.add(modifiers);
}
-
+
public void removeFilteredMemberModifiers(IProgramElement.Modifiers modifiers) {
- this.filteredMemberModifiers.remove(modifiers);
+ this.filteredMemberModifiers.remove(modifiers);
}
-
+
public StructureViewProperties.Sorting getSorting() {
return sorting;
}
@@ -99,7 +101,7 @@ public class StructureViewProperties {
public void setSorting(StructureViewProperties.Sorting sorting) {
this.sorting = sorting;
}
-
+
public List getFilteredMemberKinds() {
return filteredMemberKinds;
}
@@ -107,15 +109,15 @@ public class StructureViewProperties {
public void setFilteredMemberKinds(List memberKinds) {
this.filteredMemberKinds = memberKinds;
}
-
+
public void addFilteredMemberKind(IProgramElement.Kind kind) {
this.filteredMemberKinds.add(kind);
}
-
+
public void removeFilteredMemberKind(IProgramElement.Kind kind) {
- this.filteredMemberKinds.remove(kind);
+ this.filteredMemberKinds.remove(kind);
}
-
+
public List getGrouping() {
return grouping;
}
@@ -123,8 +125,8 @@ public class StructureViewProperties {
public void setGrouping(List grouping) {
this.grouping = grouping;
}
-
-
+
+
public void addGrouping(Grouping grouping) {
this.grouping.add(grouping);
}
@@ -140,37 +142,37 @@ public class StructureViewProperties {
public void setGranularity(Granularity granularity) {
this.granularity = granularity;
}
-
+
public String getName() {
return "<unnamed view>";
}
-
+
public String toString() {
return "\nView Properties:"
- + "\n-> sorting: " + sorting
+ + "\n-> sorting: " + sorting
+ "\n-> grouping: " + grouping
+ "\n-> filtered member kinds: " + filteredMemberKinds
+ "\n-> filtered member accessibility: " + filteredMemberAccessibility
+ "\n-> filtered member modifiers: " + filteredMemberModifiers
+ "\n-> relations: " + relations;
}
-
+
public static class Hierarchy {
-
+
public static final Hierarchy DECLARATION = new Hierarchy("package hierarchy");
public static final Hierarchy CROSSCUTTING = new Hierarchy("crosscutting structure");
public static final Hierarchy INHERITANCE = new Hierarchy("type hierarchy");
public static final Hierarchy[] ALL = { DECLARATION, CROSSCUTTING, INHERITANCE };
-
+
private final String name;
-
+
private Hierarchy(String name) {
this.name = name;
}
-
+
public String toString() {
return name;
- }
+ }
// The 4 declarations below are necessary for serialization
private static int nextOrdinal = 0;
@@ -179,22 +181,22 @@ public class StructureViewProperties {
return ALL[ordinal];
}
}
-
+
public static class Grouping {
-
+
public static final Grouping KIND = new Grouping("group by kind");
public static final Grouping VISIBILITY = new Grouping("group by visibility");
public static final Grouping[] ALL = { KIND, VISIBILITY };
-
+
private final String name;
-
+
private Grouping(String name) {
this.name = name;
}
-
+
public String toString() {
return name;
- }
+ }
// The 4 declarations below are necessary for serialization
private static int nextOrdinal = 0;
@@ -203,22 +205,22 @@ public class StructureViewProperties {
return ALL[ordinal];
}
}
-
+
public static class Sorting {
-
+
public static final Sorting ALPHABETICAL = new Sorting("sort alphabetically");
public static final Sorting DECLARATIONAL = new Sorting("sort declarationally");
public static final Sorting[] ALL = { ALPHABETICAL, DECLARATIONAL };
-
+
private final String name;
-
+
private Sorting(String name) {
this.name = name;
}
-
+
public String toString() {
return name;
- }
+ }
// The 4 declarations below are necessary for serialization
private static int nextOrdinal = 0;
@@ -227,25 +229,25 @@ public class StructureViewProperties {
return ALL[ordinal];
}
}
-
+
public static class Granularity {
-
+
public static final Granularity PACKAGE = new Granularity("package");
public static final Granularity FILE = new Granularity("file");
public static final Granularity TYPE = new Granularity("type");
public static final Granularity MEMBER = new Granularity("member");
public static final Granularity DECLARED_ELEMENTS = new Granularity("declared body elements");
public static final Granularity[] ALL = { PACKAGE, FILE, TYPE, MEMBER, DECLARED_ELEMENTS };
-
+
private final String name;
-
+
private Granularity(String name) {
this.name = name;
}
-
+
public String toString() {
return name;
- }
+ }
// The 4 declarations below are necessary for serialization
private static int nextOrdinal = 0;