Skip to content
Commits on Source (11)
Manifest-Version: 1.0
Main-Class: org.aspectj.tools.ajbrowser.Main
Automatic-Module-Name: org.aspectj.tools
Name: org/aspectj/tools/
Specification-Title: AspectJ Tools Classes
......
......@@ -124,4 +124,14 @@ public class BrowserCompilerConfiguration implements ICompilerConfiguration {
return null;
}
@Override
public String getModulepath() {
return null;
}
@Override
public String getModuleSourcepath() {
return null;
}
}
......@@ -61,10 +61,11 @@ public interface ICompilerConfiguration extends CompilerConfigurationChangeFlags
*/
public List<File> getProjectSourceFilesChanged();
/**
* @return the classpath to use
*/
public String getClasspath();
public String getModulepath();
public String getModuleSourcepath();
/**
* @return the IOutputLocationManager associated with this compiler configuration
......
......@@ -37,6 +37,7 @@ import org.aspectj.bridge.ISourceLocation;
import org.aspectj.bridge.Message;
import org.aspectj.bridge.SourceLocation;
import org.aspectj.bridge.context.CompilationAndWeavingContext;
import org.aspectj.org.eclipse.jdt.internal.compiler.batch.FileSystem.Classpath;
import org.aspectj.org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.aspectj.util.LangUtil;
......@@ -277,6 +278,14 @@ public class AjdeCoreBuildManager {
both.addAll(configClasspath);
both.addAll(toAdd);
config.setClasspath(both);
Classpath[] checkedClasspaths = config.getCheckedClasspaths();
ArrayList<Classpath> cps = parser.handleClasspath(toAdd, compilerConfig.getProjectEncoding());
Classpath[] newCheckedClasspaths = new Classpath[checkedClasspaths.length+cps.size()];
System.arraycopy(checkedClasspaths, 0, newCheckedClasspaths, 0, checkedClasspaths.length);
for (int i=0;i<cps.size();i++) {
newCheckedClasspaths[checkedClasspaths.length+i] = cps.get(i);
}
config.setCheckedClasspaths(newCheckedClasspaths);
}
}
......@@ -295,18 +304,18 @@ public class AjdeCoreBuildManager {
}
// Process the INPATH
mergeInto(config.getInpath(), compilerConfig.getInpath());
config.addToInpath(compilerConfig.getInpath());
// bug 168840 - calling 'setInPath(..)' creates BinarySourceFiles which
// are used to see if there have been changes in classes on the inpath
if (config.getInpath() != null) {
config.setInPath(config.getInpath());
config.processInPath();
}
// Process the SOURCE PATH RESOURCES
config.setSourcePathResources(compilerConfig.getSourcePathResources());
// Process the ASPECTPATH
mergeInto(config.getAspectpath(), compilerConfig.getAspectPath());
config.addToAspectpath(compilerConfig.getAspectPath());
// Process the JAVA OPTIONS MAP
Map<String,String> jom = compilerConfig.getJavaOptionsMap();
......@@ -347,17 +356,6 @@ public class AjdeCoreBuildManager {
return config;
}
private <T> void mergeInto(Collection<T> target, Collection<T> source) {
if ((null == target) || (null == source)) {
return;
}
for (T next : source) {
if (!target.contains(next)) {
target.add(next);
}
}
}
/**
* Helper method for configure build options. This reads all command-line options specified in the non-standard options text
* entry and sets any corresponding unset values in config.
......
......@@ -101,7 +101,7 @@ public class Ajde {
INSTANCE.compilerConfig = compilerConfig;
INSTANCE.uiBuildMsgHandler = uiBuildMessageHandler;
INSTANCE.buildProgressMonitor = monitor;
INSTANCE.asm = AsmManager.createNewStructureModel(Collections.EMPTY_MAP);
INSTANCE.asm = AsmManager.createNewStructureModel(Collections.<File,String>emptyMap());
INSTANCE.iconRegistry = iconRegistry;
INSTANCE.ideUIAdapter = ideUIAdapter;
......
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.7
Manifest-Version: 1.0
Main-Class: org.aspectj.tools.ajdoc.Main
Automatic-Module-Name: org.aspectj.tools
Name: org/aspectj/tools/
Specification-Title: AspectJ Tools Classes
......
......@@ -48,7 +48,7 @@ class HtmlDecorator {
private static final String ITD_FIELD_SUMMARY = "Inter-Type Field Summary";
private static final String ITD_CONSTRUCTOR_SUMMARY = "Inter-Type Constructor Summary";
static List visibleFileList = new ArrayList();
static List<String> visibleFileList = new ArrayList<String>();
static Hashtable declIDTable = null;
static File rootDir = null;
static String docVisibilityModifier;
......@@ -266,6 +266,11 @@ class HtmlDecorator {
// Java8:
// <pre>static class <span class="typeNameLabel">ClassA.InnerAspect</span>
classStartIndex = fileContents.toString().indexOf("class <span class=\"typeNameLabel\">");
if (classStartIndex == -1) {
// Java7: 464604
// <pre>public class <span class="strong">Azpect</span>
classStartIndex = fileContents.toString().indexOf("class <span class=\"strong\">");
}
int classEndIndex = fileContents.toString().indexOf("</span>", classStartIndex);
if (classEndIndex != -1) {
// Convert it to "aspect <span class="typeNameLabel">ClassA.InnerAspect</span>"
......@@ -286,22 +291,22 @@ class HtmlDecorator {
}
static void addAspectDocumentation(IProgramElement node, StringBuffer fileBuffer, int index) {
List pointcuts = new ArrayList();
List advice = new ArrayList();
List declares = new ArrayList();
List methodsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_METHOD);
List<IProgramElement> pointcuts = new ArrayList<IProgramElement>();
List<IProgramElement> advice = new ArrayList<IProgramElement>();
List<IProgramElement> declares = new ArrayList<IProgramElement>();
List<IProgramElement> methodsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_METHOD);
if (methodsDeclaredOn != null && !methodsDeclaredOn.isEmpty()) {
insertDeclarationsSummary(fileBuffer, methodsDeclaredOn, ITD_METHOD_SUMMARY, index);
}
List fieldsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_FIELD);
List<IProgramElement> fieldsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_FIELD);
if (fieldsDeclaredOn != null && !fieldsDeclaredOn.isEmpty()) {
insertDeclarationsSummary(fileBuffer, fieldsDeclaredOn, ITD_FIELD_SUMMARY, index);
}
List constDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR);
List<IProgramElement> constDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.INTER_TYPE_CONSTRUCTOR);
if (fieldsDeclaredOn != null && !constDeclaredOn.isEmpty()) {
insertDeclarationsSummary(fileBuffer, constDeclaredOn, ITD_CONSTRUCTOR_SUMMARY, index);
}
for (Iterator it = node.getChildren().iterator(); it.hasNext();) {
for (Iterator<IProgramElement> it = node.getChildren().iterator(); it.hasNext();) {
IProgramElement member = (IProgramElement) it.next();
if (member.getKind().equals(IProgramElement.Kind.POINTCUT)) {
pointcuts.add(member);
......@@ -324,17 +329,17 @@ class HtmlDecorator {
insertDeclarationsDetails(fileBuffer, advice, ADVICE_DETAIL, index);
}
// add the 'aspect declarations' information against the type
List parentsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.DECLARE_PARENTS);
List<IProgramElement> parentsDeclaredOn = StructureUtil.getDeclareInterTypeTargets(node, IProgramElement.Kind.DECLARE_PARENTS);
if (parentsDeclaredOn != null && parentsDeclaredOn.size() > 0) {
decorateDocWithRel(node, fileBuffer, index, parentsDeclaredOn, HtmlRelationshipKind.ASPECT_DECLARATIONS);
}
// add the 'annotated by' information against the type
List annotatedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE, "annotated by");
List<String> annotatedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE, "annotated by");
if (annotatedBy != null && annotatedBy.size() > 0) {
decorateDocWithRel(node, fileBuffer, index, annotatedBy, HtmlRelationshipKind.ANNOTATED_BY);
}
// add the 'advised by' information against the type
List advisedBy = StructureUtil.getTargets(node, IRelationship.Kind.ADVICE);
List<String> advisedBy = StructureUtil.getTargets(node, IRelationship.Kind.ADVICE);
if (advisedBy != null && advisedBy.size() > 0) {
decorateDocWithRel(node, fileBuffer, index, advisedBy, HtmlRelationshipKind.ADVISED_BY);
}
......@@ -616,16 +621,16 @@ class HtmlDecorator {
}
static void decorateMemberDocumentation(IProgramElement node, StringBuffer fileContentsBuffer, int index) {
List targets = StructureUtil.getTargets(node, IRelationship.Kind.ADVICE);
List<String> targets = StructureUtil.getTargets(node, IRelationship.Kind.ADVICE);
decorateDocWithRel(node, fileContentsBuffer, index, targets, HtmlRelationshipKind.ADVISED_BY);
List warnings = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE, "matches declare");
List<String> warnings = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE, "matches declare");
decorateDocWithRel(node, fileContentsBuffer, index, warnings, HtmlRelationshipKind.MATCHES_DECLARE);
List softenedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE, "softened by");
List<String> softenedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE, "softened by");
decorateDocWithRel(node, fileContentsBuffer, index, softenedBy, HtmlRelationshipKind.SOFTENED_BY);
List annotatedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE, "annotated by");
List<String> annotatedBy = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE, "annotated by");
decorateDocWithRel(node, fileContentsBuffer, index, annotatedBy, HtmlRelationshipKind.ANNOTATED_BY);
}
......
......@@ -16,6 +16,14 @@ package org.aspectj.tools.ajdoc;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.List;
import java.util.Vector;
import javax.tools.DocumentationTool;
import javax.tools.DocumentationTool.DocumentationTask;
import javax.tools.JavaFileObject;
import javax.tools.StandardJavaFileManager;
import javax.tools.ToolProvider;
/**
* @author Mik Kersten
......@@ -62,7 +70,7 @@ class JavadocRunner {
// defaultSecurityManager.checkPermission( permission, context );
// }
// } );
try {
// for JDK 1.4 and above call the execute method...
Class jdMainClass = com.sun.tools.javadoc.Main.class;
......@@ -92,4 +100,13 @@ class JavadocRunner {
// Set the security manager back
// System.setSecurityManager(defaultSecurityManager);
}
public static void callJavadocViaToolProvider(Vector<String> options, List<String> files) {
DocumentationTool doctool = ToolProvider.getSystemDocumentationTool();
StandardJavaFileManager fm = doctool.getStandardFileManager(null, null, null);
Iterable<? extends JavaFileObject> jfos = fm.getJavaFileObjects(files.toArray(new String[0]));
DocumentationTask task = doctool.getTask(null/*standard System.err*/, null/*standard file manager*/,
null/*default diagnostic listener*/, null/*standard doclet*/, options, jfos);
task.call();
}
}
......@@ -35,6 +35,7 @@ import org.aspectj.asm.AsmManager;
import org.aspectj.bridge.IMessage;
import org.aspectj.bridge.Version;
import org.aspectj.util.FileUtil;
import org.aspectj.util.LangUtil;
/**
* This is an old implementation of ajdoc that does not use an OO style. However, it does the job, and should serve to evolve a
......@@ -47,24 +48,24 @@ public class Main implements Config {
private static final String FAIL_MESSAGE = "> compile failed, exiting ajdoc";
/** Command line options. */
static Vector options;
static Vector<String> options;
/** Options to pass to ajc. */
static Vector ajcOptions;
static Vector<String> ajcOptions;
/** All of the files to be processed by ajdoc. */
static Vector filenames;
static Vector<String> filenames;
/** List of files to pass to javadoc. */
static Vector fileList;
static Vector<String> fileList;
/** List of packages to pass to javadoc. */
static Vector packageList;
static Vector<String> packageList;
/** Default to package visiblity. */
static String docModifier = "package";
static Vector sourcepath;
static Vector<String> sourcepath;
static boolean verboseMode = false;
static boolean packageMode = false;
......@@ -85,13 +86,13 @@ public class Main implements Config {
private static String outputWorkingDir = Config.WORKING_DIR;
public static void clearState() {
options = new Vector();
ajcOptions = new Vector();
filenames = new Vector();
fileList = new Vector();
packageList = new Vector();
options = new Vector<String>();
ajcOptions = new Vector<String>();
filenames = new Vector<String>();
fileList = new Vector<String>();
packageList = new Vector<String>();
docModifier = "package";
sourcepath = new Vector();
sourcepath = new Vector<String>();
verboseMode = false;
packageMode = false;
rootDir = null;
......@@ -125,7 +126,7 @@ public class Main implements Config {
}
for (int i = 0; i < filenames.size(); i++) {
inputFiles[i] = new File((String) filenames.elementAt(i));
inputFiles[i] = new File(filenames.elementAt(i));
}
// PHASE 0: call ajc
......@@ -169,7 +170,7 @@ public class Main implements Config {
* package-summary properly.
*/
private static void packageHTML(AsmManager model, File[] inputFiles) throws IOException {
ArrayList dirList = new ArrayList();
ArrayList<String> dirList = new ArrayList<String>();
for (int i = 0; i < inputFiles.length; i++) {
String packageName = StructureUtil.getPackageDeclarationFromFile(model, inputFiles[i]);
// Only copy the package.html file once.
......@@ -192,7 +193,7 @@ public class Main implements Config {
String pathName = outputWorkingDir + File.separator + packageName.replace('.', File.separatorChar);
File packageDir = new File(pathName);
if (!packageDir.exists()) {
dirList.add(packageDir);
dirList.add(packageName);
continue;
}
packageName = packageName.replace('.', '/'); // !!!
......@@ -223,7 +224,7 @@ public class Main implements Config {
String[] argsToCompiler = new String[ajcOptions.size() + inputFiles.length];
int i = 0;
for (; i < ajcOptions.size(); i++) {
argsToCompiler[i] = (String) ajcOptions.elementAt(i);
argsToCompiler[i] = ajcOptions.elementAt(i);
}
for (int j = 0; j < inputFiles.length; j++) {
argsToCompiler[i] = inputFiles[j].getAbsolutePath();
......@@ -237,6 +238,8 @@ public class Main implements Config {
private static void callJavadoc(File[] signatureFiles) throws IOException {
System.out.println("> Calling javadoc...");
String[] javadocargs = null;
List<String> files = new ArrayList<String>();
if (packageMode) {
int numExtraArgs = 2;
if (authorStandardDocletSwitch)
......@@ -256,25 +259,37 @@ public class Main implements Config {
}
// javadocargs[1] = getSourcepathAsString();
for (int k = 0; k < options.size(); k++) {
javadocargs[numExtraArgs + k] = (String) options.elementAt(k);
javadocargs[numExtraArgs + k] = options.elementAt(k);
}
for (int k = 0; k < packageList.size(); k++) {
javadocargs[numExtraArgs + options.size() + k] = (String) packageList.elementAt(k);
javadocargs[numExtraArgs + options.size() + k] = packageList.elementAt(k);
}
for (int k = 0; k < fileList.size(); k++) {
javadocargs[numExtraArgs + options.size() + packageList.size() + k] = (String) fileList.elementAt(k);
javadocargs[numExtraArgs + options.size() + packageList.size() + k] = fileList.elementAt(k);
}
if (LangUtil.is19VMOrGreater()) {
options = new Vector<String>();
for (String a: javadocargs) {
options.add(a);
}
}
} else {
javadocargs = new String[options.size() + signatureFiles.length];
for (int k = 0; k < options.size(); k++) {
javadocargs[k] = (String) options.elementAt(k);
javadocargs[k] = options.elementAt(k);
}
for (int k = 0; k < signatureFiles.length; k++) {
javadocargs[options.size() + k] = StructureUtil.translateAjPathName(signatureFiles[k].getCanonicalPath());
}
for (int k = 0; k < signatureFiles.length; k++) {
files.add(StructureUtil.translateAjPathName(signatureFiles[k].getCanonicalPath()));
}
}
if (LangUtil.is19VMOrGreater()) {
JavadocRunner.callJavadocViaToolProvider(options, files);
} else {
JavadocRunner.callJavadoc(javadocargs);
}
JavadocRunner.callJavadoc(javadocargs);
}
/**
......@@ -291,7 +306,7 @@ public class Main implements Config {
removeDeclIDsFromFile("serialized-form.html", true);
if (packageList.size() > 0) {
for (int p = 0; p < packageList.size(); p++) {
removeDeclIDsFromFile(((String) packageList.elementAt(p)).replace('.', '/') + Config.DIR_SEP_CHAR
removeDeclIDsFromFile(packageList.elementAt(p).replace('.', '/') + Config.DIR_SEP_CHAR
+ "package-summary.html", true);
}
} else {
......@@ -301,6 +316,7 @@ public class Main implements Config {
return;
}
files = FileUtil.listFiles(rootDir, new FileFilter() {
@Override
public boolean accept(File f) {
return f.getName().equals("package-summary.html");
}
......@@ -345,11 +361,11 @@ public class Main implements Config {
}
}
static Vector getSourcePath() {
Vector sourcePath = new Vector();
static Vector<String> getSourcePath() {
Vector<String> sourcePath = new Vector<String>();
boolean found = false;
for (int i = 0; i < options.size(); i++) {
String currOption = (String) options.elementAt(i);
String currOption = options.elementAt(i);
if (found && !currOption.startsWith("-")) {
sourcePath.add(currOption);
}
......@@ -363,8 +379,8 @@ public class Main implements Config {
static File getRootDir() {
File rootDir = new File(".");
for (int i = 0; i < options.size(); i++) {
if (((String) options.elementAt(i)).equals("-d")) {
rootDir = new File((String) options.elementAt(i + 1));
if (options.elementAt(i).equals("-d")) {
rootDir = new File(options.elementAt(i + 1));
if (!rootDir.exists()) {
rootDir.mkdir();
// System.out.println( "Destination directory not found: " +
......@@ -455,15 +471,15 @@ public class Main implements Config {
String line = "";
line = br.readLine();
StringTokenizer st = new StringTokenizer(line, " ");
List argList = new ArrayList();
List<String> argList = new ArrayList<String>();
while (st.hasMoreElements()) {
argList.add(st.nextElement());
argList.add(st.nextToken());
}
// System.err.println(argList);
args = new String[argList.size()];
int counter = 0;
for (Iterator it = argList.iterator(); it.hasNext();) {
args[counter] = (String) it.next();
for (Iterator<String> it = argList.iterator(); it.hasNext();) {
args[counter] = it.next();
counter++;
}
} catch (FileNotFoundException e) {
......@@ -474,7 +490,7 @@ public class Main implements Config {
ioe.printStackTrace();
}
}
List vargs = new LinkedList(Arrays.asList(args));
List<String> vargs = new LinkedList<String>(Arrays.asList(args));
vargs.add("-Xset:minimalModel=false");
parseArgs(vargs, new File(".")); // !!!
......@@ -488,14 +504,14 @@ public class Main implements Config {
arg = arg + File.pathSeparator; // makes things easier for ourselves
StringTokenizer tokenizer = new StringTokenizer(arg, File.pathSeparator);
while (tokenizer.hasMoreElements()) {
sourcepath.addElement(tokenizer.nextElement());
sourcepath.addElement(tokenizer.nextToken());
}
}
static String getSourcepathAsString() {
String cPath = "";
for (int i = 0; i < sourcepath.size(); i++) {
cPath += (String) sourcepath.elementAt(i) + Config.DIR_SEP_CHAR + outputWorkingDir;
cPath += sourcepath.elementAt(i) + Config.DIR_SEP_CHAR + outputWorkingDir;
if (i != sourcepath.size() - 1) {
cPath += File.pathSeparator;
}
......@@ -668,10 +684,11 @@ public class Main implements Config {
// do this for every item in the classpath
for (int c = 0; c < sourcepath.size(); c++) {
String path = (String) sourcepath.elementAt(c) + Config.DIR_SEP_CHAR + arg;
String path = sourcepath.elementAt(c) + Config.DIR_SEP_CHAR + arg;
File pkg = new File(path);
if (pkg.isDirectory()) {
String[] files = pkg.list(new FilenameFilter() {
@Override
public boolean accept(File dir, String name) {
int index1 = name.lastIndexOf(".");
int index2 = name.length();
......@@ -685,7 +702,7 @@ public class Main implements Config {
}
});
for (int j = 0; j < files.length; j++) {
filenames.addElement((String) sourcepath.elementAt(c) + Config.DIR_SEP_CHAR + arg
filenames.addElement(sourcepath.elementAt(c) + Config.DIR_SEP_CHAR + arg
+ Config.DIR_SEP_CHAR + files[j]);
}
} else if (c == sourcepath.size()) { // last element on classpath
......@@ -705,7 +722,7 @@ public class Main implements Config {
}
static void expandAtSignFile(String filename, File currentWorkingDir) {
List result = new LinkedList();
List<String> result = new LinkedList<String>();
File atFile = qualifiedFile(filename, currentWorkingDir);
String atFileParent = atFile.getParent();
......@@ -730,6 +747,7 @@ public class Main implements Config {
continue;
result.add(line);
}
stream.close();
} catch (IOException e) {
System.err.println("Error while reading the @ file " + atFile.getPath() + ".\n" + e);
System.exit(-1);
......
......@@ -31,7 +31,7 @@ public class StructureUtil {
*
* @return null if a relationship of that kind is not found
*/
public static List /* String */getTargets(IProgramElement node, IRelationship.Kind kind) {
public static List<String> getTargets(IProgramElement node, IRelationship.Kind kind) {
return getTargets(node, kind, null);
}
......@@ -41,21 +41,21 @@ public class StructureUtil {
*
* @return null if a relationship of that kind is not found
*/
public static List /* String */getTargets(IProgramElement node, IRelationship.Kind kind, String relName) {
List relations = new ArrayList();
List rels = node.getModel().getRelationshipMap().get(node);
public static List<String> getTargets(IProgramElement node, IRelationship.Kind kind, String relName) {
List<IRelationship> relations = new ArrayList<IRelationship>();
List<IRelationship> rels = node.getModel().getRelationshipMap().get(node);
if (rels != null) {
relations.addAll(rels);
}
for (Iterator iter = node.getChildren().iterator(); iter.hasNext();) {
for (Iterator<IProgramElement> iter = node.getChildren().iterator(); iter.hasNext();) {
IProgramElement child = (IProgramElement) iter.next();
// if we're not a type, or if we are and the child is code, then
// we want to get the relationships for this child - this means that the
// correct relationships appear against the type in the ajdoc
if (!node.getKind().isType() || child.getKind().equals(IProgramElement.Kind.CODE)) {
List childRelations = node.getModel().getRelationshipMap().get(child);
List<IRelationship> childRelations = node.getModel().getRelationshipMap().get(child);
if (childRelations != null) {
for (Iterator iterator = childRelations.iterator(); iterator.hasNext();) {
for (Iterator<IRelationship> iterator = childRelations.iterator(); iterator.hasNext();) {
IRelationship rel = (IRelationship) iterator.next();
if (!relations.contains(rel)) {
relations.add(rel);
......@@ -66,13 +66,12 @@ public class StructureUtil {
}
if (relations == null || relations.isEmpty())
return null;
List targets = new ArrayList();
for (Iterator it = relations.iterator(); it.hasNext();) {
List<String> targets = new ArrayList<String>();
for (Iterator<IRelationship> it = relations.iterator(); it.hasNext();) {
IRelationship rtn = (IRelationship) it.next();
if (rtn.getKind().equals(kind) && ((relName != null && relName.equals(rtn.getName())) || relName == null)) {
List targs = rtn.getTargets();
for (Iterator iter = targs.iterator(); iter.hasNext();) {
String element = (String) iter.next();
List<String> targs = rtn.getTargets();
for (String element: targs) {
if (!targets.contains(element)) {
targets.add(element);
}
......@@ -82,14 +81,13 @@ public class StructureUtil {
return targets;
}
static List /* IProgramElement */getDeclareInterTypeTargets(IProgramElement node, IProgramElement.Kind kind) {
List targets = new ArrayList();
List stringTargets = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE);
static List<IProgramElement> getDeclareInterTypeTargets(IProgramElement node, IProgramElement.Kind kind) {
List<IProgramElement> targets = new ArrayList<IProgramElement>();
List<String> stringTargets = StructureUtil.getTargets(node, IRelationship.Kind.DECLARE_INTER_TYPE);
if (stringTargets == null) {
return null;
}
for (Iterator iter = stringTargets.iterator(); iter.hasNext();) {
String element = (String) iter.next();
for (String element: stringTargets) {
IProgramElement ipe = node.getModel().getHierarchy().findElementForHandle(element);
if (ipe != null && ipe.getKind().equals(kind)) {
targets.add(ipe);
......@@ -98,13 +96,12 @@ public class StructureUtil {
return targets;
}
public static List/* String */getDeclareTargets(IProgramElement node) {
List relations = node.getModel().getRelationshipMap().get(node);
List targets = null;
public static List<String> getDeclareTargets(IProgramElement node) {
List<IRelationship> relations = node.getModel().getRelationshipMap().get(node);
List<String> targets = null;
if (relations == null)
return null;
for (Iterator it = relations.iterator(); it.hasNext();) {
IRelationship rtn = (IRelationship) it.next();
for (IRelationship rtn: relations) {
if (rtn.getKind().isDeclareKind()) {
targets = rtn.getTargets();
}
......
#Tue Jan 16 09:21:46 GMT 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
......@@ -8,9 +7,9 @@ org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
......@@ -58,6 +57,6 @@ org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.incompatibleJDKLevel=ignore
org.eclipse.jdt.core.incompleteClasspath=error
Manifest-Version: 1.0
Automatic-Module-Name: org.aspectj.runtime
Name: org/aspectj/lang/
Specification-Title: AspectJ Runtime Classes
......
#Tue Sep 08 17:08:00 PDT 2009
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
......@@ -54,4 +54,4 @@ org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=di
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=ignore
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.5
org.eclipse.jdt.core.compiler.source=1.7
......@@ -82,6 +82,8 @@ public interface Constants {
public final static short MINOR_1_8 = 0;
public final static short MAJOR_1_9 = 53;
public final static short MINOR_1_9 = 0;
public final static short MAJOR_10 = 54;
public final static short MINOR_10 = 0;
// Defaults
public final static short MAJOR = MAJOR_1_1;
public final static short MINOR = MINOR_1_1;
......@@ -107,17 +109,28 @@ public interface Constants {
public final static short ACC_INTERFACE = 0x0200;
public final static short ACC_ABSTRACT = 0x0400;
public final static short ACC_STRICT = 0x0800;
public final static short ACC_SYNTHETIC = 0x1000;
public final static short ACC_ANNOTATION = 0x2000;
public final static short ACC_ENUM = 0x4000;
public final static int ACC_MODULE = 0x8000;
public final static short ACC_BRIDGE = 0x0040;
public final static short ACC_VARARGS = 0x0080;
// module related
public final static int MODULE_ACC_PUBLIC = 0x0020;
public final static int MODULE_ACC_SYNTHETIC = 0x1000;
public final static int MODULE_ACC_MANDATED = 0x8000;
// Module related
// Indicates that any module which depends on the current module,
// implicitly declares a dependence on the module indicated by this entry.
public final static int MODULE_ACC_TRANSITIVE = 0x0020;
// Indicates that this dependence is mandatory in the static phase, i.e., at
// compile time, but is optional in the dynamic phase, i.e., at run time.
public final static int MODULE_ACC_STATIC_PHASE = 0x0040;
// Indicates that this dependence was not explicitly or implicitly declared
// in the source of the module declaration.
public final static int MODULE_ACC_SYNTHETIC = 0x1000;
// Indicates that this dependence was implicitly declared in the source of
// the module declaration
public final static int MODULE_ACC_MANDATED = 0x8000;
// Applies to classes compiled by new compilers only
public final static short ACC_SUPER = 0x0020;
......@@ -143,10 +156,17 @@ public interface Constants {
public final static byte CONSTANT_MethodHandle = 15;
public final static byte CONSTANT_MethodType = 16;
public final static byte CONSTANT_InvokeDynamic = 18;
// J9:
public final static byte CONSTANT_Module = 19;
public final static byte CONSTANT_Package = 20;
public final static String[] CONSTANT_NAMES = { "", "CONSTANT_Utf8", "", "CONSTANT_Integer", "CONSTANT_Float", "CONSTANT_Long",
"CONSTANT_Double", "CONSTANT_Class", "CONSTANT_String", "CONSTANT_Fieldref", "CONSTANT_Methodref",
"CONSTANT_InterfaceMethodref", "CONSTANT_NameAndType","","","CONSTANT_MethodHandle","CONSTANT_MethodType","","CONSTANT_InvokeDynamic" };
"CONSTANT_InterfaceMethodref", "CONSTANT_NameAndType","","","CONSTANT_MethodHandle","CONSTANT_MethodType","","CONSTANT_InvokeDynamic",
// J9:
"CONSTANT_Module", "CONSTANT_Package"};
/**
* The name of the static initializer, also called &quot;class initialization method&quot; or &quot;interface initialization
......@@ -624,8 +644,13 @@ public interface Constants {
public static final byte ATTR_RUNTIME_VISIBLE_TYPE_ANNOTATIONS = 20;
public static final byte ATTR_RUNTIME_INVISIBLE_TYPE_ANNOTATIONS = 21;
public static final byte ATTR_METHOD_PARAMETERS = 22;
public static final short KNOWN_ATTRIBUTES = 23;
// J9:
public static final byte ATTR_MODULE = 23;
public static final byte ATTR_MODULE_PACKAGES = 24;
public static final byte ATTR_MODULE_MAIN_CLASS = 25;
public static final short KNOWN_ATTRIBUTES = 26;
public static final String[] ATTRIBUTE_NAMES = {
"SourceFile", "ConstantValue", "Code", "Exceptions", "LineNumberTable", "LocalVariableTable",
......@@ -633,7 +658,7 @@ public interface Constants {
"RuntimeVisibleAnnotations", "RuntimeInvisibleAnnotations", "RuntimeVisibleParameterAnnotations",
"RuntimeInvisibleParameterAnnotations", "LocalVariableTypeTable", "EnclosingMethod",
"AnnotationDefault","BootstrapMethods", "RuntimeVisibleTypeAnnotations", "RuntimeInvisibleTypeAnnotations",
"MethodParameters"
"MethodParameters", "Module", "ModulePackages", "ModuleMainClass"
};
/**
......
......@@ -167,6 +167,12 @@ public abstract class Attribute implements Cloneable, Node, Serializable {
return new RuntimeInvisTypeAnnos(idx, len, file, cpool);
case Constants.ATTR_METHOD_PARAMETERS:
return new MethodParameters(idx, len, file, cpool);
case Constants.ATTR_MODULE:
return new Module(idx, len, file, cpool);
case Constants.ATTR_MODULE_PACKAGES:
return new ModulePackages(idx, len, file, cpool);
case Constants.ATTR_MODULE_MAIN_CLASS:
return new ModuleMainClass(idx, len, file, cpool);
default:
throw new IllegalStateException();
}
......
......@@ -95,7 +95,7 @@ public final class BootstrapMethods extends Attribute {
BootstrapMethods(int name_index, int length, DataInputStream file, ConstantPool constant_pool) throws IOException {
this(name_index, length, (BootstrapMethod[])null, constant_pool);
data = new byte[length];
file.read(data);
file.readFully(data);
isInPackedState = true;
}
......
......@@ -180,7 +180,6 @@ public final class ClassParser {
superclassnameIndex = file.readUnsignedShort();
}
/** Read constant pool entries */
private final void readConstantPool() throws IOException {
try {
cpool = new ConstantPool(file);
......
......@@ -103,6 +103,10 @@ public interface ClassVisitor {
public void visitConstantString(ConstantString obj);
public void visitConstantModule(ConstantModule obj);
public void visitConstantPackage(ConstantPackage obj);
public void visitConstantUtf8(ConstantUtf8 obj);
public void visitConstantValue(ConstantValue obj);
......@@ -163,5 +167,8 @@ public interface ClassVisitor {
public void visitMethodParameters(MethodParameters methodParameters);
public void visitModule(Module m);
// J9:
public void visitModule(Module module);
public void visitModulePackages(ModulePackages modulePackage);
public void visitModuleMainClass(ModuleMainClass moduleMainClass);
}