Map jom = compilerConfig.getJavaOptionsMap();
if (jom != null) {
String version = (String) jom.get(CompilerOptions.OPTION_Compliance);
- if (version != null
- && (version.equals(CompilerOptions.VERSION_1_5) || version.equals(CompilerOptions.VERSION_1_6) || version
- .equals(CompilerOptions.VERSION_1_7))) {
+ if (version != null && !version.equals(CompilerOptions.VERSION_1_4)) {
config.setBehaveInJava5Way(true);
}
config.getOptions().set(jom);
} else if (arg.equals("-1.7")) {
buildConfig.setBehaveInJava5Way(true);
unparsedArgs.add("-1.7");
+ } else if (arg.equals("-1.8")) {
+ buildConfig.setBehaveInJava5Way(true);
+ unparsedArgs.add("-1.8");
} else if (arg.equals("-source")) {
if (args.size() > nextArgIndex) {
String level = ((ConfigParser.Arg) args.get(nextArgIndex)).getValue();
if (level.equals("1.5") || level.equals("5") || level.equals("1.6") || level.equals("6") || level.equals("1.7")
- || level.equals("7")) {
+ || level.equals("7") || level.equals("8") || level.equals("1.8")) {
buildConfig.setBehaveInJava5Way(true);
}
unparsedArgs.add("-source");
--- /dev/null
+public aspect MyAspect {
+ pointcut all(): execution(@javax.annotation.Resource * *(..));
+
+
+ before(): all() {
+ System.out.println("Hi");
+ }
+}
--- /dev/null
+public class MyClass {
+ @javax.annotation.Resource
+ public void method() {
+ }
+}
*/
public class Ajc180Tests extends org.aspectj.testing.XMLBasedAjcTestCase {
+ public void testAnnosWith18Flags_415957() {
+ runTest("annotations with 1.8 flags");
+ }
+
public void testJava8Code() throws Exception {
runTest("first advised java 8 code");
}
<suite>
+ <ajc-test dir="bugs180/415957" title="annotations with 1.8 flags">
+ <compile files="MyAspect.aj MyClass.java" options="-1.8 -showWeaveInfo">
+ <message kind="weave" text="Join point 'method-execution(void MyClass.method())' in Type 'MyClass' (MyClass.java:3) advised by before advice from 'MyAspect' (MyAspect.aj:5)"/>
+ </compile>
+ </ajc-test>
+
<ajc-test dir="bugs180/firstprogram" title="first advised java 8 code">
<compile files="C.java" options="-1.8">
</compile>