aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fix tests not finding project base directory 'org.aspectj'Alexander Kriegisch2021-03-202-14/+39
| | | | | | | | | | | | | | | | | Several LTW tests using class TestServer failed on my machine because there was a hard-coded project base directory name 'org.aspectj' in the class. This class has several other problems, but my quick fix for now - I did not want to rename my project base directory - was to match on a regex '(?i)(org[.])?aspectj' now. That also works for my root directory 'AspectJ'. I also moved the code determining the project dir into a protected (hence testable) method and added a sanity test case checking if the directory can be determined. If not, the test will fail with a rather lengthy warning to developers about the need to have a matching project root folder. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix tests expecting usage texts as failure outputsAlexander Kriegisch2021-03-202-207/+201
| | | | | | | | | This is a follow-up on commit @31b2d60b. Some tests were actually expecting usage texts as failure outputs. Because that was fixed, the tests no longer see those failures, hence they should no longer expect them. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix test relying on JVM warning being stripped from outputAlexander Kriegisch2021-03-202-15/+12
| | | | | | | | | | | | | | | | The line in which warnings like "Archived non-system classes are disabled because the java.system.class.loader property is specified" appears can start with e.g."OpenJDK 64-Bit Server VM" or "Java HotSpot(TM) 64-Bit Server VM". Therefore, an exact match on the former worked on Linux, but not on Windows, or maybe the difference is generally between Oracle and OpenJDK. anyway, I use Oracle on Windows and my build failed. Now it is fixed because I made the match more generic using a regex. I also removed a now obsolete check for the occurrence of the stripped line in test "JDK14 LTW with XML". Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve usage text, error and warning output in batch compilerAlexander Kriegisch2021-03-209-29/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | - Usage texts are now printed to stdOut, no longer stdErr. - 'java ...Main -?' no longer prints usage text twice (once to stdOut and then again to stdErr). - AjdtCommand.inferKind: Usage texts are no longer mis-identified as warnings or errors just because they contain substrings "warning" or "error". Matching is now more precise, looking for "[warning]" and "[error]". But in that case the method would not be called anyway because errors and warnings are identified in other ways already. As a fall-back, the categories IMessage.ERROR and IMessage.WARNING still exist in the method. - In case of compile errors, no usage message is printed anymore, because previously the user had to scroll up a lot in order to see the actual messages. This is also in line with ECJ. The same is true for warnings, but it was like this in Ajc already. - AjdtCommand.inferKind: There is a new category IMessage.USAGE especially for AspectJ usage texts, which will be identified by string matching and then correctly handled (i.e. printed to stdOut, not stdErr). - Usage text printing is no longer done in AspectJ but in the AspectJ "shadows" fork of JDT. This helps to get rid of some now obsolete code here. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Improve batch compiler usage messagesAlexander Kriegisch2021-03-201-33/+40
| | | | | | | | | | | - Use spaces instead of tabs for indentation. - Document parameters bound in Eclipse JDT, e.g. {0} is not the compiler name there but the system's path separator ';' or ':'. So if we want to display the compiler name, we need {1}. - For both normal usage and '-X' usage, compiler name + version are printed now. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Fix invalid manifests leading to "Could not find or load main class"Alexander Kriegisch2021-03-194-12/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | WARNING: Please avoid line breaks in manifest values! They are passed on like this: Assembly Plugin -> Plexus Archiver -> JRE java.util.jar .Manifest.write(OutputStream). The JRE Manifest class inserts hard line breaks always after 72 characters, no matter if those 72 characters contain line feeds, tabs or spaces. Hence, it can happen that unwanted blank lines end up in the middle of a manifest section, making the manifest invalid. Calls like e.g. 'java -cp aspectjtools.jar org.aspectj.tools.ajc.Main' can then fail with the absolutely unexpected error 'Could not find or load main class org.aspectj.tools.ajc.Main'. In IntelliJ IDEA you can deactivate wrapping text inside XML tags like this: "File | Settings | Editor | Code Style | XML | Wrap text -> off" The problem occurs in Maven Assembly in versions higher than 2.2. More exactly, it occurs in Plexus Archiver after in more recent versions it switched to using the JRE Manifest class. TODO 1: Either add a test step in phase 'verify' doing something like this: new Manifest(new FileInputStream("MANIFEST.MF")); This would lead to "IOException: invalid header field (line xy)" in case of an invalid manifest file. TODO 2: Or file a JRE bug at Oracle or OpenJDK, wherever appropriate. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Strip down compiler messages to AspectJ-specific onesAlexander Kriegisch2021-03-193-277/+27
| | | | | | | | | | | | | | | | | | | | Delete all properties from messages_aspectj.properties which were just copied from Eclipse and basically the same. This not only gets rid of duplicates but also eliminates differences found between upstream and AspectJ strings which were just cause by errors or oversights during manual upgrade. TODO: - Find a way to print the '-X' options as info instead of yielding 'abort', making it seem as if compilation failed and print the usage message to stdErr instead of stdOut. - Eclipse also has misc.usage.warn, not just misc.usage, i.e. usage info specifically for warning options. Make sure that AspectJ uses it consistently. - Find a way to merge AspectJ-specific options into the standard Eclipse usage text instead of completely replacing it, further reducing the need to merge and copy upstream content. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Begin migration to 'aspectj' locale for compiler messagesAlexander Kriegisch2021-03-194-12/+1
| | | | | | | | | | | | | | | | | | | Renamed messages.properties to messages_aspectj.properties and moved to a path identical with the Eclipse original resource file. Therefore, it is now just treated as a localised version of it. The new jdtcore-for-aspectj.jar already contains logic to use the new locale. Hence, BuildArgParser no longer needs the static block to initialise its own resource bundle, Eclipse JDT will automatically pick it up. The version string was also updated to the new Eclipse merge commit hash + date + "Java16". TODO: Strip down properties file in order to only contain delta to Eclipse. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add Java 15 / AspectJ 1.9.7 test suiteAlexander Kriegisch2021-03-1719-17/+533
| | | | | | Also fix some minor details in Java 14 suite Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add 'yield' usage to Java 12/13 switch expressions testsAlexander Kriegisch2021-03-173-19/+28
| | | | | | | So far this was a slight oversight, no test using 'yield' existed in the 'features193' test suite. Better late than never. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Do not run tests using Java 14 preview features on this Java 15 compilerAlexander Kriegisch2021-03-172-0/+10
| | | | | | | | | | | | | | | | These tests need a Java 14 level AspectJ compiler, because they use version-specific preview features. This compiler has been upgraded to a Java 15 compliant JDT Core already, i.e. it does not support preview features of a previous version anymore. An error message similar to the above explanation will appear when trying to run any XMLBasedAjcTestCaseForJava14Only subclass, such as Ajc196PreviewFeaturesTests (currently the only one). When running AllTestsAspectJ196, Ajc196PreviewFeaturesTests will not be added to the test suite anymore. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Restructure Java 14 / AJ 1.9.6 testsAlexander Kriegisch2021-03-178-9/+10
| | | | | | | | - Java 14 feature sample classes moved from 'bugs' to 'features' - One test case using a Java 14 preview feature was moved to the Java 14-only tests Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Use static import for HtmlDecorator.TYPE_NAME_LABELAlexander Kriegisch2021-03-162-25/+27
| | | | | | Mini refactoring, making the code a bit less verbose Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Add Java 15 class vile version to BCEL constants, adjust test tools etc.Alexander Kriegisch2021-03-167-81/+110
| | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Upgrade to ASM 9.1, delete obsolete ASM binariesAlexander Kriegisch2021-03-1616-20/+19
| | | | | | | | | | | Keep only ASM 2.0 binary because it is still used in UnweavableTest which uses an old ASM API, e.g. with a ClassWriter constructor which no longer exists. Also add JarJar 1.3 library because it is needed by an Ant task in lib/asm/build.xml. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Upgrade JDT Core to @3caefb80 (4.20 snapshot, date 2021-03-09)Alexander Kriegisch2021-03-163-2/+16
| | | | | | | Add methods isRecord() and getRecordComponents() to class CompactTypeStructureRepresentation Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge pull request #35 from kriegaex/make-aj196-tests-run-on-java15Andy Clement2021-03-1559-3348/+3537
|\ | | | | Fix all tests for Java 15 runtime
| * Simplify execution of PureJavaTests and KnownLimitationsTestsAlexander Kriegisch2021-03-146-2242/+2229
| | | | | | | | | | | | | | | | | | Getting rid of XML includes and two superfluous files, merging them with their respective including counterparts. As far as I can see, the two test suites are not part of the automatic build process, but can be started manually as easily as any other test (suite) now. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Fix outdated ajcTestSuite.dtd and lots of XML problemsAlexander Kriegisch2021-03-1415-397/+450
| | | | | | | | | | | | | | | | | | Now there should be no more inspection warnings when working with XML test definitions. Only the strangely looking XML files used by PureJavaTests and KnownLimitationsTests are left to be analysed and fixed. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Fix OutputSpec corner case (test empty output) from @052bd66fAlexander Kriegisch2021-03-141-1/+2
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Make sure Java 14-only tests using preview are not executed on JVM 15+Alexander Kriegisch2021-03-145-57/+120
| | | | | | | | | | | | | | | | | | | | | | Some Ajc196 tests are using preview features (see .../ajc196.xml), i.e. they will fail on Java 15+ because code compiled with '--enable-preview' can only run on the same JVM version, not on a more recent one. Hence, the preview-using tests are now being excluded in order to make the build run on Java 15, even though no Java 15 features are present in the current 1.9.7 snapshot. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Allow year 2021 in Checklics.LicenseAlexander Kriegisch2021-03-141-17/+7
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Move documentation generation into Maven profile 'create-docs'Alexander Kriegisch2021-03-141-128/+167
| | | | | | | | | | | | | | | | | | The profile is active by default, but can be deactivated via '-P !create-docs' on the Maven command line. This helps to speed up 'mvn install', maybe in combination with skipping tests, if we just want to create a new set of AspectJ binaries. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Improve text matching in OutputSpec, fixing some failing Windows testsAlexander Kriegisch2021-03-143-27/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some Java 14 text block tests failed on Windows because a StringTokenizer was used to split by LF, but the Windows line separator is CR+LF. Because a multi-line string ending with CR+LF is printed via 'System.out.println' in the test code, another CR+LF is added to the output, resulting in trailing CR+LF+CR+LF. Hence, between the two LFs, the tokenizer actually found an additional line consisting of CR (only on Windows, of course). Despite each line token actually containing a trailing CR token, that did not matter much because 'String.trim' was used everywhere before comparing values. Anyway, the improved OutputSpec uses text.trim().split("\\s*\n\\s*"), which takes care of leading/trailing whitespace both around the whole output and for each separate line. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Fix 'ajdoc' tests for Java 15 buildAlexander Kriegisch2021-03-1426-466/+526
| | | | | | | | Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Make MoveInstructionsWeaveTestCase.testFancyHello pass when run twiceAlexander Kriegisch2021-03-131-9/+14
| | | | | | | | | | | | | | | | | | | | | | Reset counter, just in case this test runs multiple times in one JVM. This can happen e.g. due to "run all tests" in IntelliJ IDEA, which directly runs this test class and als WeaverModuleTests, both of which implement junit.framework.TestCase. In that case, during the second run the counter would start at a higher base count, making the 2nd test run fail. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Make BCEL classpath utility recognise Java 15, fixing many testsAlexander Kriegisch2021-03-131-5/+1
|/ | | | | | | | | | | | | | | | | | | | Inside org.aspectj.apache.bcel.util.ClassPath.getClassPath(), some JVM version matching occurs which previously did not include Java 15. Technically, AspectJ 1.9.6 does not support Java 15, but on GitHub Actions there is a build job running on a JVM 15. This change should at least make the weaver tests pass, making that test job more meaningful. This fixes test errors like java.lang.ClassCastException: class org.aspectj.weaver.MissingResolvedTypeWithKnownSignature cannot be cast to class org.aspectj.weaver.ReferenceType (org.aspectj.weaver.MissingResolvedTypeWithKnownSignature and org.aspectj.weaver.ReferenceType are in unnamed module of loader 'app') Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge pull request #34 from kriegaex/test-fixes-kriegaex-20210312Andy Clement2021-03-123-567/+450
|\ | | | | Test fixes kriegaex 20210312
| * Fix: WeaveSpec no longer ignores the '-Xlintfile' parameterAlexander Kriegisch2021-03-121-18/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests in ajc150.xml and ajc190_from150.xml contain '<weave ...>' build steps with 'xlintfile="..."' parameters. Those parameters were passed through to Java and aspect code building steps, but not to the final weaving step, sometimes leading to spurious "type not exposed to weaver" warnings which occurred for some local and CI builds, but not always. Very strange indeed. Anyway, by making method WeaveSpec.buildWeaveArgs() pass on this parameter, the tests seem to run reliably now. TODO: Why does Ajc report that warning if the application JAR is on the inpath and the aspect JAR is on the aspectpath? Is it because a marker annotation is defined within the aspect JAR? But actually, that should not matter, especially not work once and fail at other times. I guess there is a class loading order problem or similar involved. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Add missing '-options' values -1.5, -1.9 to ajc{150,190_from150}.xmlAlexander Kriegisch2021-03-122-549/+427
|/ | | | | | | | | | | | | | | | | When trying to find out why ajc150.xml and ajc190_from150.xml look almost identical, I found out that only in many cases the 190 version has '-option="1.9"' set where in the 150 version it was '-option="1.9"'. Unfortunately, in both files source/target versions are not set at all in many places, which looks unintentional. I tried to search & replace all relevant '<compile ...>' commands for 190 first, then ported back to 150. Only cases in which clearly compiling to an older version like 1.3 or 1.4 is necessary were left like before. I am expecting missing or false Java target versions in many other of the legacy XML test suites. For now, I am just committing these two. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge pull request #33 from kriegaex/test-fixes-kriegaex-20210311Andy Clement2021-03-1127-2082/+2086
|\ | | | | Test fixes kriegaex 20210311
| * Set maven-assembly-plugin version 3.1.1 explicitly for each POM moduleAlexander Kriegisch2021-03-116-21/+40
| | | | | | | | | | | | | | | | | | | | | | | | Background: There are CI tests failing because the version is not taken from the parent POM, even if set in the 'pluginManagement' section. Instead, it is resolved via the Maven Super POM, e.g. 2.2-beta-5, see: https://maven.apache.org/ref/3.6.3/maven-model-builder/super-pom.html That assembly plugin version in turn requires plexus-archiver 1.0-alpha-12. The latter cannot be downloaded from Maven Central, leading to the problems seen during builds. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Replace path separators ';' by ',' in XML test specsAlexander Kriegisch2021-03-1114-1995/+1995
| | | | | | | | | | | | | | | | The goal is for them to be canonicalised to platform standard during test execution. I am not sure if that will fix any tests, but at least I hope it will not break any. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Unify classpath handling in CompileSpec & RunSpecAlexander Kriegisch2021-03-112-11/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Replace directory separator '/' and surrogate path separator ',' by platform-specific separators File.separatorChar and File.pathSeparatorChar, respectively. Also make sure that replacement occurs during write access, not read access. This was handled differently in both sibling classes. I am not sure if that helps to fix any Linux CI tests, but it is worth a try. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Fix MultiProjectIncrementalTests.testAspectPath_pr265693, 2nd tryAlexander Kriegisch2021-03-111-3/+7
| | | | | | | | | | | | | | Do not assume a certain element order for tree nodes if there can be more than one. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Try to fix MultiProjectIncrementalTests.testAspectPath_pr265693Alexander Kriegisch2021-03-111-1/+1
| | | | | | | | | | | | | | | | Check if path vs. package name discrepancy makes test fail on Linux. On Windows it passes. So let's find out if file p/Asp.java vs. pkg.Asp causes the problems. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * AjcTestCase cosmetics: surround command in failure report by quotesAlexander Kriegisch2021-03-111-2/+2
| | | | | | | | | | | | This is the same for successful tests in class CompilationResult. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Fix resource leak in FileUtilAlexander Kriegisch2021-03-111-24/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This made ModuleTests.testBuildModuleAndApplyAspectsFromAspectPath fail because a file delete job for a module JAR failed after a previous compile job had called FileUtil.isZipFile(File) in which the opened zip file was never closed. A try with resources fixes that. Maybe the corresponding test worked on Linux before, I did not try. I just know that Linux is more forgiving about deleting open files while on Windows they are being locked, which makes Windows the better system to search for open file leaks. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * AjBuildManager: use try with resources in 2 placesAlexander Kriegisch2021-03-111-7/+1
| | | | | | | | | | | | | | | | I was debugging something in ModuleTests, trying to find out if there are resource leaks. They were not in this class but in FileUtil - see next commit. However, the little refactoring here does not hurt either. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
| * Fix path separators in ajc190.xml, make tests run on WindowsAlexander Kriegisch2021-03-111-21/+21
|/ | | | | | | Replace ':' by ";" which will be replaced to the platform separator automatically. A fixed value of ':' does not work on Windows. Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge pull request #32 from kriegaex/installer-windows_10-windows_serverAndy Clement2021-03-051-2/+4
|\ | | | | Support Windows 10 and Windows Server 2016/2019 in installer
| * Support Windows 10 and Windows Server 2016/2019 in installerAlexander Kriegisch2021-03-041-2/+4
|/ | | | | | | | Those versions were not detected until now, which lead to bogus Windows batch files forwarding only 9 Ajc parameters to the Java process via "%1 %2 %3 %4 %5 %6 %7 %8 %9" instead of "%*". Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
* Merge pull request #29 from ebourg/patch-1Andy Clement2021-01-071-1/+1
|\ | | | | Update the URL of BCEL
| * Update the URL of BCELEmmanuel Bourg2021-01-071-1/+1
|/
* Merge pull request #23 from larsgrefer/feature/java15Andy Clement2020-12-021-1/+1
|\ | | | | Update GitHub Actions from Java 14 to 15
| * Update GitHub Action from Java 14 to 15Lars Grefer2020-09-201-1/+1
| | | | | | | | Signed-off-by: Lars Grefer <eclipse@larsgrefer.de>
* | Merge pull request #27 from capgen628/patch-1Andy Clement2020-12-021-2/+1
|\ \ | |/ |/| Remove call to System.out
| * Remove call to System.outAnuj Dodhia2020-12-021-2/+1
|/
* Merge pull request #22 from jamesjer/masterAndy Clement2020-09-161-1/+1
|\ | | | | Fix apostrophe in the license
| * Fix apostrophe in the licenseJerry James2020-09-151-1/+1
|/