Use an older version of some java modules since the latest ones
only build with JDK 7.

Index: netbeans-7.0.1+dfsg1/java.source/apichanges.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/apichanges.xml	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/apichanges.xml	2011-08-03 23:01:41.000000000 +0100
@@ -108,19 +108,6 @@
     <!-- ACTUAL CHANGES BEGIN HERE: -->
 
     <changes>
-        <change id="TreePathHandle-from-ElementHandle">
-             <api name="general"/>
-             <summary>TreePathHandle can be created from ElementHandle</summary>
-             <version major="0" minor="79"/>
-             <date day="26" month="4" year="2011"/>
-             <author login="jlahoda"/>
-             <compatibility addition="yes" binary="compatible" deletion="no" deprecation="no" modification="no" semantic="compatible" source="compatible"/>
-             <description>
-                 <code>TreePathHandle</code> has a new <code>from(ElementHandle)</code> method.
-             </description>
-             <class package="org.netbeans.api.java.source" name="TreePathHandle"/>
-             <issue number="197848"/>
-        </change>
         <change id="run-modification-task-sourceless">
              <api name="general"/>
              <summary>JavaSource.runModificationTask can run on source-less JavaSources</summary>
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java	2011-08-03 23:01:41.000000000 +0100
@@ -309,9 +309,6 @@
                 final String pkgNameF = pkgName;
                 final String pageNameF = pageName;
                 final CharSequence fragment = buildFragment ? getFragment(element) : null;
-                if (cancel == null) {
-                    return findJavadoc(classFile, pkgName, pageNameF, fragment, allowRemoteJavadoc);
-                }
                 final Future<TextStream> future = RP.submit(new Callable<TextStream>() {
                     @Override
                     public TextStream call() throws Exception {
@@ -320,7 +317,6 @@
                 });
                 do {
                     if (cancel != null && cancel.call()) {
-                        future.cancel(false);
                         break;
                     }
                     try {
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java	2011-08-03 23:01:41.000000000 +0100
@@ -90,8 +90,8 @@
 
     public static void preRegister(final Context context, final ClasspathInfo cpInfo) {
         context.put(docEnvKey, new Context.Factory<DocEnv>() {
-            public DocEnv make(Context c) {
-                return new JavadocEnv(c, cpInfo);
+            public DocEnv make() {
+                return new JavadocEnv(context, cpInfo);
             }
         });
     }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java	2011-08-03 23:01:41.000000000 +0100
@@ -60,7 +60,16 @@
     /** Creates a new instance of JBrowseModule */
     public JBrowseModule() {
     }
-    
+
+    public @Override void restored() {
+        super.restored();        
+        //XXX:
+        //#143234: javac caches content of all jar files in a static map, which leads to memory leaks affecting the IDE
+        //when "internal" execution of javac is used
+        //the property below disables the caches
+        //java.project might be a better place (currently does not have a ModuleInstall)
+        System.setProperty("useJavaUtilZip", "true"); //NOI18N
+    }   
     
     public @Override void close () {
         super.close();
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java	2011-08-03 23:01:41.000000000 +0100
@@ -39,7 +39,6 @@
 package org.netbeans.modules.java.source.save;
 
 import com.sun.source.tree.AnnotationTree;
-import com.sun.source.tree.BinaryTree;
 import com.sun.source.tree.BlockTree;
 import com.sun.source.tree.CaseTree;
 import com.sun.source.tree.ClassTree;
@@ -75,7 +74,6 @@
 import java.util.Iterator;
 import java.util.LinkedList;
 import java.util.List;
-import java.util.ListIterator;
 import java.util.Map;
 import java.util.Set;
 
@@ -135,15 +133,11 @@
             for (Region region : regions) {
                 HashSet<Integer> linesToAddStar = new HashSet<Integer>();
                 LinkedList<Integer> startOffsets = getStartOffsets(region);
-                for(ListIterator<Integer> it = startOffsets.listIterator(); it.hasNext();) {
-                    int startOffset = it.next();
-                    int endOffset;
-                    if(it.hasNext()) {
-                        endOffset = it.next();
-                        it.previous();
-                    } else {
-                        endOffset = region.getEndOffset();
-                    }
+                Iterator<Integer> it = startOffsets.iterator();
+                int startOffset = it.hasNext() ? it.next() : region.getStartOffset();
+                int endOffset = -1;
+                while (endOffset < region.getEndOffset()) {
+                    endOffset = it.hasNext() ? it.next() : region.getEndOffset();
                     String blockCommentLine = null;
                     int delta = 0;
                     if (cs.addLeadingStarInComment() && ((delta = ts.move(startOffset)) > 0 && ts.moveNext() || ts.movePrevious())
@@ -163,9 +157,10 @@
                     if (blockCommentLine != null && !blockCommentLine.startsWith("*")) { //NOI18N
                         linesToAddStar.add(startOffset);
                     }
+                    startOffset = endOffset;
                 }
                 while (!startOffsets.isEmpty()) {
-                    int startOffset = startOffsets.removeLast();
+                    startOffset = startOffsets.removeLast();
                     Integer newIndent = newIndents.get(startOffset);
                     if (linesToAddStar.contains(startOffset)) {
                         context.modifyIndent(startOffset, 0);
@@ -315,34 +310,24 @@
                 }
                 break;
             case VARIABLE:
-                Tree type = ((VariableTree)last).getType();
-                if (type != null && type.getKind() != Kind.ERRONEOUS) {
-                    ExpressionTree init = ((VariableTree)last).getInitializer();
-                    if (init == null || init.getKind() != Kind.NEW_ARRAY
-                            || (token = findFirstNonWhitespaceToken(startOffset, lastPos)) == null
-                            || token.token().id() != JavaTokenId.EQ
-                            || (token = findFirstNonWhitespaceToken(startOffset, endOffset)) == null
-                            || token.token().id() != JavaTokenId.LBRACE) {
-                        if (cs.alignMultilineAssignment()) 
-                            currentIndent = getColumn(last);
-                        else
-                            currentIndent += cs.getContinuationIndentSize();
-                    } else {
-                        switch (cs.getOtherBracePlacement()) {
-                            case NEW_LINE_INDENTED:
-                                currentIndent += cs.getIndentSize();
-                                break;
-                            case NEW_LINE_HALF_INDENTED:
-                                currentIndent += (cs.getIndentSize() / 2);
-                                break;
-                        }
-                    }
-                    break;
+                ExpressionTree init = ((VariableTree)last).getInitializer();
+                if (init == null || init.getKind() != Kind.NEW_ARRAY
+                        || (token = findFirstNonWhitespaceToken(startOffset, lastPos)) == null
+                        || token.token().id() != JavaTokenId.EQ
+                        || (token = findFirstNonWhitespaceToken(startOffset, endOffset)) == null
+                        || token.token().id() != JavaTokenId.LBRACE) {
+                    currentIndent += cs.getContinuationIndentSize();
                 } else {
-                    last = ((VariableTree)last).getModifiers();
-                    if (last == null)
-                        break;
+                    switch (cs.getOtherBracePlacement()) {
+                        case NEW_LINE_INDENTED:
+                            currentIndent += cs.getIndentSize();
+                            break;
+                        case NEW_LINE_HALF_INDENTED:
+                            currentIndent += (cs.getIndentSize() / 2);
+                            break;
+                    }
                 }
+                break;
             case MODIFIERS:
                 Tree t = null;
                 for (Tree ann : ((ModifiersTree)last).getAnnotations()) {
@@ -356,10 +341,7 @@
                 }
                 break;
             case DO_WHILE_LOOP:
-                token = findFirstNonWhitespaceToken(startOffset, lastPos);
-                if (token != null && !EnumSet.of(JavaTokenId.RBRACE, JavaTokenId.SEMICOLON).contains(token.token().id())) {
-                    currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.DO), lastPos, currentIndent);
-                }
+                currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.DO), lastPos, currentIndent);
                 break;
             case ENHANCED_FOR_LOOP:
                 currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN), (int)sp.getEndPosition(cut, ((EnhancedForLoopTree)last).getExpression()), currentIndent);
@@ -392,10 +374,7 @@
             case IF:
                 token = findFirstNonWhitespaceToken(startOffset, endOffset);
                 if (token == null || token.token().id() != JavaTokenId.ELSE) {
-                    token = findFirstNonWhitespaceToken(startOffset, lastPos);
-                    if (token != null && !EnumSet.of(JavaTokenId.RBRACE, JavaTokenId.SEMICOLON).contains(token.token().id())) {
-                        currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN, JavaTokenId.ELSE), (int)sp.getEndPosition(cut, ((IfTree)last).getCondition()) - 1, currentIndent);
-                    }
+                    currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN, JavaTokenId.ELSE), (int)sp.getEndPosition(cut, ((IfTree)last).getCondition()) - 1, currentIndent);
                 }
                 break;
             case SYNCHRONIZED:
@@ -404,17 +383,14 @@
             case TRY:
                 token = findFirstNonWhitespaceToken(startOffset, endOffset);
                 if (token == null || !EnumSet.of(JavaTokenId.CATCH, JavaTokenId.FINALLY).contains(token.token().id())) {
-                    token = findFirstNonWhitespaceToken(startOffset, lastPos);
-                    if (token != null && token.token().id() != JavaTokenId.RBRACE) {
-                        t = null;
-                        for (Tree res : ((TryTree)last).getResources()) {
-                            if (sp.getEndPosition(cut, res) > startOffset) {
-                                break;
-                            }
-                            t = res;
+                    t = null;
+                    for (Tree res : ((TryTree)last).getResources()) {
+                        if (sp.getEndPosition(cut, res) > startOffset) {
+                            break;
                         }
-                        currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.TRY, JavaTokenId.RPAREN, JavaTokenId.FINALLY), t != null ? (int)sp.getEndPosition(cut, t) : lastPos, currentIndent);
+                        t = res;
                     }
+                    currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.TRY, JavaTokenId.RPAREN, JavaTokenId.FINALLY), t != null ? (int)sp.getEndPosition(cut, t) : lastPos, currentIndent);
                 }
                 break;
             case CATCH:
@@ -548,8 +524,7 @@
                 break;
             case NEW_ARRAY:
                 token = findFirstNonWhitespaceToken(startOffset, endOffset);
-                nextTokenId = token != null ? token.token().id() : null;
-                if (nextTokenId != JavaTokenId.RBRACE) {
+                if (token == null || token.token().id() != JavaTokenId.RBRACE) {
                     token = findFirstNonWhitespaceToken(startOffset, lastPos);
                     prevTokenId = token != null ? token.token().id() : null;
                     if (prevTokenId != null) {
@@ -560,42 +535,12 @@
                             case COMMA:
                                 currentIndent = getMultilineIndent(((NewArrayTree)last).getInitializers(), path, token.offset(), lastLineStartOffset, currentIndent, cs.alignMultilineArrayInit(), false);
                                 break;
-                            case RBRACKET:
-                                if (nextTokenId == JavaTokenId.LBRACE) {
-                                    switch (cs.getOtherBracePlacement()) {
-                                        case NEW_LINE_INDENTED:
-                                            currentIndent += cs.getIndentSize();
-                                            break;
-                                        case NEW_LINE_HALF_INDENTED:
-                                            currentIndent += (cs.getIndentSize() / 2);
-                                            break;
-                                    }
-                                    break;
-                                }
                             default:
                                 currentIndent += cs.getContinuationIndentSize();
                         }
                     }
                 }
                 break;
-            case NEW_CLASS:
-                token = findFirstNonWhitespaceToken(startOffset, endOffset);
-                nextTokenId = token != null ? token.token().id() : null;
-                token = findFirstNonWhitespaceToken(startOffset, lastPos);
-                prevTokenId = token != null ? token.token().id() : null;
-                if (prevTokenId == JavaTokenId.RPAREN && nextTokenId == JavaTokenId.LBRACE) {
-                    switch (cs.getOtherBracePlacement()) {
-                        case NEW_LINE_INDENTED:
-                            currentIndent += cs.getIndentSize();
-                            break;
-                        case NEW_LINE_HALF_INDENTED:
-                            currentIndent += (cs.getIndentSize() / 2);
-                            break;
-                    }
-                } else {
-                    currentIndent += cs.getContinuationIndentSize();
-                }
-                break;
             case METHOD_INVOCATION:
                 token = findFirstNonWhitespaceToken(startOffset, lastPos);
                 if (token != null && token.token().id() == JavaTokenId.COMMA) {
@@ -755,12 +700,6 @@
         return false;
     }
 
-    private int getColumn(Tree tree) throws BadLocationException {
-        int startOffset = (int)(sp.getStartPosition(cut, tree));
-        int lineStartOffset = context.lineStartOffset(startOffset);
-        return getCol(context.document().getText(lineStartOffset, startOffset - lineStartOffset));
-    }
-
     private int getCurrentIndent(Tree tree) throws BadLocationException {
         int lineStartOffset = context.lineStartOffset((int)sp.getStartPosition(cut, tree));
         Integer newIndent = newIndents.get(lineStartOffset);
@@ -768,76 +707,10 @@
     }
 
     private int getContinuationIndent(LinkedList<? extends Tree> path, int currentIndent) throws BadLocationException {
-        for (Tree tree : path) {
-            switch (tree.getKind()) {
-                case CLASS:
-                case INTERFACE:
-                case ENUM:
-                case ANNOTATION_TYPE:
-                case VARIABLE:
-                case METHOD:
-                case TRY:
-                case RETURN:
-                case BLOCK:
-                case FOR_LOOP:
-                case SWITCH:
-                case THROW:
-                case WHILE_LOOP:
-                case IF:
-                case EXPRESSION_STATEMENT:
-                case SYNCHRONIZED:
-                case ASSERT:
-                case CONTINUE:
-                case LABELED_STATEMENT:
-                case ENHANCED_FOR_LOOP:
-                case BREAK:
-                case EMPTY_STATEMENT:
-                case DO_WHILE_LOOP:
-                    return getCurrentIndent(tree) + cs.getContinuationIndentSize();
-                case ASSIGNMENT:
-                case MULTIPLY_ASSIGNMENT:
-                case DIVIDE_ASSIGNMENT:
-                case REMAINDER_ASSIGNMENT:
-                case PLUS_ASSIGNMENT:
-                case MINUS_ASSIGNMENT:
-                case LEFT_SHIFT_ASSIGNMENT:
-                case RIGHT_SHIFT_ASSIGNMENT:
-                case UNSIGNED_RIGHT_SHIFT_ASSIGNMENT:
-                case AND_ASSIGNMENT:
-                case XOR_ASSIGNMENT:
-                case OR_ASSIGNMENT:
-                    if (cs.alignMultilineAssignment())
-                        return getColumn(tree);
-                    break;
-                case AND:
-                case CONDITIONAL_AND:
-                case CONDITIONAL_OR:
-                case DIVIDE:
-                case EQUAL_TO:
-                case GREATER_THAN:
-                case GREATER_THAN_EQUAL:
-                case LEFT_SHIFT:
-                case LESS_THAN:
-                case LESS_THAN_EQUAL:
-                case MINUS:
-                case MULTIPLY:
-                case NOT_EQUAL_TO:
-                case OR:
-                case PLUS:
-                case REMAINDER:
-                case RIGHT_SHIFT:
-                case UNSIGNED_RIGHT_SHIFT:
-                case XOR:
-                    if (cs.alignMultilineBinaryOp())
-                        return getColumn(tree);
-                    break;
-                case CONDITIONAL_EXPRESSION:
-                    if (cs.alignMultilineTernaryOp())
-                        return getColumn(tree);
-                    break;
-            }
-        }
-        return currentIndent + cs.getContinuationIndentSize();
+        Tree tree = null;
+        Iterator<? extends Tree> it = path.iterator();
+        while (it.hasNext() && !((tree = it.next()) instanceof StatementTree || tree.getKind() == Kind.CLASS || tree.getKind() == Kind.METHOD));
+        return (tree != null ? getCurrentIndent(tree) : currentIndent) + cs.getContinuationIndentSize();
     }
 
     private int getStmtIndent(int startOffset, int endOffset, Set<JavaTokenId> expectedTokenIds, int expectedTokenOffset, int currentIndent) {
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java	2011-08-03 23:01:41.000000000 +0100
@@ -223,7 +223,7 @@
                 continue;
             if (endOffset < start)
                 continue;
-            if (endOffset == start && (text == null || !(text.trim().equals("}") || templateEdit && start >= end))) //NOI18N
+            if (endOffset == start && (text == null || !(text.trim().equals("}") || templateEdit))) //NOI18N
                 continue;
             if (embeddingOffset >= start)
                 continue;
@@ -1658,7 +1658,7 @@
         }
 
         @Override
-        public Boolean visitUnionType(UnionTypeTree node, Void p) {
+        public Boolean visitDisjunctiveType(DisjunctiveTypeTree node, Void p) {
             List<? extends Tree> alts = node.getTypeAlternatives();
             if (alts != null && !alts.isEmpty()) {
                 wrapList(cs.wrapDisjunctiveCatchTypes(), cs.alignMultilineDisjunctiveCatchTypes(), false, BAR, alts);
@@ -2235,14 +2235,12 @@
             int alignIndent = cs.alignMultilineBinaryOp() ? col : -1;
             scan(node.getLeftOperand(), p);
             if (cs.wrapAfterBinaryOps()) {
-                boolean containedNewLine = spaces(cs.spaceAroundBinaryOps() ? 1 : 0, false);
+                spaces(cs.spaceAroundBinaryOps() ? 1 : 0);
                 if (OPERATOR.equals(tokens.token().id().primaryCategory())) {
                     col += tokens.token().length();
                     lastBlankLines = -1;
                     lastBlankLinesTokenIndex = -1;
                     tokens.moveNext();
-                    if (containedNewLine)
-                        newline();
                 }
                 wrapTree(cs.wrapBinaryOps(), alignIndent, cs.spaceAroundBinaryOps() ? 1 : 0, node.getRightOperand());
             } else {
@@ -2256,15 +2254,11 @@
             int alignIndent = cs.alignMultilineTernaryOp() ? col : -1;
             scan(node.getCondition(), p);
             if (cs.wrapAfterTernaryOps()) {
-                boolean containedNewLine = spaces(cs.spaceAroundTernaryOps() ? 1 : 0, false);
+                spaces(cs.spaceAroundTernaryOps() ? 1 : 0);
                 accept(QUESTION);
-                if (containedNewLine)
-                    newline();
                 wrapTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getTrueExpression());
-                containedNewLine = spaces(cs.spaceAroundTernaryOps() ? 1 : 0, false);
+                spaces(cs.spaceAroundTernaryOps() ? 1 : 0);
                 accept(COLON);
-                if (containedNewLine)
-                    newline();
                 wrapTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getFalseExpression());
             } else {
                 wrapOperatorAndTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getTrueExpression());
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java	2011-08-03 23:01:41.000000000 +0100
@@ -1103,8 +1103,6 @@
                         parens ? new JavaTokenId[] { JavaTokenId.LPAREN, JavaTokenId.RPAREN } : null,
                         pos,
                         Measure.ARGUMENT,
-                        diffContext.style.spaceBeforeSemi(),
-                        diffContext.style.spaceAfterSemi(),
                         false,
                         ";" //NOI18N
                 );
@@ -1876,7 +1874,7 @@
         if (!listsMatch(oldT.getVariables(), newT.getVariables())) {
             copyTo(bounds[0], oldT.getStartPosition());
             if (oldT.isEnum()) {
-                int pos = diffParameterList(oldT.getVariables(), newT.getVariables(), null, oldT.getStartPosition(), Measure.ARGUMENT, diffContext.style.spaceBeforeComma(), diffContext.style.spaceAfterComma(), true, ",");  //NOI18N
+                int pos = diffParameterList(oldT.getVariables(), newT.getVariables(), null, oldT.getStartPosition(), Measure.ARGUMENT, true, ",");  //NOI18N
                 copyTo(pos, bounds[1]);
                 return bounds[1];
             } else {
@@ -2239,7 +2237,7 @@
             int pos,
             Comparator<JCTree> measure)
     {
-        return diffParameterList(oldList, newList, makeAround, pos, measure, diffContext.style.spaceBeforeComma(), diffContext.style.spaceAfterComma(), false, ",");   //NOI18N
+        return diffParameterList(oldList, newList, makeAround, pos, measure, false, ",");   //NOI18N
     }
     private int diffParameterList(
             List<? extends JCTree> oldList,
@@ -2247,8 +2245,6 @@
             JavaTokenId[] makeAround,
             int pos,
             Comparator<JCTree> measure,
-            boolean spaceBefore,
-            boolean spaceAfter,
             boolean isEnum,
             String separator)
     {
@@ -2309,7 +2305,7 @@
                 // insert new element
                 case INSERT: {
                     if (wasComma) {
-                        if (spaceAfter) {
+                        if (diffContext.style.spaceAfterComma()) {
                             printer.print(" ");
                         }
                     }
@@ -2326,7 +2322,7 @@
                 // just copy existing element
                 case NOCHANGE:
                     if (oldIndex++ == 0 && wasComma) {
-                        if (spaceAfter) {
+                        if (diffContext.style.spaceAfterComma()) {
                             printer.print(" ");
                         }
                     }
@@ -2339,17 +2335,10 @@
                     int start = tokenSequence.offset();
                     tokenSequence.move(bounds[1]);
                     moveToSrcRelevant(tokenSequence, Direction.FORWARD);
-                    int end;
-                    if (isEnum) {
-                        if ((tokenSequence.token().id() == JavaTokenId.SEMICOLON || tokenSequence.token().id() == JavaTokenId.COMMA)) {
-                            end = tokenSequence.offset();
-                        } else {
-                            end = bounds[1];
-                        }
-                    } else if (oldIndex < oldList.size()) {
+                    int end = bounds[1];
+                    if (isEnum &&
+                        (tokenSequence.token().id() == JavaTokenId.SEMICOLON || tokenSequence.token().id() == JavaTokenId.COMMA)) {
                         end = tokenSequence.offset();
-                    } else {
-                        end = bounds[1];
                     }
                     copyTo(start, pos = end, printer);
                     wasLeadingDelete = false;
@@ -2358,9 +2347,6 @@
                     break;
             }
             if (commaNeeded(result, item)) {
-                if ((item.operation == Operation.INSERT || (oldIndex == oldList.size() && j + 1 < result.length && result[j + 1].operation == Operation.INSERT)) && spaceBefore) {
-                    printer.print(" ");
-                }
                 printer.print(separator);
                 wasComma = true;
             } else {
@@ -2535,11 +2521,6 @@
         return pos;
     }
 
-    protected int diffUnionType(JCTypeUnion oldT, JCTypeUnion newT, int[] bounds) {
-        int localPointer = bounds[0];
-        return diffParameterList(oldT.alternatives, newT.alternatives, null, localPointer, Measure.MEMBER, diffContext.style.spaceAroundBinaryOps(), diffContext.style.spaceAroundBinaryOps(), false, "|");
-    }
-
     private boolean commaNeeded(ResultItem[] arr, ResultItem item) {
         if (item.operation == Operation.DELETE) {
             return false;
@@ -2701,7 +2682,13 @@
                 case INSERT: {
                     int pos = estimator.getInsertPos(i);
                     if (pos > localPointer) {
-                        copyTo(localPointer, localPointer = pos);
+                        tokenSequence.move(pos);
+                        moveToDifferentThan(tokenSequence, Direction.BACKWARD, EnumSet.of(JavaTokenId.WHITESPACE));
+                        tokenSequence.moveNext();
+                        pos = tokenSequence.offset();
+                        if (pos > localPointer) {
+                            copyTo(localPointer, localPointer = pos);
+                        }
                     }
                     int oldPos = item.element.getKind() != Kind.VARIABLE ? getOldPos(item.element) : item.element.pos;
                     boolean found = false;
@@ -3297,9 +3284,6 @@
               retVal = diffModifiers((JCModifiers) oldT, (JCModifiers) newT, parent, elementBounds[0]);
               copyTo(retVal, elementBounds[1]);
               break;
-          case JCTree.TYPEUNION:
-              retVal = diffUnionType((JCTypeUnion) oldT, (JCTypeUnion) newT, elementBounds);
-              break;
           default:
               // handle special cases like field groups and enum constants
               if (oldT.getKind() == Kind.OTHER) {
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
@@ -164,7 +164,7 @@
             }
         }
 
-        if (jt == null || units == null || JavaCustomIndexer.NO_ONE_PASS_COMPILE_WORKER) {
+        if (jt == null || units == null) {
             return new ParsingOutput(false, file2FQNs, addedTypes, createdFiles, finished, modifiedTypes, aptGenerated);
         }
         if (context.isCancelled()) {
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
@@ -166,7 +166,7 @@
             }
         }
 
-        if (units == null || JavaCustomIndexer.NO_ONE_PASS_COMPILE_WORKER) {
+        if (units == null) {
             return new ParsingOutput(false, file2FQNs, addedTypes, createdFiles, finished, modifiedTypes, aptGenerated);
         }
 
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java	2011-08-03 23:01:41.000000000 +0100
@@ -121,7 +121,6 @@
  */
 public class JavaCustomIndexer extends CustomIndexer {
 
-            static final boolean NO_ONE_PASS_COMPILE_WORKER = Boolean.getBoolean(JavaCustomIndexer.class.getName() + ".no.one.pass.compile.worker");
     private static final String SOURCE_LEVEL_ROOT = "sourceLevel"; //NOI18N
     private static final String DIRTY_ROOT = "dirty"; //NOI18N
     private static final String SOURCE_PATH = "sourcePath"; //NOI18N
@@ -539,8 +538,7 @@
         return result;
     }
 
-    static boolean addAptGenerated(final Context context, JavaParsingContext javaContext, final String sourceRelative, final Set<CompileTuple> aptGenerated) throws IOException {
-        boolean ret = false;
+    static void addAptGenerated(final Context context, JavaParsingContext javaContext, final String sourceRelative, final Set<CompileTuple> aptGenerated) throws IOException {
         final File aptFolder = JavaIndex.getAptFolder(context.getRootURI(), false);
         if (aptFolder.exists()) {
             final FileObject root = FileUtil.toFileObject(aptFolder);
@@ -555,7 +553,7 @@
                         if (f.exists() && FileObjects.JAVA.equals(FileObjects.getExtension(f.getName()))) {
                             Indexable i = accessor.create(new FileObjectIndexable(root, fileName));
                             InferableJavaFileObject ffo = FileObjects.fileFileObject(f, aptFolder, null, javaContext.encoding);
-                            ret |= aptGenerated.add(new CompileTuple(ffo, i, false, true, true));
+                            aptGenerated.add(new CompileTuple(ffo, i, false, true, true));
                         }
                     }
                 } catch (IOException ioe) {
@@ -564,7 +562,6 @@
                 }
             }
         }
-        return ret;
     }
 
     static void setErrors(Context context, CompileTuple active, DiagnosticListenerImpl errors) {
@@ -587,7 +584,7 @@
         return binaryNames;
     }
 
-    private static Map<URL, Set<URL>> findDependent(final URL root, final Collection<ElementHandle<TypeElement>> classes, boolean includeFilesInError) throws IOException {
+    private static Map<URL, Set<URL>> findDependent(final URL root, final Collection<ElementHandle<TypeElement>> classes, boolean includeFilesInError) throws IOException {                
         //get dependencies
         Map<URL, List<URL>> deps = IndexingController.getDefault().getRootDependencies();
         Map<URL, List<URL>> peers = IndexingController.getDefault().getRootPeers();
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
@@ -242,7 +242,9 @@
                     continue;
                 }
                 jt.analyze(types);
-                boolean aptGenerated = aptEnabled ? JavaCustomIndexer.addAptGenerated(context, javaContext, active.indexable.getRelativePath(), previous.aptGenerated) : false;
+                if (aptEnabled) {
+                    JavaCustomIndexer.addAptGenerated(context, javaContext, active.indexable.getRelativePath(), previous.aptGenerated);
+                }
                 if (mem.isLowMemory()) {
                     dumpSymFiles(fileManager, jt, previous.createdFiles);
                     mem.isLowMemory();
@@ -287,10 +289,6 @@
                 previous.finishedFiles.add(active.indexable);
                 active = null;
                 state  = 0;
-                if (aptGenerated) {
-                    dumpSymFiles(fileManager, jt, previous.createdFiles);
-                    jt = null;
-                }
             } catch (CouplingAbort ca) {
                 //Coupling error
                 TreeLoader.dumpCouplingAbort(ca, null);
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java	2011-08-03 23:01:41.000000000 +0100
@@ -121,7 +121,8 @@
     public Name enclClassName; // the enclosing class name.
     private int indentSize;
     private int prec; // visitor argument: the current precedence level.
-    private boolean printingMethodParams;
+    private LinkedList<Comment> pendingComments = null;
+    private int lastReadCommentIdx = -1;
     private DiffContext diffContext;
     private CommentHandlerService comments;
 
@@ -298,9 +299,6 @@
     public boolean handlePossibleOldTrees(java.util.List<? extends JCTree> toPrint, boolean includeStartingComments) {
         for (JCTree t : toPrint) {
             if (!oldTrees.contains(t)) return false;
-            if (t.getKind() == Kind.ARRAY_TYPE) {
-                return false;//XXX #197584: C-like array are cannot be copied as old trees.
-            }
         }
 
         JCTree firstTree = toPrint.get(0);
@@ -762,11 +760,8 @@
             print(cs.spaceBeforeMethodDeclParen() ? " (" : "(");
             if (cs.spaceWithinMethodDeclParens() && tree.params.nonEmpty())
                 print(' ');
-            boolean oldPrintingMethodParams = printingMethodParams;
-            printingMethodParams = true;
             wrapTrees(tree.params, cs.wrapMethodParams(), cs.alignMultilineMethodParams()
                     ? out.col : out.leftMargin + cs.getContinuationIndentSize());
-            printingMethodParams = oldPrintingMethodParams;
             if (cs.spaceWithinMethodDeclParens() && tree.params.nonEmpty())
                 needSpace();
             print(')');
@@ -1489,7 +1484,7 @@
     }
 
     @Override
-    public void visitTypeUnion(JCTypeUnion that) {
+    public void visitTypeDisjunction(JCTypeDisjunction that) {
         boolean first = true;
 
         for (JCExpression c : that.getTypeAlternatives()) {
@@ -1826,16 +1821,14 @@
         
         VeryPretty del = new VeryPretty(diffContext, cs, new HashMap<Tree, Object>(), new HashMap<Object, int[]>(), origText, 0);
         del.reallyPrintAnnotations = true;
-        del.printingMethodParams = printingMethodParams;
 
         del.printAnnotations(annotations);
 
         String str = del.out.toString();
-        int col = printingMethodParams ? out.leftMargin + cs.getContinuationIndentSize() : out.col;
-        
-        str = Reformatter.reformat(str + " class A{}", cs, cs.getRightMargin() - col);
 
-        str = str.trim().replaceAll("\n", "\n" + whitespace(col));
+        str = Reformatter.reformat(str + " class A{}", cs, cs.getRightMargin() - out.col);
+
+        str = str.trim().replaceAll("\n", "\n" + whitespace(out.col));
 
         adjustSpans(annotations, str);
 
@@ -1850,10 +1843,7 @@
         if (annotations.isEmpty()) return ;
 
         if (printAnnotationsFormatted(annotations)) {
-            if (!printingMethodParams)
-                toColExactly(out.leftMargin);
-            else
-                out.needSpace();
+            toColExactly(out.leftMargin);
             return ;
         }
         
@@ -1876,8 +1866,7 @@
                     break;
                 }
             } else {
-                if (!printingMethodParams)
-                    toColExactly(out.leftMargin);
+                toColExactly(out.leftMargin);
             }
             annotations = annotations.tail;
         }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java	2011-08-03 23:01:41.000000000 +0100
@@ -127,12 +127,7 @@
             return IndexManager.readAccess(new IndexManager.Action<Boolean>() {
                 @Override
                 public Boolean run() throws IOException, InterruptedException {
-                    if (index instanceof Index.WithStatus) {
-                        //Fast path
-                        return ((Index.WithStatus)index).getStatus(false) == Index.Status.EMPTY;
-                    } else {
-                       return !index.exists();
-                    }
+                    return !PersistentClassIndex.this.index.exists();
                 }
             }).booleanValue();
         } catch (InterruptedException ie) {
@@ -147,11 +142,7 @@
     @Override
     public boolean isValid() {
         try {
-            if (index instanceof Index.WithStatus) {
-                return ((Index.WithStatus)index).getStatus(true) != Index.Status.INVALID;
-            } else {
-                return index.isValid(true);
-            }
+            return index.isValid(true);
         } catch (IOException ex) {
             return false;
         }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java	2011-08-03 23:01:41.000000000 +0100
@@ -303,12 +303,6 @@
             return null;
         }
 
-        File tagFile = new File(targetFolder, TAG_FILE_NAME);
-
-        if (!tagFile.exists()) {
-            return null;
-        }
-
         try {
             SourceUtils.waitScanFinished();
         } catch (InterruptedException e) {
@@ -317,6 +311,12 @@
             return false;
         }
 
+        File tagFile = new File(targetFolder, TAG_FILE_NAME);
+
+        if (!tagFile.exists()) {
+            return null;
+        }
+
         delete(targetFolder, false);
         delete(tagFile, true);
 
@@ -593,7 +593,7 @@
             }
             assert f.isAbsolute();
         }
-        return f;
+        return FileUtil.normalizeFile(f);
     }
     
     /**
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java	2011-08-03 23:01:41.000000000 +0100
@@ -357,7 +357,7 @@
     public Tree visitBlock(BlockTree tree, Object p) {
 	return rewriteChildren(tree);
     }
-    public Tree visitUnionType(UnionTypeTree tree, Object p) {
+    public Tree visitDisjunctiveType(DisjunctiveTypeTree tree, Object p) {
         return rewriteChildren(tree);
     }
     public Tree visitDoWhileLoop(DoWhileLoopTree tree, Object p) {
@@ -629,10 +629,10 @@
 	return tree;
     }
 
-    protected final UnionTypeTree rewriteChildren(UnionTypeTree tree) {
+    protected final DisjunctiveTypeTree rewriteChildren(DisjunctiveTypeTree tree) {
 	List<? extends Tree> newComponents = translate(tree.getTypeAlternatives());
 	if (newComponents!=tree.getTypeAlternatives()) {
-	    UnionTypeTree n = make.UnionType(newComponents);
+	    DisjunctiveTypeTree n = make.DisjunctiveType(newComponents);
 	    copyCommentTo(tree,n);
             copyPosTo(tree,n);
 	    tree = n;
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java	2011-08-03 23:01:41.000000000 +0100
@@ -44,7 +44,6 @@
 
 package org.netbeans.modules.java.source.parsing;
 
-import com.sun.tools.javac.api.ClientCodeWrapper.Trusted;
 import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -72,6 +71,7 @@
 import org.netbeans.lib.editor.util.swing.DocumentUtilities;
 import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation;
 import org.netbeans.modules.parsing.api.Source;
+import org.netbeans.modules.parsing.impl.Utilities;
 import org.openide.cookies.EditorCookie;
 import org.openide.filesystems.FileLock;
 import org.openide.filesystems.FileObject;
@@ -85,7 +85,6 @@
  *
  * @author Tomas Zezula
  */
-@Trusted
 public class SourceFileObject implements DocumentProvider, InferableJavaFileObject {
 
     final Handle handle;
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java	2011-08-03 23:01:41.000000000 +0100
@@ -45,7 +45,6 @@
 package org.netbeans.modules.java.source.parsing;
 
 
-import com.sun.tools.javac.api.ClientCodeWrapper.Trusted;
 import java.io.BufferedInputStream;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -78,7 +77,6 @@
 import javax.lang.model.element.Modifier;
 import javax.lang.model.element.NestingKind;
 import javax.tools.JavaFileObject;
-import org.netbeans.api.annotations.common.NonNull;
 import org.netbeans.api.annotations.common.NullAllowed;
 import org.netbeans.api.queries.FileEncodingQuery;
 import org.netbeans.modules.java.ClassDataLoader;
@@ -105,21 +103,8 @@
  */
 public class FileObjects {
     
-    public static final Comparator<String> SIMPLE_NAME_STRING_COMPARATOR = new Comparator<String>(){
-        @Override
-        public int compare( String o1, String o2 ) {
-            return getSimpleName( o1 ).compareTo( getSimpleName( o2 ) );
-        }
-    };
-    
-    public static final Comparator<JavaFileObject> SIMPLE_NAME_FILEOBJECT_COMPARATOR = new Comparator<JavaFileObject>(){
-        @Override
-        public int compare( JavaFileObject o1, JavaFileObject o2 ) {
-            String n1 = getSimpleName( o1 );
-            String n2 = getSimpleName( o2 );
-            return n1.compareTo( n2 );
-        }
-    };
+    public static final Comparator<String> SIMPLE_NAME_STRING_COMPARATOR = new SimpleNameStringComparator();
+    public static final Comparator<JavaFileObject> SIMPLE_NAME_FILEOBJECT_COMPARATOR = new SimpleNameFileObjectComparator();
     
     
     public static final String JAVA  = JavaDataLoader.JAVA_EXTENSION;
@@ -135,9 +120,7 @@
     public static final String RES   = "res";  //NOI18N
 
     public static final String RESOURCES = "resouces." + FileObjects.RES;  //NOI18N
-
-    private static final String encodingName = new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding();
-
+    
     //todo: If more clients than btrace will need this, create a SPI.
     private static final Set<String> javaFlavorExt = new HashSet<String>();
     static {
@@ -195,7 +178,17 @@
         assert zipFile != null;
         return new CachedZipFileObject (zipFile, folder, baseName, mtime);
     }
-            
+    
+    /**
+     * Creates {@link JavaFileObject} for a regular {@link File}
+     * @param file for which the {@link JavaFileObject} should be created
+     * @pram root - the classpath root owning the file
+     * @return {@link JavaFileObject}, never returns null
+     */
+    public static InferableJavaFileObject fileFileObject( final File file, final File root, final JavaFileFilterImplementation filter) {
+        return fileFileObject(file, root, filter, null);
+    }
+    
     /**
      * Creates {@link JavaFileObject} for a regular {@link File}
      * @param file for which the {@link JavaFileObject} should be created
@@ -203,22 +196,14 @@
      * @param encoding - the file's encoding
      * @return {@link JavaFileObject}, never returns null
      */
-    public static @NonNull InferableJavaFileObject fileFileObject( final @NonNull File file, final @NonNull File root,
-            final @NullAllowed JavaFileFilterImplementation filter, final @NullAllowed Charset encoding) {
+    public static InferableJavaFileObject fileFileObject( final File file, final File root, final JavaFileFilterImplementation filter, Charset encoding) {
         assert file != null;
         assert root != null;
-        final String[] pkgNamePair = getFolderAndBaseName(getRelativePath(root,file),File.separatorChar);
+        String[] pkgNamePair = getFolderAndBaseName(getRelativePath(root,file),File.separatorChar);
         return new FileBase( file, convertFolder2Package(pkgNamePair[0], File.separatorChar), pkgNamePair[1], filter, encoding);
     }
-
-    /**
-     * Creates a FileObject for newly created file
-     * @param root owning the file
-     * @param path the path (separated by '/') to target folder relative to root
-     * @param name of the file
-     * @return {@link JavaFileObject}
-     */
-    public static @NonNull JavaFileObject templateFileObject (final @NonNull FileObject root, final @NonNull String path, final @NonNull String name) {
+    
+    public static JavaFileObject templateFileObject (final FileObject root, final String path, String name) {
         assert root != null;
         assert path != null;        
         JavaFileFilterImplementation filter = JavaFileFilterQuery.getFilter(root);
@@ -276,12 +261,10 @@
                 return res;
             }
 
-            @Override
             protected URL getURL() throws IOException {
                 return path;
             }
 
-            @Override
             protected String getExt() {
                 String ext = super.getExt();
                 if (ext == null) {
@@ -290,7 +273,6 @@
                 return ext;
             }
 
-            @Override
             protected String getName(boolean includeExtension) {
                 String name = super.getName(includeExtension);
                 if (name == null) {
@@ -302,7 +284,6 @@
                 return name;
             }
 
-            @Override
             protected String getRelativePath() {
                 String relativePath = super.getRelativePath();
                 if (relativePath == null) {
@@ -331,11 +312,6 @@
                 return false;
             }
 
-            @Override
-            public int hashCode() {
-                return path.hashCode();
-            }
-
         };
         return new SourceFileObject(handle, null);
     }
@@ -416,22 +392,12 @@
             return new MemoryFileObject(pkgStr, nameStr, uri, lastModified, (CharBuffer)CharBuffer.allocate( length + 1 ).append( content ).append( ' ' ).flip() );
         }        
     }        
-
-    /**
-     * Removes extension from fileName
-     * @param fileName to remove extension from
-     * @return the fileName without extension
-     */
+    
     public static String stripExtension( String fileName ) {        
         int dot = fileName.lastIndexOf(".");
         return (dot == -1 ? fileName : fileName.substring(0, dot));
     }    
-
-    /**
-     * Returns file extension
-     * @param fileName to get extension from
-     * @return the file extension or empty string when fileName has no extension
-     */
+    
     public static String getExtension (final String fileName) {
         int dot = fileName.lastIndexOf('.');
         return (dot == -1 || dot == fileName.length() -1 ) ? "" : fileName.substring(dot+1);    //NOI18N
@@ -522,14 +488,8 @@
             };
         }
     }
-
-    /**
-     * Returns binary name of given file within a root
-     * @param file to get binary name for
-     * @param root the root owning the file
-     * @return the binary name
-     */
-    public static @NonNull String getBinaryName (final @NonNull File file, final @NonNull File root) {
+                
+    public static String getBinaryName (final File file, final File root) {
         assert file != null && root != null;
         String fileName = FileObjects.getRelativePath (root, file);
         int index = fileName.lastIndexOf('.');  //NOI18N
@@ -538,90 +498,72 @@
         }        
         return fileName.replace(File.separatorChar,'.');   //NOI18N        
     }
-
-    /**
-     * Converts a package name into folder using '/' as separator character
-     * @param packageName to be converted
-     * @return the folder name
-     */
-    public static @NonNull String convertPackage2Folder(final @NonNull String packageName ) {
-        return convertPackage2Folder(packageName, '/' );    //NOI18N
+    
+    public static String getSimpleName( JavaFileObject fo ) {
+        
+        String name = getName(fo,true);
+        int i = name.lastIndexOf( '$' );
+        if ( i == -1 ) {
+            return name;
+        }
+        else {
+            return name.substring( i + 1 );
+        }        
+    }
+    
+    public static String getSimpleName( String fileName ) {
+        
+        String name = getBaseName( fileName );
+        
+        int i = name.lastIndexOf( '$' );
+        if ( i == -1 ) {
+            return name;
+        }
+        else {
+            return name.substring( i + 1 );
+        }
+        
     }
 
-    /**
-     * Converts a package name into folder using given separator character
-     * @param packageName to be converted
-     * @param separatorChar separator
-     * @return the folder name
-     */
-    public static @NonNull String convertPackage2Folder(final @NonNull String packageName, final char separatorChar) {
-        return packageName.replace( '.',separatorChar); //NOI18N
+    public static String convertPackage2Folder( String packageName ) {
+        return convertPackage2Folder(packageName, '/' );
     }
 
-    /**
-     * Converts a folder into package name
-     * @param folderName to be converted, the folder name components has to be separated by '/'
-     * @return the package name
-     */
-    public static @NonNull String convertFolder2Package (@NonNull String folderName) {
-        return convertFolder2Package (folderName, '/');    //NOI18N
+    public static String convertPackage2Folder(final String packageName, final char separatorChar) {
+        return packageName.replace( '.',separatorChar);
     }
 
-    /**
-     * Converts a folder into package name
-     * @param folderName to be converted
-     * @param separatorChar separator used in folderName
-     * @return the package name
-     */
-    public static @NonNull String convertFolder2Package( @NonNull String folderName, char folderSeparator ) {
-        return folderName.replace( folderSeparator, '.' );
+    public static String convertFolder2Package (String packageName) {
+        return convertFolder2Package (packageName, '/');    //NOI18N
+    }
+    
+    public static String convertFolder2Package( String packageName, char folderSeparator ) {
+        return packageName.replace( folderSeparator, '.' );
     }
 
-    /**
-     * Checks if the given folder is a parent of the given file
-     * @param folder to test
-     * @param file to test
-     * @return true if folder is a parent of given file
-     */
-    public static boolean isParentOf (final @NonNull URL folder, final @NonNull URL file) {
+    public static boolean isParentOf (final URL folder, final URL file) {
         assert folder != null && file != null;
         return file.toExternalForm().startsWith(folder.toExternalForm());
     }
-
-    /**
-     * Resolves a relative path within a given package
-     * @param packageName in which the relative path should be resolved
-     * @param relativeName to resolve
-     * @return a relative path resolved in package as path separated by '/' character
-     */
-    public static @NonNull String getRelativePath (final @NonNull String packageName, final @NonNull String relativeName) {
+    
+    public static String getRelativePath (final String packageName, final String relativeName) {
         if (packageName.isEmpty()) return relativeName;
         StringBuilder relativePath = new StringBuilder ();
-        relativePath.append(packageName.replace('.','/'));  //NOI18N
-        relativePath.append('/');                           //NOI18N
+        relativePath.append(packageName.replace('.','/'));
+        relativePath.append('/');
         relativePath.append(relativeName);
         return relativePath.toString();
     }
-
-    /**
-     * Returns a tuple {parentPath,simpleName} for given fully qualified name
-     * @param fqn to get the parent name tuple for
-     * @return a tuple {parentPath, simpleName}
-     */
-    public static @NonNull String[] getParentRelativePathAndName (@NonNull final String fqn) {
+    
+    public static String[] getParentRelativePathAndName (final String fqn) {        
         final String[] result = getPackageAndName(fqn);
         if (result != null) {
             result[0] = result[0].replace('.','/');      //NOI18N
         }
         return result;
     }     
-
-    /**
-     * Returns a tuple {package,simpleName} for given fully qualified name
-     * @param fqn to get the package simpleName tuple for
-     * @return a tuple {package,simpleName}
-     */
-    public static @NonNull String[] getPackageAndName (final @NonNull String fqn) {
+    
+    public static String[] getPackageAndName (final String fqn) {
         if (fqn.charAt(fqn.length()-1) == '.') {
             return null;
         }
@@ -646,7 +588,7 @@
      * @param extension
      * @return the found kind
      */ 
-    public static @NonNull JavaFileObject.Kind getKind (final @NullAllowed String extension) {
+    public static JavaFileObject.Kind getKind (final @NullAllowed String extension) {
         if (extension == null) {
             return JavaFileObject.Kind.OTHER;
         }
@@ -665,12 +607,8 @@
         }
         return JavaFileObject.Kind.OTHER;
     }
-
-    /**
-     * Recursively deletes the folder
-     * @param folder to be deleted
-     */
-    public static void deleteRecursively (final @NonNull File folder) {
+        
+    public static void deleteRecursively (final File folder) {
         assert folder != null;        
         if (folder.isDirectory()) {
             File[] children = folder.listFiles();
@@ -682,103 +620,7 @@
         }
         folder.delete();
     }
-
-    /**
-     * Returns a relative path of given file in given root
-     * @param root owning the file
-     * @param fo a file to get the relative path for
-     * @return the relative path
-     */
-    public static @NonNull String getRelativePath (final @NonNull File root, final @NonNull File fo) {
-        final String rootPath = root.getAbsolutePath();
-        final String foPath = fo.getAbsolutePath();
-        assert foPath.startsWith(rootPath) : String.format("getRelativePath(%s, %s)", rootPath, foPath);    //NOI18N
-        int index = rootPath.length();
-        if (rootPath.charAt(index - 1) != File.separatorChar) {
-            index++;
-        }
-        int foIndex = foPath.length();
-        if (foIndex <= index) {
-            return ""; //NOI18N
-        }
-        return foPath.substring(index);
-    }
-
-    /**
-     * Returns a relative path of given file in given root
-     * @param root owning the file
-     * @param fo a file to get the relative path for
-     * @return the relative path
-     */
-    public static @NonNull String getRelativePath (@NonNull final URL root, @NonNull final URL fo) throws URISyntaxException {
-        final String path = getRelativePath(new File(root.toURI()), new File(fo.toURI()));
-        return path.replace(File.separatorChar, '/');   //NOI18N
-    }
-
-    // <editor-fold defaultstate="collapsed" desc="Private helper methods">
-    private static CharSequence getCharContent(InputStream ins, Charset encoding, JavaFileFilterImplementation filter, long expectedLength, boolean ignoreEncodingErrors) throws IOException {
-        char[] result;
-        Reader in;
-
-        if (encoding != null) {
-            in = new InputStreamReader (ins, encoding);
-        } else {
-            in = new InputStreamReader (ins);
-        }
-        if (filter != null) {
-            in = filter.filterReader(in);
-        }
-        int red = 0;
-        try {
-            int len = (int) expectedLength;
-            if (len == 0) len++; //len - red would be 0 while reading from the stream
-            result = new char [len+1];
-            int rv;
-            while ((rv=in.read(result,red,len-red))>=0) {
-                red += rv;
-                //In case the filter enlarged the file
-                if (red == len) {
-                    char[] _tmp = new char[2*len];
-                    System.arraycopy(result, 0, _tmp, 0, len);
-                    result = _tmp;
-                    len = result.length;
-                }
-            }
-        } finally {
-            in.close();
-        }
-        result[red++]='\n'; //NOI18N
-        CharSequence buffer = CharBuffer.wrap (result, 0, red);
-        return buffer;
-    }
-
-    private static String getSimpleName(JavaFileObject fo ) {
-        String name = getName(fo,true);
-        int i = name.lastIndexOf( '$' );
-        if ( i == -1 ) {
-            return name;
-        }
-        else {
-            return name.substring( i + 1 );
-        }
-    }
-
-    private static String getSimpleName( String fileName ) {
-
-        String name = getBaseName( fileName );
-
-        int i = name.lastIndexOf( '$' );
-        if ( i == -1 ) {
-            return name;
-        }
-        else {
-            return name.substring( i + 1 );
-        }
-
-    }
-    //</editor-fold>
-
-    //<editor-fold defaultstate="collapsed" desc="JavaFileObject implementation">
+        
     public static abstract class Base implements InferableJavaFileObject {
 
         protected final JavaFileObject.Kind kind;
@@ -796,22 +638,21 @@
             this.kind = FileObjects.getKind (this.ext);
         }
                 
-        @Override
         public JavaFileObject.Kind getKind() {
             return this.kind;
         }
         
-        @Override
         public boolean isNameCompatible (String simplename, JavaFileObject.Kind k) {
-            return this.kind == k && nameWithoutExt.equals(simplename);
+            if (this.kind != k) {
+                return false;
+            }
+	    return nameWithoutExt.equals(simplename);
 	}        
         
-        @Override
         public NestingKind getNestingKind() {
             return null;
         }
         
-        @Override
         public Modifier getAccessLevel() {
             return null;
         }
@@ -829,7 +670,6 @@
             return this.nameWithoutExt;
         }
         
-        @Override
         public String getName () {
             return this.nameWithoutExt + '.' + ext;
         }
@@ -842,7 +682,6 @@
             return false;
         }
         
-        @Override
         public final String inferBinaryName () {
             final StringBuilder sb = new StringBuilder ();
             sb.append (this.pkgName);
@@ -877,10 +716,8 @@
         }
     }
 
-    @Trusted
     public static class FileBase extends Base {
 
-        private static final boolean isWindows = Utilities.isWindows();
         protected final File f;
         private final JavaFileFilterImplementation filter;
         private final Charset encoding;
@@ -934,9 +771,16 @@
 
         @Override
 	public boolean isNameCompatible(String simplename, JavaFileObject.Kind kind) {
-            return isWindows ?
-                this.kind == kind && nameWithoutExt.equalsIgnoreCase(simplename) :
-                super.isNameCompatible(simplename, kind);
+	    boolean res = super.isNameCompatible(simplename, kind);
+            if (res) {
+                return res;
+            }
+            else if (Utilities.isWindows()) {
+                return nameWithoutExt.equalsIgnoreCase(simplename);
+            }
+            else {
+                return false;
+            }
 	}
 
         @Override
@@ -975,8 +819,74 @@
 	    return f.hashCode();
 	}
     }
-        
-    @Trusted
+
+    public static class InvalidFileException extends IOException {
+
+        public InvalidFileException () {
+            super ();
+        }
+
+        public InvalidFileException (final FileObject fo) {
+            super (NbBundle.getMessage(FileObjects.class,"FMT_InvalidFile",FileUtil.getFileDisplayName(fo)));
+        }
+    }
+
+    public static String getRelativePath (final File root, final File fo) {
+        final String rootPath = root.getAbsolutePath();
+        final String foPath = fo.getAbsolutePath();
+        assert foPath.startsWith(rootPath) : String.format("getRelativePath(%s, %s)", rootPath, foPath);
+        int index = rootPath.length();
+        if (rootPath.charAt(index - 1) != File.separatorChar) {
+            index++;
+        }
+        int foIndex = foPath.length();
+        if (foIndex <= index) {
+            return ""; //NOI18N
+        }
+        return foPath.substring(index);
+    }
+
+    public static String getRelativePath (final URL root, final URL fo) throws URISyntaxException {
+        final String path = getRelativePath(new File(root.toURI()), new File(fo.toURI()));
+        return path.replace(File.separatorChar, '/');
+    }
+
+    public static CharSequence getCharContent(InputStream ins, Charset encoding, JavaFileFilterImplementation filter, long expectedLength, boolean ignoreEncodingErrors) throws IOException {
+        char[] result;
+        Reader in;
+
+        if (encoding != null) {
+            in = new InputStreamReader (ins, encoding);
+        } else {
+            in = new InputStreamReader (ins);
+        }
+        if (filter != null) {
+            in = filter.filterReader(in);
+        }
+        int red = 0;
+        try {
+            int len = (int) expectedLength;
+            if (len == 0) len++; //len - red would be 0 while reading from the stream
+            result = new char [len+1];
+            int rv;
+            while ((rv=in.read(result,red,len-red))>=0) {
+                red += rv;
+                //In case the filter enlarged the file
+                if (red == len) {
+                    char[] _tmp = new char[2*len];
+                    System.arraycopy(result, 0, _tmp, 0, len);
+                    result = _tmp;
+                    len = result.length;
+                }
+            }
+        } finally {
+            in.close();
+        }
+        result[red++]='\n'; //NOI18N
+        CharSequence buffer = CharBuffer.wrap (result, 0, red);
+        return buffer;
+    }
+
     private static class NewFromTemplateFileObject extends FileBase {
 
         public NewFromTemplateFileObject (File f, String packageName, String baseName, JavaFileFilterImplementation filter, Charset encoding) {
@@ -1036,7 +946,10 @@
         }
     }
 
-    abstract static class ZipFileBase extends Base {
+    /** A subclass of FileObject representing zip entries.
+     * XXX: What happens when the archive is deleted or rebuilt?
+     */
+    public abstract static class ZipFileBase extends Base {
         
         protected final long mtime;
         protected final String resName;
@@ -1048,19 +961,17 @@
                 this.resName = baseName;
             }
             else {
-                StringBuilder rn = new StringBuilder (folderName);
-                rn.append('/');        //NOI18N
-                rn.append(baseName);
-                this.resName = rn.toString();
+                StringBuilder resName = new StringBuilder (folderName);
+                resName.append('/');        //NOI18N
+                resName.append(baseName);
+                this.resName = resName.toString();
             }
         }
         
-        @Override
         public OutputStream openOutputStream() throws IOException {
 	    throw new UnsupportedOperationException();
 	}
 
-        @Override
 	public Reader openReader(boolean b) throws IOException {
             if (this.getKind() == JavaFileObject.Kind.CLASS) {
                 throw new UnsupportedOperationException();
@@ -1070,23 +981,18 @@
             }
 	}
 
-        @Override
         public Writer openWriter() throws IOException {
 	    throw new UnsupportedOperationException();
 	}
         
-        @Override
         public long getLastModified() {
 	    return mtime;
 	}
 
-        @Override
 	public boolean delete() {
 	    throw new UnsupportedOperationException();
 	}
 
-        @Override
-        @SuppressWarnings("empty-statement")
 	public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException {
 	    Reader r = openReader(ignoreEncodingErrors);
             try {
@@ -1114,7 +1020,6 @@
             }
 	}
         
-        @Override
         public final URI toUri () {
             URI  zdirURI = this.getArchiveURI();
             try {
@@ -1136,10 +1041,14 @@
                     }
                     return new URI("jar:"+zdirURI.toString()+"!/"+sb.toString());    //NOI18N
                 } catch (final UnsupportedEncodingException e2) {
-                    throw new IllegalStateException(e2);
+                    final IllegalStateException ne = new IllegalStateException ();
+                    ne.initCause(e2);
+                    throw ne;
                 }
                 catch (final URISyntaxException e2) {
-                    throw new IllegalStateException(e2);
+                    final IllegalStateException ne = new IllegalStateException ();
+                    ne.initCause(e2);
+                    throw ne;
                 }
             }
         }
@@ -1162,8 +1071,7 @@
         protected abstract long getSize() throws IOException;
         
     }
-
-    @Trusted
+    
     private static class ZipFileObject extends ZipFileBase {
 	
 
@@ -1179,7 +1087,6 @@
             
 	}
 
-        @Override
         public InputStream openInputStream() throws IOException {            
             class ZipInputStream extends InputStream {
 
@@ -1208,22 +1115,18 @@
                     }
                 }
 
-                @Override
                 public int read() throws IOException {
                     throw new java.lang.UnsupportedOperationException("Not supported yet.");
                 }
 
-                @Override
                 public int read(byte b[], int off, int len) throws IOException {
                     return delegate.read(b, off, len);
                 }
 
-                @Override
                 public int available() throws IOException {
                     return this.delegate.available();
                 }
 
-                @Override
                 public void close() throws IOException {
                     try {
                         this.delegate.close();
@@ -1233,19 +1136,17 @@
                 }
 
 
-            }
+            };
             // long time = System.currentTimeMillis();
             ZipFile zf = new ZipFile (archiveFile);
             // System.out.println("ZF OPEN " + archiveFile.getPath() + " took: " + (System.currentTimeMillis() - time )+ "ms." );
             return new BufferedInputStream (new ZipInputStream (zf));
 	}
         
-        @Override
         public URI getArchiveURI () {
             return this.archiveFile.toURI();
         }
         
-        @Override
         protected long getSize () throws IOException {
             ZipFile zf = new ZipFile (archiveFile);
             try {
@@ -1256,8 +1157,7 @@
             }
         }
     }
-
-    @Trusted
+    
     private static class FastZipFileObject extends ZipFileObject {
         
         private long offset;
@@ -1301,8 +1201,7 @@
             return super.getSize();
         }
     }
-
-    @Trusted
+    
     private static class CachedZipFileObject extends ZipFileBase {
         
         private ZipFile zipFile;
@@ -1313,17 +1212,14 @@
 	    this.zipFile = zipFile;            
 	}
         
-        @Override
         public InputStream openInputStream() throws IOException {
             return new BufferedInputStream (this.zipFile.getInputStream(new ZipEntry (this.resName)));
 	}
         
-        @Override
         public URI getArchiveURI () {
             return new File (this.zipFile.getName()).toURI();
         }
         
-        @Override
         protected long getSize() throws IOException {
             ZipEntry ze = this.zipFile.getEntry(this.resName);
             return ze == null ? 0L : ze.getSize();
@@ -1331,9 +1227,8 @@
     }
     
     
-    /** Temporary FileObject for parsing input stream.
-     */
-    @Trusted
+    /** Temporay FileObject for parsing input stream.
+     */    
     private static class MemoryFileObject extends Base {
         
         private final long lastModified;
@@ -1353,22 +1248,19 @@
 
         /**
          * Get the character content of the file, if available.
-         * @param ignoreEncodingErrors if true, encoding errors will be replaced by the
+         * @param ignoreEncodingErrors if true, encoding errros will be replaced by the 
          * default translation character; otherwise they should be reported as diagnostics.
          * @throws UnsupportedOperationException if character access is not supported
          */
-        @Override
         public java.nio.CharBuffer getCharContent(boolean ignoreEncodingErrors) throws java.io.IOException {
             return cb.duplicate();
         }
 
-        @Override
         public boolean delete() {
             // Do nothing
             return false;
         }        
 
-        @Override
         public URI toUri () {
             if (this.uri != null) {
                 return this.uri;
@@ -1383,7 +1275,6 @@
             return isVirtual;
         }
 
-        @Override
         public long getLastModified() {
             return this.lastModified;
         }
@@ -1394,7 +1285,6 @@
          * @return an InputStream for this  object.
          * @throws UnsupportedOperationException if the byte access is not supported
          */
-        @Override
         public InputStream openInputStream() throws java.io.IOException {
             return new ByteArrayInputStream(cb.toString().getBytes("UTF-8"));
         }
@@ -1405,7 +1295,6 @@
          * @return an OutputStream for this  object.
          * @throws UnsupportedOperationException if byte access is not supported
          */
-        @Override
         public java.io.OutputStream openOutputStream() throws java.io.IOException {
             throw new UnsupportedOperationException();
         }
@@ -1417,7 +1306,6 @@
          * @throws UnsupportedOperationException if character access is not supported
          * @throws IOException if an error occurs while opening the reader
          */
-        @Override
         public java.io.Reader openReader (boolean b) throws java.io.IOException {
             return new StringReader(this.cb.toString());
         }
@@ -1427,22 +1315,32 @@
          * @throws UnsupportedOperationException if character access is not supported
          * @throws IOException if an error occurs while opening the writer
          */
-        @Override
         public java.io.Writer openWriter() throws java.io.IOException {
             throw new UnsupportedOperationException();
         }
         
-    }
-    //</editor-fold>
-
-    public static class InvalidFileException extends IOException {
-
-        public InvalidFileException () {
-            super ();
+    }    
+    
+    private static class SimpleNameStringComparator implements Comparator<String> {
+        
+        public int compare( String o1, String o2 ) {
+            return getSimpleName( o1 ).compareTo( getSimpleName( o2 ) );
         }
-
-        public InvalidFileException (final FileObject fo) {
-            super (NbBundle.getMessage(FileObjects.class,"FMT_InvalidFile",FileUtil.getFileDisplayName(fo)));
+                        
+    }
+    
+    private static class SimpleNameFileObjectComparator implements Comparator<JavaFileObject> {
+        
+        public int compare( JavaFileObject o1, JavaFileObject o2 ) {
+            
+            String n1 = getSimpleName( o1 );
+            String n2 = getSimpleName( o2 );
+                        
+            return n1.compareTo( n2 );
         }
+                        
     }
+    
+    static final String encodingName = new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding();            
+    
 }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java	2011-08-03 23:01:41.000000000 +0100
@@ -44,7 +44,6 @@
 
 package org.netbeans.modules.java.source.parsing;
 
-import com.sun.tools.javac.api.ClientCodeWrapper.Trusted;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
@@ -58,6 +57,7 @@
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
+import java.util.Stack;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.tools.FileObject;
@@ -71,7 +71,6 @@
  *
  * @author Tomas Zezula
  */
-@Trusted
 public class ProxyFileManager implements JavaFileManager {
 
 
@@ -142,13 +141,26 @@
         }
         else if (location == StandardLocation.SOURCE_PATH && this.sourcePath != null) {
             if (this.memoryFileManager != null) {
-                return new JavaFileManager[] {
-                    this.sourcePath,
-                    this.memoryFileManager
-                };
+                if (this.aptSources != null) {
+                    return new JavaFileManager[] {
+                        this.sourcePath,
+                        this.aptSources,
+                        this.memoryFileManager
+                    };
+                }
+                else {
+                    return new JavaFileManager[] {
+                        this.sourcePath,
+                        this.memoryFileManager
+                    };
+                }
             }
             else {
-                return new JavaFileManager[] {this.sourcePath};
+                if (this.aptSources != null) {
+                    return new JavaFileManager[] {this.sourcePath, this.aptSources};
+                } else {
+                    return new JavaFileManager[] {this.sourcePath};
+                }
             }
         }
         else if (location == StandardLocation.CLASS_OUTPUT && this.outputhPath != null) {
@@ -429,7 +441,6 @@
         }
     }
 
-    @Trusted
     private static final class NullFileObject extends ForwardingInferableJavaFileObject {
         private NullFileObject (@NonNull final InferableJavaFileObject delegate) {
             super (delegate);
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java	2011-08-03 23:01:41.000000000 +0100
@@ -46,26 +46,19 @@
 
 import java.io.File;
 import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
 import java.nio.charset.Charset;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
 import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.tools.JavaFileObject;
-import org.netbeans.api.annotations.common.NonNull;
 import org.netbeans.api.java.classpath.ClassPath;
 import org.netbeans.api.queries.FileEncodingQuery;
 import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation;
-import org.netbeans.modules.java.source.indexing.JavaIndex;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
-import org.openide.util.Exceptions;
 
 /**
  *
@@ -78,9 +71,6 @@
     
     final File root;
     final Charset encoding;
-    
-    private final AtomicBoolean sourceRootInitialized = new AtomicBoolean();
-    private volatile URL sourceRoot;
 
     /** Creates a new instance of FolderArchive */
     public FolderArchive (final File root) {
@@ -100,7 +90,6 @@
         }
     }
     
-    @Override
     public Iterable<JavaFileObject> getFiles(String folderName, ClassPath.Entry entry, Set<JavaFileObject.Kind> kinds, JavaFileFilterImplementation filter) throws IOException {
         assert folderName != null;
         if (folderName.length()>0) {
@@ -132,7 +121,6 @@
         return Collections.<JavaFileObject>emptyList();
     }
 
-    @Override
     public JavaFileObject create (String relativePath, final JavaFileFilterImplementation filter) throws UnsupportedOperationException {
         if (File.separatorChar != '/') {    //NOI18N
             relativePath = relativePath.replace('/', File.separatorChar);
@@ -141,38 +129,12 @@
         return FileObjects.fileFileObject(file, root, filter, encoding);
     }
 
-    @Override
     public void clear () {
     }
 
     @Override
-    public JavaFileObject getFile(final @NonNull String name) {
-        final String path = name.replace('/', File.separatorChar);        //NOI18N
-        File file = new File (this.root, path);
-        if (file.exists()) {
-            return FileObjects.fileFileObject(file,this.root,null,encoding);
-        }
-        try {
-            final URL srcRoot = getBaseSourceRoot(this.root.toURI().toURL());
-            if (srcRoot != null) {
-                final File folder = new File(srcRoot.toURI());
-                file = new File (folder,path);
-                if (file.exists()) {
-                    return FileObjects.fileFileObject(file,folder,null,encoding);
-                }
-            }
-        } catch (MalformedURLException e) {
-            Exceptions.printStackTrace(e);
-        } catch (URISyntaxException e) {
-            Exceptions.printStackTrace(e);
-        }
-        return null;
-    }
-
-    private URL getBaseSourceRoot(final URL binRoot) {
-        if (!sourceRootInitialized.getAndSet(true)) {
-            sourceRoot = JavaIndex.getSourceRootForClassFolder(binRoot);
-        }
-        return sourceRoot;
+    public JavaFileObject getFile(String name) {
+        final File file = new File (this.root, name.replace('/', File.separatorChar));      //NOI18N
+        return file.exists() ? FileObjects.fileFileObject(file,this.root,null,encoding) : null ;
     }
 }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java	2011-08-03 23:01:41.000000000 +0100
@@ -55,7 +55,6 @@
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.TreeMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -86,7 +85,6 @@
     private CompilationUnitTree compilationUnit;
 
     private JavacTaskImpl javacTask;
-    private DiagnosticListener<JavaFileObject> diagnosticListener;
     private final ClasspathInfo cpInfo;
     Pair<DocPositionRegion,MethodTree> changedMethod;
     private final FileObject file;
@@ -113,7 +111,6 @@
                          final FileObject file,
                          final FileObject root,
                          final JavacTaskImpl javacTask,
-                         final DiagnosticListener<JavaFileObject> diagnosticListener,
                          final Snapshot snapshot,
                          final boolean detached) throws IOException {
         assert parser != null;
@@ -126,7 +123,6 @@
         assert file == null || snapshot != null;
         this.jfo = file != null ? JavacParser.jfoProvider.createJavaFileObject(file, root, JavaFileFilterQuery.getFilter(file), snapshot.getText()) : null;
         this.javacTask = javacTask;
-        this.diagnosticListener = diagnosticListener;
         this.isClassFile = false;
         this.isDetached = detached;
     }
@@ -248,21 +244,13 @@
         if (this.jfo == null) {
             throw new IllegalStateException ();
         }
-        Collection<Collection<Diagnostic<? extends JavaFileObject>>> errors = ((DiagnosticListenerImpl)diagnosticListener).getErrors(jfo).values();
-        List<Diagnostic<? extends JavaFileObject>> partialReparseErrors = ((DiagnosticListenerImpl)diagnosticListener).partialReparseErrors;
-        List<Diagnostic<? extends JavaFileObject>> affectedErrors = ((DiagnosticListenerImpl)diagnosticListener).affectedErrors;
-        int errorsSize = 0;
-
-        for (Collection<Diagnostic<? extends JavaFileObject>> err : errors) {
-            errorsSize += err.size();
-        }
-
-        List<Diagnostic> localErrors = new ArrayList<Diagnostic>(errorsSize +
+        Collection<Diagnostic<? extends JavaFileObject>> errors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).getErrors(jfo).values();
+        List<Diagnostic<? extends JavaFileObject>> partialReparseErrors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).partialReparseErrors;
+        List<Diagnostic<? extends JavaFileObject>> affectedErrors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).affectedErrors;
+        List<Diagnostic> localErrors = new ArrayList<Diagnostic>(errors.size() + 
                 (partialReparseErrors == null ? 0 : partialReparseErrors.size()) + 
                 (affectedErrors == null ? 0 : affectedErrors.size()));
-        for (Collection<Diagnostic<? extends JavaFileObject>> err : errors) {
-            localErrors.addAll(err);
-        }
+        localErrors.addAll(errors);
         if (partialReparseErrors != null) {
             localErrors.addAll (partialReparseErrors);
         }
@@ -379,20 +367,11 @@
      */
     public synchronized JavacTaskImpl getJavacTask() {
         if (javacTask == null) {
-            diagnosticListener = new DiagnosticListenerImpl(this.jfo);
             javacTask = JavacParser.createJavacTask(this.file, this.root, this.cpInfo,
-                    this.parser, diagnosticListener, null, isDetached);
+                    this.parser, new DiagnosticListenerImpl(this.jfo), null, isDetached);
         }
 	return javacTask;
     }
-
-    /**
-     * Returns current {@link DiagnosticListener}
-     * @return listener
-     */
-    DiagnosticListener<JavaFileObject> getDiagnosticListener() {
-        return diagnosticListener;
-    }
     
     /**
      * Sets the current {@link JavaSource.Phase}
@@ -428,7 +407,7 @@
     // Innerclasses ------------------------------------------------------------    
     static class DiagnosticListenerImpl implements DiagnosticListener<JavaFileObject> {
         
-        private final Map<JavaFileObject, TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>>> source2Errors;
+        private final Map<JavaFileObject, TreeMap<Integer,Diagnostic<? extends JavaFileObject>>> source2Errors;
         private final JavaFileObject jfo;
         private volatile List<Diagnostic<? extends JavaFileObject>> partialReparseErrors;
         private volatile List<Diagnostic<? extends JavaFileObject>> affectedErrors;
@@ -436,7 +415,7 @@
         
         public DiagnosticListenerImpl(final JavaFileObject jfo) {
             this.jfo = jfo;
-            this.source2Errors = new HashMap<JavaFileObject, TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>>>();
+            this.source2Errors = new HashMap<JavaFileObject, TreeMap<Integer, Diagnostic<? extends JavaFileObject>>>();
         }
         
         @Override
@@ -446,22 +425,15 @@
                     partialReparseErrors.add(message);
                 }
             } else {
-                TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>> errors = getErrors(message.getSource());
-                Collection<Diagnostic<? extends JavaFileObject>> diags = errors.get((int) message.getPosition());
-
-                if (diags == null) {
-                    errors.put((int) message.getPosition(), diags = new ArrayList<Diagnostic<? extends JavaFileObject>>());
-                }
-                
-                diags.add(message);
+                getErrors(message.getSource()).put((int) message.getPosition(), message);
             }
         }
 
-        private TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>> getErrors(JavaFileObject file) {
-                TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>> errors = source2Errors.get(file);
+        private TreeMap<Integer,Diagnostic<? extends JavaFileObject>> getErrors(JavaFileObject file) {
+                TreeMap<Integer, Diagnostic<? extends JavaFileObject>> errors = source2Errors.get(file);
 
                 if (errors == null) {
-                    source2Errors.put(file, errors = new TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>>());
+                    source2Errors.put(file, errors = new TreeMap<Integer, Diagnostic<? extends JavaFileObject>>());
                 }
 
                 return errors;
@@ -474,20 +446,18 @@
         final void startPartialReparse (int from, int to) {
             if (partialReparseErrors == null) {
                 partialReparseErrors = new ArrayList<Diagnostic<? extends JavaFileObject>>();
-                TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>> errors = getErrors(jfo);
+                TreeMap<Integer, Diagnostic<? extends JavaFileObject>> errors = getErrors(jfo);
                 errors.subMap(from, to).clear();       //Remove errors in changed method durring the partial reparse
-                Map<Integer, Collection<Diagnostic<? extends JavaFileObject>>> tail = errors.tailMap(to);
+                Map<Integer,Diagnostic<? extends JavaFileObject>> tail = errors.tailMap(to);
                 this.affectedErrors = new ArrayList<Diagnostic<? extends JavaFileObject>>(tail.size());
-                for (Iterator<Entry<Integer,Collection<Diagnostic<? extends JavaFileObject>>>> it = tail.entrySet().iterator(); it.hasNext();) {
-                    Entry<Integer, Collection<Diagnostic<? extends JavaFileObject>>> e = it.next();
+                for (Iterator<Map.Entry<Integer,Diagnostic<? extends JavaFileObject>>> it = tail.entrySet().iterator(); it.hasNext();) {
+                    Map.Entry<Integer,Diagnostic<? extends JavaFileObject>> e = it.next();                    
+                    final JCDiagnostic diagnostic = (JCDiagnostic)e.getValue();
                     it.remove();
-                    for (Diagnostic<? extends JavaFileObject> d : e.getValue()) {
-                        final JCDiagnostic diagnostic = (JCDiagnostic) d;
-                        if (diagnostic == null) {
-                            throw new IllegalStateException("#184910: diagnostic == null " + mapArraysToLists(Thread.getAllStackTraces())); //NOI18N
-                        }
-                        this.affectedErrors.add(new D (diagnostic));
+                    if (diagnostic == null) {
+                        throw new IllegalStateException("#184910: diagnostic == null " + mapArraysToLists(Thread.getAllStackTraces())); //NOI18N
                     }
+                    this.affectedErrors.add(new D (diagnostic));
                 }
             }
             else {
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java	2011-08-03 23:01:41.000000000 +0100
@@ -74,8 +74,6 @@
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 import java.io.PrintWriter;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
@@ -87,14 +85,12 @@
 import java.util.List;
 import java.util.Map;
 import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.concurrent.atomic.AtomicReference;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 import javax.annotation.processing.Processor;
 import javax.swing.event.ChangeEvent;
 import  javax.swing.event.ChangeListener;
 import javax.swing.text.Document;
-import javax.swing.text.JTextComponent;
 import javax.tools.Diagnostic;
 import javax.tools.DiagnosticListener;
 import javax.tools.JavaCompiler;
@@ -102,7 +98,6 @@
 import javax.tools.ToolProvider;
 import org.netbeans.api.annotations.common.NonNull;
 import org.netbeans.api.annotations.common.NullAllowed;
-import org.netbeans.api.editor.EditorRegistry;
 import org.netbeans.api.java.classpath.ClassPath;
 import org.netbeans.api.java.lexer.JavaTokenId;
 import org.netbeans.api.java.queries.SourceLevelQuery;
@@ -203,11 +198,10 @@
     //Incremental parsing support
     private final boolean supportsReparse;
     //Incremental parsing support
-    private final List<Pair<DocPositionRegion,MethodTree>> positions =
-            Collections.synchronizedList(new LinkedList<Pair<DocPositionRegion,MethodTree>>());
+    private final List<Pair<DocPositionRegion,MethodTree>> positions = Collections.synchronizedList(new LinkedList<Pair<DocPositionRegion,MethodTree>>());
     //Incremental parsing support
-    private final AtomicReference<Pair<DocPositionRegion,MethodTree>> changedMethod =
-            new AtomicReference<Pair<DocPositionRegion, MethodTree>>();
+    //@GuardedBy(this)
+    private Pair<DocPositionRegion,MethodTree> changedMethod;
     //Incremental parsing support
     private final DocListener listener;
     //J2ME preprocessor support
@@ -353,23 +347,28 @@
                 init (snapshot, task, true);
                 boolean needsFullReparse = true;
                 if (supportsReparse) {
-                    final Pair<DocPositionRegion,MethodTree> _changedMethod = changedMethod.getAndSet(null);
+                    Pair<DocPositionRegion,MethodTree> _changedMethod;
+                    synchronized (this) {
+                        _changedMethod = this.changedMethod;
+                        this.changedMethod = null;
+                    }
                     if (_changedMethod != null && ciImpl != null) {
                         LOGGER.log(Level.FINE, "\t:trying partial reparse:\n{0}", _changedMethod.first.getText());                           //NOI18N
                         needsFullReparse = !reparseMethod(ciImpl, snapshot, _changedMethod.second, _changedMethod.first.getText());
                     }
                 }
                 if (needsFullReparse) {
-                    positions.clear();
-                    ciImpl = createCurrentInfo (this, file, root, snapshot, null, null);
+                    synchronized (positions) {
+                        positions.clear();
+                    }
+                    ciImpl = createCurrentInfo (this, file, root,snapshot, null);
                     LOGGER.fine("\t:created new javac");                                    //NOI18N
                 }
                 break;
             default:
                 init (snapshot, task, false);
                 ciImpl = createCurrentInfo(this, file, root, snapshot,
-                    ciImpl == null ? null : ciImpl.getJavacTask(),
-                    ciImpl == null ? null : ciImpl.getDiagnosticListener());
+                    ciImpl == null ? null : ciImpl.getJavacTask());
         }
         cachedSnapShot = snapshot;
     }
@@ -460,7 +459,7 @@
             if (nct.getCompilationController() == null || nct.getTimeStamp() != parseId) {
                 try {
                     nct.setCompilationController(
-                        JavaSourceAccessor.getINSTANCE().createCompilationController(new CompilationInfoImpl(this, file, root, null, null, cachedSnapShot, true)),
+                        JavaSourceAccessor.getINSTANCE().createCompilationController(new CompilationInfoImpl(this, file, root, null, cachedSnapShot, true)),
                         parseId);
                 } catch (IOException ioe) {
                     throw new ParseException ("Javac Failure", ioe);
@@ -617,9 +616,8 @@
             final FileObject file,
             final FileObject root,
             final Snapshot snapshot,
-            final JavacTaskImpl javac,
-            final DiagnosticListener<JavaFileObject> diagnosticListener) throws IOException {
-        CompilationInfoImpl info = new CompilationInfoImpl(parser, file, root, javac, diagnosticListener, snapshot, false);
+            final JavacTaskImpl javac) throws IOException {
+        CompilationInfoImpl info = new CompilationInfoImpl(parser, file, root, javac, snapshot, false);
         if (file != null) {
             Logger.getLogger("TIMER").log(Level.FINE, "CompilationInfo",    //NOI18N
                     new Object[] {file, info});
@@ -687,8 +685,6 @@
         }
         options.add("-XDide");   // NOI18N, javac runs inside the IDE
         options.add("-XDsave-parameter-names");   // NOI18N, javac runs inside the IDE
-        options.add("-XDsuppressAbortOnBadClassFile");   // NOI18N, when a class file cannot be read, produce an error type instead of failing with an exception
-        options.add("-XDshouldStopPolicy=GENERATE");   // NOI18N, parsing should not stop in phase where an error is found
         options.add("-g:source"); // NOI18N, Make the compiler to maintian source file info
         options.add("-g:lines"); // NOI18N, Make the compiler to maintain line table
         options.add("-g:vars");  // NOI18N, Make the compiler to maintain local variables table
@@ -925,7 +921,7 @@
                 final JavaFileObject prevLogged = l.useSource(cu.getSourceFile());
                 JCBlock block;
                 try {
-                    DiagnosticListener dl = ci.getDiagnosticListener();
+                    DiagnosticListener dl = ctx.get(DiagnosticListener.class);
                     assert dl instanceof CompilationInfoImpl.DiagnosticListenerImpl;
                     ((CompilationInfoImpl.DiagnosticListenerImpl)dl).startPartialReparse(origStartPos, origEndPos);
                     long start = System.currentTimeMillis();
@@ -1068,7 +1064,6 @@
                 th.addTokenHierarchyListener(lexListener = WeakListeners.create(TokenHierarchyListener.class, this,th));
                 document = doc;
             }
-            EditorRegistry.addPropertyChangeListener(new EditorRegistryWeakListener(this));
         }
 
         @Override
@@ -1090,13 +1085,6 @@
                     //reset document
                     this.document = doc;
                 }
-            } else if (EditorRegistry.FOCUS_GAINED_PROPERTY.equals(evt.getPropertyName())) {
-                final Document doc = document;
-                final JTextComponent focused = EditorRegistry.focusedComponent();
-                final Document focusedDoc = focused == null ? null : focused.getDocument();
-                if (doc != null && doc == focusedDoc) {
-                    positions.clear();
-                }
             }
         }
 
@@ -1148,49 +1136,15 @@
                         if (changedMethod!=null) {
                             positions.add (changedMethod);
                         }
-                        JavacParser.this.changedMethod.set(changedMethod);
+                        synchronized (JavacParser.this) {
+                            JavacParser.this.changedMethod = changedMethod;
+                        }
                     }
                 }
             }
         }
     }
 
-    private static final class EditorRegistryWeakListener extends WeakReference<PropertyChangeListener> implements PropertyChangeListener, Runnable {
-        private Reference<JTextComponent> last;
-
-        private EditorRegistryWeakListener(final @NonNull PropertyChangeListener delegate) {
-            super(delegate,org.openide.util.Utilities.activeReferenceQueue());
-        }
-
-        @Override
-        public void propertyChange(PropertyChangeEvent evt) {
-            final PropertyChangeListener delegate = get();
-            final JTextComponent lastCandidate = EditorRegistry.focusedComponent();
-            if (delegate != null && lastCandidate != null && lastCandidate != getLast()) {
-                setLast(lastCandidate);
-                delegate.propertyChange(evt);
-            }
-        }
-
-        @Override
-        public void run() {
-            EditorRegistry.removePropertyChangeListener(this);
-        }
-
-        /**
-         * @return the last
-         */
-        private JTextComponent getLast() {
-            return last == null ? null : last.get();
-        }
-
-        /**
-         * @param last the last to set
-         */
-        private void setLast(JTextComponent last) {
-            this.last = new WeakReference<JTextComponent>(last);
-        }
-    }
 
     /**
      * For unit tests only
@@ -1199,7 +1153,7 @@
      */
     public synchronized void setChangedMethod (final Pair<DocPositionRegion,MethodTree> changedMethod) {
         assert changedMethod != null;
-        this.changedMethod.set(changedMethod);
+        this.changedMethod = changedMethod;
     }
 
     /**
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java	2011-08-03 23:01:41.000000000 +0100
@@ -63,8 +63,8 @@
 
     public static void preRegister(final Context context) {
         context.put(enterKey, new Context.Factory<Enter>() {
-            public Enter make(Context c) {
-                return new ErrorHandlingJavadocEnter(c);
+            public Enter make() {
+                return new ErrorHandlingJavadocEnter(context);
             }
         });
     }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java	2011-08-03 23:01:41.000000000 +0100
@@ -90,7 +90,6 @@
     ASTService model;
     Elements elements;
     Types types;
-    private final CommentHandlerService chs;
     
     private static final Context.Key<TreeFactory> contextKey = new Context.Key<TreeFactory>();
 
@@ -110,7 +109,6 @@
         make = com.sun.tools.javac.tree.TreeMaker.instance(context);
         elements = JavacElements.instance(context);
         types = JavacTypes.instance(context);
-        chs = CommentHandlerService.instance(context);
         make.toplevel = null;
     }
     
@@ -207,7 +205,7 @@
         return make.at(NOPOS).ClassDef((JCModifiers)modifiers,
                              names.fromString(simpleName.toString()),
                              typarams.toList(),
-                             (JCExpression)extendsClause,
+                             (JCTree)extendsClause,
                              impls.toList(),
                              defs.toList());
         
@@ -296,11 +294,11 @@
         return make.at(NOPOS).Continue(n);
     }
     
-    public UnionTypeTree UnionType(List<? extends Tree> typeComponents) {
+    public DisjunctiveTypeTree DisjunctiveType(List<? extends Tree> typeComponents) {
         ListBuffer<JCExpression> components = new ListBuffer<JCExpression>();
         for (Tree t : typeComponents)
             components.append((JCExpression)t);
-        return make.at(NOPOS).TypeUnion(components.toList());
+        return make.at(NOPOS).TypeDisjunction(components.toList());
     }
 
     public DoWhileLoopTree DoWhileLoop(ExpressionTree condition, StatementTree statement) {
@@ -1447,16 +1445,7 @@
         REMOVE
     }
     
-    public <N extends Tree> N setLabel(final N node, final CharSequence aLabel)
-            throws IllegalArgumentException {
-        N result = setLabelImpl(node, aLabel);
-
-        chs.copyComments(node, result);
-
-        return result;
-    }
-
-    private <N extends Tree> N setLabelImpl(final N node, final CharSequence aLabel)
+    public <N extends Tree> N setLabel(final N node, final CharSequence aLabel) 
             throws IllegalArgumentException
     {
         // todo (#pf): Shouldn't here be check that names are not the same?
@@ -1607,7 +1596,7 @@
         return make.at(NOPOS).ClassDef(make.at(NOPOS).Modifiers(modifiers, annotations),
                              names.fromString(simpleName.toString()),
                              typarams.toList(),
-                             (JCExpression)extendsClause,
+                             (JCTree)extendsClause,
                              impls.toList(),
                              defs.toList());
         
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java	2011-08-03 23:01:41.000000000 +0100
@@ -53,7 +53,6 @@
 import com.sun.tools.javac.util.Context;
 
 import java.util.*;
-import org.netbeans.modules.java.source.query.CommentSet.RelativePosition;
 
 
 /**
@@ -116,10 +115,12 @@
             if (from != null) {
                 CommentSetImpl to = map.get(toTree);
                 if (to == null) {
-                    map.put(toTree, to = new CommentSetImpl());
-                }
-                for (RelativePosition pos : RelativePosition.values()) {
-                    to.addComments(pos, from.getComments(pos));
+                    to = (CommentSetImpl)from.clone();
+                    map.put(toTree, to);
+                } 
+                else {
+                    to.addPrecedingComments(from.getPrecedingComments());
+                    to.addTrailingComments(from.getTrailingComments());
                 }
             }
         }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreePathHandle.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TreePathHandle.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreePathHandle.java	2011-08-03 23:01:41.000000000 +0100
@@ -44,8 +44,6 @@
                                                                                                                                                                                                                                
 package org.netbeans.api.java.source;                                                                                                                                                                                          
                                                                                                                                                                                                                                
-import com.sun.source.tree.ImportTree;
-import com.sun.source.tree.MemberSelectTree;
 import com.sun.source.tree.Tree;                                                                                                                                                                                               
 import com.sun.source.tree.Tree.Kind;
 import com.sun.source.util.TreePath;                                                                                                                                                                                           
@@ -64,9 +62,6 @@
 import java.util.logging.Level;
 import javax.lang.model.element.Element;                                                                                                                                                                                       
 import javax.lang.model.element.ElementKind;
-import javax.lang.model.element.Modifier;
-import javax.lang.model.element.Name;
-import javax.lang.model.element.TypeElement;
 import javax.swing.text.Position;
 import javax.swing.text.Position.Bias;                                                                                                                                                                                         
 import javax.tools.JavaFileObject;
@@ -324,20 +319,6 @@
         }
         throw new IllegalStateException("Cannot create PositionRef for file " + file.getPath() + ". CloneableEditorSupport not found");
     }
-
-    /**Constructs a <code>TreePathHandle</code> that corresponds to the given <code>ElementHandle</code>.
-     *
-     * @param handle an <code>ElementHandle</code> for which the <code>TreePathHandle</code> should be constructed
-     * @param cpInfo a classpath which is supposed to contain the element described by given the <code>ElementHandle</code>
-     * @return a newly constructed <code>TreePathHandle</code>
-     * @since 0.79
-     */
-    public static @NonNull TreePathHandle from(@NonNull ElementHandle<?> handle, @NonNull ClasspathInfo cpInfo) {
-        Parameters.notNull("handle", handle);
-        Parameters.notNull("cpInfo", cpInfo);
-
-        return new TreePathHandle(new ElementDelegate(handle, null, null, cpInfo));
-    }
     
     @Override
     public String toString() {
@@ -536,10 +517,6 @@
             Element el = info.getTrees().getElement(tp);
             if (el == null) {
                 Logger.getLogger(TreePathHandle.class.toString()).fine("info.getTrees().getElement(tp) returned null for " + tp);
-                Element staticallyImported = getStaticallyImportedElement(tp, info);
-                if (staticallyImported!=null) {
-                    return staticallyImported;
-                }
                 if (enclElIsCorrespondingEl) {
                     Element e = enclosingElement.resolve(info);
                     if (e == null) {
@@ -553,54 +530,6 @@
                 return el;
             }
         }
-        
-        /**
-         * special handling of static imports
-         * see #196685
-         * 
-         */
-        private Element getStaticallyImportedElement(TreePath treePath, CompilationInfo info) {
-            if (treePath.getLeaf().getKind() != Tree.Kind.MEMBER_SELECT) 
-                return null;
-                
-            MemberSelectTree memberSelectTree = (MemberSelectTree) treePath.getLeaf();
-            TreePath tp = treePath; 
-            while (tp!=null) {
-                Kind treeKind = tp.getLeaf().getKind();
-                if (treeKind == Tree.Kind.IMPORT) {
-                    if (!((ImportTree) tp.getLeaf()).isStatic()) {
-                        return null;
-                    }
-                    break;    
-                } else if (treeKind == Tree.Kind.MEMBER_SELECT || treeKind == Tree.Kind.IDENTIFIER) {
-                    tp = tp.getParentPath();
-                    continue;
-                }
-                return null;
-            }
-            
-            Name simpleName = memberSelectTree.getIdentifier();
-            if (simpleName == null) {
-                return null;
-            }
-            TreePath declPath  = new TreePath(new TreePath(treePath, memberSelectTree), memberSelectTree.getExpression());
-            TypeElement decl = (TypeElement) info.getTrees().getElement(declPath);
-            if (decl==null) {
-                return null;
-            }
-            
-            for (Element e : info.getElements().getAllMembers((TypeElement) decl)) {
-                if (!e.getModifiers().contains(Modifier.STATIC)) {
-                    continue;
-                }
-                if (!e.getSimpleName().equals(simpleName)) {
-                    continue;
-                }
-                return e;
-            }
-            return null;
-        }
-
 
         /**                                                                                                                                                                                                                        
          * Returns the {@link Tree.Kind} of this TreePathHandle,                                                                                                                                                                   
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementHandle.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ElementHandle.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementHandle.java	2011-08-03 23:01:41.000000000 +0100
@@ -66,7 +66,6 @@
 import org.netbeans.modules.java.source.ElementHandleAccessor;
 import org.netbeans.modules.java.source.usages.ClassFileUtil;
 import org.openide.util.Parameters;
-import org.openide.util.WeakSet;
 
 /**
  * Represents a handle for {@link Element} which can be kept and later resolved
@@ -370,8 +369,7 @@
         return this.kind;
     }
     
-    private static final WeakSet<ElementHandle<?>> NORMALIZATION_CACHE = new WeakSet<ElementHandle<?>>();
-
+    
     /**
      * Factory method for creating {@link ElementHandle}.
      * @param element for which the {@link ElementHandle} should be created. Permitted
@@ -384,12 +382,6 @@
      * @throws IllegalArgumentException if the element is of an unsupported {@link ElementKind}
      */
     public static @NonNull <T extends Element> ElementHandle<T> create (@NonNull final T element) throws IllegalArgumentException {
-        ElementHandle<T> eh = createImpl(element);
-
-        return (ElementHandle<T>) NORMALIZATION_CACHE.putIfAbsent(eh);
-    }
-
-    private static @NonNull <T extends Element> ElementHandle<T> createImpl (@NonNull final T element) throws IllegalArgumentException {
         Parameters.notNull("element", element);
         ElementKind kind = element.getKind();
         String[] signatures;
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/AssignComments.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/AssignComments.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/AssignComments.java	2011-08-03 23:01:41.000000000 +0100
@@ -193,8 +193,6 @@
     }
 
     private void attachComments(Tree tree, CommentsCollection result, CommentSet.RelativePosition position) {
-        if (!mapComments) return;
-        
         CommentSetImpl cs = commentService.getComments(tree);
         for (Token<JavaTokenId> token : result) {
             attachComment(position, cs, token);
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreeMaker.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TreeMaker.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreeMaker.java	2011-08-03 23:01:41.000000000 +0100
@@ -460,7 +460,7 @@
     }
 
     /**
-     * Creates new UnionTypeTree.
+     * Creates new DisjunctiveTypeTree.
      *
      * @param typeComponents components from which the DisjunctiveTypeTree should be created.
      *                       The components should either be {@link ExpressionTree} (qualified or unqualified identifier),
@@ -468,8 +468,8 @@
      * @return newly created DisjunctiveTypeTree
      * @since 0.70
      */
-    public UnionTypeTree UnionType(List<? extends Tree> typeComponents) {
-        return delegate.UnionType(typeComponents);
+    public DisjunctiveTypeTree DisjunctiveType(List<? extends Tree> typeComponents) {
+        return delegate.DisjunctiveType(typeComponents);
     }
     
     /** Creates a new DoWhileLoopTree.
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java	2011-08-03 23:01:41.000000000 +0100
@@ -174,7 +174,7 @@
             final boolean allowAptRoots = true; //todo: Set by PROCESSOR_PATH != null
             this.cachedUserSrcClassPath = SourcePath.sources(srcCp, backgroundCompilation);
             this.cachedAptSrcClassPath = allowAptRoots ? SourcePath.apt(srcCp, backgroundCompilation) : null;
-            this.cachedSrcClassPath = this.cachedUserSrcClassPath;
+            this.cachedSrcClassPath =    allowAptRoots ? ClassPathSupport.createProxyClassPath(this.cachedUserSrcClassPath,this.cachedAptSrcClassPath) : this.cachedUserSrcClassPath;
             this.outputClassPath = CacheClassPath.forSourcePath (this.cachedUserSrcClassPath);
 	    this.cachedSrcClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedSrcClassPath));
         }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java	2011-08-03 23:01:41.000000000 +0100
@@ -240,14 +240,14 @@
     }
 
     @Override
-    public Tree visitUnionType(UnionTypeTree node, Boolean p) {
+    public Tree visitDisjunctiveType(DisjunctiveTypeTree node, Boolean p) {
         List<? extends Tree> typeComponents = translateTree(node.getTypeAlternatives());
 
         if (make == null) return node;
 
         if (typeComponents != node.getTypeAlternatives())
         {
-            node = make.UnionType(typeComponents);
+            node = make.DisjunctiveType(typeComponents);
         }
         return node;
     }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementUtilities.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ElementUtilities.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementUtilities.java	2011-08-03 23:01:41.000000000 +0100
@@ -555,7 +555,6 @@
             }
         }
         Types types = JavacTypes.instance(ctx);
-        com.sun.tools.javac.code.Types implTypes = com.sun.tools.javac.code.Types.instance(ctx);
         DeclaredType implType = (DeclaredType)impl.asType();
         for (TypeMirror t : types.directSupertypes(element.asType())) {
             for (ExecutableElement ee : findUnimplementedMethods(impl, (TypeElement) ((DeclaredType) t).asElement())) {
@@ -578,7 +577,8 @@
                                     if (subType != null) {
                                         undef.remove(existing);
                                         MethodSymbol ms = ((MethodSymbol)existing).clone((Symbol)impl);
-                                        Type mt = implTypes.createMethodTypeWithReturn((MethodType)ms.type, (Type)subType);
+                                        MethodType mt = (MethodType)ms.type.clone();
+                                        mt.restype = (Type)subType;
                                         ms.type = mt;
                                         undef.add(ms);
                                     }
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/SourceUtils.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/SourceUtils.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/SourceUtils.java	2011-08-03 23:01:41.000000000 +0100
@@ -82,7 +82,6 @@
 import java.util.concurrent.Future;
 import java.util.logging.Level;
 import java.util.logging.Logger;
-import javax.lang.model.util.ElementScanner6;
 import javax.swing.SwingUtilities;
 
 import org.netbeans.api.annotations.common.NonNull;
@@ -749,32 +748,36 @@
         try {
             final List<ElementHandle<TypeElement>> result = new LinkedList<ElementHandle<TypeElement>>();
             js.runUserActionTask(new Task<CompilationController>() {            
-                @Override
                 public void run(final CompilationController control) throws Exception {
                     if (control.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED).compareTo (JavaSource.Phase.ELEMENTS_RESOLVED)>=0) {
-                        final List<TypeElement>  types = new ArrayList<TypeElement>();
-                        final ElementScanner6<Void,Void> visitor = new ElementScanner6<Void, Void>() {
-                            @Override
-                            public Void visitType(TypeElement e, Void p) {
-                                if (e.getEnclosingElement().getKind() == ElementKind.PACKAGE
-                                   || e.getModifiers().contains(Modifier.STATIC)) {
-                                    types.add(e);
-                                    return super.visitType(e, p);
-                                } else {
-                                    return null;
-                                }
-                            }
-                        };
-                        visitor.scan(control.getTopLevelElements(), null);
-                        for (TypeElement type : types) {
-                            for (ExecutableElement exec :  ElementFilter.methodsIn(control.getElements().getAllMembers(type))) {
-                                if (SourceUtils.isMainMethod(exec)) {
-                                    result.add (ElementHandle.create(type));
-                                }
-                            }
+                        new TreePathScanner<Void,Void> () {
+                           public @Override Void visitMethod(MethodTree node, Void p) {
+                               ExecutableElement method = (ExecutableElement) control.getTrees().getElement(getCurrentPath());
+                               if (method != null && SourceUtils.isMainMethod(method) && isAccessible(method.getEnclosingElement())) {
+                                   result.add (ElementHandle.create((TypeElement)method.getEnclosingElement()));
+                               }
+                               return null;
+                           }
+                        }.scan(control.getCompilationUnit(), null);
+                    }                   
+                }
+
+                private boolean isAccessible (Element element) {
+                    ElementKind kind = element.getKind();
+                    while (kind != ElementKind.PACKAGE) {
+                        if (!kind.isClass() && !kind.isInterface()) {
+                            return false;
+                        }                    
+                        Set<Modifier> modifiers = ((TypeElement)element).getModifiers();
+                        Element parent = element.getEnclosingElement();
+                        if (parent.getKind() != ElementKind.PACKAGE && !modifiers.contains(Modifier.STATIC)) {
+                            return false;
                         }
+                        element = parent;
+                        kind = element.getKind();
                     }
-                }                
+                    return true;
+                }
 
             }, true);
             return result;
Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java	2011-08-03 23:01:41.000000000 +0100
@@ -95,10 +95,12 @@
 import javax.lang.model.type.TypeMirror;
 import javax.lang.model.type.TypeVariable;
 import javax.lang.model.type.WildcardType;
+import javax.lang.model.util.TypeKindVisitor7;
 import javax.lang.model.util.Types;
 import javax.swing.text.Document;
 
 import org.netbeans.api.java.lexer.JavaTokenId;
+import org.netbeans.api.java.queries.SourceLevelQuery;
 import org.netbeans.api.lexer.TokenSequence;
 import org.netbeans.editor.GuardedDocument;
 import org.netbeans.modules.java.source.builder.CommentHandlerService;
@@ -107,6 +109,7 @@
 import org.netbeans.modules.java.source.query.CommentSet.RelativePosition;
 import org.openide.cookies.EditorCookie;
 import org.openide.loaders.DataObject;
+import org.openide.modules.SpecificationVersion;
 import org.openide.util.Exceptions;
 
 /**
@@ -355,15 +358,10 @@
         TreeMaker make = copy.getTreeMaker();
         Set<Modifier> mods = EnumSet.of(clazz.getKind() == ElementKind.ENUM ? Modifier.PRIVATE : Modifier.PUBLIC);
         List<VariableTree> parameters = new ArrayList<VariableTree>();
-        LinkedList<StatementTree> statements = new LinkedList<StatementTree>();
+        List<StatementTree> statements = new ArrayList<StatementTree>();
         ModifiersTree parameterModifiers = make.Modifiers(EnumSet.noneOf(Modifier.class));
         List<ExpressionTree> throwsList = new LinkedList<ExpressionTree>();
         List<TypeParameterTree> typeParams = new LinkedList<TypeParameterTree>();
-        for (VariableElement ve : fields) {
-            TypeMirror type = copy.getTypes().asMemberOf((DeclaredType)clazz.asType(), ve);
-            parameters.add(make.Variable(parameterModifiers, ve.getSimpleName(), make.Type(type), null));
-            statements.add(make.ExpressionStatement(make.Assignment(make.MemberSelect(make.Identifier("this"), ve.getSimpleName()), make.Identifier(ve.getSimpleName())))); //NOI18N
-        }
         if (constructor != null) {
             ExecutableType constructorType = clazz.getSuperclass().getKind() == TypeKind.DECLARED ? (ExecutableType) copy.getTypes().asMemberOf((DeclaredType) clazz.getSuperclass(), constructor) : null;
             if (!constructor.getParameters().isEmpty()) {
@@ -378,7 +376,7 @@
                     parameters.add(make.Variable(parameterModifiers, simpleName, make.Type(type), null));
                     arguments.add(make.Identifier(simpleName));
                 }
-                statements.addFirst(make.ExpressionStatement(make.MethodInvocation(Collections.<ExpressionTree>emptyList(), make.Identifier("super"), arguments))); //NOI18N
+                statements.add(make.ExpressionStatement(make.MethodInvocation(Collections.<ExpressionTree>emptyList(), make.Identifier("super"), arguments))); //NOI18N
             }
             constructorType = constructorType != null ? constructorType : (ExecutableType) constructor.asType();
             for (TypeMirror th : constructorType.getThrownTypes()) {
@@ -392,8 +390,13 @@
                 typeParams.add(make.TypeParameter(typeParameterElement.getSimpleName(), boundsList));
             }
         }
+        for (VariableElement ve : fields) {
+            TypeMirror type = copy.getTypes().asMemberOf((DeclaredType)clazz.asType(), ve);
+            parameters.add(make.Variable(parameterModifiers, ve.getSimpleName(), make.Type(type), null));
+            statements.add(make.ExpressionStatement(make.Assignment(make.MemberSelect(make.Identifier("this"), ve.getSimpleName()), make.Identifier(ve.getSimpleName())))); //NOI18N
+        }
         BlockTree body = make.Block(statements, false);
-        return make.Method(make.Modifiers(mods), "<init>", null, typeParams, parameters, throwsList, body, null, constructor!= null ? constructor.isVarArgs() : false); //NOI18N
+        return make.Method(make.Modifiers(mods), "<init>", null, typeParams, parameters, throwsList, body, null); //NOI18N
     }
 
     /**
@@ -532,7 +535,7 @@
 
     static <T extends Tree> T importComments(CompilationInfo info, T original, CompilationUnitTree cut) {
         try {
-            JCTree.JCCompilationUnit unit = (JCCompilationUnit) cut;
+            JCTree.JCCompilationUnit unit = (JCCompilationUnit) cut;            
             TokenSequence<JavaTokenId> seq = ((SourceFileObject) unit.getSourceFile()).getTokenHierarchy().tokenSequence(JavaTokenId.language());
             TreePath tp = TreePath.getPath(cut, original);
             Tree toMap = (tp != null && original.getKind() != Kind.COMPILATION_UNIT) ? tp.getParentPath().getLeaf() : original;
Index: netbeans-7.0.1+dfsg1/java.source/nbproject/project.properties
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/project.properties	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/nbproject/project.properties	2011-08-03 23:08:30.651929442 +0100
@@ -46,7 +46,7 @@
 javadoc.title=Java Source
 javadoc.arch=${basedir}/arch.xml
 javadoc.apichanges=${basedir}/apichanges.xml
-spec.version.base=0.80.1
+spec.version.base=0.79.2
 test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/javac-api-nb-7.0-b07.jar
 test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\
     ${o.n.core.dir}/lib/boot.jar:\
@@ -132,8 +132,7 @@
     org/netbeans/api/java/source/gen/BlockTest.class,\
     org/netbeans/api/java/source/gen/ImportAnalysisTest.class,\
     org/netbeans/api/java/source/gen/ImportAnalysis2Test.class,\
-    org/netbeans/modules/java/source/save/DiffFacilityTest.class,\
-    org/netbeans/api/java/source/gen/RewriteMultipleExpressionsTest.class
+    org/netbeans/modules/java/source/save/DiffFacilityTest.class
 
 test.config.jet-main.includes=${test.config.generator.includes},\
     org/netbeans/api/java/source/TypeUtilitiesTest.class,\
Index: netbeans-7.0.1+dfsg1/java.source/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/project.xml	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/nbproject/project.xml	2011-08-03 23:01:41.000000000 +0100
@@ -55,7 +55,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.9.1</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -64,7 +64,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.33.1</specification-version>
+                        <specification-version>1.28</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -73,7 +73,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.29.1</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -89,7 +89,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.6.1.3</specification-version>
+                        <specification-version>7.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -107,7 +107,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>3</release-version>
-                        <specification-version>3.2.1</specification-version>
+                        <specification-version>3.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -124,7 +124,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.12.1</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -133,7 +133,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>2</release-version>
-                        <specification-version>1.24.1</specification-version>
+                        <specification-version>1.11</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -142,7 +142,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>0-1</release-version>
-                        <specification-version>1.5.1</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -151,7 +151,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>3</release-version>
-                        <specification-version>3.9.1.13.10</specification-version>
+                        <specification-version>3.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -160,7 +160,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.43.1.10</specification-version>
+                        <specification-version>1.11</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -169,7 +169,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.22.1</specification-version>
+                        <specification-version>1.7</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -178,7 +178,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.18</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -187,7 +187,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.42.1</specification-version>
+                        <specification-version>1.22</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -196,7 +196,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.14.1</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -205,7 +205,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.21.1</specification-version>
+                        <specification-version>1.8</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -213,7 +213,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.18.1.1</specification-version>
+                        <specification-version>1.14</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -222,7 +222,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>2</release-version>
-                        <specification-version>1.39.1.1</specification-version>
+                        <specification-version>1.25</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -231,7 +231,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.22.1</specification-version>
+                        <specification-version>1.5</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -240,7 +240,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.25.1</specification-version>
+                        <specification-version>1.20</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -257,7 +257,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.5.1</specification-version>
+                        <specification-version>1.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -266,7 +266,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.13</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -275,7 +275,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.51.1.8</specification-version>
+                        <specification-version>1.30</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -284,7 +284,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.23.1</specification-version>
+                        <specification-version>1.9</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -292,7 +292,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.16.1</specification-version>
+                        <specification-version>1.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -301,7 +301,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.15.1.1</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -309,7 +309,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.31.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -317,7 +317,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.20.1</specification-version>
+                        <specification-version>7.8</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -325,7 +325,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.47.1</specification-version>
+                        <specification-version>7.19</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -333,7 +333,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
+                        <specification-version>7.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -341,7 +341,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.23.1</specification-version>
+                        <specification-version>7.9</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -349,7 +349,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -357,7 +357,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.37.1</specification-version>
+                        <specification-version>6.26</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -365,7 +365,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.15.1</specification-version>
+                        <specification-version>8.4</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -373,7 +373,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.8.1</specification-version>
+                        <specification-version>8.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -381,7 +381,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.40.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
             </module-dependencies>
@@ -424,7 +424,6 @@
                     </test-dependency>
                     <test-dependency>
                         <code-name-base>org.netbeans.modules.java.editor</code-name-base>
-                        <recursive/>
                         <compile-dependency/>
                     </test-dependency>
                     <test-dependency>
Index: netbeans-7.0.1+dfsg1/java.source/nbproject/org-netbeans-modules-java-source.sig
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/org-netbeans-modules-java-source.sig	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/nbproject/org-netbeans-modules-java-source.sig	2011-08-03 23:01:41.000000000 +0100
@@ -1,5 +1,5 @@
 #Signature file v4.1
-#Version 0.76.1
+#Version 0.60.0
 
 CLSS public abstract interface com.sun.source.tree.TreeVisitor<%0 extends java.lang.Object, %1 extends java.lang.Object>
 meth public abstract {com.sun.source.tree.TreeVisitor%0} visitAnnotation(com.sun.source.tree.AnnotationTree,{com.sun.source.tree.TreeVisitor%1})
@@ -377,14 +377,12 @@
 meth public boolean alignMultilineAssignment()
 meth public boolean alignMultilineBinaryOp()
 meth public boolean alignMultilineCallArgs()
-meth public boolean alignMultilineDisjunctiveCatchTypes()
 meth public boolean alignMultilineFor()
 meth public boolean alignMultilineImplements()
 meth public boolean alignMultilineMethodParams()
 meth public boolean alignMultilineParenthesized()
 meth public boolean alignMultilineTernaryOp()
 meth public boolean alignMultilineThrows()
-meth public boolean alignMultilineTryResources()
 meth public boolean expandTabToSpaces()
 meth public boolean indentCasesFromSwitch()
 meth public boolean indentTopLevelClassMembers()
@@ -432,7 +430,6 @@
 meth public boolean spaceBeforeSynchronizedLeftBrace()
 meth public boolean spaceBeforeSynchronizedParen()
 meth public boolean spaceBeforeTryLeftBrace()
-meth public boolean spaceBeforeTryParen()
 meth public boolean spaceBeforeWhile()
 meth public boolean spaceBeforeWhileLeftBrace()
 meth public boolean spaceBeforeWhileParen()
@@ -447,7 +444,6 @@
 meth public boolean spaceWithinParens()
 meth public boolean spaceWithinSwitchParens()
 meth public boolean spaceWithinSynchronizedParens()
-meth public boolean spaceWithinTryParens()
 meth public boolean spaceWithinTypeCastParens()
 meth public boolean spaceWithinWhileParens()
 meth public boolean specialElseIf()
@@ -497,7 +493,6 @@
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapAssignOps()
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapBinaryOps()
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapChainedMethodCalls()
-meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapDisjunctiveCatchTypes()
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapDoWhileStatement()
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapEnumConstants()
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapExtendsImplementsKeyword()
@@ -510,7 +505,6 @@
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapTernaryOps()
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapThrowsKeyword()
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapThrowsList()
-meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapTryResources()
 meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapWhileStatement()
 meth public static org.netbeans.api.java.source.CodeStyle getDefault(javax.swing.text.Document)
 meth public static org.netbeans.api.java.source.CodeStyle getDefault(org.netbeans.api.project.Project)
@@ -801,7 +795,7 @@
 meth protected final void fileObjectsChanged()
 meth protected final void reschedule(org.openide.filesystems.FileObject)
 supr java.lang.Object
-hfds ACCESSOR2,BEFORE_ADDING_REMOVING_TASKS,FILEOBJECTS_COMPUTATION,LOG,SYNCHRONOUS_EVENTS,WORKER,file2JS,file2Task,filesLock,phase,priority
+hfds ACCESSOR2,BEFORE_ADDING_REMOVING_TASKS,FILEOBJECTS_COMPUTATION,LOG,SYNCHRONOUS_EVENTS,WORKER,file2JS,file2Task,phase,priority
 hcls Accessor2
 
 CLSS public final org.netbeans.api.java.source.ModificationResult
@@ -825,7 +819,7 @@
 meth public void commit() throws java.io.IOException
 supr java.lang.Object
 hfds committed,diffs,sources,tag2Span
-hcls CreateChange,FilteringReader,FilteringWriter
+hcls CreateChange
 
 CLSS public static org.netbeans.api.java.source.ModificationResult$Difference
  outer org.netbeans.api.java.source.ModificationResult
@@ -874,7 +868,6 @@
 CLSS public org.netbeans.api.java.source.SourceUtils
 meth public static boolean checkTypesAssignable(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.type.TypeMirror,javax.lang.model.type.TypeMirror)
 meth public static boolean isMainClass(java.lang.String,org.netbeans.api.java.source.ClasspathInfo)
-meth public static boolean isMainClass(java.lang.String,org.netbeans.api.java.source.ClasspathInfo,boolean)
 meth public static boolean isMainMethod(javax.lang.model.element.ExecutableElement)
 meth public static boolean isScanInProgress()
 meth public static java.lang.String resolveImport(org.netbeans.api.java.source.CompilationInfo,com.sun.source.util.TreePath,java.lang.String) throws java.io.IOException
@@ -893,8 +886,7 @@
 meth public static org.openide.filesystems.FileObject getFile(org.netbeans.api.java.source.ElementHandle<? extends javax.lang.model.element.Element>,org.netbeans.api.java.source.ClasspathInfo)
 meth public static void waitScanFinished() throws java.lang.InterruptedException
 supr java.lang.Object
-hfds LOG,MAX_LEN,VOWELS
-hcls CaseInsensitiveMatch,CaseSensitiveMatch,Match
+hfds LOG,MAX_LEN,PACKAGE_SUMMARY,VOWELS
 
 CLSS public abstract interface org.netbeans.api.java.source.Task<%0 extends java.lang.Object>
 meth public abstract void run({org.netbeans.api.java.source.Task%0}) throws java.lang.Exception
@@ -943,21 +935,15 @@
 meth public com.sun.source.tree.ClassTree removeClassTypeParameter(com.sun.source.tree.ClassTree,int)
 meth public com.sun.source.tree.ClassTree setExtends(com.sun.source.tree.ClassTree,com.sun.source.tree.ExpressionTree)
 meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(com.sun.source.tree.ExpressionTree,java.util.List<? extends com.sun.source.tree.ImportTree>,java.util.List<? extends com.sun.source.tree.Tree>,javax.tools.JavaFileObject)
-meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(java.util.List<? extends com.sun.source.tree.AnnotationTree>,com.sun.source.tree.ExpressionTree,java.util.List<? extends com.sun.source.tree.ImportTree>,java.util.List<? extends com.sun.source.tree.Tree>,javax.tools.JavaFileObject)
-meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(java.util.List<? extends com.sun.source.tree.AnnotationTree>,org.openide.filesystems.FileObject,java.lang.String,java.util.List<? extends com.sun.source.tree.ImportTree>,java.util.List<? extends com.sun.source.tree.Tree>)
 meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(org.openide.filesystems.FileObject,java.lang.String,java.util.List<? extends com.sun.source.tree.ImportTree>,java.util.List<? extends com.sun.source.tree.Tree>)
 meth public com.sun.source.tree.CompilationUnitTree addCompUnitImport(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.ImportTree)
 meth public com.sun.source.tree.CompilationUnitTree addCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.Tree)
-meth public com.sun.source.tree.CompilationUnitTree addPackageAnnotation(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.AnnotationTree)
 meth public com.sun.source.tree.CompilationUnitTree insertCompUnitImport(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.ImportTree)
 meth public com.sun.source.tree.CompilationUnitTree insertCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.Tree)
-meth public com.sun.source.tree.CompilationUnitTree insertPackageAnnotation(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.AnnotationTree)
 meth public com.sun.source.tree.CompilationUnitTree removeCompUnitImport(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.ImportTree)
 meth public com.sun.source.tree.CompilationUnitTree removeCompUnitImport(com.sun.source.tree.CompilationUnitTree,int)
 meth public com.sun.source.tree.CompilationUnitTree removeCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.Tree)
 meth public com.sun.source.tree.CompilationUnitTree removeCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,int)
-meth public com.sun.source.tree.CompilationUnitTree removePackageAnnotation(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.AnnotationTree)
-meth public com.sun.source.tree.CompilationUnitTree removePackageAnnotation(com.sun.source.tree.CompilationUnitTree,int)
 meth public com.sun.source.tree.CompoundAssignmentTree CompoundAssignment(com.sun.source.tree.Tree$Kind,com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree)
 meth public com.sun.source.tree.ConditionalExpressionTree ConditionalExpression(com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree)
 meth public com.sun.source.tree.ContinueTree Continue(java.lang.CharSequence)
@@ -966,9 +952,6 @@
 meth public com.sun.source.tree.EnhancedForLoopTree EnhancedForLoop(com.sun.source.tree.VariableTree,com.sun.source.tree.ExpressionTree,com.sun.source.tree.StatementTree)
 meth public com.sun.source.tree.ErroneousTree Erroneous(java.util.List<? extends com.sun.source.tree.Tree>)
 meth public com.sun.source.tree.ExpressionStatementTree ExpressionStatement(com.sun.source.tree.ExpressionTree)
-meth public com.sun.source.tree.ExpressionTree QualIdent(java.lang.String)
- anno 0 org.netbeans.api.annotations.common.NonNull()
- anno 1 org.netbeans.api.annotations.common.NonNull()
 meth public com.sun.source.tree.ExpressionTree QualIdent(javax.lang.model.element.Element)
  anno 0 org.netbeans.api.annotations.common.NonNull()
  anno 1 org.netbeans.api.annotations.common.NonNull()
@@ -1062,14 +1045,10 @@
 meth public com.sun.source.tree.SwitchTree removeSwitchCase(com.sun.source.tree.SwitchTree,int)
 meth public com.sun.source.tree.SynchronizedTree Synchronized(com.sun.source.tree.ExpressionTree,com.sun.source.tree.BlockTree)
 meth public com.sun.source.tree.ThrowTree Throw(com.sun.source.tree.ExpressionTree)
-meth public com.sun.source.tree.Tree Type(java.lang.String)
- anno 0 org.netbeans.api.annotations.common.NonNull()
- anno 1 org.netbeans.api.annotations.common.NonNull()
 meth public com.sun.source.tree.Tree Type(javax.lang.model.type.TypeMirror)
  anno 0 org.netbeans.api.annotations.common.NonNull()
  anno 1 org.netbeans.api.annotations.common.NonNull()
 meth public com.sun.source.tree.TryTree Try(com.sun.source.tree.BlockTree,java.util.List<? extends com.sun.source.tree.CatchTree>,com.sun.source.tree.BlockTree)
-meth public com.sun.source.tree.TryTree Try(java.util.List<? extends com.sun.source.tree.Tree>,com.sun.source.tree.BlockTree,java.util.List<? extends com.sun.source.tree.CatchTree>,com.sun.source.tree.BlockTree)
 meth public com.sun.source.tree.TryTree addTryCatch(com.sun.source.tree.TryTree,com.sun.source.tree.CatchTree)
 meth public com.sun.source.tree.TryTree insertTryCatch(com.sun.source.tree.TryTree,int,com.sun.source.tree.CatchTree)
 meth public com.sun.source.tree.TryTree removeTryCatch(com.sun.source.tree.TryTree,com.sun.source.tree.CatchTree)
@@ -1108,17 +1087,12 @@
 hcls CountingDelegate,Delegate,ElementDelegate,EmptyDelegate,TreeDelegate
 
 CLSS public final org.netbeans.api.java.source.TreeUtilities
-fld public final static java.util.Set<com.sun.source.tree.Tree$Kind> CLASS_TREE_KINDS
 meth public boolean isAccessible(com.sun.source.tree.Scope,javax.lang.model.element.Element,javax.lang.model.type.TypeMirror)
 meth public boolean isAnnotation(com.sun.source.tree.ClassTree)
- anno 0 java.lang.Deprecated()
 meth public boolean isClass(com.sun.source.tree.ClassTree)
- anno 0 java.lang.Deprecated()
 meth public boolean isEnum(com.sun.source.tree.ClassTree)
- anno 0 java.lang.Deprecated()
 meth public boolean isEnumConstant(com.sun.source.tree.VariableTree)
 meth public boolean isInterface(com.sun.source.tree.ClassTree)
- anno 0 java.lang.Deprecated()
 meth public boolean isStaticContext(com.sun.source.tree.Scope)
 meth public boolean isSynthetic(com.sun.source.util.TreePath)
 meth public com.sun.source.tree.BlockTree parseStaticBlock(java.lang.String,com.sun.source.util.SourcePositions[])
@@ -1129,10 +1103,6 @@
 meth public com.sun.source.tree.Scope scopeFor(int)
 meth public com.sun.source.tree.StatementTree getBreakContinueTarget(com.sun.source.util.TreePath)
 meth public com.sun.source.tree.StatementTree parseStatement(java.lang.String,com.sun.source.util.SourcePositions[])
-meth public com.sun.source.tree.Tree translate(com.sun.source.tree.Tree,java.util.Map<? extends com.sun.source.tree.Tree,? extends com.sun.source.tree.Tree>)
- anno 0 org.netbeans.api.annotations.common.NonNull()
- anno 1 org.netbeans.api.annotations.common.NonNull()
- anno 2 org.netbeans.api.annotations.common.NonNull()
 meth public com.sun.source.util.TreePath pathFor(com.sun.source.util.TreePath,int)
 meth public com.sun.source.util.TreePath pathFor(com.sun.source.util.TreePath,int,com.sun.source.util.SourcePositions)
 meth public com.sun.source.util.TreePath pathFor(int)
@@ -1155,7 +1125,7 @@
 meth public org.netbeans.api.lexer.TokenSequence<org.netbeans.api.java.lexer.JavaTokenId> tokensFor(com.sun.source.tree.Tree,com.sun.source.util.SourcePositions)
 supr java.lang.Object
 hfds ESCAPE_ENCODE,ESCAPE_UNENCODE,EXOTIC_ESCAPE,handler,info
-hcls NoImports,UncaughtExceptionsVisitor,UnrelatedTypeMirrorSet
+hcls UncaughtExceptionsVisitor,UnrelatedTypeMirrorSet
 
 CLSS public final org.netbeans.api.java.source.TypeMirrorHandle<%0 extends javax.lang.model.type.TypeMirror>
 meth public javax.lang.model.type.TypeKind getKind()
@@ -1170,25 +1140,10 @@
 hcls PlaceholderType,Visitor
 
 CLSS public final org.netbeans.api.java.source.TypeUtilities
-innr public final static !enum TypeNameOptions
-meth public !varargs java.lang.CharSequence getTypeName(javax.lang.model.type.TypeMirror,org.netbeans.api.java.source.TypeUtilities$TypeNameOptions[])
- anno 0 org.netbeans.api.annotations.common.CheckReturnValue()
- anno 0 org.netbeans.api.annotations.common.NonNull()
- anno 1 org.netbeans.api.annotations.common.NullAllowed()
- anno 2 org.netbeans.api.annotations.common.NonNull()
 meth public boolean isCastable(javax.lang.model.type.TypeMirror,javax.lang.model.type.TypeMirror)
 meth public javax.lang.model.type.TypeMirror substitute(javax.lang.model.type.TypeMirror,java.util.List<? extends javax.lang.model.type.TypeMirror>,java.util.List<? extends javax.lang.model.type.TypeMirror>)
 supr java.lang.Object
-hfds CAPTURED_WILDCARD,UNKNOWN,info
-hcls TypeNameVisitor
-
-CLSS public final static !enum org.netbeans.api.java.source.TypeUtilities$TypeNameOptions
- outer org.netbeans.api.java.source.TypeUtilities
-fld public final static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions PRINT_AS_VARARG
-fld public final static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions PRINT_FQN
-meth public static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions valueOf(java.lang.String)
-meth public static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions[] values()
-supr java.lang.Enum<org.netbeans.api.java.source.TypeUtilities$TypeNameOptions>
+hfds info
 
 CLSS public final org.netbeans.api.java.source.TypesEvent
 meth public java.lang.Iterable<? extends org.netbeans.api.java.source.ElementHandle<javax.lang.model.element.TypeElement>> getTypes()
@@ -1251,7 +1206,7 @@
  anno 1 org.netbeans.api.annotations.common.NonNull()
  anno 2 org.netbeans.api.annotations.common.NonNull()
 supr org.netbeans.api.java.source.CompilationController
-hfds REWRITE_WHOLE_FILE,afterCommit,changes,externalChanges,instance,overlay,textualChanges,tree2Tag,treeMaker,userInfo
+hfds REWRITE_WHOLE_FILE,afterCommit,changes,externalChanges,instance,textualChanges,tree2Tag,treeMaker,userInfo
 hcls Rewriter,Translator
 
 CLSS public org.netbeans.api.java.source.support.CancellableTreePathScanner<%0 extends java.lang.Object, %1 extends java.lang.Object>
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -244,16 +244,6 @@
                 "package t;\n@Deprecated\npublic class T {\n}\n");
     }
 
-    public void testNewLineIndentationAfterSimpleAnnotationInsideEmptyClass() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    @Deprecated|\n}\n",
-                "package t;\npublic class T {\n    @Deprecated\n    \n}\n");
-    }
-
-    public void testLineIndentationAfterSimpleAnnotationInsideEmptyClass() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    @Deprecated\n|\n}\n",
-                "package t;\npublic class T {\n    @Deprecated\n    \n}\n");
-    }
-
     public void testNewLineIndentationAfterField() throws Exception {
         performNewLineIndentationTest("package t;\npublic class T {\n    public int i;|\n}\n",
                 "package t;\npublic class T {\n    public int i;\n    \n}\n");
@@ -702,26 +692,6 @@
         }
     }
 
-    public void testNewLineIndentationBeforeWhileInDoWhile() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        }| while (check());\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        do {\n        }\n        while (check());\n    }\n}\n");
-    }
-
-    public void testLineIndentationBeforeWhileInDoWhile() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        }\n| while (check());\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        do {\n        }\n        while (check());\n    }\n}\n");
-    }
-
-    public void testNewLineIndentationBeforeWhileOnNewLineInDoWhile() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        }|\n        while (check());\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        do {\n        }\n        \n        while (check());\n    }\n}\n");
-    }
-
-    public void testLineIndentationBeforeWhileOnNewLineInDoWhile() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        }\n|\n        while (check());\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        do {\n        }\n        \n        while (check());\n    }\n}\n");
-    }
-
     public void testNewLineIndentationInsideDoWhileCond() throws Exception {
         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        } while (check()|);\n    }\n}\n",
                 "package t;\npublic class T {\n    public void op() {\n        do {\n        } while (check()\n                );\n    }\n}\n");
@@ -918,26 +888,6 @@
                 "package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }\n        else {\n        }\n    }\n}\n");
     }
 
-    public void testNewLineIndentationBeforeElseOnNewLine() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }|\n        else {\n        }\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }\n        \n        else {\n        }\n    }\n}\n");
-    }
-
-    public void testLineIndentationBeforeElseOnNewLine() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }\n|\n        else {\n        }\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }\n        \n        else {\n        }\n    }\n}\n");
-    }
-
-    public void testNewLineIndentationAfterStatementBeforeElseOnNewLine() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true)\n            System.out.println();|\n        else {\n        }\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        if (true)\n            System.out.println();\n        \n        else {\n        }\n    }\n}\n");
-    }
-
-    public void testLineIndentationAfterStatementBeforeElseOnNewLine() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true)\n            System.out.println();\n|\n        else {\n        }\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        if (true)\n            System.out.println();\n        \n        else {\n        }\n    }\n}\n");
-    }
-
     public void testNewLineIndentationBeforeElseStmt() throws Exception {
         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true) {\n        } else|\n    }\n}\n",
                 "package t;\npublic class T {\n    public void op() {\n        if (true) {\n        } else\n            \n    }\n}\n");
@@ -1104,16 +1054,6 @@
                 "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        catch (Exception e) {\n        }\n    }\n}\n");
     }
 
-    public void testNewLineIndentationBeforeCatchOnNewLine() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        }|\n        catch (Exception e) {\n        }\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        \n        catch (Exception e) {\n        }\n    }\n}\n");
-    }
-
-    public void testLineIndentationBeforeCatchOnNewLine() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        }\n|\n        catch (Exception e) {\n        }\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        \n        catch (Exception e) {\n        }\n    }\n}\n");
-    }
-
     public void testNewLineIndentationBeforeCatchBlock() throws Exception {
         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        } catch (Exception e)| {\n        }\n    }\n}\n",
                 "package t;\npublic class T {\n    public void op() {\n        try {\n        } catch (Exception e)\n        {\n        }\n    }\n}\n");
@@ -1156,16 +1096,6 @@
                 "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        finally {\n        }\n    }\n}\n");
     }
 
-    public void testNewLineIndentationBeforeFinallyOnNewLine() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        }|\n        finally {\n        }\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        \n        finally {\n        }\n    }\n}\n");
-    }
-
-    public void testLineIndentationBeforeFinallyOnNewLine() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        }\n|\n        finally {\n        }\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        \n        finally {\n        }\n    }\n}\n");
-    }
-
     public void testNewLineIndentationBeforeFinallyBlock() throws Exception {
         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        } finally| {\n        }\n    }\n}\n",
                 "package t;\npublic class T {\n    public void op() {\n        try {\n        } finally\n        {\n        }\n    }\n}\n");
@@ -1436,38 +1366,6 @@
         }
     }
 
-    public void testNewLineIndentationBeforeNewArrayInit() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]| {\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n        {\n    }\n}\n");
-    }
-
-    public void testLineIndentationBeforeNewArrayInit() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n|                {\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n        {\n    }\n}\n");
-    }
-
-    public void testNewLineIndentationBeforeHalfIndentedNewArrayInit() throws Exception {
-        Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class);
-        preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name());
-        try {
-            performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]| {\n    }\n}\n",
-                    "package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n          {\n    }\n}\n");
-        } finally {
-            preferences.remove("otherBracePlacement");
-        }
-    }
-
-    public void testLineIndentationBeforeHalfIndentedNewArrayInit() throws Exception {
-        Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class);
-        preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name());
-        try {
-            performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n|                {\n    }\n}\n",
-                    "package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n          {\n    }\n}\n");
-        } finally {
-            preferences.remove("otherBracePlacement");
-        }
-    }
-
     public void testNewLineIndentationIndideEmptyArrayInit() throws Exception {
         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = {|\n    }\n}\n",
                 "package t;\npublic class T {\n    public void op() {\n        int[] arr = {\n            \n    }\n}\n");
@@ -1540,38 +1438,6 @@
         }
     }
 
-    public void testNewLineIndentationBeforeNewClassTreeBody() throws Exception {
-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()| {\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n        {\n    }\n}\n");
-    }
-
-    public void testLineIndentationBeforeNewClassTreeBody() throws Exception {
-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n|                {\n    }\n}\n",
-                "package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n        {\n    }\n}\n");
-    }
-
-    public void testNewLineIndentationBeforeHalfIndentedNewClassTreeBody() throws Exception {
-        Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class);
-        preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name());
-        try {
-            performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()| {\n    }\n}\n",
-                    "package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n          {\n    }\n}\n");
-        } finally {
-            preferences.remove("otherBracePlacement");
-        }
-    }
-
-    public void testLineIndentationBeforeHalfIndentedNewClassTreeBody() throws Exception {
-        Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class);
-        preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name());
-        try {
-            performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n|                {\n    }\n}\n",
-                    "package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n          {\n    }\n}\n");
-        } finally {
-            preferences.remove("otherBracePlacement");
-        }
-    }
-
     public void testNewLineIndentationAfterLineComment() throws Exception {
         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        System.out.println(); // Comment|\n    }\n}\n",
                 "package t;\npublic class T {\n    public void op() {\n        System.out.println(); // Comment\n        \n    }\n}\n");
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -43,11 +43,7 @@
 package org.netbeans.modules.java.source.parsing;
 
 import java.io.File;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
 import javax.lang.model.element.TypeElement;
-import javax.tools.Diagnostic;
 import org.netbeans.api.java.source.ClasspathInfo;
 import org.netbeans.api.java.source.CompilationController;
 import org.netbeans.api.java.source.JavaSource;
@@ -56,7 +52,6 @@
 import org.netbeans.api.java.source.Task;
 import org.netbeans.api.java.source.TestUtilities;
 import org.netbeans.junit.NbTestCase;
-import org.netbeans.modules.java.source.tasklist.CompilerSettings;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
 
@@ -102,31 +97,6 @@
         }, true);
     }
 
-    public void test199332() throws Exception {
-        CompilerSettings.getNode().putBoolean(CompilerSettings.ENABLE_LINT, true);
-        CompilerSettings.getNode().putBoolean(CompilerSettings.ENABLE_LINT_SERIAL, true);
-
-        FileObject f2 = createFile("test/Test2.java", "package test; class Test2 implements Runnable, java.io.Serializable {}");
-        JavaSource js = JavaSource.forFileObject(f2);
-
-        SourceUtilsTestUtil.compileRecursively(sourceRoot);
-
-        js.runUserActionTask(new Task<CompilationController>() {
-            public void run(CompilationController parameter) throws Exception {
-                assertTrue(Phase.RESOLVED.compareTo(parameter.toPhase(Phase.RESOLVED)) <= 0);
-                assertEquals(parameter.getDiagnostics().toString(), 2, parameter.getDiagnostics().size());
-
-                Set<String> codes = new HashSet<String>();
-
-                for (Diagnostic d : parameter.getDiagnostics()) {
-                    codes.add(d.getCode());
-                }
-
-                assertEquals(new HashSet<String>(Arrays.asList("compiler.warn.missing.SVUID", "compiler.err.does.not.override.abstract")), codes);
-            }
-        }, true);
-    }
-
     private FileObject createFile(String path, String content) throws Exception {
         FileObject file = FileUtil.createData(sourceRoot, path);
         TestUtilities.copyStringToFile(file, content);
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -90,20 +90,20 @@
     public void testRegularGetCharContent () throws Exception {
         final File wd = this.getWorkDir();
         final File testFile = createTestFile (wd);
-        JavaFileObject jfo = FileObjects.fileFileObject(testFile, wd, null, null);
+        JavaFileObject jfo = FileObjects.fileFileObject(testFile, wd, null);
         CharSequence content = jfo.getCharContent(true);
         String expectedData = DATA+"\n";
         assertTrue (expectedData.contentEquals(content));
         
         Filter f = new Filter (null);
-        jfo = FileObjects.fileFileObject(testFile, wd, f, null);
+        jfo = FileObjects.fileFileObject(testFile, wd, f);
         content = jfo.getCharContent(true);
         expectedData = DATA+"\n";
         assertTrue (expectedData.contentEquals(content));
         assertEquals(EnumSet.of(Call.READER), f.calls);
         
         f = new Filter (PAD);
-        jfo = FileObjects.fileFileObject(testFile, wd, f, null);
+        jfo = FileObjects.fileFileObject(testFile, wd, f);
         content = jfo.getCharContent(true);
         expectedData = PAD + DATA+"\n";
         assertTrue (expectedData.contentEquals(content));
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java	2011-08-03 23:01:41.000000000 +0100
@@ -50,12 +50,15 @@
 import java.util.Collection;
 import java.util.Collections;
 import java.util.Comparator;
+import java.util.Iterator;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Set;
 import javax.tools.JavaFileObject;
 import org.netbeans.api.java.classpath.ClassPath;
 import org.netbeans.modules.java.source.TestUtil;
 import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation;
+import org.netbeans.modules.java.source.util.Factory;
 
 /** Class which takes a folder and behaves like an archive should behave.
  * It does not apply any optimalizations. However it is good for comparing
@@ -124,7 +127,7 @@
         
         for( File f : files ) {
             if ( !f.isDirectory() ) {
-                entries.add( FileObjects.fileFileObject (f, rootFolder, null, null));
+                entries.add( FileObjects.fileFileObject (f, rootFolder, null));
             }
         }
         
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -44,10 +44,8 @@
 
 package org.netbeans.api.java.source;
 
-import java.io.ByteArrayInputStream;
 import java.io.File;
 import java.io.IOException;
-import java.io.OutputStream;
 import java.net.URL;
 import java.util.Arrays;
 import java.util.Collections;
@@ -70,12 +68,9 @@
 import org.netbeans.junit.NbTestCase;
 import org.netbeans.modules.java.source.ElementHandleAccessor;
 import org.netbeans.modules.java.source.TestUtil;
-import org.netbeans.modules.java.source.usages.ClassIndexManager;
 import org.netbeans.modules.java.source.usages.ClasspathInfoAccessor;
-import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
 import org.netbeans.spi.java.classpath.support.ClassPathSupport;
 import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation;
-import org.openide.filesystems.FileLock;
 import org.openide.filesystems.FileObject;
 import org.openide.filesystems.FileUtil;
 
@@ -100,7 +95,41 @@
         clearWorkDir();
         SourceUtilsTestUtil.prepareTest(new String[0], new Object[] {SFBQImpl.getDefault()});
     }
+
+    private void prepareTest() throws Exception {
+        File work = getWorkDir();
+        FileObject workFO = FileUtil.toFileObject(work);
+        
+        assertNotNull(workFO);
+        
+        FileObject sourceRoot = workFO.createFolder("src");
+        FileObject buildRoot  = workFO.createFolder("build");
+        FileObject cache = workFO.createFolder("cache");
+        FileObject packageRoot = sourceRoot.createFolder("sourceutils");
+        
+        SourceUtilsTestUtil.prepareTest(sourceRoot, buildRoot, cache);
+        
+        String capitalizedName = "T" + getName().substring(1);
+        
+        TestUtil.copyFiles(FileUtil.toFile(sourceRoot), "sourceutils/" + capitalizedName + ".java");
+        
+        packageRoot.refresh();
+        
+        FileObject testSource = packageRoot.getFileObject(capitalizedName + ".java");
+        
+        assertNotNull(testSource);
+
+        SourceUtilsTestUtil.compileRecursively(sourceRoot);
+        
+        js = JavaSource.forFileObject(testSource);
+        
+        assertNotNull(js);
         
+        info = SourceUtilsTestUtil.getCompilationInfo(js, JavaSource.Phase.RESOLVED);
+        
+        assertNotNull(info);
+    }
+    
     public void testGetEnclosingTypeElement() throws Exception {
         //only a scatch of the test, add testcases as needed:
         prepareTest();
@@ -287,15 +316,69 @@
         assertEquals (new URL[] {url1, url3, url5}, result);
     }
     
-                    
+    
+    private void assertEquals (URL[] expected, Set<URL> result) {
+        assertEquals (expected.length,result.size());
+        for (URL eurl : expected) {
+            assertTrue (result.remove(eurl));
+        }
+        assertTrue(result.isEmpty());
+    }
+    
+    private <E extends Element> E findElementBySimpleName(String simpleName, List<E> elements) {
+        for (E e : elements) {
+            if (simpleName.contentEquals(e.getSimpleName()))
+                return e;
+        }
+        
+        fail("Not found element with simple name: " + simpleName);
+        
+        throw new Error("Should never be here!");
+    }
+    
+    public void testGetFQNsForSimpleName() throws Exception {
+// The method was removed,
+// tzezula: I am going to create an replacement using lucene        
+//        prepareTest();
+//        
+//        List<TypeElement> fqnTEs;
+//        List<String> fqns;
+//        
+//        fqnTEs = SourceUtils.getFQNsForSimpleNamePrefix(info, "List", true);
+//        fqns = new ArrayList<String>();
+//        
+//        for (TypeElement te : fqnTEs) {
+//            fqns.add(te.getQualifiedName().toString());
+//        }
+//        
+//        assertTrue(fqns.remove("java.util.List"));
+//        assertTrue(fqns.remove("java.awt.List"));
+//        
+//        //JDK16 specific:
+//        fqns.remove("com.sun.xml.bind.v2.schemagen.xmlschema.List");
+//        
+//        assertEquals(fqns.toString(), 0, fqns.size());
+//
+//        fqnTEs = SourceUtils.getFQNsForSimpleNamePrefix(info, "File", true);
+//        fqns = new ArrayList<String>();
+//        
+//        for (TypeElement te : fqnTEs) {
+//            fqns.add(te.getQualifiedName().toString());
+//        }
+//        
+//        assertTrue(fqns.remove("java.io.File"));
+//        
+//        assertEquals(fqns.toString(), 0, fqns.size());
+        
+        //XXX: onlyExact
+    }
+    
+    
     public void testGetFile () throws Exception {
         File workDir = getWorkDir();
         FileObject workFo = FileUtil.toFileObject(workDir);
         assertNotNull (workFo);
         FileObject src = workFo.createFolder("src");
-        FileObject userDir = workFo.createFolder("ud");
-        CacheFolder.setCacheFolder(userDir);
-        ClassIndexManager.getDefault().createUsagesQuery(src.getURL(), true);
         FileObject srcInDefPkg = src.createData("Foo","java");
         assertNotNull(srcInDefPkg);
         FileObject sourceFile = src.createFolder("org").createFolder("me").createData("Test", "java");
@@ -326,156 +409,6 @@
         result = SourceUtils.getFile(handle,cpInfo);
         assertNotNull(result);
     }
-
-    public void testGetMainClasses() throws Exception {
-        final File wd = getWorkDir();
-        final FileObject src = FileUtil.createFolder(new File (wd,"src"));
-        final FileObject userDir = FileUtil.createFolder(new File (wd,"ud"));
-        CacheFolder.setCacheFolder(userDir);
-        final FileObject emptyClass = createFile(src, "C1.java","class C1 {}");
-        assertEquals(0, SourceUtils.getMainClasses(emptyClass).size());
-        final FileObject classWithMethod = createFile(src, "C2.java","class C2 { public static void test (String... args){} }");
-        assertEquals(0, SourceUtils.getMainClasses(classWithMethod).size());
-        final FileObject classWithMethod2 = createFile(src, "C3.java","class C3 { static void main (String... args){} }");
-        assertEquals(0, SourceUtils.getMainClasses(classWithMethod2).size());
-        final FileObject classWithMethod3 = createFile(src, "C4.java","class C4 { public void main (String... args){} }");
-        assertEquals(0, SourceUtils.getMainClasses(classWithMethod3).size());
-        final FileObject classWithMethod4 = createFile(src, "C5.java","class C5 { public static void main (StringBuilder... args){} }");
-        assertEquals(0, SourceUtils.getMainClasses(classWithMethod4).size());
-        final FileObject simpleMain = createFile(src, "M1.java","class M1 { public static void main (String... args){} }");
-        assertMain(new String[] {"M1"}, SourceUtils.getMainClasses(simpleMain));
-        final FileObject simpleMain2 = createFile(src, "M2.java","public class M2 { public static void main (String... args){} }");
-        assertMain(new String[] {"M2"}, SourceUtils.getMainClasses(simpleMain2));
-        final FileObject innerMain = createFile(src, "M3.java","class M3 { public static class Inner { public static void main (String... args){} } }");
-        assertMain(new String[] {"M3.Inner"}, SourceUtils.getMainClasses(innerMain));
-        final FileObject innerMain2 = createFile(src, "M4.java","class M4 { protected static class Inner { public static void main (String... args){} } }");
-        assertMain(new String[] {"M4.Inner"}, SourceUtils.getMainClasses(innerMain2));
-        final FileObject innerMain3 = createFile(src, "M5.java","class M5 { static class Inner { public static void main (String... args){} } }");
-        assertMain(new String[] {"M5.Inner"}, SourceUtils.getMainClasses(innerMain3));
-        final FileObject innerMain4 = createFile(src, "M6.java","class M6 { private static class Inner { public static void main (String... args){} } }");
-        assertMain(new String[] {"M6.Inner"}, SourceUtils.getMainClasses(innerMain4));
-        final FileObject innerMain5 = createFile(src, "M7.java","class M7 { class Inner { public static void main (String... args){} } }");
-        assertEquals(0, SourceUtils.getMainClasses(innerMain5).size());
-        final FileObject innerMain6 = createFile(src, "M8.java","class M8 { class Inner { static class InnerInner {public static void main (String... args){} } } }");
-        assertEquals(0, SourceUtils.getMainClasses(innerMain6).size());
-        final FileObject innerMain7 = createFile(src, "M9.java","class M9 { static class Inner { static class InnerInner {public static void main (String... args){} } } }");
-        assertMain(new String[] {"M9.Inner.InnerInner"}, SourceUtils.getMainClasses(innerMain7));
-        final FileObject twoTop = createFile(src, "T1.java","class T1 { public static void main (String... args){}} class T1X {public static void main (String... args){}}");
-        assertMain(new String[] {"T1","T1X"}, SourceUtils.getMainClasses(twoTop));
-        final FileObject twoTop2 = createFile(src, "T2.java","class T2 { public static void main (String... args){} static class Inner {public static void main (String... args){}}} class T2X {public static void main (String... args){} static class Inner {public static void main (String... args){}}}");
-        assertMain(new String[] {"T2","T2X", "T2.Inner", "T2X.Inner"}, SourceUtils.getMainClasses(twoTop2));
-        final FileObject inhMain = createFile(src, "D1.java","class D1 { public static void main (String... args){}} class D1X extends D1 {}");
-        assertMain(new String[] {"D1","D1X"}, SourceUtils.getMainClasses(inhMain));
-    }
-    
-    public void testGenerateReadableParameterName() throws Exception {
-        System.out.println("testGenerateReadableParameterName");
-        Match m = new Match("java.lang.Object", "o");
-        m.match("java.lang.Runnable", "r")
-        .match("java.awt.event.ActionListener,java.awt.event.ActionListener","al,al1")
-        .match("java.io.InputStream", "in")
-        .match("java.io.OutputStream","out")
-        .match("java.io.ByteArrayOutputStream","stream")
-        .match("missingthing.Foodbar", "fdbr")
-        .match("somepackage.FillUpNoKnownMessageEverywhere", "funkme")
-        .match("java.lang.Class","type")
-        .match("java.lang.Class<T>", "type")
-        .match("org.openide.util.Lookup","lkp")
-        .match("sun.awt.KeyboardFocusManagerPeerImpl", "kfmpi")
-        .match("com.foo.BigInterface", "bi")
-        .match("java.util.concurrent.Callable<Runnable>", "clbl")
-        .match("int[]", "ints")
-        .match("short", "s")
-        .match("java.lang.Integer...", "intgrs")
-        .match("java.awt.Component[]", "cmpnts")
-        .match("int,java.lang.Runnable", "i,r")
-        .match("java.lang.Runnable[]", "rs")
-        .match("com.foo.Classwithanannoyinglylongname", "c")
-        .match("com.foo.Classwithanannoyinglylongname,foo.bar.Classwithanotherannoyinglylongname", "c,c1")
-        .match("com.foo.Classwithanannoyinglylongname,foo.bar.ClasswithLongnameButshortAcronym", "c,clba")
-        .match("com.foo.ClassWithAnAnnoyinglyLongNameThatGoesOnForever", "c");
-        m.assertMatch();
-    }
-
-    //<editor-fold defaultstate="collapsed" desc="Helper methods & Mock services">
-    
-    private void prepareTest() throws Exception {
-        File work = getWorkDir();
-        FileObject workFO = FileUtil.toFileObject(work);
-        
-        assertNotNull(workFO);
-        
-        FileObject sourceRoot = workFO.createFolder("src");
-        FileObject buildRoot  = workFO.createFolder("build");
-        FileObject cache = workFO.createFolder("cache");
-        FileObject packageRoot = sourceRoot.createFolder("sourceutils");
-        
-        SourceUtilsTestUtil.prepareTest(sourceRoot, buildRoot, cache);
-        
-        String capitalizedName = "T" + getName().substring(1);
-        
-        TestUtil.copyFiles(FileUtil.toFile(sourceRoot), "sourceutils/" + capitalizedName + ".java");
-        
-        packageRoot.refresh();
-        
-        FileObject testSource = packageRoot.getFileObject(capitalizedName + ".java");
-        
-        assertNotNull(testSource);
-
-        SourceUtilsTestUtil.compileRecursively(sourceRoot);
-        
-        js = JavaSource.forFileObject(testSource);
-        
-        assertNotNull(js);
-        
-        info = SourceUtilsTestUtil.getCompilationInfo(js, JavaSource.Phase.RESOLVED);
-        
-        assertNotNull(info);
-    }
-
-    private void assertEquals (URL[] expected, Set<URL> result) {
-        assertEquals (expected.length,result.size());
-        for (URL eurl : expected) {
-            assertTrue (result.remove(eurl));
-        }
-        assertTrue(result.isEmpty());
-    }
-
-    private <E extends Element> E findElementBySimpleName(String simpleName, List<E> elements) {
-        for (E e : elements) {
-            if (simpleName.contentEquals(e.getSimpleName()))
-                return e;
-        }
-
-        fail("Not found element with simple name: " + simpleName);
-
-        throw new Error("Should never be here!");
-    }
-
-    private void assertMain(final String[] expected, final Iterable<? extends ElementHandle<TypeElement>> result) {
-        final Set<String> es = new HashSet<String>(Arrays.asList(expected));
-        for (ElementHandle<TypeElement> r : result) {
-            assertTrue(es.remove(r.getQualifiedName()));
-        }
-        assertTrue(es.isEmpty());
-    }
-
-
-    private static FileObject createFile (final FileObject folder, final String name, final String content) throws IOException {
-        final FileObject fo = FileUtil.createData(folder, name);
-        final FileLock lock = fo.lock();
-        try {
-            final OutputStream out = fo.getOutputStream(lock);
-            try {
-                FileUtil.copy(new ByteArrayInputStream(content.getBytes()), out);
-            } finally {
-                out.close();
-            }
-        } finally {
-            lock.releaseLock();
-        }
-        return fo;
-    }
     
     
     private static class SFBQImpl implements SourceForBinaryQueryImplementation {
@@ -518,7 +451,36 @@
             return instance;
         }
     }
-    
+
+    public void testGenerateReadableParameterName() throws Exception {
+        System.out.println("testGenerateReadableParameterName");
+        Match m = new Match("java.lang.Object", "o");
+        m.match("java.lang.Runnable", "r")
+        .match("java.awt.event.ActionListener,java.awt.event.ActionListener","al,al1")
+        .match("java.io.InputStream", "in")
+        .match("java.io.OutputStream","out")
+        .match("java.io.ByteArrayOutputStream","stream")
+        .match("missingthing.Foodbar", "fdbr")
+        .match("somepackage.FillUpNoKnownMessageEverywhere", "funkme")
+        .match("java.lang.Class","type")
+        .match("java.lang.Class<T>", "type")
+        .match("org.openide.util.Lookup","lkp")
+        .match("sun.awt.KeyboardFocusManagerPeerImpl", "kfmpi")
+        .match("com.foo.BigInterface", "bi")
+        .match("java.util.concurrent.Callable<Runnable>", "clbl")
+        .match("int[]", "ints")
+        .match("short", "s")
+        .match("java.lang.Integer...", "intgrs")
+        .match("java.awt.Component[]", "cmpnts")
+        .match("int,java.lang.Runnable", "i,r")
+        .match("java.lang.Runnable[]", "rs")
+        .match("com.foo.Classwithanannoyinglylongname", "c")
+        .match("com.foo.Classwithanannoyinglylongname,foo.bar.Classwithanotherannoyinglylongname", "c,c1")
+        .match("com.foo.Classwithanannoyinglylongname,foo.bar.ClasswithLongnameButshortAcronym", "c,clba")
+        .match("com.foo.ClassWithAnAnnoyinglyLongNameThatGoesOnForever", "c");
+        m.assertMatch();
+    }
+
     private static final class Match {
         private String[] fqns;
         private String[] names;
@@ -551,5 +513,99 @@
             return next;
         }
     }
-    //</editor-fold>
+    
+//    //tests for SourceUtils.filterSupportedMIMETypes:
+//
+//    @SuppressWarnings("deprecation")
+//    public void testFilter() throws Exception {
+//        SourceUtilsTestUtil.setLookup(new Object[] {new JavaSourceProviderImpl(), new ResolverImpl()}, SourceUtilsTest.class.getClassLoader());
+//        boolean registered = false;
+//        
+//        for (JavaSourceProvider p : Lookup.getDefault().lookupAll(JavaSourceProvider.class)) {
+//            if (p instanceof JavaSourceProvider) {
+//                registered = true;
+//                break;
+//            }
+//        }
+//        
+//        assertTrue(registered);
+//        
+//        FileObject work = FileUtil.toFileObject(getWorkDir());
+//        
+//        FileObject file1 = FileUtil.createData(work, "test.ext1");
+//        FileObject file2 = FileUtil.createData(work, "test.ext2");
+//        FileObject file3 = FileUtil.createData(work, "test.ext3");
+//        FileObject file4 = FileUtil.createData(work, "test.ext4");
+//        FileObject file5 = FileUtil.createData(work, "test.txt");
+//        FileObject file6 = FileUtil.createData(work, "test.ant");
+//
+//        assertEquals("text/x-java", FileUtil.getMIMEType(file1));
+//        assertEquals("text/jsp", FileUtil.getMIMEType(file2));
+//        assertEquals("text/plain", FileUtil.getMIMEType(file3));
+//        assertEquals("text/test+x-java", FileUtil.getMIMEType(file4));
+//        assertEquals("text/test+x-ant+xml", FileUtil.getMIMEType(file6));
+//        
+//        List<FileObject> files = Arrays.asList(file1, file2, file3, file4, file5, file6);
+//        
+//        assertEquals(Arrays.asList(file1, file2, file3, file4, file6), SourceUtils.filterSupportedMIMETypes(files, F1.class));
+//        assertEquals(Arrays.asList(file1, file4), SourceUtils.filterSupportedMIMETypes(files, F2.class));
+//        assertEquals(Arrays.asList(file4), SourceUtils.filterSupportedMIMETypes(files, F3.class));
+//        assertEquals(Arrays.asList(file1, file4), SourceUtils.filterSupportedMIMETypes(files, F4.class));
+//        assertEquals(Arrays.asList(file1, file2, file4), SourceUtils.filterSupportedMIMETypes(files, F5.class));
+//    }
+//    
+//    public static class JavaSourceProviderImpl implements JavaSourceProvider {
+//        public PositionTranslatingJavaFileFilterImplementation forFileObject(FileObject fo) {
+//            if ("txt".equals(fo.getExt()))
+//                return null;
+//            
+//            return new PositionTranslatingJavaFileFilterImplementation() {
+//                public int getOriginalPosition(int javaSourcePosition) {
+//                    return javaSourcePosition;
+//                }
+//                public int getJavaSourcePosition(int originalPosition) {
+//                    return originalPosition;
+//                }
+//                public Reader filterReader(Reader r) {
+//                    return r;
+//                }
+//                public CharSequence filterCharSequence(CharSequence charSequence) {
+//                    return charSequence;
+//                }
+//                public Writer filterWriter(Writer w) {
+//                    return w;
+//                }
+//                public void addChangeListener(ChangeListener listener) {}
+//                public void removeChangeListener(ChangeListener listener) {}
+//            };
+//        }
+//    }
+//    
+//    public static class ResolverImpl extends MIMEResolver {
+//        public String findMIMEType(FileObject fo) {
+//            String ext = fo.getExt();
+//            
+//            if ("ext1".contains(ext)) return "text/x-java";
+//            if ("ext2".contains(ext)) return "text/jsp";
+//            if ("ext3".contains(ext)) return "text/plain";
+//            if ("ext4".contains(ext)) return "text/test+x-java";
+//            if ("ant".contains(ext)) return "text/test+x-ant+xml";
+//            
+//            return null;
+//        }
+//    }
+//    
+//    @SupportedMimeTypes("*")
+//    private static class F1 {}
+//    
+//    @SupportedMimeTypes("text/x-java")
+//    private static class F2 {}
+//    
+//    @SupportedMimeTypes("text/test+x-java")
+//    private static class F3 {}
+//    
+//    private static class F4 {}
+//    
+//    @SupportedMimeTypes({"text/x-java", "text/jsp"})
+//    private static class F5 {}
 }
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -45,14 +45,12 @@
 package org.netbeans.api.java.source;
 
 import com.sun.source.tree.ClassTree;
-import com.sun.source.tree.MethodTree;
 import com.sun.source.tree.Tree.Kind;
 import com.sun.source.tree.VariableTree;
 import com.sun.source.util.TreePath;
 import java.io.File;
 import java.io.OutputStream;
 import java.security.Permission;
-import javax.lang.model.element.Element;
 import javax.lang.model.element.TypeElement;
 import org.netbeans.api.java.source.JavaSource.Phase;
 import org.netbeans.junit.NbTestCase;
@@ -338,32 +336,6 @@
         assertTrue(tp.getLeaf() == resolved.getLeaf());
     }
 
-    public void testFromElementHandle() throws Exception {
-        FileObject file = FileUtil.createData(sourceRoot, "test/test.java");
-        String code = "package test;\n" +
-                      "public class Test {\n" +
-                      "    public static void test() {\n" +
-                      "    }\n" +
-                      "}";
-
-        writeIntoFile(file,code);
-
-        JavaSource js = JavaSource.forFileObject(file);
-        CompilationInfo info = SourceUtilsTestUtil.getCompilationInfo(js, Phase.RESOLVED);
-
-        ClassTree clazz = (ClassTree) info.getCompilationUnit().getTypeDecls().get(0);
-        MethodTree method = (MethodTree) clazz.getMembers().get(1);
-        TreePath tp = TreePath.getPath(info.getCompilationUnit(), method);
-        Element el = info.getTrees().getElement(tp);
-        ElementHandle<?> elHandle = ElementHandle.create(el);
-        TreePathHandle handle   = TreePathHandle.from(elHandle, info.getClasspathInfo());
-        TreePath       resolved = handle.resolve(info);
-
-        assertNotNull(resolved);
-
-        assertTrue(tp.getLeaf() == resolved.getLeaf());
-    }
-
     private static final class SecMan extends SecurityManager {
 
         @Override
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -331,10 +331,6 @@
         performTest("package test;\npublic class Test extends XX {\nprivate int test;\n}\nclass XX {\npublic XX(boolean b){\n}\n}\n", new ConstructorTask(30), new ConstructorValidator());
     }
 
-    public void testConstructor197192() throws Exception {
-        performTest("package test;\npublic class Test extends XX {\nprivate int test;\n}\nclass XX {\npublic XX(String... args){\n}\n}\n", new ConstructorTask(30), new ConstructorValidator());
-    }
-
     public void testConstructor100341() throws Exception {
         performTest("package test;\npublic class Test extends java.util.ArrayList<String> {\n}\n", new ALConstructorTask(30), null);
     }
@@ -818,8 +814,6 @@
             ExecutableElement ctor = ctors.get(0);
 
             assertEquals(supCtor == null ? 1 : 2, ctor.getParameters().size());
-            if (supCtor != null)
-                assertEquals(supCtor.isVarArgs(), ctor.isVarArgs());
         }
 
     }
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -509,34 +509,6 @@
         src.runModificationTask(task);
 
     }
-
-    public void test197057() throws Exception {
-        File testFile = new File(work, "Test.java");
-        final String origin =
-                       "package test;\n" +
-                       "public class Test {\n public void aa() {\n//aa\n } public void bb() {\n//bb\n } }\n";
-        TestUtilities.copyStringToFile(testFile, origin);
-        JavaSource src = getJavaSource(testFile);
-
-        Task<WorkingCopy> task = new Task<WorkingCopy>() {
-            public void run(final WorkingCopy workingCopy) throws Exception {
-                workingCopy.toPhase(JavaSource.Phase.PARSED);
-                ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0);
-                MethodTree a = (MethodTree) clazz.getMembers().get(0);
-                MethodTree b = (MethodTree) clazz.getMembers().get(1);
-
-                a = GeneratorUtilities.get(workingCopy).importComments(a, workingCopy.getCompilationUnit());
-                b = GeneratorUtilities.get(workingCopy).importComments(b, workingCopy.getCompilationUnit());
-
-                final CommentHandlerService service = CommentHandlerService.instance(workingCopy.impl.getJavacTask().getContext());
-
-                verify(a.getBody(), CommentSet.RelativePosition.INNER, service, "", "//aa");
-                verify(b.getBody(), CommentSet.RelativePosition.INNER, service, "", "//bb");
-            }
-        };
-        src.runModificationTask(task);
-
-    }
     
     void verify(Tree tree, CommentSet.RelativePosition position, CommentHandler service, String... comments) {
         assertNotNull("Comments handler service not null", service);
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -88,7 +88,6 @@
 import java.util.List;
 import java.util.Set;
 import java.util.concurrent.TimeUnit;
-import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.logging.Handler;
 import javax.swing.text.BadLocationException;
@@ -1209,12 +1208,7 @@
         rutStart.await();
         res = js.runWhenScanFinished(new T(latch), true);
         assertEquals(1,latch.getCount());
-        try {
-            res.get(1,TimeUnit.SECONDS);
-            assertTrue(false);
-        } catch (TimeoutException te) {
-            //Pass
-        }
+        res.get(1,TimeUnit.SECONDS);
         assertFalse(res.isDone());
         assertFalse (res.isCancelled());
         rutLatch.countDown();
@@ -1231,23 +1225,13 @@
         rutStart.await();
         res = js.runWhenScanFinished(new T(latch), true);
         assertEquals(1,latch.getCount());
-        try {
-            res.get(1,TimeUnit.SECONDS);
-            assertTrue(false);
-        } catch (TimeoutException te) {
-            //Pass
-        }
+        res.get(1,TimeUnit.SECONDS);
         assertFalse(res.isDone());
         assertFalse (res.isCancelled());
         assertTrue (res.cancel(false));
         rutLatch.countDown();
         assertFalse(latch.await(3, TimeUnit.SECONDS));
-        try {
-            res.get(1,TimeUnit.SECONDS);
-            assertTrue(false);
-        } catch (TimeoutException te) {
-            //Pass
-        }
+        res.get(1,TimeUnit.SECONDS);
         assertFalse(res.isDone());
         assertTrue (res.isCancelled());
     }
@@ -2186,7 +2170,7 @@
 
     }
 
-    private static class TestIndex implements Index.WithStatus {
+    private static class TestIndex implements Index {
         //Activate the TestIndex.await after scan is done
         //during the scan the prebuildArgs may call the index
         //and cause deadlock
@@ -2197,17 +2181,12 @@
         }
 
         @Override
-        public Status getStatus(boolean tryOpen) throws IOException {
-            return Status.VALID;
-        }
-
-        @Override
-        public boolean exists() {
+        public boolean isValid(boolean tryOpen) throws IOException {
             return true;
         }
 
         @Override
-        public boolean isValid(boolean tryOpen) throws IOException {
+        public boolean exists() {
             return true;
         }
 
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -44,14 +44,11 @@
 package org.netbeans.api.java.source.gen;
 
 import com.sun.source.tree.*;
-import com.sun.source.util.TreeScanner;
 import java.io.File;
 import java.io.IOException;
-import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.EnumSet;
-import java.util.List;
 import javax.lang.model.element.Modifier;
 import org.netbeans.api.java.source.Task;
 import org.netbeans.api.java.source.JavaSource;
@@ -114,7 +111,7 @@
                 TryTree tt = make.Try(make.Block(Collections.<StatementTree>emptyList(), false),
                                       Collections.singletonList(make.Catch(make.Variable(make.Modifiers(EnumSet.of(Modifier.FINAL)),
                                                                                          "ex",
-                                                                                         make.UnionType(Arrays.asList(make.Identifier("java.net.MalformedURLException"),
+                                                                                         make.DisjunctiveType(Arrays.asList(make.Identifier("java.net.MalformedURLException"),
                                                                                                                             make.Identifier("java.io.IOException"))
                                                                                                           ),
                                                                                          null),
@@ -129,202 +126,6 @@
         System.err.println(res);
         assertEquals(golden, res);
     }
-
-    public void testRenameInMultiCatch() throws Exception {
-        testFile = new File(getWorkDir(), "Test.java");
-        TestUtilities.copyStringToFile(testFile,
-            "package hierbas.del.litoral;\n" +
-            "import java.io.*;\n" +
-            "import java.net.*;\n" +
-            "public class Test {\n" +
-            "    public void taragui() {\n" +
-            "        try {\n" +
-            "        } catch (MalformedURLException | FileNotFoundException ex) {\n" +
-            "        }\n" +
-            "    }\n" +
-            "}\n"
-            );
-        String golden =
-            "package hierbas.del.litoral;\n" +
-            "import java.io.*;\n" +
-            "import java.net.*;\n" +
-            "public class Test {\n" +
-            "    public void taragui() {\n" +
-            "        try {\n" +
-            "        } catch (MalformedURLException | IOException ex) {\n" +
-            "        }\n" +
-            "    }\n" +
-            "}\n";
-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
-        Task task = new Task<WorkingCopy>() {
-
-            public void run(final WorkingCopy workingCopy) throws IOException {
-                workingCopy.toPhase(Phase.RESOLVED);
-                final TreeMaker make = workingCopy.getTreeMaker();
-
-                new TreeScanner<Void, Void>() {
-                    @Override public Void visitIdentifier(IdentifierTree node, Void p) {
-                        if (node.getName().contentEquals("FileNotFoundException")) {
-                            workingCopy.rewrite(node, make.Identifier("IOException"));
-                        }
-                        return super.visitIdentifier(node, p);
-                    }
-                }.scan(workingCopy.getCompilationUnit(), null);
-            }
-
-        };
-        testSource.runModificationTask(task).commit();
-        String res = TestUtilities.copyFileToString(testFile);
-        System.err.println(res);
-        assertEquals(golden, res);
-    }
-
-    public void testAddLastToMultiCatch() throws Exception {
-        testFile = new File(getWorkDir(), "Test.java");
-        TestUtilities.copyStringToFile(testFile,
-            "package hierbas.del.litoral;\n" +
-            "import java.io.*;\n" +
-            "import java.net.*;\n" +
-            "public class Test {\n" +
-            "    public void taragui() {\n" +
-            "        try {\n" +
-            "        } catch (MalformedURLException | FileNotFoundException ex) {\n" +
-            "        }\n" +
-            "    }\n" +
-            "}\n"
-            );
-        String golden =
-            "package hierbas.del.litoral;\n" +
-            "import java.io.*;\n" +
-            "import java.net.*;\n" +
-            "public class Test {\n" +
-            "    public void taragui() {\n" +
-            "        try {\n" +
-            "        } catch (MalformedURLException | FileNotFoundException | IOException ex) {\n" +
-            "        }\n" +
-            "    }\n" +
-            "}\n";
-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
-        Task task = new Task<WorkingCopy>() {
-
-            public void run(final WorkingCopy workingCopy) throws IOException {
-                workingCopy.toPhase(Phase.RESOLVED);
-                final TreeMaker make = workingCopy.getTreeMaker();
-
-                new TreeScanner<Void, Void>() {
-                    @Override public Void visitUnionType(UnionTypeTree node, Void p) {
-                        List<Tree> alternatives = new ArrayList<Tree>(node.getTypeAlternatives());
-                        alternatives.add(make.Identifier("IOException"));
-                        workingCopy.rewrite(node, make.UnionType(alternatives));
-                        return null;
-                    }
-                }.scan(workingCopy.getCompilationUnit(), null);
-            }
-
-        };
-        testSource.runModificationTask(task).commit();
-        String res = TestUtilities.copyFileToString(testFile);
-        System.err.println(res);
-        assertEquals(golden, res);
-    }
-
-    public void testAddFirstToMultiCatch() throws Exception {
-        testFile = new File(getWorkDir(), "Test.java");
-        TestUtilities.copyStringToFile(testFile,
-            "package hierbas.del.litoral;\n" +
-            "import java.io.*;\n" +
-            "import java.net.*;\n" +
-            "public class Test {\n" +
-            "    public void taragui() {\n" +
-            "        try {\n" +
-            "        } catch (MalformedURLException | FileNotFoundException ex) {\n" +
-            "        }\n" +
-            "    }\n" +
-            "}\n"
-            );
-        String golden =
-            "package hierbas.del.litoral;\n" +
-            "import java.io.*;\n" +
-            "import java.net.*;\n" +
-            "public class Test {\n" +
-            "    public void taragui() {\n" +
-            "        try {\n" +
-            "        } catch (IOException | MalformedURLException | FileNotFoundException ex) {\n" +
-            "        }\n" +
-            "    }\n" +
-            "}\n";
-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
-        Task task = new Task<WorkingCopy>() {
-
-            public void run(final WorkingCopy workingCopy) throws IOException {
-                workingCopy.toPhase(Phase.RESOLVED);
-                final TreeMaker make = workingCopy.getTreeMaker();
-
-                new TreeScanner<Void, Void>() {
-                    @Override public Void visitUnionType(UnionTypeTree node, Void p) {
-                        List<Tree> alternatives = new ArrayList<Tree>(node.getTypeAlternatives());
-                        alternatives.add(0, make.Identifier("IOException"));
-                        workingCopy.rewrite(node, make.UnionType(alternatives));
-                        return null;
-                    }
-                }.scan(workingCopy.getCompilationUnit(), null);
-            }
-
-        };
-        testSource.runModificationTask(task).commit();
-        String res = TestUtilities.copyFileToString(testFile);
-        System.err.println(res);
-        assertEquals(golden, res);
-    }
-
-    public void testAddMiddleToMultiCatch() throws Exception {
-        testFile = new File(getWorkDir(), "Test.java");
-        TestUtilities.copyStringToFile(testFile,
-            "package hierbas.del.litoral;\n" +
-            "import java.io.*;\n" +
-            "import java.net.*;\n" +
-            "public class Test {\n" +
-            "    public void taragui() {\n" +
-            "        try {\n" +
-            "        } catch (MalformedURLException | FileNotFoundException ex) {\n" +
-            "        }\n" +
-            "    }\n" +
-            "}\n"
-            );
-        String golden =
-            "package hierbas.del.litoral;\n" +
-            "import java.io.*;\n" +
-            "import java.net.*;\n" +
-            "public class Test {\n" +
-            "    public void taragui() {\n" +
-            "        try {\n" +
-            "        } catch (MalformedURLException | IOException | FileNotFoundException ex) {\n" +
-            "        }\n" +
-            "    }\n" +
-            "}\n";
-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
-        Task task = new Task<WorkingCopy>() {
-
-            public void run(final WorkingCopy workingCopy) throws IOException {
-                workingCopy.toPhase(Phase.RESOLVED);
-                final TreeMaker make = workingCopy.getTreeMaker();
-
-                new TreeScanner<Void, Void>() {
-                    @Override public Void visitUnionType(UnionTypeTree node, Void p) {
-                        List<Tree> alternatives = new ArrayList<Tree>(node.getTypeAlternatives());
-                        alternatives.add(1, make.Identifier("IOException"));
-                        workingCopy.rewrite(node, make.UnionType(alternatives));
-                        return null;
-                    }
-                }.scan(workingCopy.getCompilationUnit(), null);
-            }
-
-        };
-        testSource.runModificationTask(task).commit();
-        String res = TestUtilities.copyFileToString(testFile);
-        System.err.println(res);
-        assertEquals(golden, res);
-    }
     
     String getGoldenPckg() {
         return "";
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -904,42 +904,6 @@
         assertEquals(golden, res);
     }
 
-    public void testParameterAnnotations() throws Exception {
-        testFile = new File(getWorkDir(), "Test.java");
-        String code = "package hierbas.del.litoral;\n" +
-                      "\n" +
-                      "public class Test {\n\n" +
-                      "    public Test() {\n" +
-                      "    }\n\n" +
-                      "    public void test() {\n" +
-                      "    }\n" +
-                      "}\n";
-
-        code = Reformatter.reformat(code, CodeStyle.getDefault(FileUtil.toFileObject(testFile)));
-        TestUtilities.copyStringToFile(testFile, code);
-
-        JavaSource src = getJavaSource(testFile);
-        Task task = new Task<WorkingCopy>() {
-
-            public void run(final WorkingCopy workingCopy) throws IOException {
-                workingCopy.toPhase(Phase.RESOLVED);
-
-                NewClassTree nct = (NewClassTree) workingCopy.getTreeUtilities().parseExpression("new Object() { public int a(@Test1(a=1) @Test2(b=2) int i, @Test1 @Test2 int j) { return 0; }", new SourcePositions[1]);
-                ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0);
-                workingCopy.rewrite(clazz, workingCopy.getTreeMaker().addClassMember(clazz, nct.getClassBody().getMembers().get(0)));
-            }
-
-        };
-        src.runModificationTask(task).commit();
-        String res = TestUtilities.copyFileToString(testFile);
-        String formattedRes = Reformatter.reformat(res, CodeStyle.getDefault(FileUtil.toFileObject(testFile)));
-        System.err.println(res);
-        res = res.replaceAll("\n[ ]*\n", "\n");
-        System.err.println(formattedRes);
-        formattedRes = formattedRes.replaceAll("\n[ ]*\n", "\n"); //XXX: workaround for a bug in reformatter
-        assertEquals(formattedRes, res);
-    }
-
     private void setValues(Preferences p, Map<String, String> values) {
         for (Entry<String, String> e : values.entrySet()) {
             if (e.getValue() != null) {
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -43,10 +43,6 @@
  */
 package org.netbeans.api.java.source.gen;
 
-import com.sun.source.util.TreePath;
-import org.openide.cookies.EditorCookie;
-import org.openide.filesystems.FileUtil;
-import org.openide.loaders.DataObject;
 import java.io.File;
 import java.io.IOException;
 import java.util.Collections;
@@ -63,7 +59,7 @@
 
 /**
  *
- * @author Pavel Flaska, Jan Becicka
+ * @author Pavel Flaska
  */
 public class RefactoringRegressionsTest extends GeneratorTestMDRCompat {
 
@@ -736,110 +732,6 @@
         assertEquals(golden, res);
     }
 
-    public void test197057() throws Exception {
-        System.err.println("test197057");
-
-
-        testFile = new File(getWorkDir(), "Test.java");
-        TestUtilities.copyStringToFile(testFile,
-            "package personal;\n" +
-            "\n" +
-            "public class Test {\n" +
-            "    private void a() {\n" +
-            "       //a\n" +
-            "    }\n" +
-            "    private void b() {\n" +
-            "       //b\n" +
-            "    }\n" +
-            "}\n" +
-            "class A {\n" +
-            "}\n");
-
-
-
-         String golden =
-            "package personal;\n" +
-            "\n" +
-            "public class Test {\n" +
-            "    private void a() {\n" +
-            "       //a\n" +
-            "    }\n" +
-            "    private void b() {\n" +
-            "       //b\n" +
-            "    }\n" +
-            "}\n" +
-            "class A {\n\n" +
-            "    private void a() {\n" +
-            "        //a\n" +
-            "    }\n\n" +
-            "    private void b() {\n" +
-            "        //b\n" +
-            "    }\n" +
-            "}\n";
-
-
-
-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
-        Task task = new Task<WorkingCopy>() {
-
-            public void run(WorkingCopy workingCopy) throws java.io.IOException {
-                workingCopy.toPhase(Phase.RESOLVED);
-                TreeMaker make = workingCopy.getTreeMaker();
-                ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0);
-                ClassTree dest = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(1);
-                ClassTree newDest;
-
-                MethodTree a = (MethodTree) clazz.getMembers().get(1);
-                MethodTree b = (MethodTree) clazz.getMembers().get(2);
-
-                GeneratorUtilities genUtils = GeneratorUtilities.get(workingCopy);
-                TreePath mpath = workingCopy.getTrees().getPath(workingCopy.getCompilationUnit(), a);
-                Tree newMethodTree = genUtils.importComments(mpath.getLeaf(), mpath.getCompilationUnit());
-                newMethodTree = genUtils.importFQNs(newMethodTree);
-
-                MethodTree oldOne = (MethodTree) newMethodTree;
-                MethodTree newm = make.Method(
-                        oldOne.getModifiers(),
-                        oldOne.getName(),
-                        oldOne.getReturnType(),
-                        oldOne.getTypeParameters(),
-                        oldOne.getParameters(),
-                        oldOne.getThrows(),
-                        oldOne.getBody(),
-                        (ExpressionTree) oldOne.getDefaultValue());
-                //RetoucheUtils.copyJavadoc(methodElm, m, workingCopy);
-                newDest = genUtils.insertClassMember(dest, newm);
-
-                mpath = workingCopy.getTrees().getPath(workingCopy.getCompilationUnit(), b);
-                newMethodTree = genUtils.importComments(mpath.getLeaf(), mpath.getCompilationUnit());
-                newMethodTree = genUtils.importFQNs(newMethodTree);
-
-                oldOne = (MethodTree) newMethodTree;
-                newm = make.Method(
-                        oldOne.getModifiers(),
-                        oldOne.getName(),
-                        oldOne.getReturnType(),
-                        oldOne.getTypeParameters(),
-                        oldOne.getParameters(),
-                        oldOne.getThrows(),
-                        oldOne.getBody(),
-                        (ExpressionTree) oldOne.getDefaultValue());
-                //RetoucheUtils.copyJavadoc(methodElm, m, workingCopy);
-                newDest = genUtils.insertClassMember(newDest, newm);
-
-                workingCopy.rewrite(dest, newDest);
-            }
-        };
-        testSource.runModificationTask(task).commit();
-        DataObject d = DataObject.find(FileUtil.toFileObject(testFile));
-        EditorCookie ec = d.getLookup().lookup(EditorCookie.class);
-        ec.saveDocument();
-
-        String res = TestUtilities.copyFileToString(testFile);
-        System.err.println(res);
-        assertEquals(golden, res);
-    }
-    
     String getGoldenPckg() {
         return "";
     }
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -1485,6 +1485,7 @@
                 ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0);
                 GeneratorUtilities.get(workingCopy).importComments(clazz, cut);
                 ClassTree newClazz = make.setLabel(clazz, clazz.getSimpleName());
+                GeneratorUtilities.get(workingCopy).copyComments(clazz, newClazz, true);
                 make.removeComment(newClazz, 0, true);
                 workingCopy.rewrite(clazz, newClazz);
             }
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java	2011-08-03 23:01:41.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java	2011-08-03 23:01:41.000000000 +0100
@@ -604,46 +604,6 @@
         Utils.setCodePreferences(origValues);
     }
 
-    public void testCLikeArray() throws Exception {
-        testFile = new File(getWorkDir(), "Test.java");
-        TestUtilities.copyStringToFile(testFile,
-            "package hierbas.del.litoral;\n\n" +
-            "public class Test {\n" +
-            "    public int taragui() {\n" +
-            "        int ii[] = null;" +
-            "    }\n" +
-            "}\n"
-            );
-        String golden =
-            "package hierbas.del.litoral;\n\n" +
-            "public class Test {\n" +
-            "    public int taragui(int[] a) {\n" +
-            "        int ii[] = null;" +
-            "    }\n" +
-            "}\n";
-
-        JavaSource src = getJavaSource(testFile);
-        Task<WorkingCopy> task = new Task<WorkingCopy>() {
-
-            public void run(WorkingCopy workingCopy) throws IOException {
-                workingCopy.toPhase(Phase.RESOLVED);
-                CompilationUnitTree cut = workingCopy.getCompilationUnit();
-                ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0);
-                MethodTree method = (MethodTree) clazz.getMembers().get(1);
-                VariableTree var = (VariableTree) method.getBody().getStatements().get(0);
-                TreeMaker make = workingCopy.getTreeMaker();
-                VariableTree param = workingCopy.getTreeMaker().Variable(make.Modifiers(EnumSet.noneOf(Modifier.class)), "a", var.getType(), null);
-
-                workingCopy.rewrite(method, make.addMethodParameter(method, param));
-            }
-
-        };
-        src.runModificationTask(task).commit();
-        String res = TestUtilities.copyFileToString(testFile);
-        System.err.println(res);
-        assertEquals(golden, res);
-    }
-
     String getGoldenPckg() {
         return "";
     }
