]> source.dussan.org Git - aspectj.git/commitdiff
fix warnings in build - support .isJava8 option in build V1_8_10
authorAndy Clement <aclement@pivotal.io>
Fri, 9 Dec 2016 17:46:10 +0000 (09:46 -0800)
committerAndy Clement <aclement@pivotal.io>
Fri, 9 Dec 2016 17:46:10 +0000 (09:46 -0800)
ajdoc/testsrc/org/aspectj/tools/ajdoc/CoverageTestCase.java
build/src/org/aspectj/internal/tools/ant/taskdefs/AntBuilder.java
lib/build/build.jar
testing-client/.isJava5 [new file with mode: 0644]
testing/src/org/aspectj/internal/tools/ant/taskdefs/Ajctest.java
weaver5/java5-testsrc/org/aspectj/weaver/tools/Java15PointcutExpressionTest.java

index afa27b3195f6359755ff6afd55c9d724029eced2..6ee7f7a88ced182465746ec6dd43013799472897 100644 (file)
 import java.io.File;
 import java.util.List;
 
-import org.aspectj.util.FileUtil;
 import org.aspectj.util.LangUtil;
 
-import com.sun.org.apache.xml.internal.serializer.utils.Utils;
-
 
 /**
  * A long way to go until full coverage, but this is the place to add more.
index 379016a6f7630c7771709f950c0759d6cec6edeb..107905231c086e23bf264eba0bb6fad3abe05f58 100644 (file)
@@ -224,15 +224,20 @@ public class AntBuilder extends Builder {
                Path path = new Path(project);
                boolean hasSourceDirectories = false;
                boolean isJava5Compile = false;
+               boolean isJava8Compile = false;
                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(
-                                                       file.getParent(), ".isJava5").exists())) {
+                                       && (Util.Constants.JAVA5_SRC.equals(file.getName()) || 
+                                               Util.Constants.JAVA5_TESTSRC.equals(file.getName()) ||
+                                               new File(file.getParent(), ".isJava5").exists())) {
                                isJava5Compile = true;
                        }
+                       if (new File(file.getParent(),".isJava8").exists()) {
+                               isJava8Compile = true;
+                       }
                        if (!hasSourceDirectories) {
                                hasSourceDirectories = true;
                        }
@@ -269,8 +274,13 @@ 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.7");
-                       javac.setTarget("1.7");
+                       if (isJava8Compile) {
+                               javac.setSource("1.8");
+                               javac.setTarget("1.8");                         
+                       } else {
+                               javac.setSource("1.7");
+                               javac.setTarget("1.7");
+                       }
                }
                // compile
                boolean passed = false;
index 36d2da115fb238b2cd8c4fad4a1b7125522b7386..28a3fea05bf39280fb4c80924b14bc537ec19137 100644 (file)
Binary files a/lib/build/build.jar and b/lib/build/build.jar differ
diff --git a/testing-client/.isJava5 b/testing-client/.isJava5
new file mode 100644 (file)
index 0000000..136d063
--- /dev/null
@@ -0,0 +1 @@
+  
\ No newline at end of file
index 2502bca0d1cb4a2beda39da1064c0f5ae17fdbca..8fb2741762f6c1417b397fbaeb14f0779b95f790 100644 (file)
@@ -818,8 +818,8 @@ public class Ajctest extends Task implements PropertyChangeListener {
             testsetToArgcombo.put(testset, argcombo);
         }
         while (!testsetToArgcombo.isEmpty()) {
-            int _ = 1;
-            for (Iterator<Testset> iter = testsets.iterator(); iter.hasNext(); _++) {
+            int testsetCounter = 1;
+            for (Iterator<Testset> iter = testsets.iterator(); iter.hasNext(); testsetCounter++) {
                 Testset testset = iter.next();
                 List<List<Arg>> argcombo = testsetToArgcombo.get(testset);
                 if (argcombo.size() == 0) {
@@ -827,8 +827,8 @@ public class Ajctest extends Task implements PropertyChangeListener {
                     continue;
                 }
                 List<Arg> args = argcombo.remove(0);
-                final String startStr = "Testset " + _ + " of " + testsets.size();
-                String str = startStr + " / Combo " + _ + " of " + argcombos.size();
+                final String startStr = "Testset " + testsetCounter + " of " + testsets.size();
+                String str = startStr + " / Combo " + testsetCounter + " of " + argcombos.size();
                 log("---------- " + str + " ----------");
                 execute(testset, args);
             }
index 9b155df3e4a7687e8395cdf87de02f60227b7bce..f651a2f29c6f08761cc73e88da0e2962a762921e 100644 (file)
@@ -105,11 +105,11 @@ public class Java15PointcutExpressionTest extends TestCase {
                PointcutExpression pexpr = null;
                ShadowMatch match = null;
 
-               Method n = test.AnnoValues.class.getMethod("none",null);          
-               Method r = test.AnnoValues.class.getMethod("redMethod",null);           
-               Method g = test.AnnoValues.class.getMethod("greenMethod",null);     
-               Method b = test.AnnoValues.class.getMethod("blueMethod",null);
-               Method d = test.AnnoValues.class.getMethod("defaultMethod",null);
+               Method n = test.AnnoValues.class.getMethod("none");          
+               Method r = test.AnnoValues.class.getMethod("redMethod");           
+               Method g = test.AnnoValues.class.getMethod("greenMethod");     
+               Method b = test.AnnoValues.class.getMethod("blueMethod");
+               Method d = test.AnnoValues.class.getMethod("defaultMethod");
 
                pexpr = p.parsePointcutExpression("execution(@test.A3(test.Color.RED) public void *(..))");
                assertTrue("Should match", pexpr.matchesMethodExecution(n).neverMatches()); // default value RED