Fixing breakages found by tests
authorjlahoda
Sun, 23 Oct 2016 20:17:24 +0200
changeset 1020e27afbce8568
parent 1019 5f3232e1cd46
child 1021 bd16abcadca1
Fixing breakages found by tests
cmdline/compiler/build.xml
cmdline/compiler/src/org/netbeans/api/java/source/CompilationInfoHack.java
cmdline/compiler/test/unit/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessingTestBase.java
cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java
     1.1 --- a/cmdline/compiler/build.xml	Sun Oct 23 11:50:54 2016 +0200
     1.2 +++ b/cmdline/compiler/build.xml	Sun Oct 23 20:17:24 2016 +0200
     1.3 @@ -63,5 +63,10 @@
     1.4      <target name="netbeans-extra" depends="ant"/>
     1.5      
     1.6      <target name="test-build" depends="projectized-common.test-build,-prepare-scripted-tests" />
     1.7 +    <target name="build-init" depends="harness.build-init">
     1.8 +        <condition property="run.bootclasspath.prepend" value="${bootclasspath.prepend}${path.separator}${retouche.javac.impl}">
     1.9 +            <istrue value="${requires.nb.javac}"/>
    1.10 +        </condition>
    1.11 +    </target>
    1.12      
    1.13  </project>
     2.1 --- a/cmdline/compiler/src/org/netbeans/api/java/source/CompilationInfoHack.java	Sun Oct 23 11:50:54 2016 +0200
     2.2 +++ b/cmdline/compiler/src/org/netbeans/api/java/source/CompilationInfoHack.java	Sun Oct 23 20:17:24 2016 +0200
     2.3 @@ -40,6 +40,7 @@
     2.4  
     2.5  import com.sun.source.tree.CompilationUnitTree;
     2.6  import com.sun.source.tree.Tree;
     2.7 +import com.sun.source.util.JavacTask;
     2.8  import com.sun.source.util.TreePath;
     2.9  import com.sun.source.util.Trees;
    2.10  import com.sun.tools.javac.api.JavacTaskImplHack;
    2.11 @@ -112,7 +113,16 @@
    2.12              Field javacTask = CompilationInfoImpl.class.getDeclaredField("javacTask");
    2.13  
    2.14              javacTask.setAccessible(true);
    2.15 -            javacTask.set(this.impl, new JavacTaskImplHack(context));
    2.16 +
    2.17 +            JavacTask prevTask = context.get(JavacTask.class);
    2.18 +
    2.19 +            try {
    2.20 +                context.put(JavacTask.class, (JavacTask) null);
    2.21 +                javacTask.set(this.impl, new JavacTaskImplHack(context));
    2.22 +            } finally {
    2.23 +                context.put(JavacTask.class, (JavacTask) null);
    2.24 +                context.put(JavacTask.class, prevTask);
    2.25 +            }
    2.26  
    2.27              Method init = WorkingCopy.class.getDeclaredMethod("init");
    2.28  
     3.1 --- a/cmdline/compiler/test/unit/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessingTestBase.java	Sun Oct 23 11:50:54 2016 +0200
     3.2 +++ b/cmdline/compiler/test/unit/src/org/netbeans/modules/jackpot30/compiler/HintsAnnotationProcessingTestBase.java	Sun Oct 23 20:17:24 2016 +0200
     3.3 @@ -118,7 +118,7 @@
     3.4          options.add("-s");
     3.5          options.add(sourceOutput.getAbsolutePath());
     3.6          options.add("-source");
     3.7 -        options.add("1.5");
     3.8 +        options.add("1.7");
     3.9          options.add("-Xjcov");
    3.10  
    3.11          for (String eo : extraOptions) {
     4.1 --- a/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java	Sun Oct 23 11:50:54 2016 +0200
     4.2 +++ b/cmdline/lib/test/unit/src/org/netbeans/modules/jackpot30/cmdline/lib/CreateStandaloneJar.java	Sun Oct 23 20:17:24 2016 +0200
     4.3 @@ -199,6 +199,7 @@
     4.4              if (    clazz.getProtectionDomain().getCodeSource() == null
     4.5                  && !clazz.getName().startsWith("com.sun.source")
     4.6                  && !clazz.getName().startsWith("com.sun.javadoc")
     4.7 +                && !clazz.getName().startsWith("com.sun.tools")
     4.8                  && !clazz.getName().startsWith("javax.tools")
     4.9                  && !clazz.getName().startsWith("javax.annotation.processing")
    4.10                  && !clazz.getName().startsWith("javax.lang.model")) {