1. Jan Lahoda
  2. jackpot30

Commits

Jan Lahoda  committed 91636ab

Preventing NPE in ImmutableTreeTranslator.

  • Participants
  • Parent commits c69e43c
  • Branches default

Comments (0)

Files changed (1)

File api/src/org/netbeans/modules/jackpot30/impl/Utilities.java

View file
 import com.sun.source.tree.Tree.Kind;
 import com.sun.source.util.SourcePositions;
 import com.sun.source.util.TreePath;
+import com.sun.tools.javac.util.Context;
 import java.util.Collection;
 import java.util.Iterator;
 import java.util.LinkedList;
 import org.netbeans.modules.jackpot30.spi.HintDescription;
 import org.netbeans.modules.jackpot30.spi.HintProvider;
 import org.netbeans.modules.java.source.JavaSourceAccessor;
+import org.netbeans.modules.java.source.pretty.ImportAnalysis2;
 import org.netbeans.modules.java.source.transform.ImmutableTreeTranslator;
 import org.netbeans.spi.java.classpath.support.ClassPathSupport;
 import org.openide.util.Lookup;
         }
 
         FixTree fixTree = new FixTree();
+        Context c = JavaSourceAccessor.getINSTANCE().getJavacTask(info).getContext();
 
-        fixTree.attach(JavaSourceAccessor.getINSTANCE().getJavacTask(info).getContext());
+        fixTree.attach(c, new ImportAnalysis2(c), info.getCompilationUnit(), null);
         
         patternTree = fixTree.translate(patternTree);