Browse Source

Upgraded to new JDT compiler - neon.1 and a bit

tags/V1_8_10
Andy Clement 7 years ago
parent
commit
de34df77ea
37 changed files with 236 additions and 196 deletions
  1. 1
    0
      build/.isJava5
  2. 19
    18
      build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
  3. 6
    6
      build/src/org/aspectj/internal/tools/ant/taskdefs/Checklics.java
  4. 6
    6
      build/src/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java
  5. 12
    13
      build/src/org/aspectj/internal/tools/build/Builder.java
  6. 33
    30
      build/src/org/aspectj/internal/tools/build/Module.java
  7. 1
    1
      build/src/org/aspectj/internal/tools/build/Modules.java
  8. 30
    31
      build/src/org/aspectj/internal/tools/build/Result.java
  9. 10
    14
      build/src/org/aspectj/internal/tools/build/SampleGatherer.java
  10. 8
    11
      build/testsrc/org/aspectj/build/BuildModuleTests.java
  11. 1
    1
      build/testsrc/org/aspectj/internal/build/BuildModuleTest.java
  12. 6
    8
      build/testsrc/org/aspectj/internal/build/ModulesTest.java
  13. BIN
      lib/build/build.jar
  14. BIN
      lib/build/build.old.jar
  15. 1
    1
      org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties
  16. 1
    0
      org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java
  17. 1
    1
      org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java
  18. 5
    0
      org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java
  19. 1
    1
      org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java
  20. 1
    1
      org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java
  21. 4
    0
      org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java
  22. 15
    15
      org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java
  23. 1
    1
      org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BinaryFormsTestCase.java
  24. 2
    2
      org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AjCompilerOptionsTest.java
  25. 5
    8
      org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/VisitorTestCase.java
  26. BIN
      org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip
  27. BIN
      org.eclipse.jdt.core/jdtcore-for-aspectj.jar
  28. 8
    9
      testing-client/src/org/aspectj/testing/Tester.java
  29. 3
    3
      testing-client/src/org/aspectj/testing/server/TestServer.java
  30. 4
    5
      testing-client/testsrc/org/aspectj/testing/TesterTest.java
  31. 36
    0
      tests/bugs1810/502807/TestCollectors.java
  32. 2
    2
      tests/src/org/aspectj/systemtest/ajc150/ajc150.xml
  33. 4
    0
      tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java
  34. 6
    0
      tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml
  35. 1
    3
      weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java
  36. 2
    3
      weaver/testsrc/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java
  37. 0
    2
      weaver5/java5-testsrc/org/aspectj/weaver/MemberTestCase15.java

+ 1
- 0
build/.isJava5 View File

@@ -0,0 +1 @@

+ 19
- 18
build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java View File

@@ -84,7 +84,7 @@ public class AntBuilder extends Builder {
/**
* Ensure targets exist for this module and all antecedants, so topoSort can work.
*/
private static void makeTargetsForResult(final Result result, final Hashtable targets) {
private static void makeTargetsForResult(final Result result, final Hashtable<String,Target> targets) {
final String resultTargetName = resultToTargetName(result);
Target target = (Target) targets.get(resultTargetName);
if (null == target) {
@@ -196,7 +196,7 @@ public class AntBuilder extends Builder {
return copy;
}

protected void dumpMinFile(Result result, File classesDir, List errors) {
protected void dumpMinFile(Result result, File classesDir, List<String> errors) {
String name = result.getName() + "-empty";
File minFile = new File(classesDir, name);
FileWriter fw = null;
@@ -211,8 +211,8 @@ public class AntBuilder extends Builder {

}

protected boolean compile(Result result, File classesDir, boolean useExistingClasses, List errors) {
@Override
protected boolean compile(Result result, File classesDir, boolean useExistingClasses, List<String> errors) {
if (!classesDir.exists() && !classesDir.mkdirs()) {
errors.add("compile - unable to create " + classesDir);
return false;
@@ -224,8 +224,9 @@ public class AntBuilder extends Builder {
Path path = new Path(project);
boolean hasSourceDirectories = false;
boolean isJava5Compile = false;
for (Iterator iter = result.getSrcDirs().iterator(); iter.hasNext();) {
File file = (File) iter.next();
for (File file: result.getSrcDirs()) {
// for (Iterator iter = result.getSrcDirs().iterator(); iter.hasNext();) {
// File file = (File) iter.next();
path.createPathElement().setLocation(file);
if (!isJava5Compile
&& (Util.Constants.JAVA5_SRC.equals(file.getName()) || Util.Constants.JAVA5_TESTSRC.equals(file.getName()) || new File(
@@ -268,8 +269,8 @@ public class AntBuilder extends Builder {
javac.setTarget("1.1"); // 1.1 class files - Javac in 1.4 uses 1.4
javac.setSource("1.3");
} else {
javac.setSource("1.5");
javac.setTarget("1.5");
javac.setSource("1.8");
javac.setTarget("1.8");
}
// compile
boolean passed = false;
@@ -330,7 +331,8 @@ public class AntBuilder extends Builder {
* Merge classes directory and any merge jars into module jar with any specified manifest file. META-INF directories are
* excluded.
*/
protected boolean assemble(Result result, File classesDir, List errors) {
@Override
protected boolean assemble(Result result, File classesDir, List<String> errors) {
if (!buildingEnabled) {
return false;
}
@@ -400,18 +402,18 @@ public class AntBuilder extends Builder {
* @see org.aspectj.internal.tools.build.Builder#buildAntecedants(Module)
*/
protected Result[] getAntecedantResults(Result moduleResult) {
Hashtable targets = new Hashtable();
Hashtable<String,Target> targets = new Hashtable<>();
makeTargetsForResult(moduleResult, targets);
String targetName = resultToTargetName(moduleResult);
// bug: doc says topoSort returns String, but returns Target
Collection result = project.topoSort(targetName, targets);
Collection<Target> result = project.topoSort(targetName, targets);
// fyi, we don't rely on topoSort to detect cycles - see buildAll
int size = result.size();
if (0 == result.size()) {
return new Result[0];
}
ArrayList toReturn = new ArrayList();
for (Iterator iter = result.iterator(); iter.hasNext();) {
ArrayList<String> toReturn = new ArrayList<>();
for (Iterator<Target> iter = result.iterator(); iter.hasNext();) {
Target target = (Target) iter.next();
String name = target.getName();
if (null == name) {
@@ -450,11 +452,10 @@ public class AntBuilder extends Builder {
zip.setDestFile(result.getOutputFile());
ZipFileSet zipfileset = null;
final Module module = result.getModule();
List known = result.findJarRequirements();
List<File> known = result.findJarRequirements();
removeLibraryFilesToSkip(module, known);
// -- merge any antecedents, less any manifest
for (Iterator iter = known.iterator(); iter.hasNext();) {
File jarFile = (File) iter.next();
for (File jarFile: known) {
zipfileset = new ZipFileSet();
zipfileset.setProject(project);
zipfileset.setSrc(jarFile);
@@ -541,8 +542,7 @@ public class AntBuilder extends Builder {

/** @return true if aspectjrt.jar is on classpath */
private static boolean runtimeJarOnClasspath(Result result) {
for (Iterator iter = result.getLibJars().iterator(); iter.hasNext();) {
File file = (File) iter.next();
for (File file: result.getLibJars()) {
if ("aspectjrt.jar".equals(file.getName())) {
return true;
}
@@ -582,6 +582,7 @@ public class AntBuilder extends Builder {
* @param runtimeJar the Path to the aspectjrt.jar
* @return javac or another Task invoking the AspectJ compiler
*/
@SuppressWarnings("unchecked")
static Task aspectJTask(Javac javac, Path toolsJar, Path runtimeJar) {
Object task = null;
String url = null;

+ 6
- 6
build/src/org/aspectj/internal/tools/ant/taskdefs/Checklics.java View File

@@ -54,7 +54,7 @@ public class Checklics extends MatchingTask {
public static final String EPL_CPL_IBM_PARC_XEROX_OTHERS_TAG = "epl-cpl-ibm|parc|xerox|vmware|others";
public static final String DEFAULT = EPL_CPL_IBM_PARC_XEROX_OTHERS_TAG;

static final Map LICENSES; // unmodifiable Map
static final Map<String,License> LICENSES; // unmodifiable Map

static {
final String CONTRIBUTORS = "Contributors";
@@ -82,7 +82,7 @@ public class Checklics extends MatchingTask {
License MPL_ONLY = new License(MPL_ONLY_TAG, LIC_MPL);
License MPL_PARC = new License(MPL_PARC_TAG, LIC_MPL, PARC);
License PARC_COPYRIGHT = new License(PARC_COPYRIGHT_TAG, null, PARC);
LICENSES = new Hashtable();
LICENSES = new Hashtable<>();
LICENSES.put(APL.tag, APL);
LICENSES.put(MPL.tag, MPL);
LICENSES.put(MPL_PARC.tag, MPL_PARC);
@@ -458,11 +458,11 @@ class HeaderInfo {
/** last line of license */
public final boolean hasLicense;

public HeaderInfo(File file, int lastLine, List years, boolean hasLicense) {
public HeaderInfo(File file, int lastLine, List<String> years, boolean hasLicense) {
this.lastLine = lastLine;
this.file = file;
this.hasLicense = hasLicense;
List newYears = new ArrayList();
List<String> newYears = new ArrayList<>();
newYears.addAll(years);
Collections.sort(newYears);
this.years = Collections.unmodifiableList(newYears);
@@ -610,7 +610,7 @@ class Header {
}

public static HeaderInfo checkFile(final File file) {
ArrayList years = new ArrayList();
ArrayList<String> years = new ArrayList<>();
int endLine = 0;
BufferedReader input = null;
int lineNum = 0;
@@ -647,7 +647,7 @@ class Header {
*
* @return true if this line has end-of-comment
*/
private static boolean checkLine(String line, ArrayList years) {
private static boolean checkLine(String line, ArrayList<String> years) {
if ((null == line) || (0 == line.length())) {
return false;
}

+ 6
- 6
build/src/org/aspectj/internal/tools/ant/taskdefs/ConditionalTask.java View File

@@ -25,9 +25,9 @@ public abstract class ConditionalTask extends Task {

public final static String TRUE = "true";

private List ifs;
protected List ifs() {
return ifs != null ? ifs : (ifs = new Vector());
private List<If> ifs;
protected List<If> ifs() {
return ifs != null ? ifs : (ifs = new Vector<If>());
}

public If createIf() {
@@ -166,9 +166,9 @@ public abstract class ConditionalTask extends Task {
return getFalses().size() == 0;
}

protected List getFalses() {
Iterator iter = ifs().iterator();
List result = new Vector();
protected List<String> getFalses() {
Iterator<If> iter = ifs().iterator();
List<String> result = new Vector<>();
while (iter.hasNext()) {
If next = (If) iter.next();
String name = next.getName();

+ 12
- 13
build/src/org/aspectj/internal/tools/build/Builder.java View File

@@ -104,14 +104,14 @@ public abstract class Builder {
private static final String SKIP_LIBRARIES_KEY = "skip.libraries";

/** List (String) names of libraries to skip during assembly */
private static final List SKIP_LIBRARIES;
private static final List<String> SKIP_LIBRARIES;

private static final String ERROR_KEY = "error loading properties";

private static final Properties PROPS;
static {
PROPS = new Properties();
List skips = Collections.EMPTY_LIST;
List<String> skips = Collections.emptyList();
String resourcePattern = "**/*.txt,**/*.rsc,**/*.gif,**/*.properties";
String allPattern = "**/*";
String binarySourcePattern = "**/*.rsc,**/*.gif,**/*.jar,**/*.zip";
@@ -149,7 +149,7 @@ public abstract class Builder {
if ((null == text) || (0 == text.length())) {
return Collections.EMPTY_LIST;
}
List strings = new ArrayList();
List<String> strings = new ArrayList<>();
StringTokenizer tok = new StringTokenizer(text, ",");
while (tok.hasMoreTokens()) {
String token = tok.nextToken().trim();
@@ -275,13 +275,13 @@ public abstract class Builder {
return buildProduct(buildSpec);
}
Result result = specifyResultFor(buildSpec);
ArrayList errors = new ArrayList();
ArrayList<String> errors = new ArrayList<>();
try {
return buildAll(result, errors);
} finally {
if (0 < errors.size()) {
String label = "error building " + buildSpec + ": ";
for (Iterator iter = errors.iterator(); iter.hasNext();) {
for (Iterator<String> iter = errors.iterator(); iter.hasNext();) {
String m = label + iter.next();
handler.error(m);
}
@@ -340,7 +340,7 @@ public abstract class Builder {
*/
protected final boolean buildAll(Result result, List errors) {
Result[] buildList = skipUptodate(getAntecedantResults(result));
ArrayList doneList = new ArrayList();
ArrayList<String> doneList = new ArrayList<>();
if ((null != buildList) && (0 < buildList.length)) {
if (isLogging()) {
handler.log("modules to build: " + Arrays.asList(buildList));
@@ -371,7 +371,7 @@ public abstract class Builder {
* the List sink for errors, if any
* @return false after successful build, when module jar should exist
*/
protected final boolean buildOnly(Result result, List errors) {
protected final boolean buildOnly(Result result, List<String> errors) {
if (!result.outOfDate()) {
return true;
}
@@ -545,7 +545,7 @@ public abstract class Builder {
* deliverables.
*/
protected ProductModule[] discoverModules(File productDir, Modules modules) {
final ArrayList found = new ArrayList();
final ArrayList<File> found = new ArrayList<>();
FileFilter filter = new FileFilter() {// empty jar files
public boolean accept(File file) {
if ((null != file) && file.canRead()
@@ -557,9 +557,8 @@ public abstract class Builder {
}
};
Util.visitFiles(productDir, filter);
ArrayList results = new ArrayList();
for (Iterator iter = found.iterator(); iter.hasNext();) {
File file = (File) iter.next();
ArrayList<ProductModule> results = new ArrayList<>();
for (File file: found) {
String jarName = moduleAliasFor(file.getName().toLowerCase());
if (jarName.endsWith(".jar") || jarName.endsWith(".zip")) { // XXXFileLiteral
jarName = jarName.substring(0, jarName.length() - 4);
@@ -625,7 +624,7 @@ public abstract class Builder {
* the List to add error messages to
*/
abstract protected boolean compile(Result result, File classesDir,
boolean useExistingClasses, List errors);
boolean useExistingClasses, List<String> errors);

/**
* Assemble the module distribution from the classesDir, saving String
@@ -634,7 +633,7 @@ public abstract class Builder {
* @see #removeLibraryFilesToSkip(Module, File)
*/
abstract protected boolean assemble(Result result, File classesDir,
List errors);
List<String> errors);

/**
* Assemble the module distribution from the classesDir and all

+ 33
- 30
build/src/org/aspectj/internal/tools/build/Module.java View File

@@ -68,13 +68,13 @@ public class Module {
}

/** @return all source files under srcDir */
private static Iterator sourceFiles(File srcDir) {
ArrayList result = new ArrayList();
private static Iterator<File> sourceFiles(File srcDir) {
ArrayList<File> result = new ArrayList<>();
sourceFiles(srcDir, result);
return result.iterator();
}

private static void sourceFiles(File srcDir, List result) {
private static void sourceFiles(File srcDir, List<File> result) {
if ((null == srcDir) || !srcDir.canRead() || !srcDir.isDirectory()) {
return;
}
@@ -88,9 +88,8 @@ public class Module {
}
}

private static void addIfNew(List source, List sink) {
for (Iterator iter = source.iterator(); iter.hasNext();) {
Object item = iter.next();
private static void addIfNew(List<File> source, List<File> sink) {
for (File item: source) {
if (!sink.contains(item)) {
sink.add(item);
}
@@ -102,7 +101,7 @@ public class Module {
*
* @see findKnownJarAntecedants()
*/
static void doFindJarRequirements(Result result, List known) {
static void doFindJarRequirements(Result result, List<File> known) {
Util.iaxIfNull(result, "result");
Util.iaxIfNull(known, "known");
addIfNew(result.getLibJars(), known);
@@ -170,25 +169,25 @@ public class Module {
private final File moduleJar;

/** File list of library jars */
private final List libJars;
private final List<File> libJars;

/** String list of classpath variables */
private final List classpathVariables;
/** List of classpath variables */
private final List<String> classpathVariables;

/**
* File list of library jars exported to clients (duplicates some libJars
* List of library jars exported to clients (duplicates some libJars
* entries)
*/
private final List exportedLibJars;
private final List<File> exportedLibJars;

/** File list of source directories */
private final List srcDirs;
private final List<File> srcDirs;

/** properties from the modules {name}.properties file */
private final Properties properties;

/** Module list of required modules */
private final List requiredModules;
/** List of required modules */
private final List<Module> requiredModules;

/** logger */
private final Messager messager;
@@ -200,11 +199,11 @@ public class Module {
Util.iaxIfNull(name, "name");
Util.iaxIfNull(modules, "modules");
this.moduleDir = moduleDir;
this.libJars = new ArrayList();
this.exportedLibJars = new ArrayList();
this.requiredModules = new ArrayList();
this.srcDirs = new ArrayList();
this.classpathVariables = new ArrayList();
this.libJars = new ArrayList<>();
this.exportedLibJars = new ArrayList<>();
this.requiredModules = new ArrayList<>();
this.srcDirs = new ArrayList<>();
this.classpathVariables = new ArrayList<>();
this.properties = new Properties();
this.name = name;
this.modules = modules;
@@ -239,10 +238,10 @@ public class Module {
}
final long time = outputFile.lastModified();
File file;
for (Iterator iter = result.getSrcDirs().iterator(); iter.hasNext();) {
File srcDir = (File) iter.next();
for (Iterator srcFiles = sourceFiles(srcDir); srcFiles.hasNext();) {
file = (File) srcFiles.next();
for (Iterator<File> iter = result.getSrcDirs().iterator(); iter.hasNext();) {
File srcDir = iter.next();
for (Iterator<File> srcFiles = sourceFiles(srcDir); srcFiles.hasNext();) {
file = srcFiles.next();
if (outOfDate(time, file)) {
return true;
}
@@ -284,23 +283,27 @@ public class Module {
: (kind.normal ? release : test);
}
List srcDirs(Result result) {
List<File> srcDirs(Result result) {
myResult(result);
return srcDirs;
}
List libJars(Result result) {
List<File> libJars(Result result) {
myResult(result);
return libJars;
}
List classpathVariables(Result result) {
List<String> classpathVariables(Result result) {
myResult(result);
return classpathVariables;
}
List exportedLibJars(Result result) {
List<File> exportedLibJars(Result result) {
myResult(result);
return exportedLibJars;
}
List requiredModules(Result result) {
List<Module> requiredModules(Result result) {
myResult(result);
return requiredModules;
}
@@ -610,7 +613,7 @@ public class Module {
String[] tokenize(String line) {
final String DELIM = " \n\t\\<>\"=";
StringTokenizer st = new StringTokenizer(line, DELIM, true);
ArrayList result = new ArrayList();
ArrayList<String> result = new ArrayList<>();
StringBuffer quote = new StringBuffer();
boolean inQuote = false;
while (st.hasMoreTokens()) {

+ 1
- 1
build/src/org/aspectj/internal/tools/build/Modules.java View File

@@ -24,7 +24,7 @@ import java.util.Hashtable;
*/
public class Modules {
private final Hashtable modules = new Hashtable();
private final Hashtable<String,Module> modules = new Hashtable<>();
public final File baseDir;
public final File jarDir;
private final Messager handler;

+ 30
- 31
build/src/org/aspectj/internal/tools/build/Result.java View File

@@ -40,7 +40,7 @@ public class Result {

private static final Kind[] KINDS = { RELEASE, TEST, RELEASE_ALL, TEST_ALL };

private static final HashMap nameToResult = new HashMap();
private static final HashMap<String,Result> nameToResult = new HashMap<>();

public static boolean isTestingJar(String name) {
name = name.toLowerCase();
@@ -141,25 +141,25 @@ public class Result {
/** path to output jar - may not exist */
private final File outputFile;

/** list of required Result */
private final List requiredResults;
/** List of required Result */
private final List<Result> requiredResults;

/** File list of library jars */
private final List libJars;
/** List of library jars */
private final List<File> libJars;

/** String list of classpath variables */
private final List classpathVariables;
/** List of classpath variables */
private final List<String> classpathVariables;

transient String toLongString;

/**
* File list of library jars exported to clients (duplicates some libJars
* List of library jars exported to clients (duplicates some libJars
* entries)
*/
private final List exportedLibJars;
private final List<File> exportedLibJars;

/** File list of source directories */
private final List srcDirs;
/** List of source directories */
private final List<File> srcDirs;

/** true if this has calculated List fields. */
private boolean requiredDone;
@@ -179,11 +179,11 @@ public class Result {
Result(Kind kind, Module module, File jarDir) {
this.kind = kind;
this.module = module;
this.libJars = new ArrayList();
this.exportedLibJars = new ArrayList();
this.srcDirs = new ArrayList();
this.classpathVariables = new ArrayList();
this.requiredResults = new ArrayList();
this.libJars = new ArrayList<>();
this.exportedLibJars = new ArrayList<>();
this.srcDirs = new ArrayList<>();
this.classpathVariables = new ArrayList<>();
this.requiredResults = new ArrayList<>();
String name = module.name;
if (!kind.normal) {
name += "-test";
@@ -218,14 +218,14 @@ public class Result {
}

/** @return List (File) of jar's required */
public List findJarRequirements() {
ArrayList result = new ArrayList();
public List<File> findJarRequirements() {
ArrayList<File> result = new ArrayList<>();
Module.doFindJarRequirements(this, result);
return result;
}

/** @return unmodifiable List of String classpath variables */
public List getClasspathVariables() {
public List<String> getClasspathVariables() {
return safeList(classpathVariables);
}

@@ -238,14 +238,14 @@ public class Result {
/**
* @return unmodifiable list of exported library files, guaranteed readable
*/
public List getExportedLibJars() {
public List<File> getExportedLibJars() {
return safeList(exportedLibJars);
}

/**
* @return unmodifiable list of required library files, guaranteed readable
*/
public List getLibJars() {
public List<File> getLibJars() {
requiredDone();
return safeList(libJars);
}
@@ -258,7 +258,7 @@ public class Result {
// return safeList(merges);
// }
/** @return unmodifiable list of source directories, guaranteed readable */
public List getSrcDirs() {
public List<File> getSrcDirs() {
return safeList(srcDirs);
}

@@ -283,12 +283,12 @@ public class Result {
return name;
}

private List safeList(List l) {
private <T> List<T> safeList(List<T> l) {
requiredDone();
return Collections.unmodifiableList(l);
}

private Result[] safeResults(List list) {
private Result[] safeResults(List<Result> list) {
requiredDone();
if (null == list) {
return new Result[0];
@@ -300,8 +300,8 @@ public class Result {
srcDirs.addAll(getModule().srcDirs(this));
if (getKind().normal) {
// trim testing source directories
for (ListIterator iter = srcDirs.listIterator(); iter.hasNext();) {
File srcDir = (File) iter.next();
for (ListIterator<File> iter = srcDirs.listIterator(); iter.hasNext();) {
File srcDir = iter.next();
if (isTestingDir(srcDir.getName())) {
iter.remove();
}
@@ -313,8 +313,8 @@ public class Result {
libJars.addAll(getModule().libJars(this));
if (getKind().normal && !isTestingModule(getModule())) {
// trim testing libraries
for (ListIterator iter = libJars.listIterator(); iter.hasNext();) {
File libJar = (File) iter.next();
for (ListIterator<File> iter = libJars.listIterator(); iter.hasNext();) {
File libJar = iter.next();
if (isTestingJar(libJar.getName())) {
iter.remove();
}
@@ -348,10 +348,9 @@ public class Result {
assertKind(RELEASE);
}
// externally-required:
List modules = module.requiredModules(this);
List<Module> modules = module.requiredModules(this);
final boolean adoptTests = !kind.normal || isTestingModule(module);
for (Iterator iter = modules.iterator(); iter.hasNext();) {
Module required = (Module) iter.next();
for (Module required: modules) {
if (adoptTests) {
// testing builds can rely on other release and test results
requiredResults.add(required.getResult(TEST));

+ 10
- 14
build/src/org/aspectj/internal/tools/build/SampleGatherer.java View File

@@ -268,10 +268,8 @@ class Sample {
public static final String ASPECTJ_TEAM = "The AspectJ Team";

/** sort by anchorName, file path, and start/end location */
static Comparator NAME_SOURCE_COMPARER = new Comparator() {
public int compare(Object lhs, Object rhs) {
Sample left = (Sample) lhs;
Sample right = (Sample) rhs;
static Comparator<Sample> NAME_SOURCE_COMPARER = new Comparator<Sample>() {
public int compare(Sample left, Sample right) {
if (null == left) {
return (null == right ? 0 : -1);
}
@@ -295,10 +293,8 @@ class Sample {
};

/** sort by author, then NAME_SOURCE_COMPARER */
static Comparator AUTHOR_NAME_SOURCE_COMPARER = new Comparator() {
public int compare(Object lhs, Object rhs) {
Sample left = (Sample) lhs;
Sample right = (Sample) rhs;
static Comparator<Sample> AUTHOR_NAME_SOURCE_COMPARER = new Comparator<Sample>() {
public int compare(Sample left, Sample right) {
if (null == left) {
return (null == right ? 0 : -1);
}
@@ -309,7 +305,7 @@ class Sample {
if (0 != result) {
return result;
}
return NAME_SOURCE_COMPARER.compare(lhs, rhs);
return NAME_SOURCE_COMPARER.compare(left,right);
}
};
@@ -395,7 +391,7 @@ class Sample {
* type-safe Collection of samples.
*/
class Samples {
private ArrayList samples = new ArrayList();
private ArrayList<Sample> samples = new ArrayList<>();
int size() {
return samples.size();
}
@@ -405,12 +401,12 @@ class Samples {
/**
* @return List copy, sorted by Sample.NAME_SOURCE_COMPARER
*/
List getSortedSamples() {
List<Sample> getSortedSamples() {
return getSortedSamples(Sample.NAME_SOURCE_COMPARER);
}
List getSortedSamples(Comparator comparer) {
ArrayList result = new ArrayList();
List<Sample> getSortedSamples(Comparator<Sample> comparer) {
ArrayList<Sample> result = new ArrayList<>();
result.addAll(samples);
Collections.sort(result, comparer);
return result;
@@ -961,7 +957,7 @@ class SampleUtil {
}
public static String[] splitAnchorName(String anchorName) {
ArrayList result = new ArrayList();
ArrayList<String> result = new ArrayList<>();
int start = 0;
int loc = anchorName.indexOf("-", start);
String next;

+ 8
- 11
build/testsrc/org/aspectj/build/BuildModuleTests.java View File

@@ -27,7 +27,6 @@ import java.io.FileFilter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import java.util.StringTokenizer;

@@ -62,7 +61,7 @@ public class BuildModuleTests extends TestCase {
return null; // use permissive default
}

final static List SOURCE_NAMES = Collections.unmodifiableList(
final static List<String> SOURCE_NAMES = Collections.unmodifiableList(
Arrays.asList(new String[]{"src", "testsrc", "java5-src", "java5-testsrc", "aspectj-src"}));

/**
@@ -70,9 +69,8 @@ public class BuildModuleTests extends TestCase {
* @return
*/
private static File[] findSourceRoots(File moduleDir) {
ArrayList result = new ArrayList();
for (Iterator iter = SOURCE_NAMES.iterator(); iter.hasNext();) {
String name = (String) iter.next();
ArrayList<File> result = new ArrayList<>();
for (String name: SOURCE_NAMES) {
File srcDir = new File(moduleDir, name);
if (srcDir.canRead() && srcDir.isDirectory()) {
result.add(srcDir);
@@ -219,12 +217,12 @@ public class BuildModuleTests extends TestCase {
*/
static class UnknownFileCheck implements FileFilter {
private static final UnknownFileCheck SINGLETON = new UnknownFileCheck();
private static final ArrayList STATIC_ERRORS = new ArrayList();
private static final ArrayList<String> STATIC_ERRORS = new ArrayList<>();
// Builder.BINARY_SOURCE_PATTERN and Builder.RESOURCE_PATTERN
public static final List KNOWN_SUFFIXES;
public static final List<String> KNOWN_SUFFIXES;

static {
List suffixes = new ArrayList();
List<String> suffixes = new ArrayList<>();
// sources from org.aspectj.util.FileUtil.SOURCE_SUFFIXES
suffixes.add(".aj");
suffixes.add(".java");
@@ -278,8 +276,7 @@ public class BuildModuleTests extends TestCase {
return false;
}
// to do not accepting uppercase suffixes...
for (Iterator iter = KNOWN_SUFFIXES.iterator(); iter.hasNext();) {
String suffix = (String) iter.next();
for (String suffix: KNOWN_SUFFIXES) {
if (name.endsWith(suffix)) {
return false;
}
@@ -287,7 +284,7 @@ public class BuildModuleTests extends TestCase {
return true;
}
void unknownFiles(File dir, ArrayList results) {
void unknownFiles(File dir, ArrayList<File> results) {
File[] files = dir.listFiles(this);
for (int j = 0; j < files.length; j++) {
File file = files[j];

+ 1
- 1
build/testsrc/org/aspectj/internal/build/BuildModuleTest.java View File

@@ -80,7 +80,7 @@ public class BuildModuleTest extends TestCase {
}
}
ArrayList tempFiles = new ArrayList();
ArrayList<File> tempFiles = new ArrayList<>();
private File jarDir;
private boolean deleteJars;
boolean building; // must be enabled for tests to run

+ 6
- 8
build/testsrc/org/aspectj/internal/build/ModulesTest.java View File

@@ -41,7 +41,7 @@ import org.aspectj.internal.tools.build.Result.Kind;
*
*/
public class ModulesTest extends TestCase {
public static final List /*String*/ MODULE_NAMES;
public static final List<String> MODULE_NAMES;
private static final File BASE_DIR = new File("..");
static {
String[] names = {
@@ -49,7 +49,7 @@ public class ModulesTest extends TestCase {
"bridge", "loadtime", "loadtime5", "org.aspectj.ajdt.core",
"runtime", "taskdefs", "testing-client", "testing-util",
"tests", "util", "weaver"};
List list = Arrays.asList(names);
List<String> list = Arrays.asList(names);
MODULE_NAMES = Collections.unmodifiableList(list);
}

@@ -80,7 +80,7 @@ public class ModulesTest extends TestCase {

protected void tearDown() throws Exception {
super.tearDown();
for (Iterator iter = tempFiles.iterator(); iter.hasNext();) {
for (Iterator<File> iter = tempFiles.iterator(); iter.hasNext();) {
File file = (File) iter.next();
if (!ModulesTest.delete(file)) {
System.err.println("warning: ModulesTest unable to delete " + file);
@@ -101,9 +101,8 @@ public class ModulesTest extends TestCase {
}
public void testAllModulesCreation() {
ArrayList badModules = new ArrayList();
for (Iterator iter = MODULE_NAMES.iterator(); iter.hasNext();) {
String name = (String) iter.next();
ArrayList<Module> badModules = new ArrayList<>();
for (String name: MODULE_NAMES) {
File dir = new File(BASE_DIR, name);
if (dir.isDirectory()) {
File classpath = new File(dir, ".classpath");
@@ -118,8 +117,7 @@ public class ModulesTest extends TestCase {
}
if (!badModules.isEmpty()) {
StringBuffer sb = new StringBuffer();
for (Iterator iter = badModules.iterator(); iter.hasNext();) {
Module module = (Module) iter.next();
for (Module module: badModules) {
System.err.println(module.toLongString());
sb.append("\n");
sb.append(module);

BIN
lib/build/build.jar View File


BIN
lib/build/build.old.jar View File


+ 1
- 1
org.aspectj.ajdt.core/src/org/aspectj/ajdt/ajc/messages.properties View File

@@ -5,7 +5,7 @@
org/aspectj/weaver/XlintDefault.properties for the default behavior and a template to copy.
### AspectJ-specific messages
compiler.name = AspectJ Compiler 1.8.10
compiler.version = Eclipse Compiler Mars.2 #A7BBA8B1, 3.12
compiler.version = Eclipse Compiler Neon.1 #5925A0B5, 3.12
compiler.copyright =

## this next one superceded by above...

+ 1
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AccessForInlineVisitor.java View File

@@ -181,6 +181,7 @@ public class AccessForInlineVisitor extends ASTVisitor {
}
FieldBinding ret = new InlineAccessFieldBinding(inAspect, binding, m);
inAspect.accessForInline.put(m, ret);
System.out.println(">>"+m);
return ret;
}


+ 1
- 1
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/ast/AdviceDeclaration.java View File

@@ -65,7 +65,7 @@ public class AdviceDeclaration extends AjMethodDeclaration {
public int adviceSequenceNumberInType;

public MethodBinding proceedMethodBinding; // set during this.resolveStaments, referenced by Proceed
public List proceedCalls = new ArrayList(2); // populated during Proceed.findEnclosingAround
public List<Proceed> proceedCalls = new ArrayList<>(2); // populated during Proceed.findEnclosingAround

private boolean proceedInInners;
private ResolvedMember[] proceedCallSignatures;

+ 5
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/compiler/problem/AjProblemReporter.java View File

@@ -757,6 +757,11 @@ public class AjProblemReporter extends ProblemReporter {
public String getSupplementaryMessageInfo() {
return delegate.getSupplementaryMessageInfo();
}

@Override
public boolean isInfo() {
return delegate.isInfo();
}
}

public void duplicateMethodInType(AbstractMethodDeclaration methodDecl, boolean equalParameters, int severity) {

+ 1
- 1
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjBuildManager.java View File

@@ -1021,7 +1021,7 @@ public class AjBuildManager implements IOutputClassFileNameProvider, IBinarySour
}

org.aspectj.ajdt.internal.compiler.CompilerAdapter.setCompilerAdapterFactory(this);
final Map<?, ?> settings = buildConfig.getOptions().getMap();
final Map<String, String> settings = buildConfig.getOptions().getMap();
final BuildArgParser bMain = buildConfig.getBuildArgParser();

final org.aspectj.org.eclipse.jdt.internal.compiler.Compiler compiler = new org.aspectj.org.eclipse.jdt.internal.compiler.Compiler(

+ 1
- 1
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/AjCompilerOptions.java View File

@@ -128,7 +128,7 @@ public class AjCompilerOptions extends CompilerOptions {
*
* @see org.eclipse.jdt.internal.compiler.impl.CompilerOptions#getMap()
*/
public Map getMap() {
public Map<String,String> getMap() {
Map<String,String> map = super.getMap();
// now add AspectJ additional options
map.put(OPTION_ReportInvalidAbsoluteTypeName, getSeverityString(InvalidAbsoluteTypeName));

+ 4
- 0
org.aspectj.ajdt.core/src/org/aspectj/ajdt/internal/core/builder/CompactTypeStructureRepresentation.java View File

@@ -20,6 +20,7 @@ import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryNestedType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryType;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.IBinaryTypeAnnotation;
import org.aspectj.org.eclipse.jdt.internal.compiler.env.ITypeAnnotationWalker;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.ExternalAnnotationStatus;
import org.aspectj.org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment;

/**
@@ -189,4 +190,7 @@ public class CompactTypeStructureRepresentation implements IBinaryType {
return walker;
}

public ExternalAnnotationStatus getExternalAnnotationStatus() {
return ExternalAnnotationStatus.NOT_EEA_CONFIGURED;
}
}

+ 15
- 15
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BcweaverJarMaker.java View File

@@ -49,7 +49,7 @@ public class BcweaverJarMaker {
}
public static void makeJar0() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/tracing.jar");

@@ -63,7 +63,7 @@ public class BcweaverJarMaker {
}
public static void makeJar1() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/megatrace.jar");

@@ -78,7 +78,7 @@ public class BcweaverJarMaker {
public static void makeJarObviousNothing() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/megatrace0easy.jar");

@@ -92,7 +92,7 @@ public class BcweaverJarMaker {
}
public static void makeJarHardNothing() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/megatrace0hard.jar");

@@ -107,7 +107,7 @@ public class BcweaverJarMaker {
public static void makeJar1a() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/megatraceNoweave.jar");

@@ -124,7 +124,7 @@ public class BcweaverJarMaker {
public static void makeJar2() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();
args.add("-outjar");
args.add("../weaver/testdata/dummyAspect.jar");

@@ -137,7 +137,7 @@ public class BcweaverJarMaker {
}
public static void makeTestJars() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();

args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
@@ -148,7 +148,7 @@ public class BcweaverJarMaker {
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
args = new ArrayList();
args = new ArrayList<>();

args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
@@ -159,7 +159,7 @@ public class BcweaverJarMaker {
CommandTestCase.runCompiler(args, CommandTestCase.NO_ERRORS);
args = new ArrayList();
args = new ArrayList<>();

args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
@@ -196,7 +196,7 @@ public class BcweaverJarMaker {
}
public static void makeURLWeavingClassLoaderJars() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();

/*
* Vanilla classes
@@ -302,7 +302,7 @@ public class BcweaverJarMaker {
private static void buildJarWithClasspath(String outjar,String input,String deps,boolean nodebug) {
System.out.println(" Building "+outjar);
List args = new ArrayList();
List<String> args = new ArrayList<>();
if (nodebug) args.add("-g:none");
args.add("-classpath");
args.add("../lib/test/aspectjrt.jar;../lib/test/testing-client.jar" +
@@ -332,7 +332,7 @@ public class BcweaverJarMaker {
}
public static void makeDuplicateManifestTestJars() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();

/*
* injar
@@ -360,7 +360,7 @@ public class BcweaverJarMaker {
}
public static void makeAspectPathTestJars() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();

args.clear();
args.add("-classpath");
@@ -372,7 +372,7 @@ public class BcweaverJarMaker {
}
public static void makeAjc11TestJars() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();

args.clear();
args.add("-classpath");
@@ -384,7 +384,7 @@ public class BcweaverJarMaker {
}
public static void makeOutjarTestJars() throws IOException {
List args = new ArrayList();
List<String> args = new ArrayList<>();

/*
* parent

+ 1
- 1
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/compiler/batch/BinaryFormsTestCase.java View File

@@ -32,7 +32,7 @@ public class BinaryFormsTestCase extends CommandTestCase {
public void testJar1() throws IOException {
String library = getSandboxName() + "/lib.jar";
List args = new ArrayList();
List<String> args = new ArrayList<>();
args.add("-outjar");
args.add(library);


+ 2
- 2
org.aspectj.ajdt.core/testsrc/org/aspectj/ajdt/internal/core/builder/AjCompilerOptionsTest.java View File

@@ -46,9 +46,9 @@ public class AjCompilerOptionsTest extends TestCase {
assertFalse(options.generateEmacsSymFiles);
assertFalse(options.noAtAspectJProcessing);
Map map = options.getMap();
Map<String,String> map = options.getMap();
assertEquals(CompilerOptions.WARNING,map.get(AjCompilerOptions.OPTION_ReportInvalidAbsoluteTypeName));
assertEquals(CompilerOptions.IGNORE,map.get(AjCompilerOptions.OPTION_ReportInvalidWildcardTypeName));
assertEquals(CompilerOptions.WARNING,map.get(AjCompilerOptions.OPTION_ReportInvalidWildcardTypeName));
assertEquals(CompilerOptions.WARNING,map.get(AjCompilerOptions.OPTION_ReportUnresolvableMember));
assertEquals(CompilerOptions.WARNING,map.get(AjCompilerOptions.OPTION_ReportTypeNotExposedToWeaver));
assertEquals(CompilerOptions.IGNORE,map.get(AjCompilerOptions.OPTION_ReportShadowNotInStructure));

+ 5
- 8
org.aspectj.matcher/testsrc/org/aspectj/weaver/patterns/VisitorTestCase.java View File

@@ -15,7 +15,6 @@ import junit.framework.TestCase;

import java.util.HashSet;
import java.util.Set;
import java.util.Iterator;
import java.io.LineNumberReader;
import java.io.FileReader;

@@ -28,8 +27,8 @@ import org.aspectj.weaver.patterns.TypePattern;
*/
public class VisitorTestCase extends TestCase {

private Set pointcuts = new HashSet();
private Set typePatterns = new HashSet();
private Set<String> pointcuts = new HashSet<>();
private Set<String> typePatterns = new HashSet<>();

protected void setUp() throws Exception {
super.setUp();
@@ -41,7 +40,7 @@ public class VisitorTestCase extends TestCase {
rt.close();
}

private void feed(LineNumberReader r, Set set) throws Exception {
private void feed(LineNumberReader r, Set<String> set) throws Exception {
for (String line = r.readLine(); line != null; line = r.readLine()) {
set.add(line);
}
@@ -51,8 +50,7 @@ public class VisitorTestCase extends TestCase {
if (pointcuts.isEmpty()) {
fail("Empty pointcuts file!");
}
for (Iterator iterator = pointcuts.iterator(); iterator.hasNext();) {
String pointcut = (String) iterator.next();
for (String pointcut: pointcuts) {
try {
DumpPointcutVisitor.check(pointcut);
} catch (Throwable t) {
@@ -66,8 +64,7 @@ public class VisitorTestCase extends TestCase {
if (typePatterns.isEmpty()) {
fail("Empty typePatterns file!");
}
for (Iterator iterator = typePatterns.iterator(); iterator.hasNext();) {
String tp = (String) iterator.next();
for (String tp: typePatterns) {
try {
TypePattern p = new PatternParser(tp).parseTypePattern();
DumpPointcutVisitor.check(p, true);

BIN
org.eclipse.jdt.core/jdtcore-for-aspectj-src.zip View File


BIN
org.eclipse.jdt.core/jdtcore-for-aspectj.jar View File


+ 8
- 9
testing-client/src/org/aspectj/testing/Tester.java View File

@@ -51,10 +51,10 @@ public class Tester {
private static Set notes;
/** <code>List</code> to hold events submitted. */
private static List actualEvents = new ArrayList();
private static List<String> actualEvents = new ArrayList<>();
/** <code>List</code> to hold events we expect. */
private static List expectedEvents = new ArrayList();
private static List<String> expectedEvents = new ArrayList<>();

static {
setBASEDIR(new File("."));
@@ -103,8 +103,8 @@ public class Tester {

/** XXX deprecated #clear() */
public static void clearEvents() {
actualEvents = new ArrayList();
expectedEvents = new ArrayList();
actualEvents = new ArrayList<>();
expectedEvents = new ArrayList<>();
}

@@ -707,10 +707,10 @@ public class Tester {
}
/** @return String[] of differences '{un}expected msg "..." {not} found' */
private static String[] diffIgnoreDups(Collection set, String[] expected, String msg,
private static String[] diffIgnoreDups(Collection<String> set, String[] expected, String msg,
boolean ignoreDups) {
ArrayList result = new ArrayList();
ArrayList actual = new ArrayList(set);
ArrayList<String> result = new ArrayList<>();
ArrayList<String> actual = new ArrayList<>(set);
BitSet hits = new BitSet();
for (int i = 0; i < expected.length; i++) {
if (!actual.remove(expected[i])) {
@@ -722,8 +722,7 @@ public class Tester {
}
}
}
for (Iterator iter = actual.iterator(); iter.hasNext();) {
String act = (String) iter.next();
for (String act: actual) {
result.add(" unexpected " + msg + " \"" + act + "\" found");
}
return (String[]) result.toArray(new String[0]);

+ 3
- 3
testing-client/src/org/aspectj/testing/server/TestServer.java View File

@@ -32,7 +32,7 @@ public class TestServer implements Runnable {
private boolean exitOnError = true;
private File workingDirectory;
private ClassLoader rootLoader;
private Map loaders = new HashMap();
private Map<String,ClassLoader> loaders = new HashMap<>();

private String mainClass = "UnknownClass";
private String mainLoader = "UnknownLoader";
@@ -75,7 +75,7 @@ public class TestServer implements Runnable {
if (parent == null) error("No such loader: " + parentName);
}

List urlList = new ArrayList();
List<URL> urlList = new ArrayList<>();
st = new StringTokenizer(classpath,";");
while (st.hasMoreTokens()) {
String fileName = st.nextToken();
@@ -93,7 +93,7 @@ public class TestServer implements Runnable {
}
private void createRootLoader () throws IOException {
List urlList = new ArrayList();
List<URL> urlList = new ArrayList();
/* Sandbox */
URL url = workingDirectory.getCanonicalFile().toURL();

+ 4
- 5
testing-client/testsrc/org/aspectj/testing/TesterTest.java View File

@@ -167,8 +167,8 @@ public class TesterTest extends TestCase {
* @author isberg
*/
public static class MyTestReporter implements IMessageHandler {
public ArrayList failures = new ArrayList();
public ArrayList passes = new ArrayList();
public ArrayList<IMessage> failures = new ArrayList<>();
public ArrayList<IMessage> passes = new ArrayList<>();

public void clear() {
failures.clear();
@@ -188,9 +188,8 @@ public class TesterTest extends TestCase {
return gotItem(failures, substring);
}
boolean gotItem(List list, String substring) {
for (Iterator iterator = list.iterator(); iterator.hasNext(); ) {
IMessage element = (IMessage) iterator.next();
boolean gotItem(List<IMessage> list, String substring) {
for (IMessage element: list) {
String s = element.getMessage();
if ((null != s) && (-1 != s.indexOf(substring))) {
return true;

+ 36
- 0
tests/bugs1810/502807/TestCollectors.java View File

@@ -0,0 +1,36 @@
import java.util.HashSet;
import java.util.Set;
import java.util.stream.Collectors;

public class TestCollectors {
Set<Integer> ids;

public TestCollectors(Set<Inner> inners) {
ids = inners.stream().collect(Collectors.toList(Inner::getId));
// ids = inners.stream().map(Inner::getId).collect(Collectors.toSet());
}

public static void main() {
Set<Inner> inners = new HashSet<>();
inners.add(new Inner(1, "a"));
inners.add(new Inner(1, "a"));

new TestCollectors(inners);
}


public static class Inner {
private int id;
private String name;

public Inner(int id, String name) {
this.id = id;
this.name = name;
}

public int getId() { return id; }

public String getName() { return name; }
}
}


+ 2
- 2
tests/src/org/aspectj/systemtest/ajc150/ajc150.xml View File

@@ -4545,8 +4545,8 @@
</ajc-test>
<ajc-test dir="java5/generics/genericaspects/" title="uberaspects - M">
<compile files="GenericAspectM.aj" options="-1.5">
<message kind="error" line="23" text="The method m0(Integer) in the type GenericAspect&lt;A,B&gt;.SimpleI&lt;Integer&gt; is not applicable for the arguments (String)"/>
<message kind="error" line="24" text="The method m1(List&lt;Integer&gt;) in the type GenericAspect&lt;A,B&gt;.SimpleI&lt;Integer&gt; is not applicable for the arguments (List&lt;String&gt;)"/>
<message kind="error" line="23" text="The method m0(Integer) in the type GenericAspect.SimpleI&lt;Integer&gt; is not applicable for the arguments (String)"/>
<message kind="error" line="24" text="The method m1(List&lt;Integer&gt;) in the type GenericAspect.SimpleI&lt;Integer&gt; is not applicable for the arguments (List&lt;String&gt;)"/>
<message kind="error" line="25" text="Type mismatch: cannot convert from String to Integer"/>
<message kind="error" line="26" text="Type mismatch: cannot convert from List&lt;String&gt; to List&lt;Integer&gt;"/>
</compile>

+ 4
- 0
tests/src/org/aspectj/systemtest/ajc1810/Ajc1810Tests.java View File

@@ -30,6 +30,10 @@ import org.aspectj.testing.XMLBasedAjcTestCase;
*/
public class Ajc1810Tests extends org.aspectj.testing.XMLBasedAjcTestCase {

public void testAIOOBE_502807() {
runTest("unexpected aioobe");
}
public void testInvokeDynamic_490315() {
runTest("indy");
}

+ 6
- 0
tests/src/org/aspectj/systemtest/ajc1810/ajc1810.xml View File

@@ -18,5 +18,11 @@
<ajc-test dir="bugs1810/ambig" title="ambiguous message - 17">
<compile options="-1.7" files="X.java"/>
</ajc-test>

<ajc-test dir="bugs1810/502807" title="unexpected aioobe">
<compile options="-1.8" files="TestCollectors.java">
<message kind="error" text="The method toList() in the type Collectors is not applicable for the arguments (Inner::getId)"/>
</compile>
</ajc-test>
</suite>

+ 1
- 3
weaver/src/org/aspectj/weaver/bcel/LazyMethodGen.java View File

@@ -24,7 +24,6 @@ import java.util.List;
import java.util.ListIterator;
import java.util.Map;
import java.util.Set;
import java.util.Stack;

import org.aspectj.apache.bcel.Constants;
import org.aspectj.apache.bcel.classfile.Attribute;
@@ -688,8 +687,7 @@ public final class LazyMethodGen implements Traceable {
}
}
int ecounter = 0;
for (Iterator i = exnTable.iterator(); i.hasNext();) {
ExceptionRange er = (ExceptionRange) i.next();
for (ExceptionRange er: exnTable) {
String exceptionLabel = "E" + ecounter++;
labelMap.put(Range.getRealStart(er.getHandler()), exceptionLabel);
labelMap.put(er.getHandler(), exceptionLabel);

+ 2
- 3
weaver/testsrc/org/aspectj/weaver/bcel/ArgsWeaveTestCase.java View File

@@ -22,6 +22,7 @@ import org.aspectj.apache.bcel.generic.InstructionFactory;
import org.aspectj.apache.bcel.generic.InstructionHandle;
import org.aspectj.apache.bcel.generic.InstructionList;
import org.aspectj.apache.bcel.generic.Type;
import org.aspectj.weaver.Advice;
import org.aspectj.weaver.AdviceKind;
import org.aspectj.weaver.MemberImpl;
import org.aspectj.weaver.ResolvedType;
@@ -54,8 +55,7 @@ public class ArgsWeaveTestCase extends WeaveTestCase {
}

public void testLots() throws IOException {
List l = new ArrayList();
List<Advice> l = new ArrayList();
BcelAdvice p1 =
makeArgsMunger("before");
@@ -70,7 +70,6 @@ public class ArgsWeaveTestCase extends WeaveTestCase {
l.add(p2);
l.add(p3);


weaveTest("HelloWorld", "ArgsBeforeAfterHelloWorld", addLexicalOrder(l));
}


+ 0
- 2
weaver5/java5-testsrc/org/aspectj/weaver/MemberTestCase15.java View File

@@ -11,8 +11,6 @@
* ******************************************************************/
package org.aspectj.weaver;

import java.util.List;

import org.aspectj.weaver.bcel.BcelWorld;

import junit.framework.TestCase;

Loading…
Cancel
Save