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

Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/DelegateMethodGenerator.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/DelegateMethodGenerator.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/DelegateMethodGenerator.java	2011-08-04 21:48:28.718408699 +0100
@@ -119,26 +119,21 @@
             } catch (IOException ioe) {
                 return ret;
             }
-            TypeElement typeElement = (TypeElement) controller.getTrees().getElement(path);
-            if (typeElement == null || !typeElement.getKind().isClass())
-                return ret;
             List<ElementNode.Description> descriptions = computeUsableFieldsDescriptions(controller, path);
             if (!descriptions.isEmpty()) {
                 Collections.reverse(descriptions);
-                ret.add(new DelegateMethodGenerator(component, ElementHandle.create(typeElement), ElementNode.Description.create(descriptions)));
+                ret.add(new DelegateMethodGenerator(component, ElementNode.Description.create(descriptions)));
             }
             return ret;
         }
     }
 
     private JTextComponent component;
-    private ElementHandle<TypeElement> handle;
     private ElementNode.Description description;
     
     /** Creates a new instance of DelegateMethodGenerator */
-    private DelegateMethodGenerator(JTextComponent component, ElementHandle<TypeElement> handle, ElementNode.Description description) {
+    private DelegateMethodGenerator(JTextComponent component, ElementNode.Description description) {
         this.component = component;
-        this.handle = handle;
         this.description = description;
     }
 
@@ -163,21 +158,15 @@
                     ModificationResult mr = js.runModificationTask(new Task<WorkingCopy>() {
                         public void run(WorkingCopy copy) throws IOException {
                             copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
-                            Element e = handle.resolve(copy);
-                            TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset);
+                            TreePath path = copy.getTreeUtilities().pathFor(caretOffset);
                             path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path);
-                            if (path == null) {
-                                String message = NbBundle.getMessage(DelegateMethodGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N
-                                org.netbeans.editor.Utilities.setStatusBoldText(component, message);
-                            } else {
-                                int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
-                                ElementHandle<? extends Element> handle = panel.getDelegateField();
-                                VariableElement delegate = handle != null ? (VariableElement)handle.resolve(copy) : null;
-                                ArrayList<ExecutableElement> methods = new ArrayList<ExecutableElement>();
-                                for (ElementHandle<? extends Element> elementHandle : panel.getDelegateMethods())
-                                    methods.add((ExecutableElement)elementHandle.resolve(copy));
-                                generateDelegatingMethods(copy, path, delegate, methods, idx);
-                            }
+                            int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
+                            ElementHandle<? extends Element> handle = panel.getDelegateField();
+                            VariableElement delegate = handle != null ? (VariableElement)handle.resolve(copy) : null;
+                            ArrayList<ExecutableElement> methods = new ArrayList<ExecutableElement>();
+                            for (ElementHandle<? extends Element> elementHandle : panel.getDelegateMethods())
+                                methods.add((ExecutableElement)elementHandle.resolve(copy));
+                            generateDelegatingMethods(copy, path, delegate, methods, idx);
                         }
                     });
                     GeneratorUtils.guardedCommit(component, mr);
@@ -231,6 +220,10 @@
 
     static List<ElementNode.Description> computeUsableFieldsDescriptions(CompilationInfo info, TreePath path) {
         Elements elements = info.getElements();
+        TypeElement typeElement = (TypeElement) info.getTrees().getElement(path);
+        if (typeElement == null || !typeElement.getKind().isClass()) {
+            return Collections.emptyList();
+        }
         Trees trees = info.getTrees();
         Scope scope = trees.getScope(path);
         Map<Element, List<ElementNode.Description>> map = new LinkedHashMap<Element, List<ElementNode.Description>>();
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/GetterSetterGenerator.java	2011-08-04 21:48:28.718408699 +0100
@@ -45,6 +45,7 @@
 
 import org.netbeans.spi.editor.codegen.CodeGenerator;
 import com.sun.source.tree.ClassTree;
+import com.sun.source.tree.Tree;
 import com.sun.source.util.TreePath;
 import java.awt.Dialog;
 import java.io.IOException;
@@ -212,19 +213,13 @@
                     ModificationResult mr = js.runModificationTask(new Task<WorkingCopy>() {
                         public void run(WorkingCopy copy) throws IOException {
                             copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
-                            Element e = description.getElementHandle().resolve(copy);
-                            TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset);
+                            TreePath path = copy.getTreeUtilities().pathFor(caretOffset);
                             path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path);
-                            if (path == null) {
-                                String message = NbBundle.getMessage(GetterSetterGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N
-                                org.netbeans.editor.Utilities.setStatusBoldText(component, message);
-                            } else {
-                                int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
-                                ArrayList<VariableElement> variableElements = new ArrayList<VariableElement>();
-                                for (ElementHandle<? extends Element> elementHandle : panel.getVariables())
-                                    variableElements.add((VariableElement)elementHandle.resolve(copy));
-                                GeneratorUtils.generateGettersAndSetters(copy, path, variableElements, type, idx);
-                            }
+                            int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
+                            ArrayList<VariableElement> variableElements = new ArrayList<VariableElement>();
+                            for (ElementHandle<? extends Element> elementHandle : panel.getVariables())
+                                variableElements.add((VariableElement)elementHandle.resolve(copy));
+                            GeneratorUtils.generateGettersAndSetters(copy, path, variableElements, type, idx);
                         }
                     });
                     GeneratorUtils.guardedCommit(component, mr);
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ImplementOverrideMethodGenerator.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/ImplementOverrideMethodGenerator.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ImplementOverrideMethodGenerator.java	2011-08-04 21:48:28.718408699 +0100
@@ -110,7 +110,7 @@
             for (Map.Entry<Element, List<ElementNode.Description>> entry : map.entrySet())
                 implementDescriptions.add(ElementNode.Description.create(controller, entry.getKey(), entry.getValue(), false, false));
             if (!implementDescriptions.isEmpty())
-                ret.add(new ImplementOverrideMethodGenerator(component, ElementHandle.create(typeElement), ElementNode.Description.create(implementDescriptions), true));
+                ret.add(new ImplementOverrideMethodGenerator(component, ElementNode.Description.create(implementDescriptions), true));
             map = new LinkedHashMap<Element, List<ElementNode.Description>>();
             ArrayList<Element> orderedElements = new ArrayList<Element>();
             for (ExecutableElement method : GeneratorUtils.findOverridable(controller, typeElement)) {
@@ -128,20 +128,18 @@
             for (Element e : orderedElements)
                 overrideDescriptions.add(ElementNode.Description.create(controller, e, map.get( e ), false, false));
             if (!overrideDescriptions.isEmpty())
-                ret.add(new ImplementOverrideMethodGenerator(component, ElementHandle.create(typeElement), ElementNode.Description.create(overrideDescriptions), false));
+                ret.add(new ImplementOverrideMethodGenerator(component, ElementNode.Description.create(overrideDescriptions), false));
             return ret;
         }
     }
 
     private JTextComponent component;
-    private ElementHandle<TypeElement> handle;
     private ElementNode.Description description;
     private boolean isImplement;
     
     /** Creates a new instance of OverrideMethodGenerator */
-    private ImplementOverrideMethodGenerator(JTextComponent component, ElementHandle<TypeElement> handle, ElementNode.Description description, boolean isImplement) {
+    private ImplementOverrideMethodGenerator(JTextComponent component, ElementNode.Description description, boolean isImplement) {
         this.component = component;
-        this.handle = handle;
         this.description = description;
         this.isImplement = isImplement;
     }
@@ -164,22 +162,18 @@
                     ModificationResult mr = js.runModificationTask(new Task<WorkingCopy>() {
                         public void run(WorkingCopy copy) throws IOException {
                             copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
-                            Element e = handle.resolve(copy);
-                            TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset);
+                            TreePath path = copy.getTreeUtilities().pathFor(caretOffset);
                             path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path);
-                            if (path == null) {
-                                String message = NbBundle.getMessage(ImplementOverrideMethodGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N
-                                org.netbeans.editor.Utilities.setStatusBoldText(component, message);
-                            } else {
-                                int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
-                                ArrayList<ExecutableElement> methodElements = new ArrayList<ExecutableElement>();
-                                for (ElementHandle<? extends Element> elementHandle : panel.getSelectedMethods())
-                                    methodElements.add((ExecutableElement)elementHandle.resolve(copy));
-                                if (isImplement)
-                                    GeneratorUtils.generateAbstractMethodImplementations(copy, path, methodElements, idx);
-                                else
-                                    GeneratorUtils.generateMethodOverrides(copy, path, methodElements, idx);
-                            }
+                            if (path == null)
+                                return;
+                            int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
+                            ArrayList<ExecutableElement> methodElements = new ArrayList<ExecutableElement>();
+                            for (ElementHandle<? extends Element> elementHandle : panel.getSelectedMethods())
+                                methodElements.add((ExecutableElement)elementHandle.resolve(copy));
+                            if (isImplement)
+                                GeneratorUtils.generateAbstractMethodImplementations(copy, path, methodElements, idx);
+                            else
+                                GeneratorUtils.generateMethodOverrides(copy, path, methodElements, idx);
                         }
                     });
                     GeneratorUtils.guardedCommit(component, mr);
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ToStringGenerator.java	2011-08-04 21:48:28.718408699 +0100
@@ -158,30 +158,26 @@
 
                     public void run(WorkingCopy copy) throws IOException {
                         copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
-                        Element e = description.getElementHandle().resolve(copy);
-                        TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset);
+                        TreePath path = copy.getTreeUtilities().pathFor(caretOffset);
                         path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path);
-                        if (path == null) {
-                            String message = NbBundle.getMessage(ToStringGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N
-                            org.netbeans.editor.Utilities.setStatusBoldText(component, message);
+                        if (path == null)
+                            return;
+                        ClassTree cls = (ClassTree) path.getLeaf();
+                        int idx = GeneratorUtils.findClassMemberIndex(copy, cls, caretOffset);
+                        ArrayList<VariableElement> fields = new ArrayList<VariableElement>();
+                        for (ElementHandle<? extends Element> elementHandle : panel.getVariables()) {
+                            VariableElement field = (VariableElement) elementHandle.resolve(copy);
+                            if (field == null)
+                                return;
+                            fields.add(field);
+                        }
+                        MethodTree mth = createToStringMethod(copy, fields, cls.getSimpleName().toString());
+                        if (idx >= 0) {
+                            cls = copy.getTreeMaker().insertClassMember(cls, idx, mth);
                         } else {
-                            ClassTree cls = (ClassTree) path.getLeaf();
-                            int idx = GeneratorUtils.findClassMemberIndex(copy, cls, caretOffset);
-                            ArrayList<VariableElement> fields = new ArrayList<VariableElement>();
-                            for (ElementHandle<? extends Element> elementHandle : panel.getVariables()) {
-                                VariableElement field = (VariableElement) elementHandle.resolve(copy);
-                                if (field == null)
-                                    return;
-                                fields.add(field);
-                            }
-                            MethodTree mth = createToStringMethod(copy, fields, cls.getSimpleName().toString());
-                            if (idx >= 0) {
-                                cls = copy.getTreeMaker().insertClassMember(cls, idx, mth);
-                            } else {
-                                cls = copy.getTreeMaker().addClassMember(cls, mth);
-                            }
-                            copy.rewrite(path.getLeaf(), cls);
+                            cls = copy.getTreeMaker().addClassMember(cls, mth);
                         }
+                        copy.rewrite(path.getLeaf(), cls);
                     }
                 });
                 GeneratorUtils.guardedCommit(component, mr);
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/Bundle.properties	2011-08-04 21:48:28.718408699 +0100
@@ -90,6 +90,5 @@
 A11Y_Generate_ImplementOverride=Implement/Override Method Dialog
 
 ERR_CannotApplyGuarded=Cannot apply changes due to guarded block
-ERR_CannotFindOriginalClass=Cannot find original class
 
 LBL_Get_Available_Methods=Gathering of Available Methods
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ConstructorGenerator.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/ConstructorGenerator.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/ConstructorGenerator.java	2011-08-04 21:48:28.728434605 +0100
@@ -144,21 +144,19 @@
                 fieldsDescription = ElementNode.Description.create(controller, typeElement, fieldDescriptions, false, false);
             }
             if (constructorHandle != null || constructorDescription != null || fieldsDescription != null)
-                ret.add(new ConstructorGenerator(component, ElementHandle.create(typeElement), constructorHandle, constructorDescription, fieldsDescription));
+                ret.add(new ConstructorGenerator(component, constructorHandle, constructorDescription, fieldsDescription));
             return ret;
         }
     }
 
     private JTextComponent component;
-    private ElementHandle<TypeElement> typeHandle;
     private ElementHandle<? extends Element> constructorHandle;
     private ElementNode.Description constructorDescription;
     private ElementNode.Description fieldsDescription;
     
     /** Creates a new instance of ConstructorGenerator */
-    private ConstructorGenerator(JTextComponent component, ElementHandle<TypeElement> typeHandle, ElementHandle<? extends Element> constructorHandle, ElementNode.Description constructorDescription, ElementNode.Description fieldsDescription) {
+    private ConstructorGenerator(JTextComponent component, ElementHandle<? extends Element> constructorHandle, ElementNode.Description constructorDescription, ElementNode.Description fieldsDescription) {
         this.component = component;
-        this.typeHandle = typeHandle;
         this.constructorHandle = constructorHandle;
         this.constructorDescription = constructorDescription;
         this.fieldsDescription = fieldsDescription;
@@ -196,36 +194,30 @@
                 ModificationResult mr = js.runModificationTask(new Task<WorkingCopy>() {
                     public void run(WorkingCopy copy) throws IOException {
                         copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
-                        Element e = typeHandle.resolve(copy);
-                        TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset);
+                        TreePath path = copy.getTreeUtilities().pathFor(caretOffset);
                         path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path);
-                        if (path == null) {
-                            String message = NbBundle.getMessage(ConstructorGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N
-                            org.netbeans.editor.Utilities.setStatusBoldText(component, message);
-                        } else {
-                            int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
-                            ArrayList<VariableElement> variableElements = new ArrayList<VariableElement>();
-                            if (fieldHandles != null) {
-                                for (ElementHandle<? extends Element> elementHandle : fieldHandles) {
-                                    VariableElement field = (VariableElement) elementHandle.resolve(copy);
-                                    if (field == null)
-                                        return;
-                                    variableElements.add(field);
-                                }
-                            }
-                            if (constrHandles != null && !constrHandles.isEmpty()) {
-                                ArrayList<ExecutableElement> constrElements = new ArrayList<ExecutableElement>();
-                                for (ElementHandle<? extends Element> elementHandle : constrHandles) {
-                                    ExecutableElement constr = (ExecutableElement)elementHandle.resolve(copy);
-                                    if (constr == null)
-                                        return;
-                                    constrElements.add(constr);
-                                }
-                                GeneratorUtils.generateConstructors(copy, path, variableElements, constrElements, idx);
-                            } else {
-                                GeneratorUtils.generateConstructor(copy, path, variableElements, constructorHandle != null ? (ExecutableElement)constructorHandle.resolve(copy) : null, idx);
+                        int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
+                        ArrayList<VariableElement> variableElements = new ArrayList<VariableElement>();
+                        if (fieldHandles != null) {
+                            for (ElementHandle<? extends Element> elementHandle : fieldHandles) {
+                                VariableElement field = (VariableElement) elementHandle.resolve(copy);
+                                if (field == null)
+                                    return;
+                                variableElements.add(field);
                             }
                         }
+                        if (constrHandles != null && !constrHandles.isEmpty()) {
+                            ArrayList<ExecutableElement> constrElements = new ArrayList<ExecutableElement>();
+                            for (ElementHandle<? extends Element> elementHandle : constrHandles) {
+                                ExecutableElement constr = (ExecutableElement)elementHandle.resolve(copy);
+                                if (constr == null)
+                                    return;
+                                constrElements.add(constr);
+                            }
+                            GeneratorUtils.generateConstructors(copy, path, variableElements, constrElements, idx);
+                        } else {
+                            GeneratorUtils.generateConstructor(copy, path, variableElements, constructorHandle != null ? (ExecutableElement)constructorHandle.resolve(copy) : null, idx);
+                        }    
                     }
                 });
                 GeneratorUtils.guardedCommit(component, mr);
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/EqualsHashCodeGenerator.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/codegen/EqualsHashCodeGenerator.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/codegen/EqualsHashCodeGenerator.java	2011-08-04 21:48:28.728434605 +0100
@@ -346,31 +346,25 @@
                     ModificationResult mr = js.runModificationTask(new Task<WorkingCopy>() {
                         public void run(WorkingCopy copy) throws IOException {
                             copy.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED);
-                            Element e = description.getElementHandle().resolve(copy);
-                            TreePath path = e != null ? copy.getTrees().getPath(e) : copy.getTreeUtilities().pathFor(caretOffset);
+                            TreePath path = copy.getTreeUtilities().pathFor(caretOffset);
                             path = Utilities.getPathElementOfKind(TreeUtilities.CLASS_TREE_KINDS, path);
-                            if (path == null) {
-                                String message = NbBundle.getMessage(EqualsHashCodeGenerator.class, "ERR_CannotFindOriginalClass"); //NOI18N
-                                org.netbeans.editor.Utilities.setStatusBoldText(component, message);
-                            } else {
-                                int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
-                                ArrayList<VariableElement> equalsElements = new ArrayList<VariableElement>();
-                                if( generateEquals ) {
-                                    for (ElementHandle<? extends Element> elementHandle : panel.getEqualsVariables())
-                                        equalsElements.add((VariableElement)elementHandle.resolve(copy));
-                                    }
-                                ArrayList<VariableElement> hashCodeElements = new ArrayList<VariableElement>();
-                                if( generateHashCode ) {
-                                    for (ElementHandle<? extends Element> elementHandle : panel.getHashCodeVariables())
-                                        hashCodeElements.add((VariableElement)elementHandle.resolve(copy));
+                            int idx = GeneratorUtils.findClassMemberIndex(copy, (ClassTree)path.getLeaf(), caretOffset);
+                            ArrayList<VariableElement> equalsElements = new ArrayList<VariableElement>();
+                            if( generateEquals ) {
+                                for (ElementHandle<? extends Element> elementHandle : panel.getEqualsVariables())
+                                    equalsElements.add((VariableElement)elementHandle.resolve(copy));
                                 }
-                                generateEqualsAndHashCode(
-                                    copy, path, 
-                                    generateEquals ? equalsElements : null, 
-                                    generateHashCode ? hashCodeElements : null, 
-                                    idx
-                                );
+                            ArrayList<VariableElement> hashCodeElements = new ArrayList<VariableElement>();
+                            if( generateHashCode ) {
+                                for (ElementHandle<? extends Element> elementHandle : panel.getHashCodeVariables())
+                                    hashCodeElements.add((VariableElement)elementHandle.resolve(copy));
                             }
+                            generateEqualsAndHashCode(
+                                copy, path, 
+                                generateEquals ? equalsElements : null, 
+                                generateHashCode ? hashCodeElements : null, 
+                                idx
+                            );
                         }
                     });
                     GeneratorUtils.guardedCommit(component, mr);
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManager.java	2011-08-04 21:48:28.728434605 +0100
@@ -49,17 +49,18 @@
 import com.sun.source.tree.ImportTree;
 import com.sun.source.tree.MethodTree;
 import com.sun.source.tree.Tree;
+import com.sun.source.tree.Tree.Kind;
 import com.sun.source.tree.VariableTree;
 import com.sun.source.util.SourcePositions;
 import com.sun.source.util.TreePath;
 import java.lang.ref.Reference;
 import java.lang.ref.WeakReference;
 import java.util.ArrayList;
-import java.util.Collections;
 import java.util.ConcurrentModificationException;
-import java.util.Iterator;
+import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.TreeMap;
 import java.util.WeakHashMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
@@ -127,11 +128,9 @@
         Object od = doc.getProperty(Document.StreamDescriptionProperty);
         
         if (od instanceof DataObject) {
-            FileObject file = ((DataObject)od).getPrimaryFile();
-
-            currentFolds = new ArrayList<FoldInfo>();
-            task = JavaElementFoldTask.getTask(file);
-            task.setJavaElementFoldManager(JavaElementFoldManager.this, file);
+            currentFolds = new HashMap<FoldInfo, Fold>();
+            task = JavaElementFoldTask.getTask(((DataObject)od).getPrimaryFile());
+            task.setJavaElementFoldManager(JavaElementFoldManager.this);
         }
     }
     
@@ -163,7 +162,7 @@
 
     public synchronized void release() {
         if (task != null)
-            task.setJavaElementFoldManager(null, null);
+            task.setJavaElementFoldManager(null);
         
         task         = null;
         file         = null;
@@ -196,12 +195,8 @@
         
         private Reference<JavaElementFoldManager> manager;
 
-        synchronized void setJavaElementFoldManager(JavaElementFoldManager manager, FileObject file) {
+        synchronized void setJavaElementFoldManager(JavaElementFoldManager manager) {
             this.manager = new WeakReference<JavaElementFoldManager>(manager);
-
-            if (file != null) {
-                JavaElementFoldManagerTaskFactory.doRefresh(file);
-            }
         }
         
         public void run(final CompilationInfo info) {
@@ -235,8 +230,7 @@
             
             if (v.stopped || isCancelled())
                 return ;
-
-            Collections.sort(v.folds);
+            
             SwingUtilities.invokeLater(jefm.new CommitFolds(v.folds));
             
             long endTime = System.currentTimeMillis();
@@ -274,82 +268,66 @@
                 try {
                     if (currentFolds == null)
                         return ;
+                    
+                    Map<FoldInfo, Fold> added   = new TreeMap<FoldInfo, Fold>();
+                    List<FoldInfo>      removed = new ArrayList<FoldInfo>(currentFolds.keySet());
+                    
+                    for (FoldInfo i : infos) {
+                        if (currentFolds.containsKey(i)) {
+                            removed.remove(i);
+                            continue ;
+                        }
+                        
+                        int start = i.start.getOffset();
+                        int end   = i.end.getOffset();
 
-                    List<FoldInfo> updatedFolds = new ArrayList<FoldInfo>(infos.size());
-                    Iterator<FoldInfo> itExisting = currentFolds.iterator();
-                    Iterator<FoldInfo> itNew = infos.iterator();
-                    FoldInfo currentExisting = itExisting.hasNext() ? itExisting.next() : null;
-                    FoldInfo currentNew = itNew.hasNext() ? itNew.next() : null;
-
-                    while (currentExisting != null || currentNew != null) {
-                        int order = currentExisting != null && currentNew != null ? currentExisting.compareTo(currentNew) : currentExisting != null ? -1 : 1;
-
-                        if (order < 0) {
-                            //fold removed:
-                            operation.removeFromHierarchy(currentExisting.fold, tr);
-
-                            if (importsFold == currentExisting.fold) {
-                                importsFold = null;
-                            }
-
-                            if (initialCommentFold == currentExisting.fold) {
-                                initialCommentFold = null;
-                            }
+                        // XXX: In some situations infos contains duplicate folds and we don't
+                        // want to add the same multiple times. The situation that I came across
+                        // was with having an empty enum subclass with javadoc. The javadoc fold
+                        // was added twice - once from visitClass and second time from visitMethod
+                        // for the <init> node, which for some reason has the same offset as the
+                        // the enum inner class.
+                        
+                        if (end > start &&
+                            (end - start) > (i.template.getStartGuardedLength() + i.template.getEndGuardedLength()) &&
+                            !added.containsKey(i))
+                        {
+                            Fold f    = operation.addToHierarchy(i.template.getType(),
+                                                                 i.template.getDescription(),
+                                                                 i.collapseByDefault,
+                                                                 start,
+                                                                 end,
+                                                                 i.template.getStartGuardedLength(),
+                                                                 i.template.getEndGuardedLength(),
+                                                                 i,
+                                                                 tr);
+                            
+                            added.put(i, f);
                             
-                            currentExisting = itExisting.hasNext() ? itExisting.next() : null;
-                        } else {
-                            //added or remains:
-                            if (order > 0) {
-                                //added:
-                                int start = currentNew.start.getOffset();
-                                int end   = currentNew.end.getOffset();
-
-                                if (end > start &&
-                                        (end - start) > (currentNew.template.getStartGuardedLength() + currentNew.template.getEndGuardedLength())) {
-                                    Fold f = operation.addToHierarchy(currentNew.template.getType(),
-                                            currentNew.template.getDescription(),
-                                            currentNew.collapseByDefault,
-                                            start,
-                                            end,
-                                            currentNew.template.getStartGuardedLength(),
-                                            currentNew.template.getEndGuardedLength(),
-                                            currentNew,
-                                            tr);
-
-                                    currentNew.fold = f;
-
-                                    if (currentNew.template == IMPORTS_FOLD_TEMPLATE) {
-                                        importsFold = f;
-                                    }
-                                    
-                                    if (currentNew.template == INITIAL_COMMENT_FOLD_TEMPLATE) {
-                                        initialCommentFold = f;
-                                    }
-
-                                    updatedFolds.add(currentNew);
-                                }
-                            } else {
-                                updatedFolds.add(currentExisting);
-                                currentExisting = itExisting.hasNext() ? itExisting.next() : null;
+                            if (i.template == IMPORTS_FOLD_TEMPLATE) {
+                                importsFold = f;
                             }
-
-                            FoldInfo newNew = itNew.hasNext() ? itNew.next() : null;
-
-                            // XXX: In some situations infos contains duplicate folds and we don't
-                            // want to add the same multiple times. The situation that I came across
-                            // was with having an empty enum subclass with javadoc. The javadoc fold
-                            // was added twice - once from visitClass and second time from visitMethod
-                            // for the <init> node, which for some reason has the same offset as the
-                            // the enum inner class.
-                            while (newNew != null && currentNew.compareTo(newNew) == 0) {
-                                newNew = itNew.hasNext() ? itNew.next() : null;
+                            if (i.template == INITIAL_COMMENT_FOLD_TEMPLATE) {
+                                initialCommentFold = f;
                             }
-
-                            currentNew = newNew;
                         }
                     }
                     
-                    currentFolds = updatedFolds;
+                    for (FoldInfo i : removed) {
+                        Fold f = currentFolds.remove(i);
+                        
+                        operation.removeFromHierarchy(f, tr);
+                        
+                        if (importsFold == f ) {
+                            importsFold = null;
+                        }
+                        
+                        if (initialCommentFold == f) {
+                            initialCommentFold = null;
+                        }
+                    }
+                    
+                    currentFolds.putAll(added);
                 } catch (BadLocationException e) {
                     Exceptions.printStackTrace(e);
                 } finally {
@@ -365,9 +343,8 @@
                     new Object[] {file, endTime - startTime});
         }
     }
-
-    //@GuardedBy(FoldOperation.openTransaction())
-    private List<FoldInfo> currentFolds; //in natural order
+    
+    private Map<FoldInfo, Fold> currentFolds;
     private Fold initialCommentFold;
     private Fold importsFold;
     
@@ -560,12 +537,10 @@
     
     protected static final class FoldInfo implements Comparable {
         
-        private final Position start;
-        private final Position end;
-        private final FoldTemplate template;
-        private final boolean collapseByDefault;
-        //@GUardedBy(FoldOperation.openTransaction())
-        private Fold fold;
+        private Position start;
+        private Position end;
+        private FoldTemplate template;
+        private boolean collapseByDefault;
         
         public FoldInfo(Document doc, int start, int end, FoldTemplate template, boolean collapseByDefault) throws BadLocationException {
             this.start = doc.createPosition(start);
@@ -574,6 +549,19 @@
             this.collapseByDefault = collapseByDefault;
         }
         
+        @Override
+        public int hashCode() {
+            return 1;
+        }
+        
+        @Override
+        public boolean equals(Object o) {
+            if (!(o instanceof FoldInfo))
+                return false;
+            
+            return compareTo(o) == 0;
+        }
+        
         public int compareTo(Object o) {
             FoldInfo remote = (FoldInfo) o;
             
@@ -592,15 +580,10 @@
             if (end.getOffset() > remote.end.getOffset()) {
                 return 1;
             }
-
-            //XXX: abusing the length of the fold description to implement ordering (the exact order does not matter in this case):
-            return template.getDescription().length() - remote.template.getDescription().length();
-        }
-
-        @Override
-        public String toString() {
-            return "FoldInfo[" + start.getOffset() + ", " + end.getOffset() + ", " + template.getDescription() + "]";
+            
+            return 0;
         }
+        
     }
     
 }
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManagerTaskFactory.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManagerTaskFactory.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/fold/JavaElementFoldManagerTaskFactory.java	2011-08-04 21:48:28.728434605 +0100
@@ -45,12 +45,11 @@
 
 import org.netbeans.api.java.source.CancellableTask;
 import org.netbeans.api.java.source.CompilationInfo;
+import org.netbeans.api.java.source.JavaSource;
 import org.netbeans.api.java.source.JavaSource.Phase;
 import org.netbeans.api.java.source.JavaSource.Priority;
-import org.netbeans.api.java.source.JavaSourceTaskFactory;
 import org.netbeans.api.java.source.support.EditorAwareJavaSourceTaskFactory;
 import org.openide.filesystems.FileObject;
-import org.openide.util.Lookup;
 
 /**
  *
@@ -59,6 +58,7 @@
 @org.openide.util.lookup.ServiceProvider(service=org.netbeans.api.java.source.JavaSourceTaskFactory.class)
 public class JavaElementFoldManagerTaskFactory extends EditorAwareJavaSourceTaskFactory {
 
+    /** Creates a new instance of JavaElementFoldManagerTaskFactory */
     public JavaElementFoldManagerTaskFactory() {
         super(Phase.PARSED, Priority.NORMAL);
     }
@@ -66,12 +66,5 @@
     public CancellableTask<CompilationInfo> createTask(FileObject file) {
         return JavaElementFoldManager.JavaElementFoldTask.getTask(file);
     }
-
-    public static void doRefresh(FileObject file) {
-        for (JavaSourceTaskFactory f : Lookup.getDefault().lookupAll(JavaSourceTaskFactory.class)) {
-            if (f instanceof JavaElementFoldManagerTaskFactory) {
-                ((JavaElementFoldManagerTaskFactory) f).reschedule(file);
-            }
-        }
-    }
+    
 }
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/hyperlink/JavaHyperlinkProvider.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/hyperlink/JavaHyperlinkProvider.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/hyperlink/JavaHyperlinkProvider.java	2011-08-04 21:48:28.728434605 +0100
@@ -88,7 +88,7 @@
             case ALT_HYPERLINK:
                 JTextComponent focused = EditorRegistry.focusedComponent();
                 
-                if (focused != null && focused.getDocument() == doc) {
+                if (focused.getDocument() == doc) {
                     focused.setCaretPosition(offset);
                     GoToImplementation.goToImplementation(focused);
                 }
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/resources/DefaultAbbrevs.xml	2011-08-04 21:48:28.728434605 +0100
@@ -378,7 +378,7 @@
         ${cursor}
      }
      ]]></code></codetemplate>
-     <codetemplate abbreviation="Psfm"><code><![CDATA[    public static final ${ret default="void"} ${mname default="method"}(${args default=""}) {
+     <codetemplate abbreviation="Psfm"><code><![CDATA[    public final ${ret default="void"} ${mname default="method"}(${args default=""}) {
         ${cursor}
      }
      ]]></code></codetemplate>
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/rename/InstantRenamePerformer.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/rename/InstantRenamePerformer.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/rename/InstantRenamePerformer.java	2011-08-04 21:48:28.728434605 +0100
@@ -43,23 +43,15 @@
  */
 package org.netbeans.modules.java.editor.rename;
 
-import com.sun.source.tree.BreakTree;
-import com.sun.source.tree.ContinueTree;
-import com.sun.source.tree.LabeledStatementTree;
-import com.sun.source.tree.StatementTree;
 import com.sun.source.tree.Tree.Kind;
 import com.sun.source.util.TreePath;
-import com.sun.source.util.TreePathScanner;
 import java.awt.Color;
 import java.awt.event.KeyEvent;
 import java.awt.event.KeyListener;
 import java.io.IOException;
-import java.lang.ref.Reference;
-import java.lang.ref.WeakReference;
 import java.util.ArrayList;
 import java.util.EnumSet;
 import java.util.HashSet;
-import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Set;
 import java.util.logging.Level;
@@ -68,7 +60,6 @@
 import javax.lang.model.element.ElementKind;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.Modifier;
-import javax.lang.model.element.Name;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.util.ElementFilter;
 import javax.lang.model.util.ElementScanner6;
@@ -76,8 +67,6 @@
 import javax.swing.event.CaretEvent;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
-import javax.swing.event.UndoableEditEvent;
-import javax.swing.event.UndoableEditListener;
 import javax.swing.text.AttributeSet;
 import javax.swing.text.BadLocationException;
 import javax.swing.text.Document;
@@ -85,7 +74,6 @@
 import javax.swing.text.Position;
 import javax.swing.text.Position.Bias;
 import javax.swing.text.StyleConstants;
-import javax.swing.undo.AbstractUndoableEdit;
 import javax.swing.undo.CannotUndoException;
 import javax.swing.undo.UndoableEdit;
 import org.netbeans.api.editor.mimelookup.MimeLookup;
@@ -181,13 +169,7 @@
         region = new SyncDocumentRegion(doc, regions);
 
         if (doc instanceof BaseDocument) {
-            BaseDocument bdoc = ((BaseDocument) doc);
-            bdoc.setPostModificationDocumentListener(this);
-
-            UndoableEdit undo = new CancelInstantRenameUndoableEdit(this);
-            for (UndoableEditListener l : bdoc.getUndoableEditListeners()) {
-                l.undoableEditHappened(new UndoableEditEvent(doc, undo));
-            }
+            ((BaseDocument) doc).setPostModificationDocumentListener(this);
         }
 
         target.addKeyListener(this);
@@ -322,19 +304,6 @@
                 : info.getTrees().getElement(path);
         
         if (el == null) {
-            if (EnumSet.of(Kind.LABELED_STATEMENT, Kind.BREAK, Kind.CONTINUE).contains(path.getLeaf().getKind())) {
-                Token<JavaTokenId> span = org.netbeans.modules.java.editor.semantic.Utilities.findIdentifierSpan(info, doc, path);
-                if (span != null && span.offset(null) <= adjustedCaret[0] && adjustedCaret[0] <= span.offset(null) + span.length()) {
-                    if (path.getLeaf().getKind() != Kind.LABELED_STATEMENT) {
-                        StatementTree tgt = info.getTreeUtilities().getBreakContinueTarget(path);
-                        path = tgt != null ? info.getTrees().getPath(info.getCompilationUnit(), tgt) : null;
-                    }
-                    if (path != null) {
-                        wasResolved[0] = true;
-                        return collectLabels(info, doc, path);
-                    }
-                }
-            }            
             wasResolved[0] = false;
             return null;
         }
@@ -402,31 +371,6 @@
         return null;
     }
 
-    private static Set<Token> collectLabels(final CompilationInfo info, final Document document, final TreePath labeledStatement) {
-        final Set<Token> result = new LinkedHashSet<Token>();
-        if (labeledStatement.getLeaf().getKind() == Kind.LABELED_STATEMENT) {
-            result.add(org.netbeans.modules.java.editor.semantic.Utilities.findIdentifierSpan(info, document, labeledStatement));
-            final Name label = ((LabeledStatementTree)labeledStatement.getLeaf()).getLabel();
-            new TreePathScanner <Void, Void>() {
-                @Override
-                public Void visitBreak(BreakTree node, Void p) {
-                    if (node.getLabel() != null && label.contentEquals(node.getLabel())) {
-                        result.add(org.netbeans.modules.java.editor.semantic.Utilities.findIdentifierSpan(info, document, getCurrentPath()));
-                    }
-                    return super.visitBreak(node, p);
-                }
-                @Override
-                public Void visitContinue(ContinueTree node, Void p) {
-                    if (node.getLabel() != null && label.contentEquals(node.getLabel())) {
-                        result.add(org.netbeans.modules.java.editor.semantic.Utilities.findIdentifierSpan(info, document, getCurrentPath()));
-                    }
-                    return super.visitContinue(node, p);
-                }
-            }.scan(labeledStatement, null);
-        }
-        return result;
-    }
-
     private static boolean allowInstantRename(Element e, ElementUtilities eu) {
         if (org.netbeans.modules.java.editor.semantic.Utilities.isPrivateElement(e)) {
             return true;
@@ -845,26 +789,5 @@
         
         return bag;
     }
-
-    private static class CancelInstantRenameUndoableEdit extends AbstractUndoableEdit {
-
-        private final Reference<InstantRenamePerformer> performer;
-
-        public CancelInstantRenameUndoableEdit(InstantRenamePerformer performer) {
-            this.performer = new WeakReference<InstantRenamePerformer>(performer);
-        }
-
-        @Override public boolean isSignificant() {
-            return false;
-        }
-
-        @Override public void undo() throws CannotUndoException {
-            InstantRenamePerformer perf = performer.get();
-
-            if (perf != null) {
-                perf.release();
-            }
-        }
-    }
     
 }
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionItem.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionItem.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/javadoc/JavadocCompletionItem.java	2011-08-04 21:48:28.728434605 +0100
@@ -363,20 +363,7 @@
         }
 
         public boolean instantSubstitution(JTextComponent component) {
-            if (component != null) {
-                try {
-                    int caretOffset = component.getSelectionEnd();
-                    if (caretOffset > substitutionOffset) {
-                        String text = component.getDocument().getText(substitutionOffset, caretOffset - substitutionOffset);
-                        if (!getInsertPrefix().toString().startsWith(text)) {
-                            return false;
-                        }
-                    }
-                }
-                catch (BadLocationException ble) {}
-            }
-            defaultAction(component);
-            return true;
+            return delegate.instantSubstitution(component);
         }
 
         public int getSortPriority() {
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/MarkOccurrencesHighlighter.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/semantic/MarkOccurrencesHighlighter.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/MarkOccurrencesHighlighter.java	2011-08-04 21:48:28.738408732 +0100
@@ -43,12 +43,9 @@
  */
 package org.netbeans.modules.java.editor.semantic;
 
-import com.sun.source.tree.BreakTree;
 import com.sun.source.tree.ClassTree;
 import com.sun.source.tree.CompilationUnitTree;
-import com.sun.source.tree.ContinueTree;
 import com.sun.source.tree.DoWhileLoopTree;
-import com.sun.source.tree.EnhancedForLoopTree;
 import com.sun.source.tree.ForLoopTree;
 import com.sun.source.tree.ImportTree;
 import com.sun.source.tree.LabeledStatementTree;
@@ -62,7 +59,6 @@
 import com.sun.source.tree.WhileLoopTree;
 import com.sun.source.util.SourcePositions;
 import com.sun.source.util.TreePath;
-import com.sun.source.util.TreePathScanner;
 
 import java.awt.Color;
 import java.util.ArrayList;
@@ -79,7 +75,6 @@
 import javax.lang.model.element.ElementKind;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.Modifier;
-import javax.lang.model.element.Name;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.util.ElementFilter;
 import javax.swing.event.DocumentEvent;
@@ -394,17 +389,8 @@
 
         Tree tree =tp.getLeaf();
 
-        if (node.getBoolean(MarkOccurencesSettings.BREAK_CONTINUE, true)) {
-            if (tree.getKind() == Kind.BREAK || tree.getKind() == Kind.CONTINUE) {
-                return detectBreakOrContinueTarget(info, doc, tp, caretPosition);
-            } else if (tree.getKind() == Kind.LABELED_STATEMENT) {
-                int[] span = Utilities.findIdentifierSpan(tp, info, doc);
-                if (span[0] <= caretPosition && caretPosition <= span[1]) {
-                    List<int[]> ret = detectLabel(info, doc, tp);
-                    ret.add(span);
-                    return ret;
-                }
-            }
+        if (node.getBoolean(MarkOccurencesSettings.BREAK_CONTINUE, true) && (tree.getKind() == Kind.BREAK || tree.getKind() == Kind.CONTINUE)) {
+            return detectBreakOrContinueTarget(info, doc, tp);
         }
 
         Element el;
@@ -604,7 +590,7 @@
         return highlights;
     }
 
-    private List<int[]> detectBreakOrContinueTarget(CompilationInfo info, Document document, TreePath breakOrContinue, int caretPosition) {
+    private List<int[]> detectBreakOrContinueTarget(CompilationInfo info, Document document, TreePath breakOrContinue) {
         List<int[]> result = new ArrayList<int[]>();
         StatementTree target = info.getTreeUtilities().getBreakContinueTarget(breakOrContinue);
 
@@ -612,7 +598,7 @@
             return null;
 
         TokenSequence<JavaTokenId> ts = info.getTokenHierarchy().tokenSequence(JavaTokenId.language());
-        
+
         ts.move((int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), target));
 
         if (ts.moveNext()) {
@@ -634,10 +620,6 @@
                 if (((ForLoopTree) statement).getStatement().getKind() == Kind.BLOCK)
                     block = ((ForLoopTree) statement).getStatement();
                 break;
-            case ENHANCED_FOR_LOOP:
-                if (((EnhancedForLoopTree) statement).getStatement().getKind() == Kind.BLOCK)
-                    block = ((EnhancedForLoopTree) statement).getStatement();
-                break;
             case DO_WHILE_LOOP:
                 if (((DoWhileLoopTree) statement).getStatement().getKind() == Kind.BLOCK)
                     block = ((DoWhileLoopTree) statement).getStatement();
@@ -651,37 +633,9 @@
                 result.add(new int[] {ts.offset(), ts.offset() + ts.token().length()});
             }
         }
-        
-        if (target.getKind() == Kind.LABELED_STATEMENT && isIn(caretPosition, Utilities.findIdentifierSpan(info, document, breakOrContinue))) {
-            result.addAll(detectLabel(info, document, info.getTrees().getPath(info.getCompilationUnit(), target)));
-        }
 
         return result;
     }
-    
-    private List<int[]> detectLabel(final CompilationInfo info, final Document document, final TreePath labeledStatement) {
-        final List<int[]> result = new ArrayList<int[]>();
-        if (labeledStatement.getLeaf().getKind() == Kind.LABELED_STATEMENT) {
-            final Name label = ((LabeledStatementTree)labeledStatement.getLeaf()).getLabel();
-            new TreePathScanner <Void, Void>() {
-                @Override
-                public Void visitBreak(BreakTree node, Void p) {
-                    if (node.getLabel() != null && label.contentEquals(node.getLabel())) {
-                        result.add(Utilities.findIdentifierSpan(getCurrentPath(), info, document));
-                    }
-                    return super.visitBreak(node, p);
-                }
-                @Override
-                public Void visitContinue(ContinueTree node, Void p) {
-                    if (node.getLabel() != null && label.contentEquals(node.getLabel())) {
-                        result.add(Utilities.findIdentifierSpan(getCurrentPath(), info, document));
-                    }
-                    return super.visitContinue(node, p);
-                }
-            }.scan(labeledStatement, null);
-        }
-        return result;
-    }
 
     static OffsetsBag getHighlightsBag(Document doc) {
         OffsetsBag bag = (OffsetsBag) doc.getProperty(MarkOccurrencesHighlighter.class);
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/Utilities.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/semantic/Utilities.java	2011-07-28 20:45:54.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/Utilities.java	2011-08-04 21:48:28.738408732 +0100
@@ -44,12 +44,9 @@
 package org.netbeans.modules.java.editor.semantic;
 
 import com.sun.source.tree.ArrayTypeTree;
-import com.sun.source.tree.BreakTree;
 import com.sun.source.tree.IdentifierTree;
 import com.sun.source.tree.ClassTree;
 import com.sun.source.tree.CompilationUnitTree;
-import com.sun.source.tree.ContinueTree;
-import com.sun.source.tree.LabeledStatementTree;
 import com.sun.source.tree.MemberSelectTree;
 import com.sun.source.tree.MethodTree;
 import com.sun.source.tree.ParameterizedTypeTree;
@@ -60,7 +57,6 @@
 import com.sun.source.util.TreePath;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.EnumSet;
 import java.util.HashMap;
 import java.util.logging.Level;
 import javax.swing.text.BadLocationException;
@@ -285,58 +281,7 @@
         if (class2Kind.get(ParameterizedTypeTree.class).contains(leaf.getKind())) {
             return findIdentifierSpanImpl(info, new TreePath(decl, ((ParameterizedTypeTree) leaf).getType()));
         }
-        if (class2Kind.get(BreakTree.class).contains(leaf.getKind())) {
-            Name name = ((BreakTree) leaf).getLabel();
-            
-            if (name == null || name.length() == 0)
-                return null;
-            
-            SourcePositions positions = info.getTrees().getSourcePositions();
-            CompilationUnitTree cu = info.getCompilationUnit();
-            int start = (int)positions.getStartPosition(cu, leaf);
-            int end   = (int)positions.getEndPosition(cu, leaf);
-            
-            if (start == (-1) || end == (-1)) {
-                return null;
-            }
-            
-           return findTokenWithText(info, name.toString(), start, end);
-        }
-        if (class2Kind.get(ContinueTree.class).contains(leaf.getKind())) {
-            Name name = ((ContinueTree) leaf).getLabel();
-            
-            if (name == null || name.length() == 0)
-                return null;
-            
-            SourcePositions positions = info.getTrees().getSourcePositions();
-            CompilationUnitTree cu = info.getCompilationUnit();
-            int start = (int)positions.getStartPosition(cu, leaf);
-            int end   = (int)positions.getEndPosition(cu, leaf);
-            
-            if (start == (-1) || end == (-1)) {
-                return null;
-            }
-            
-           return findTokenWithText(info, name.toString(), start, end);
-        }
-        if (class2Kind.get(LabeledStatementTree.class).contains(leaf.getKind())) {
-            Name name = ((LabeledStatementTree) leaf).getLabel();
-            
-            if (name == null || name.length() == 0)
-                return null;
-            
-            SourcePositions positions = info.getTrees().getSourcePositions();
-            CompilationUnitTree cu = info.getCompilationUnit();
-            int start = (int)positions.getStartPosition(cu, leaf);
-            int end   = (int)positions.getStartPosition(cu, ((LabeledStatementTree) leaf).getStatement());
-            
-            if (start == (-1) || end == (-1)) {
-                return null;
-            }
-            
-           return findTokenWithText(info, name.toString(), start, end);
-        }
-        throw new IllegalArgumentException("Only MethodDecl, VariableDecl, MemberSelectTree, IdentifierTree, ClassDecl, BreakTree, ContinueTree, and LabeledStatementTree are accepted by this method. Got: " + leaf.getKind());
+        throw new IllegalArgumentException("Only MethodDecl, VariableDecl, MemberSelectTree, IdentifierTree and ClassDecl are accepted by this method. Got: " + leaf.getKind());
     }
 
     public static int[] findIdentifierSpan( final TreePath decl, final CompilationInfo info, final Document doc) {
@@ -564,11 +509,18 @@
 
         return false;
     }
-
-    private static final Set<ElementKind> LOCAL_ELEMENT_KINDS = EnumSet.of(ElementKind.PARAMETER, ElementKind.LOCAL_VARIABLE, ElementKind.EXCEPTION_PARAMETER, ElementKind.RESOURCE_VARIABLE);
-
+    
     public static boolean isPrivateElement(Element el) {
-        return LOCAL_ELEMENT_KINDS.contains(el.getKind()) || el.getModifiers().contains(Modifier.PRIVATE);
+        if (el.getKind() == ElementKind.PARAMETER)
+            return true;
+        
+        if (el.getKind() == ElementKind.LOCAL_VARIABLE)
+            return true;
+        
+        if (el.getKind() == ElementKind.EXCEPTION_PARAMETER)
+            return true;
+        
+        return el.getModifiers().contains(Modifier.PRIVATE);
     }
 
 
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/SemanticHighlighter.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/java/editor/semantic/SemanticHighlighter.java	2011-07-28 20:45:54.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/java/editor/semantic/SemanticHighlighter.java	2011-08-04 21:48:28.738408732 +0100
@@ -55,6 +55,7 @@
 import com.sun.source.tree.CompilationUnitTree;
 import com.sun.source.tree.CompoundAssignmentTree;
 import com.sun.source.tree.ConditionalExpressionTree;
+import com.sun.source.tree.DisjunctiveTypeTree;
 import com.sun.source.tree.EnhancedForLoopTree;
 import com.sun.source.tree.ExpressionStatementTree;
 import com.sun.source.tree.ExpressionTree;
@@ -76,7 +77,6 @@
 import com.sun.source.tree.TypeCastTree;
 import com.sun.source.tree.TypeParameterTree;
 import com.sun.source.tree.UnaryTree;
-import com.sun.source.tree.UnionTypeTree;
 import com.sun.source.tree.VariableTree;
 import com.sun.source.tree.WildcardTree;
 import com.sun.source.util.SourcePositions;
@@ -1412,11 +1412,11 @@
         }
 
         @Override
-        public Void visitUnionType(UnionTypeTree node, EnumSet<UseTypes> p) {
+        public Void visitDisjunctiveType(DisjunctiveTypeTree node, EnumSet<UseTypes> p) {
             for (Tree tree : node.getTypeAlternatives()) {
                 handlePossibleIdentifier(new TreePath(getCurrentPath(), tree), EnumSet.of(UseTypes.CLASS_USE));
             }
-            return super.visitUnionType(node, p);
+            return super.visitDisjunctiveType(node, p);
         }
 
         @Override
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateProcessor.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateProcessor.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCodeTemplateProcessor.java	2011-08-04 21:48:28.738408732 +0100
@@ -380,7 +380,8 @@
                         if (tpe != null)
                             return tpe.getSimpleName().toString();
                     }
-                    tm = resolveCapturedType(tm);
+                    if (tm.getKind() == TypeKind.TYPEVAR)
+                        tm = ((TypeVariable)tm).getUpperBound();
                     String value = Utilities.getTypeName(cInfo, tm, true).toString();
                     if (value != null) {
                         param2hints.put(param, TYPE);
@@ -394,7 +395,8 @@
             } else if (ITERABLE_ELEMENT_TYPE.equals(entry.getKey())) {
                 TypeMirror tm = iterableElementType(param.getInsertTextOffset() + 1);
                 if (tm != null && tm.getKind() != TypeKind.ERROR) {
-                    tm = resolveCapturedType(tm);
+                    if (tm.getKind() == TypeKind.TYPEVAR)
+                        tm = ((TypeVariable)tm).getUpperBound();
                     String value = Utilities.getTypeName(cInfo, tm, true).toString();
                     if (value != null) {
                         param2hints.put(param, ITERABLE_ELEMENT_TYPE);
@@ -406,7 +408,8 @@
             } else if (LEFT_SIDE_TYPE.equals(entry.getKey())) {
                 TypeMirror tm = assignmentSideType(param.getInsertTextOffset() + 1, true);
                 if (tm != null && tm.getKind() != TypeKind.ERROR) {
-                    tm = resolveCapturedType(tm);
+                    if (tm.getKind() == TypeKind.TYPEVAR)
+                        tm = ((TypeVariable)tm).getUpperBound();
                     String value = Utilities.getTypeName(cInfo, tm, true).toString();
                     if (value != null) {
                         param2hints.put(param, LEFT_SIDE_TYPE);
@@ -418,7 +421,8 @@
             } else if (RIGHT_SIDE_TYPE.equals(entry.getKey())) {
                 TypeMirror tm = assignmentSideType(param.getInsertTextOffset() + 1, false);
                 if (tm != null && tm.getKind() != TypeKind.ERROR) {
-                    tm = resolveCapturedType(tm);
+                    if (tm.getKind() == TypeKind.TYPEVAR)
+                        tm = ((TypeVariable)tm).getUpperBound();
                     String value = Utilities.getTypeName(cInfo, tm, true).toString();
                     if (value != null) {
                         param2hints.put(param, RIGHT_SIDE_TYPE);
@@ -434,7 +438,6 @@
                     param2types.remove(param);
                     return ""; //NOI18N
                 } else if (tm.getKind() != TypeKind.ERROR) {
-                    tm = resolveCapturedType(tm);
                     String value = Utilities.getTypeName(cInfo, tm, true).toString();
                     if (value != null) {
                         param2hints.put(param, CAST);
@@ -454,7 +457,8 @@
             } else if (UNCAUGHT_EXCEPTION_TYPE.equals(entry.getKey())) {
                 TypeMirror tm = uncaughtExceptionType(param.getInsertTextOffset() + 1);
                 if (tm != null && tm.getKind() != TypeKind.ERROR) {
-                    tm = resolveCapturedType(tm);
+                    if (tm.getKind() == TypeKind.TYPEVAR)
+                        tm = ((TypeVariable)tm).getUpperBound();
                     String value = Utilities.getTypeName(cInfo, tm, true).toString();
                     if (value != null) {
                         param2hints.put(param, UNCAUGHT_EXCEPTION_TYPE);
@@ -621,7 +625,6 @@
                         }
                     }
                 }
-                return cInfo.getTreeUtilities().parseType(typeName, enclClass);
             }
         } catch (Exception e) {            
         }
@@ -856,15 +859,6 @@
         }
     }
     
-    private TypeMirror resolveCapturedType(TypeMirror type) {
-        if (type.getKind() == TypeKind.TYPEVAR) {
-            WildcardType wildcard = SourceUtils.resolveCapturedType(type);
-            if (wildcard != null)
-                return wildcard.getExtendsBound();
-        }
-        return type;
-    }
-    
     private boolean initParsing() {
         if (cInfo == null) {
             JTextComponent c = request.getComponent();
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/SelectCodeElementAction.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/SelectCodeElementAction.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/SelectCodeElementAction.java	2011-08-04 21:48:28.738408732 +0100
@@ -150,18 +150,16 @@
         public void selectNext() {
             if (selectionInfos == null) {
                 final JavaSource js = JavaSource.forDocument(target.getDocument());
-                if (js != null) {
-                    cancel = new AtomicBoolean();
-                    ProgressUtils.runOffEventDispatchThread(new Runnable() {
-                        public void run() {
-                            try {
-                                js.runUserActionTask(SelectionHandler.this, true);
-                            } catch (IOException ex) {
-                                Exceptions.printStackTrace(ex);
-                            }
+                cancel = new AtomicBoolean();
+                ProgressUtils.runOffEventDispatchThread(new Runnable() {
+                    public void run() {
+                        try {
+                            js.runUserActionTask(SelectionHandler.this, true);
+                        } catch (IOException ex) {
+                            Exceptions.printStackTrace(ex);
                         }
-                    }, name, cancel, false);
-                }
+                    }
+                }, name, cancel, false);
             }            
             run();
         }
@@ -221,7 +219,7 @@
         }
 
         public void run() {
-            if (selectionInfos != null && selIndex < selectionInfos.length - 1) {
+            if (selIndex < selectionInfos.length - 1) {
                 select(selectionInfos[++selIndex]);
             }
         }
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionItem.java	2011-08-04 21:48:28.738408732 +0100
@@ -241,8 +241,8 @@
         }
     }
 
-    public static final JavaCompletionItem createInitializeAllConstructorItem(CompilationInfo info, Iterable<? extends VariableElement> fields, ExecutableElement superConstructor, TypeElement parent, int substitutionOffset) {
-        return new InitializeAllConstructorItem(info, fields, superConstructor, parent, substitutionOffset);
+    public static final JavaCompletionItem createInitializeAllConstructorItem(CompilationInfo info, Iterable<? extends VariableElement> fields, TypeElement parent, int substitutionOffset) {
+        return new InitializeAllConstructorItem(info, fields, parent, substitutionOffset);
     }
 
     public static final String COLOR_END = "</font>"; //NOI18N
@@ -3148,13 +3148,12 @@
         
         private List<ElementHandle<VariableElement>> fieldHandles;
         private ElementHandle<TypeElement> parentHandle;
-        private ElementHandle<ExecutableElement> superConstructorHandle;
         private String simpleName;
         private List<ParamDesc> params;
         private String sortText;
         private String leftText;
         
-        private InitializeAllConstructorItem(CompilationInfo info, Iterable<? extends VariableElement> fields, ExecutableElement superConstructor, TypeElement parent, int substitutionOffset) {
+        private InitializeAllConstructorItem(CompilationInfo info, Iterable<? extends VariableElement> fields, TypeElement parent, int substitutionOffset) {
             super(substitutionOffset);
             this.fieldHandles = new ArrayList<ElementHandle<VariableElement>>();
             this.parentHandle = ElementHandle.create(parent);
@@ -3163,10 +3162,6 @@
                 this.fieldHandles.add(ElementHandle.create(ve));
                 this.params.add(new ParamDesc(null, Utilities.getTypeName(info, ve.asType(), false).toString(), ve.getSimpleName().toString()));
             }
-            this.superConstructorHandle = ElementHandle.create(superConstructor);
-            for (VariableElement ve : superConstructor.getParameters()) {
-                this.params.add(new ParamDesc(null, Utilities.getTypeName(info, ve.asType(), false).toString(), ve.getSimpleName().toString()));                
-            }
             this.simpleName = parent.getSimpleName().toString();
         }
         
@@ -3261,12 +3256,11 @@
                                 else
                                     break;
                             }
-                            ExecutableElement superConstructor = superConstructorHandle.resolve(copy);
                             
                             TreeMaker make = copy.getTreeMaker();
                             ClassTree clazz = (ClassTree) tp.getLeaf();
                             GeneratorUtilities gu = GeneratorUtilities.get(copy);
-                            ClassTree decl = make.insertClassMember(clazz, idx, gu.createConstructor(parent, fieldElements, superConstructor)); //NOI18N
+                            ClassTree decl = make.insertClassMember(clazz, idx, gu.createConstructor(parent, fieldElements, null)); //NOI18N
                             
                             copy.rewrite(clazz, decl);
                         }
@@ -3360,13 +3354,7 @@
                         int endPos = (int)sp.getEndPosition(tp.getCompilationUnit(), t);
                         TokenSequence<JavaTokenId> ts = findLastNonWhitespaceToken(controller, embeddedOffset, endPos);
                         if (ts != null) {
-                            if (ts.token().id() == JavaTokenId.SEMICOLON) {
-                                ret[0] = -1;
-                            } else if (ts.moveNext()) {
-                                ret[0] = ts.token().id() == JavaTokenId.LINE_COMMENT || ts.token().id() == JavaTokenId.WHITESPACE && ts.token().text().toString().contains("\n") ? ts.offset() : offset;                                
-                            } else {
-                                ret[0] = ts.offset() + ts.token().length();
-                            }
+                            ret[0] = ts.token().id() == JavaTokenId.SEMICOLON ? -1 : ts.offset() + ts.token().length();
                         }
                     } else {
                         TokenSequence<JavaTokenId> ts = controller.getTokenHierarchy().tokenSequence(JavaTokenId.language());
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaKit.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/JavaKit.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaKit.java	2011-08-04 21:48:28.748408787 +0100
@@ -103,7 +103,7 @@
 
     private static final Logger LOGGER = Logger.getLogger(JavaKit.class.getName());
 
-//    private static final Object sourceLevelKey = new Object();
+    private static final Object sourceLevelKey = new Object();
 
     public JavaKit(){
     }
@@ -112,20 +112,20 @@
         return JAVA_MIME_TYPE;
     }
 
-//    /** Create new instance of syntax coloring scanner
-//    * @param doc document to operate on. It can be null in the cases the syntax
-//    *   creation is not related to the particular document
-//    */
-//    public Syntax createSyntax(Document doc) {
-//        // XXX: sourcelevel can be subject of changes, ignored by this cache
-//        // Should not be a problem here however. Covered by #171330.
-//        String sourceLevel = (String) doc.getProperty(sourceLevelKey);
-//        if (sourceLevel == null) {
-//            sourceLevel = getSourceLevel((BaseDocument) doc);
-//            doc.putProperty(sourceLevelKey, sourceLevel);
-//        }
-//        return new JavaSyntax(sourceLevel);
-//    }
+    /** Create new instance of syntax coloring scanner
+    * @param doc document to operate on. It can be null in the cases the syntax
+    *   creation is not related to the particular document
+    */
+    public Syntax createSyntax(Document doc) {
+        // XXX: sourcelevel can be subject of changes, ignored by this cache
+        // Should not be a problem here however. Covered by #171330.
+        String sourceLevel = (String) doc.getProperty(sourceLevelKey);
+        if (sourceLevel == null) {
+            sourceLevel = getSourceLevel((BaseDocument) doc);
+            doc.putProperty(sourceLevelKey, sourceLevel);
+        }
+        return new JavaSyntax(sourceLevel);
+    }
 
     public String getSourceLevel(BaseDocument doc) {
         DataObject dob = NbEditorUtilities.getDataObject(doc);
@@ -516,10 +516,9 @@
         public void actionPerformed(ActionEvent evt, JTextComponent target) {
             try {
                 super.actionPerformed(evt, target);
-                Document doc = target.getDocument();
-                if (isJavadocTouched && !org.netbeans.lib.editor.util.swing.DocumentUtilities.isWriteLocked(doc)) {
-                    // XXX temporary solution until the editor will provide a SPI to plug. See issue #115739
-                    // This must run outside the document lock
+                // XXX temporary solution until the editor will provide a SPI to plug. See issue #115739
+                // This must run outside the document lock
+                if (isJavadocTouched) {
                     Lookup.Result<TextAction> res = MimeLookup.getLookup(MimePath.parse("text/x-javadoc")).lookupResult(TextAction.class);
                     ActionEvent newevt = new ActionEvent(target, ActionEvent.ACTION_PERFORMED, "fix-javadoc");
                     for (TextAction action : res.allInstances()) {
@@ -527,6 +526,7 @@
                     }
                 } else {
                     //Complete block comment
+                    Document doc = target.getDocument();
                     int start = ((AbstractDocument) doc).getParagraphElement(target.getCaretPosition()).getStartOffset();
                     int end = ((AbstractDocument) doc).getParagraphElement(target.getCaretPosition()).getEndOffset();
                     //Check if line with just one * surrounded by spaces is already entered
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/CamelCaseOperations.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/CamelCaseOperations.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/CamelCaseOperations.java	2011-08-04 21:48:28.748408787 +0100
@@ -44,16 +44,14 @@
 
 package org.netbeans.modules.editor.java;
 
-import java.util.List;
 import javax.swing.text.BadLocationException;
 import javax.swing.text.Document;
 import javax.swing.text.JTextComponent;
-import org.netbeans.api.java.lexer.JavaTokenId;
-import org.netbeans.api.lexer.Token;
-import org.netbeans.api.lexer.TokenHierarchy;
-import org.netbeans.api.lexer.TokenSequence;
 import org.netbeans.editor.BaseDocument;
+import org.netbeans.editor.SyntaxSupport;
+import org.netbeans.editor.TokenItem;
 import org.netbeans.editor.Utilities;
+import org.netbeans.editor.ext.ExtSyntaxSupport;
 import org.openide.util.Exceptions;
 
 /**
@@ -63,25 +61,25 @@
 /* package */ class CamelCaseOperations {
 
     static int nextCamelCasePosition(JTextComponent textComponent) throws BadLocationException {
+        SyntaxSupport syntaxSupport =  Utilities.getSyntaxSupport(textComponent);
+        if (syntaxSupport == null) {
+            // no syntax support available :(
+            return -1;
+        }
+
         // get current caret position
         int offset = textComponent.getCaretPosition();
-        Document doc = textComponent.getDocument();
-        TokenHierarchy<Document> th = doc != null ? TokenHierarchy.get(doc) : null;
-        List<TokenSequence<?>> embeddedSequences = th != null ? th.embeddedTokenSequences(offset, false) : null;
-        TokenSequence<?> seq = embeddedSequences != null ? embeddedSequences.get(embeddedSequences.size() - 1) : null;
-
-        if (seq  != null) seq.move(offset);
-
-        Token t = seq != null && seq.moveNext() ? seq.offsetToken() : null;
+        // get token chain at the offset + 1 ( + 1 so that the following uppercase char is skipped
+        TokenItem tokenItem = ((ExtSyntaxSupport) syntaxSupport).getTokenChain(offset, offset + 1);
 
         // is this an identifier
-        if (t != null && t.id() == JavaTokenId.IDENTIFIER) { // NOI18N
-            String image = t.text().toString();
+        if (tokenItem != null && ("identifier".equals(tokenItem.getTokenID().getName()))) { // NOI18N
+            String image = tokenItem.getImage();
             if (image != null && image.length() > 0) {
                 int length = image.length();
                 // is caret at the end of the identifier
-                if (offset != (t.offset(th) + length)) {
-                    int offsetInImage = offset - t.offset(th);
+                if (offset != (tokenItem.getOffset() + length)) {
+                    int offsetInImage = offset - tokenItem.getOffset();
                     int start = offsetInImage + 1;
                     if (Character.isUpperCase(image.charAt(offsetInImage))) {
                         // if starting from a Uppercase char, first skip over follwing upper case chars
@@ -97,11 +95,11 @@
                         char charAtI = image.charAt(i);
                         if (Character.isUpperCase(charAtI)) {
                             // return offset of next uppercase char in the identifier
-                            return t.offset(th) + i;
+                            return tokenItem.getOffset() + i;
                         }
                     }
                 }
-                return t.offset(th) + image.length();
+                return tokenItem.getOffset() + image.length();
             }
         }
 
@@ -110,36 +108,39 @@
     }
 
     static int previousCamelCasePosition(JTextComponent textComponent) throws BadLocationException {
+        SyntaxSupport syntaxSupport = Utilities.getSyntaxSupport(textComponent);
+        if (syntaxSupport == null) {
+            // no syntax support available :(
+            return -1;
+        }
+
         // get current caret position
         int offset = textComponent.getCaretPosition();
-        Document doc = textComponent.getDocument();
-        TokenHierarchy<Document> th = doc != null ? TokenHierarchy.get(doc) : null;
-        List<TokenSequence<?>> embeddedSequences = th != null ? th.embeddedTokenSequences(offset, false) : null;
-        TokenSequence<?> seq = embeddedSequences != null ? embeddedSequences.get(embeddedSequences.size() - 1) : null;
 
-        if (seq  != null) seq.move(offset);
+        // Are we at the beginning of the document
+        if (offset == 0) {
+            return -1;
+        }
 
-        Token t = seq != null && seq.moveNext() ? seq.offsetToken() : null;
+        // get token chain at the offset
+        TokenItem tokenItem = ((ExtSyntaxSupport) syntaxSupport).getTokenChain(offset - 1, offset);
 
         // is this an identifier
-        if (t != null) {
-            if (t.offset(th) == offset) {
-                t = seq.movePrevious() ? seq.offsetToken() : null;
-            }
-            if (t != null && t.id() == JavaTokenId.IDENTIFIER) { // NOI18N
-                String image = t.text().toString();
+        if (tokenItem != null) {
+            if ("identifier".equals(tokenItem.getTokenID().getName())) { // NOI18N
+                String image = tokenItem.getImage();
                 if (image != null && image.length() > 0) {
                     int length = image.length();
-                    int offsetInImage = offset - 1 - t.offset(th);
+                    int offsetInImage = offset - 1 - tokenItem.getOffset();
                     if (Character.isUpperCase(image.charAt(offsetInImage))) {
                         for (int i = offsetInImage - 1; i >= 0; i--) {
                             char charAtI = image.charAt(i);
                             if (!Character.isUpperCase(charAtI)) {
                                 // return offset of previous uppercase char in the identifier
-                                return t.offset(th) + i + 1;
+                                return tokenItem.getOffset() + i + 1;
                             }
                         }
-                        return t.offset(th);
+                        return tokenItem.getOffset();
                     } else {
                         for (int i = offsetInImage - 1; i >= 0; i--) {
                             char charAtI = image.charAt(i);
@@ -149,27 +150,27 @@
                                     char charAtJ = image.charAt(j);
                                     if (!Character.isUpperCase(charAtJ)) {
                                         // return offset of previous uppercase char in the identifier
-                                        return t.offset(th) + j + 1;
+                                        return tokenItem.getOffset() + j + 1;
                                     }
                                 }
-                                return t.offset(th);
+                                return tokenItem.getOffset();
                             }
                         }
                     }
-                    return t.offset(th);
+                    return tokenItem.getOffset();
                 }
-            } else if (t != null && t.id() == JavaTokenId.WHITESPACE) { // NOI18N
-                Token whitespaceToken = t;
-                while (whitespaceToken != null && whitespaceToken.id() == JavaTokenId.WHITESPACE) {
-                    int wsOffset = whitespaceToken.offset(th);
+            } else if ("whitespace".equals(tokenItem.getTokenID().getName())) { // NOI18N
+                TokenItem whitespaceTokenItem = tokenItem;
+                while (whitespaceTokenItem != null && "whitespace".equals(whitespaceTokenItem.getTokenID().getName())) {
+                    int wsOffset = whitespaceTokenItem.getOffset();
                     if (wsOffset == 0) {
                         //#145250: at the very beginning of a file
                         return 0;
                     }
-                    whitespaceToken = seq.movePrevious() ? seq.offsetToken() : null;
+                    whitespaceTokenItem =((ExtSyntaxSupport) syntaxSupport).getTokenChain(wsOffset - 1, wsOffset);
                 }
-                if (whitespaceToken != null) {
-                    return whitespaceToken.offset(th) + whitespaceToken.length();
+                if (whitespaceTokenItem != null) {
+                    return whitespaceTokenItem.getOffset() + whitespaceTokenItem.getImage().length();
                 }
             }
         }
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java	2011-08-04 21:48:28.748408787 +0100
@@ -456,7 +456,7 @@
             // Search would stop on an extra opening left brace if found
             int braceBalance = 0; // balance of '{' and '}'
             int bracketBalance = -1; // balance of the brackets or parenthesis
-            int numOfSemi = 0;
+            int lastRBracketIndex = javaTS.index();
             boolean finished = false;
             while (!finished && javaTS.movePrevious()) {
                 JavaTokenId id = javaTS.token().id();
@@ -499,31 +499,9 @@
                     case RBRACE:
                         braceBalance--;
                         break;
-                        
-                    case SEMICOLON:
-                        numOfSemi++;
-                        break;
                 }
             }
 
-            if (bracketBalance == 0 && numOfSemi < 2) {
-                finished = false;
-                while (!finished && javaTS.movePrevious()) {
-                    switch (javaTS.token().id()) {
-                        case WHITESPACE:
-                        case LINE_COMMENT:
-                        case BLOCK_COMMENT:
-                        case JAVADOC_COMMENT:
-                            break;
-                        case FOR:
-                            bracketBalance--;
-                        default:
-                            finished = true;
-                            break;
-                    }
-                }
-            }
-            
             skipClosingBracket = bracketBalance != 0;
 
             //commented out due to #147683:
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/JavaCompletionProvider.java	2011-08-04 21:48:28.758408099 +0100
@@ -644,8 +644,8 @@
                 case CATCH:
                     insideCatch(env);
                     break;
-                case UNION_TYPE:
-                    insideUnionType(env);
+                case DISJUNCTIVE_TYPE:
+                    insideDisjunctiveType(env);
                     break;
                 case IF:
                     insideIf(env);
@@ -1831,10 +1831,10 @@
             }
         }
 
-        private void insideUnionType(Env env) throws IOException {
+        private void insideDisjunctiveType(Env env) throws IOException {
             TreePath path = env.getPath();
             String prefix = env.getPrefix();
-            UnionTypeTree dtt = (UnionTypeTree)path.getLeaf();
+            DisjunctiveTypeTree dtt = (DisjunctiveTypeTree)path.getLeaf();
             CompilationController controller = env.getController();
             TokenSequence<JavaTokenId> last = findLastNonWhitespaceToken(env, dtt, env.getOffset());
             if (last != null && last.token().id() == JavaTokenId.BAR) {
@@ -2356,8 +2356,8 @@
                     results.add(JavaCompletionItem.createVariableItem(env.getController(), name, anchorOffset, true, false));
                 return;
             }
-            if (et.getKind() == Tree.Kind.UNION_TYPE) {
-                for(Tree t : ((UnionTypeTree)et).getTypeAlternatives()) {
+            if (et.getKind() == Tree.Kind.DISJUNCTIVE_TYPE) {
+                for(Tree t : ((DisjunctiveTypeTree)et).getTypeAlternatives()) {
                     et = t;
                     exPath = new TreePath(exPath, t);
                 }
@@ -3733,52 +3733,27 @@
                     if (e.getKind().isField())
                         initializedFields.add((VariableElement)e);
                 }
-                Map<ExecutableElement, boolean[]> ctors2generate = new LinkedHashMap<ExecutableElement, boolean[]>();
                 GeneratorUtils.scanForFieldsAndConstructors(controller, clsPath, initializedFields, uninitializedFields, constructors);
-                for (ExecutableElement ctor : ElementFilter.constructorsIn(((DeclaredType)te.getSuperclass()).asElement().getEnclosedElements())) {
-                    if (!ctor.getModifiers().contains(Modifier.PRIVATE)) {
-                        ctors2generate.put(ctor, new boolean[] {true, !uninitializedFields.isEmpty()});
-                    }
-                }
+                boolean hasDefaultConstructor = false;
+                boolean hasConstrutorForAllUnintialized = false;
                 for (ExecutableElement ee : constructors) {
-                    if (!controller.getElementUtilities().isSynthetic(ee)) {
-                        List<? extends VariableElement> parameters = ee.getParameters();
-                        for (Map.Entry<ExecutableElement, boolean[]> entry : ctors2generate.entrySet()) {
-                            int size = entry.getKey().getParameters().size();
-                            if (size >= 0 && parameters.size() == size) {
-                                Iterator<? extends VariableElement> proposed = entry.getKey().getParameters().iterator();
-                                Iterator<? extends VariableElement> original = parameters.iterator();                        
-                                boolean same = true;
-                                while (same && proposed.hasNext() && original.hasNext())
-                                    same &= controller.getTypes().isSameType(proposed.next().asType(), original.next().asType());
-                                if (same)
-                                    entry.getValue()[0] = false;
-                            } else if (!uninitializedFields.isEmpty()) {
-                                size += uninitializedFields.size();
-                                if (size > 0 && parameters.size() == size) {
-                                    Iterator<? extends VariableElement> proposed = uninitializedFields.iterator();
-                                    Iterator<? extends VariableElement> original = parameters.iterator();                        
-                                    boolean same = true;
-                                    while (same && proposed.hasNext() && original.hasNext())
-                                        same &= controller.getTypes().isSameType(proposed.next().asType(), original.next().asType());
-                                    if (same) {
-                                        proposed = entry.getKey().getParameters().iterator();
-                                        while (same && proposed.hasNext() && original.hasNext())
-                                            same &= controller.getTypes().isSameType(proposed.next().asType(), original.next().asType());
-                                        if (same)
-                                            entry.getValue()[1] = false;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-                for (Map.Entry<ExecutableElement, boolean[]> entry : ctors2generate.entrySet()) {
-                    if (entry.getValue()[0])
-                        results.add(JavaCompletionItem.createInitializeAllConstructorItem(env.getController(), Collections.<VariableElement>emptySet(), entry.getKey(), te, anchorOffset));
-                    if (entry.getValue()[1])
-                        results.add(JavaCompletionItem.createInitializeAllConstructorItem(env.getController(), uninitializedFields, entry.getKey(), te, anchorOffset));
-                }
+                    List<? extends VariableElement> parameters = ee.getParameters();
+                    if (parameters.isEmpty() && !controller.getElementUtilities().isSynthetic(ee))
+                        hasDefaultConstructor = true;
+                    if (parameters.size() == uninitializedFields.size() && !uninitializedFields.isEmpty()) {
+                        Iterator<? extends VariableElement> proposed = uninitializedFields.iterator();
+                        Iterator<? extends VariableElement> original = parameters.iterator();                        
+                        boolean same = true;
+                        while (same && proposed.hasNext() && original.hasNext())
+                            same &= controller.getTypes().isSameType(proposed.next().asType(), original.next().asType());
+                        if (same)
+                            hasConstrutorForAllUnintialized = true;
+                    }
+                }
+                if (!uninitializedFields.isEmpty() && !hasConstrutorForAllUnintialized)
+                    results.add(JavaCompletionItem.createInitializeAllConstructorItem(env.getController(), uninitializedFields, te, anchorOffset));
+                if (!hasDefaultConstructor)
+                    results.add(JavaCompletionItem.createInitializeAllConstructorItem(env.getController(), Collections.<VariableElement>emptySet(), te, anchorOffset));
             }
         }
         
Index: netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/src/org/netbeans/modules/editor/java/GoToSupport.java	2011-08-04 21:48:28.758408099 +0100
@@ -370,9 +370,15 @@
             return null;
         }
 
+        TypeMirror parentTypeForAnonymous = null;
+
         if (controller.getElementUtilities().isSynthetic(el) && el.getKind() == ElementKind.CONSTRUCTOR) {
             //check for annonymous innerclasses:
-            el = handlePossibleAnonymousInnerClass(controller, el);
+            TypeMirror[] classTypeRef = new TypeMirror[] {classType };
+
+            el = handlePossibleAnonymousInnerClass(controller, el, classTypeRef);
+
+            classType = parentTypeForAnonymous = classTypeRef[0];
         }
 
         if (isError(el)) {
@@ -383,7 +389,7 @@
             return null;
         }
 
-        return new Context(classType, el);
+        return new Context(classType, parentTypeForAnonymous, el);
     }
 
     private static String computeTooltip(CompilationInfo controller, Context resolved, String key) {
@@ -391,6 +397,8 @@
 
         if (resolved.resolved.getKind() == ElementKind.CONSTRUCTOR && resolved.classType != null && resolved.classType.getKind() == TypeKind.DECLARED) {
             v.printExecutable(((ExecutableElement) resolved.resolved), (DeclaredType) resolved.classType, true);
+        } else if (resolved.resolved.getKind() == ElementKind.INTERFACE && resolved.parentTypeForAnonymous != null && resolved.parentTypeForAnonymous.getKind() == TypeKind.DECLARED) {
+            v.printType(((TypeElement) resolved.resolved), (DeclaredType) resolved.classType, true);
         } else  {
             v.visit(resolved.resolved, true);
         }
@@ -454,9 +462,12 @@
         return new int [] {ts.offset(), ts.offset() + t.length()};
     }
     
-    private static Element handlePossibleAnonymousInnerClass(CompilationInfo info, final Element el) {
+    private static Element handlePossibleAnonymousInnerClass(CompilationInfo info, final Element el, TypeMirror[] classTypeRef) {
         Element encl = el.getEnclosingElement();
         Element doubleEncl = encl != null ? encl.getEnclosingElement() : null;
+        TypeMirror classType = classTypeRef[0];
+
+        classTypeRef[0] = null;
         
         if (   doubleEncl != null
             && !doubleEncl.getKind().isClass()
@@ -470,6 +481,25 @@
                 NewClassTree nct = (NewClassTree) enclTreePath.getParentPath().getLeaf();
                 
                 if (nct.getClassBody() != null) {
+                    List<? extends TypeMirror> sup = classType != null && classType.getKind() == TypeKind.DECLARED
+                            ? info.getTypes().directSupertypes(classType) : Collections.<TypeMirror>emptyList();
+                    TypeElement jlObject = info.getElements().getTypeElement("java.lang.Object");
+
+                    if (jlObject != null) {
+                        TypeMirror jlObjectType = jlObject.asType();
+                        TypeMirror parent = null;
+
+                        for(TypeMirror tm : sup) {
+                            if (info.getTypes().isSameType(tm, jlObjectType)) {
+                                continue;
+                            }
+                            assert parent == null;
+                            parent = tm;
+                        }
+
+                        classTypeRef[0] = parent;
+                    }
+                    
                     Element parentElement = info.getTrees().getElement(new TreePath(enclTreePath, nct.getIdentifier()));
                     
                     if (parentElement == null || parentElement.getKind().isInterface()) {
@@ -955,9 +985,11 @@
 
     public static final class Context {
         public final TypeMirror classType;
+        public final TypeMirror parentTypeForAnonymous;
         public final Element resolved;
-        public Context(TypeMirror classType, Element resolved) {
+        public Context(TypeMirror classType, TypeMirror parentTypeForAnonymous, Element resolved) {
             this.classType = classType;
+            this.parentTypeForAnonymous = parentTypeForAnonymous;
             this.resolved = resolved;
         }
     }
Index: netbeans-7.0.1+dfsg1/java.editor/nbproject/project.properties
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/nbproject/project.properties	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/nbproject/project.properties	2011-08-04 21:48:28.758408099 +0100
@@ -42,7 +42,7 @@
 
 javadoc.title=Java Editor
 
-spec.version.base=2.34.1
+spec.version.base=2.32.1
 test.qa-functional.cp.extra=${editor.dir}/modules/org-netbeans-modules-editor-fold.jar
 javac.source=1.6
 #test.unit.cp.extra=
@@ -91,8 +91,7 @@
    org/netbeans/modules/java/editor/semantic/DetectorTest.class,\
    org/netbeans/modules/java/editor/semantic/MarkOccDetTest.class,\
    org/netbeans/modules/java/editor/semantic/UnusedImportsTest.class,\
-   org/netbeans/modules/editor/java/GoToSupportTest.class,\
-   org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.class
+   org/netbeans/modules/editor/java/GoToSupportTest.class
 
 test.timeout=1200000
 
Index: netbeans-7.0.1+dfsg1/java.editor/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/nbproject/project.xml	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/nbproject/project.xml	2011-08-04 21:48:28.758408099 +0100
@@ -55,7 +55,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.33.1</specification-version>
+                        <specification-version>1.18</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -64,7 +64,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.29.1</specification-version>
+                        <specification-version>1.24</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -73,7 +73,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.24.1</specification-version>
+                        <specification-version>1.16</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -88,7 +88,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>3</release-version>
-                        <specification-version>1.57.1.5.13.10</specification-version>
+                        <specification-version>1.53</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -97,7 +97,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>0-1</release-version>
-                        <specification-version>1.18.1</specification-version>
+                        <specification-version>1.6</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -123,7 +123,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>0-1</release-version>
-                        <specification-version>1.4.1.1.5.13.10</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -149,7 +149,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>2</release-version>
-                        <specification-version>1.24.1</specification-version>
+                        <specification-version>1.19</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -158,7 +158,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>
@@ -167,7 +167,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.43.1.10</specification-version>
+                        <specification-version>1.35</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -176,7 +176,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.22.1</specification-version>
+                        <specification-version>1.6</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -185,7 +185,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.19</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -202,7 +202,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.20.1</specification-version>
+                        <specification-version>1.9</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -211,7 +211,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.14.1</specification-version>
+                        <specification-version>1.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -219,7 +219,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.18.1.1</specification-version>
+                        <specification-version>1.9</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -227,7 +227,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>0.79.1.17.15.6</specification-version>
+                        <specification-version>0.67</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -236,7 +236,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.22.1.1.17</specification-version>
+                        <specification-version>1.20</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -245,7 +245,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>
@@ -254,7 +254,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>
@@ -263,7 +263,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>
@@ -272,7 +272,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.42.1.6</specification-version>
+                        <specification-version>1.26</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -281,7 +281,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>
@@ -289,7 +289,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.16.1</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -298,7 +298,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>0-1</release-version>
-                        <specification-version>1.18.1.7.10</specification-version>
+                        <specification-version>1.7</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -306,7 +306,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.31.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -314,7 +314,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.20.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -322,7 +322,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.35.1</specification-version>
+                        <specification-version>6.8</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -330,7 +330,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.47.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -338,7 +338,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
+                        <specification-version>4.11</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -346,7 +346,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.23.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -354,7 +354,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -362,7 +362,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.37.1</specification-version>
+                        <specification-version>6.16</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -370,7 +370,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.15.1</specification-version>
+                        <specification-version>8.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -378,7 +378,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.8.1</specification-version>
+                        <specification-version>8.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -386,7 +386,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>
Index: netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/java/editor/view/JavaViewHierarchyRandomTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/test/unit/src/org/netbeans/modules/java/editor/view/JavaViewHierarchyRandomTest.java	2011-07-28 20:45:54.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/java/editor/view/JavaViewHierarchyRandomTest.java	2011-08-04 21:48:28.758408099 +0100
@@ -45,7 +45,6 @@
 package org.netbeans.modules.java.editor.view;
 
 import java.awt.Color;
-import java.awt.Font;
 import java.awt.Rectangle;
 import java.util.ArrayList;
 import java.util.Arrays;
@@ -66,7 +65,6 @@
 import javax.swing.text.BadLocationException;
 import javax.swing.text.DefaultEditorKit;
 import javax.swing.text.Document;
-import javax.swing.text.Position;
 import javax.swing.text.Position.Bias;
 import javax.swing.text.SimpleAttributeSet;
 import javax.swing.text.StyleConstants;
@@ -89,6 +87,7 @@
 import org.netbeans.spi.editor.highlighting.HighlightsSequence;
 import org.netbeans.spi.editor.highlighting.ZOrder;
 import org.netbeans.spi.editor.mimelookup.MimeDataProvider;
+import org.openide.util.Exceptions;
 import org.openide.util.Lookup;
 import org.openide.util.RequestProcessor;
 import org.openide.util.Task;
@@ -106,7 +105,6 @@
     public JavaViewHierarchyRandomTest(String testName) {
         super(testName);
         List<String> includes = new ArrayList<String>();
-//        includes.add("testToolTipView");
 //        includes.add("testSimpleBadListener");
 //        includes.add("testRemoveNewline");
 //        includes.add("testGap");
@@ -145,7 +143,6 @@
         Logger.getLogger("org.netbeans.modules.editor.lib2.view.EditorBoxViewChildren").setLevel(Level.FINE);
         Logger.getLogger("org.netbeans.editor.BaseDocument.EDT").setLevel(Level.FINE);
         Logger.getLogger("org.netbeans.editor.BaseCaret.EDT").setLevel(Level.FINE);
-        ViewHierarchyRandomTesting.setDirectViewRebuild(true);
     }
 
     @Override
@@ -360,7 +357,7 @@
         RandomTestContainer.Context context = container.context();
 //        ViewHierarchyRandomTesting.disableHighlighting(container);
         DocumentTesting.setSameThreadInvoke(context, true); // Do not post to EDT
-        DocumentTesting.insert(context, 0, "abc\ndef\nghi\n");
+        DocumentTesting.insert(context, 0, "abc\ndef\ng\thi\n\nj\tkl\nmno\n\np\tqr\n stuv \n\nwxyz");
         final JEditorPane[] toolTipPaneRef = new JEditorPane[1];
         final BadLocationException[] excRef = new BadLocationException[1];
         final JFrame[] toolTipFrameRef = new JFrame[1];
@@ -371,32 +368,17 @@
                 toolTipPaneRef[0] = toolTipPane;
                 toolTipPane.setEditorKit(pane.getEditorKit());
                 try {
-                    Position startPos = doc.createPosition(4); // Line begining
-                    Position endPos = doc.createPosition(8); // Line boundary too
-                    toolTipPane.putClientProperty("document-view-start-position", startPos);
-                    toolTipPane.putClientProperty("document-view-end-position", endPos);
-                    toolTipPane.setDocument(doc);
-                    JFrame toolTipFrame = new JFrame("ToolTip Frame");
-                    toolTipFrameRef[0] = toolTipFrame;
-                    toolTipFrame.getContentPane().add(new JScrollPane(toolTipPane));
-                    toolTipFrame.setSize(100, 100);
-                    toolTipFrame.setVisible(true);
-
-                    doc.insertString(4, "o", null);
-                    toolTipPane.setFont(new Font("Monospaced", Font.PLAIN, 22)); // Force VH rebuild
-                    toolTipPane.modelToView(6);
-                    doc.remove(3, 3);
-                    doc.insertString(4, "ab", null);
-                    
-                    assert (endPos.getOffset() == 8);
-                    doc.remove(7, 2);
-                    toolTipPane.setFont(new Font("Monospaced", Font.PLAIN, 23)); // Force VH rebuild
-                    toolTipPane.modelToView(6);
-
+                    toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(4));
+                    toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(20));
                 } catch (BadLocationException ex) {
                     excRef[0] = ex;
                 }
-
+                toolTipPane.setDocument(doc);
+                JFrame toolTipFrame = new JFrame("ToolTip Frame");
+                toolTipFrameRef[0] = toolTipFrame;
+                toolTipFrame.getContentPane().add(new JScrollPane(toolTipPane));
+                toolTipFrame.setSize(100, 100);
+                toolTipFrame.setVisible(true);
             }
         };
         SwingUtilities.invokeAndWait(tooltipRun);
@@ -404,13 +386,14 @@
             throw new IllegalStateException(excRef[0]);
         }
 
+        DocumentTesting.insert(context, 10, "abc\ndef\ng");
+        DocumentTesting.remove(context, 15, 4);
+        DocumentTesting.insert(context, 4, "abc\ndef\ng");
+        DocumentTesting.insert(context, 20, "abc\ndef\ng");
         DocumentTesting.setSameThreadInvoke(context, false);
-        DocumentTesting.undo(context, 2);
-        DocumentTesting.undo(context, 1);
-        DocumentTesting.undo(context, 1);
+        DocumentTesting.undo(context, 4);
         DocumentTesting.redo(context, 4);
         
-        // Hide tooltip's frame
         SwingUtilities.invokeLater(new Runnable() {
             @Override
             public void run() {
@@ -778,7 +761,7 @@
                 toolTipPane.setEditorKit(pane.getEditorKit());
                 try {
                     toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(4));
-                    toolTipPane.putClientProperty("document-view-end-position", doc.createPosition(20));
+                    toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(20));
                 } catch (BadLocationException ex) {
                     excRef[0] = ex;
                 }
@@ -790,7 +773,7 @@
                 toolTipFrame.setVisible(true);
             }
         };
-        SwingUtilities.invokeAndWait(tooltipRun);
+// Uncomment for #196814 fixing       SwingUtilities.invokeAndWait(tooltipRun);
         if (excRef[0] != null) {
             throw new IllegalStateException(excRef[0]);
         }
@@ -834,7 +817,7 @@
                 toolTipPane.setEditorKit(pane.getEditorKit());
                 try {
                     toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(4));
-                    toolTipPane.putClientProperty("document-view-end-position", doc.createPosition(20));
+                    toolTipPane.putClientProperty("document-view-start-position", doc.createPosition(20));
                 } catch (BadLocationException ex) {
                     excRef[0] = ex;
                 }
@@ -846,7 +829,7 @@
                 toolTipFrame.setVisible(true);
             }
         };
-        SwingUtilities.invokeAndWait(tooltipRun);
+// Uncomment for #196814 fixing       SwingUtilities.invokeAndWait(tooltipRun);
         if (excRef[0] != null) {
             throw new IllegalStateException(excRef[0]);
         }
Index: netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportTest.java	2011-07-28 20:45:54.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/editor/java/GoToSupportTest.java	2011-08-04 21:48:28.758408099 +0100
@@ -974,6 +974,72 @@
         assertEquals(golden, tooltip);
     }
 
+    public void testTooltipForConciseConstructorCall2() throws Exception {
+        String code = "package test; public class Test {java.util.List<String> l = new java.util.Arr|ayList<>() {};}";
+        int offset = code.indexOf('|');
+        code = code.replaceAll(Pattern.quote("|"), "");
+        assertNotSame(-1, offset);
+        String golden = "<html><body>public  <b>ArrayList</b>&lt;java.lang.String&gt;()";
+
+        String tooltip = performTest(code, offset, new OrigUiUtilsCaller() {
+            public void open(FileObject fo, int pos) {
+                fail("Should not be called.");
+            }
+            public void beep() {
+                fail("Should not be called.");
+            }
+            public void open(ClasspathInfo info, Element el) {
+                fail("Should not be called.");
+            }
+        }, true);
+
+        assertEquals(golden, tooltip);
+    }
+
+    public void testTooltipForConciseConstructorCall3() throws Exception {
+        String code = "package test; public class Test {java.util.List<String> l = new java.util.L|ist<>() {};}";
+        int offset = code.indexOf('|');
+        code = code.replaceAll(Pattern.quote("|"), "");
+        assertNotSame(-1, offset);
+        String golden = "<html><body>public abstract interface java.util.List&lt;java.lang.String&gt;";
+
+        String tooltip = performTest(code, offset, new OrigUiUtilsCaller() {
+            public void open(FileObject fo, int pos) {
+                fail("Should not be called.");
+            }
+            public void beep() {
+                fail("Should not be called.");
+            }
+            public void open(ClasspathInfo info, Element el) {
+                fail("Should not be called.");
+            }
+        }, true);
+
+        assertEquals(golden, tooltip);
+    }
+
+    public void testTooltipForConciseConstructorCall4() throws Exception {
+        String code = "package test; public class Test {java.util.List<String> l = new java.util.LinkedL|ist<>(java.util.Arrays.asList(\"\")) {};}";
+        int offset = code.indexOf('|');
+        code = code.replaceAll(Pattern.quote("|"), "");
+        assertNotSame(-1, offset);
+        String golden = "<html><body>public  <b>LinkedList</b>&lt;java.lang.String&gt;(java.util.Collection&lt;? extends java.lang.String&gt; arg0)";
+
+        String tooltip = performTest(code, offset, new OrigUiUtilsCaller() {
+            public void open(FileObject fo, int pos) {
+                fail("Should not be called.");
+            }
+            public void beep() {
+                fail("Should not be called.");
+            }
+            public void open(ClasspathInfo info, Element el) {
+                fail("Should not be called.");
+            }
+        }, true);
+
+        assertEquals(golden, tooltip);
+    }
+
     private FileObject source;
     
     private String performTest(String sourceCode, final int offset, final OrigUiUtilsCaller validator, boolean tooltip) throws Exception {
Index: netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java	2011-07-28 20:45:54.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java	2011-08-04 21:48:28.768407458 +0100
@@ -1,7 +1,7 @@
 /*
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  *
- * Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved.
+ * Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
  *
  * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  * Other names may be trademarks of their respective owners.
@@ -27,7 +27,7 @@
  * Contributor(s):
  *
  * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun
+ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  * Microsystems, Inc. All Rights Reserved.
  *
  * If you wish your version of this file to be governed by only the CDDL
@@ -61,7 +61,8 @@
 import org.netbeans.api.lexer.Language;
 import org.netbeans.junit.NbTestCase;
 import org.netbeans.lib.editor.util.CharSequenceUtilities;
-import org.openide.awt.AcceleratorBinding;
+import org.openide.modules.ModuleInfo;
+import org.openide.util.Lookup;
 
 
 /**
@@ -79,9 +80,7 @@
     @Override
     protected void setUp() throws Exception {
         super.setUp();
-        Preferences prefs = MimeLookup.getLookup(JavaKit.JAVA_MIME_TYPE).lookup(Preferences.class);
-        prefs.putBoolean(SimpleValueNames.COMPLETION_PAIR_CHARACTERS, true);
-        Class.forName(AcceleratorBinding.class.getName(), true, AcceleratorBinding.class.getClassLoader());
+        Lookup.getDefault().lookup(ModuleInfo.class);
     }
 
     // ------- Tests for completion of right parenthesis ')' -------------
@@ -204,167 +203,99 @@
 
     public void testTypeAddRightBraceIfLeftBrace() {
         Context ctx = new Context(new JavaKit(),
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) {|\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) {|"
         );
         ctx.typeChar('\n');
         ctx.assertDocumentTextEquals(
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) {\n" +
-                "            |\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) {\n" +
+                "    |\n" +
+                "}"
         );
     }
 
     public void testTypeAddRightBraceIfLeftBraceWhiteSpace() {
         Context ctx = new Context(new JavaKit(),
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) { \t|\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) { \t|"
         );
         ctx.typeChar('\n');
         ctx.assertDocumentTextEquals(
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) { \t\n" +
-                "            |\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) { \t\n" +
+                "    |\n" +
+                "}"
         );
     }
 
     public void testTypeAddRightBraceIfLeftBraceLineComment() {
         Context ctx = new Context(new JavaKit(),
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) { // line-comment|\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) { // line-comment|"
         );
         ctx.typeChar('\n');
         ctx.assertDocumentTextEquals(
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) { // line-comment\n" +
-                "            |\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) { // line-comment\n" +
+                "    |\n" +
+                "}"
         );
     }
 
     public void testTypeAddRightBraceIfLeftBraceBlockComment() {
         Context ctx = new Context(new JavaKit(),
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) { /* block-comment */|\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) { /* block-comment */|"
         );
         ctx.typeChar('\n');
         ctx.assertDocumentTextEquals(
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) { /* block-comment */\n" +
-                "            |\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) { /* block-comment */\n" +
+                "    |\n" +
+                "}"
         );
     }
 
     public void testTypeAddRightBraceIfLeftBraceAlreadyPresent() {
         Context ctx = new Context(new JavaKit(),
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) {|\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) {|\n" +
+                "}"
         );
         ctx.typeChar('\n');
         ctx.assertDocumentTextEquals(
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) {\n" +
-                "            |\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) {\n" +
+                "    |\n" +
+                "}"
         );
     }
 
-    public void XtestTypeAddRightBraceCaretInComment() {
-        Context ctx = new Context(new JavaKit(),
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) { /* unclosed-block-comment|\n" +
-                "          */\n" +
-                "    }\n" +
-                "}\n"
+    public void testTypeAddRightBraceCaretInComment() {
+        Context ctx = new Context(new JavaKit(),
+                "if (true) { /* unclosed-block-comment|\n" +
+                "  */"
         );
         ctx.typeChar('\n');
         ctx.assertDocumentTextEquals(
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) { /* unclosed-block-comment\n" +
-                "                     * |\n" +
-                "          */\n" +
-                "    }\n" +
-                "}\n"
+                "if (true) { /* unclosed-block-comment\n" +
+                "             * |\n" +
+                "  */"
         );
     }
 
     public void testTypeAddRightBraceMultiLine() {
         Context ctx = new Context(new JavaKit(),
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) {| System.out.println(\n" +
-                "        \"\");\n" +
-                "    }\n" +
-                "}\n"
-                );
+                "if (true) {| System.out.println(\n" +
+                "\"\");\n");
 
         ctx.typeChar('\n');
         ctx.assertDocumentTextEquals(
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) {\n" +
-                "            System.out.println(\n" +
-                "        \"\");\n" +
-                "    }\n" +
-                "}\n"
-                );
+                "if (true) {\n" +
+                "    System.out.println(\n" +
+                "\"\");\n");
     }
 
     public void testTypeAddRightBraceSingleLine() {
         Context ctx = new Context(new JavaKit(),
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) {| System.out.println(\"\");\n" +
-                "    }\n" +
-                "}\n"
-                );
+                "if (true) {| System.out.println(\"\");\n");
 
         ctx.typeChar('\n');
         ctx.assertDocumentTextEquals(
-                "class Test {\n" +
-                "    {\n" +
-                "        if (true) {\n" +
-                "            System.out.println(\"\");\n" +
-                "        }\n" +
-                "    }\n" +
-                "}\n"
-                );
+                "if (true) {\n" +
+                "    System.out.println(\"\");\n" +
+                "}\n");
     }
 
 
@@ -863,66 +794,6 @@
         );
     }
 
-    public void testSkipWhenBalanced198194a() throws Exception {
-        Context ctx = new Context(new JavaKit(),
-                "for (int i = a(|); i < 10; i++)"
-        );
-        ctx.typeChar(')');
-        ctx.assertDocumentTextEquals(
-                "for (int i = a()|; i < 10; i++)"
-        );
-    }
-
-    public void testSkipWhenNotBalanced198194a() throws Exception {
-        Context ctx = new Context(new JavaKit(),
-                "for (int i = a(|; i < 10; i++)"
-        );
-        ctx.typeChar(')');
-        ctx.assertDocumentTextEquals(
-                "for (int i = a()|; i < 10; i++)"
-        );
-    }
-
-    public void testSkipWhenBalanced198194b() throws Exception {
-        Context ctx = new Context(new JavaKit(),
-                "for (int i = a(); i < 10; i = a(|))"
-        );
-        ctx.typeChar(')');
-        ctx.assertDocumentTextEquals(
-                "for (int i = a(); i < 10; i = a()|)"
-        );
-    }
-
-    public void testSkipWhenNotBalanced198194b() throws Exception {
-        Context ctx = new Context(new JavaKit(),
-                "for (int i = a(); i < 10; i = a(|)"
-        );
-        ctx.typeChar(')');
-        ctx.assertDocumentTextEquals(
-                "for (int i = a(); i < 10; i = a()|)"
-        );
-    }
-
-    public void testSkipWhenNotBalanced198194c() throws Exception {
-        Context ctx = new Context(new JavaKit(),
-                "for (int i = a(); i < 10; i++) a(|;"
-        );
-        ctx.typeChar(')');
-        ctx.assertDocumentTextEquals(
-                "for (int i = a(); i < 10; i++) a()|;"
-        );
-    }
-
-    public void testSkipWhenBalanced198194c() throws Exception {
-        Context ctx = new Context(new JavaKit(),
-                "for (int i = a(); i < 10; i++) a(|);"
-        );
-        ctx.typeChar(')');
-        ctx.assertDocumentTextEquals(
-                "for (int i = a(); i < 10; i++) a()|;"
-        );
-    }
-
     public void testKeepBalance148878() throws Exception {
         Context ctx = new Context(new JavaKit(),
                 "Map[|] m = new HashMap[1];"
Index: netbeans-7.0.1+dfsg1/java.kit/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.kit/nbproject/project.xml	2011-08-04 21:48:28.588416313 +0100
+++ netbeans-7.0.1+dfsg1/java.kit/nbproject/project.xml	2011-08-04 21:48:28.768407458 +0100
@@ -58,14 +58,14 @@
                 <dependency>
                     <code-name-base>org.netbeans.modules.java.debug</code-name-base>
                     <run-dependency>
-                        <specification-version>1.19.1.1.15.17</specification-version>
+                        <specification-version>1.17.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
                     <code-name-base>org.netbeans.modules.java.editor</code-name-base>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>2.34.1.8.1.1</specification-version>
+                        <specification-version>2.32.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -100,7 +100,7 @@
                     <code-name-base>org.netbeans.modules.java.hints</code-name-base>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.54.1.5.8.17.6</specification-version>
+                        <specification-version>1.49.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -127,7 +127,7 @@
                     <code-name-base>org.netbeans.modules.java.navigation</code-name-base>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.21.1</specification-version>
+                        <specification-version>1.20.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
Index: netbeans-7.0.1+dfsg1/java.debug/src/org/netbeans/modules/java/debug/TreeNode.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.debug/src/org/netbeans/modules/java/debug/TreeNode.java	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.debug/src/org/netbeans/modules/java/debug/TreeNode.java	2011-08-04 21:48:28.768407458 +0100
@@ -58,6 +58,7 @@
 import com.sun.source.tree.CompoundAssignmentTree;
 import com.sun.source.tree.ConditionalExpressionTree;
 import com.sun.source.tree.ContinueTree;
+import com.sun.source.tree.DisjunctiveTypeTree;
 import com.sun.source.tree.DoWhileLoopTree;
 import com.sun.source.tree.EmptyStatementTree;
 import com.sun.source.tree.EnhancedForLoopTree;
@@ -88,7 +89,6 @@
 import com.sun.source.tree.TypeCastTree;
 import com.sun.source.tree.TypeParameterTree;
 import com.sun.source.tree.UnaryTree;
-import com.sun.source.tree.UnionTypeTree;
 import com.sun.source.tree.VariableTree;
 import com.sun.source.tree.WhileLoopTree;
 import com.sun.source.tree.WildcardTree;
@@ -397,12 +397,12 @@
         }
 
         @Override
-        public Void visitUnionType(UnionTypeTree tree, List<Node> d) {
+        public Void visitDisjunctiveType(DisjunctiveTypeTree tree, List<Node> d) {
             List<Node> below = new ArrayList<Node>();
 
             addCorrespondingType(below);
             addCorrespondingComments(below);
-            super.visitUnionType(tree, below);
+            super.visitDisjunctiveType(tree, below);
 
             d.add(new TreeNode(info, getCurrentPath(), below));
             return null;
Index: netbeans-7.0.1+dfsg1/java.debug/nbproject/project.properties
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.debug/nbproject/project.properties	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.debug/nbproject/project.properties	2011-08-04 21:48:28.768407458 +0100
@@ -40,6 +40,6 @@
 # Version 2 license, then the option applies only if the new code is
 # made subject to such option by the copyright holder.
 javac.source=1.6
-spec.version.base=1.19.1
+spec.version.base=1.17.1
 requires.nb.javac=true
 
Index: netbeans-7.0.1+dfsg1/java.debug/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.debug/nbproject/project.xml	2011-07-28 20:45:52.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.debug/nbproject/project.xml	2011-08-04 21:48:28.768407458 +0100
@@ -11,7 +11,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.9.1</specification-version>
+                        <specification-version>1.4</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -20,7 +20,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.33.1</specification-version>
+                        <specification-version>1.18</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -29,7 +29,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>
@@ -53,7 +53,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>
@@ -62,7 +62,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.43.1.10</specification-version>
+                        <specification-version>1.4</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -71,7 +71,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.11</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -88,7 +88,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.14</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -97,7 +97,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.17.1</specification-version>
+                        <specification-version>1.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -105,7 +105,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.35.1</specification-version>
+                        <specification-version>6.8</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -113,7 +113,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.47.1</specification-version>
+                        <specification-version>6.3</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -121,7 +121,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
+                        <specification-version>5.7</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -129,7 +129,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
+                        <specification-version>6.6</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -137,7 +137,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.37.1</specification-version>
+                        <specification-version>6.16</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -145,7 +145,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.15.1</specification-version>
+                        <specification-version>8.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -153,7 +153,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.8.1</specification-version>
+                        <specification-version>8.0</specification-version>
                     </run-dependency>
                 </dependency>
             </module-dependencies>
Index: netbeans-7.0.1+dfsg1/java.hints/manifest.mf
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/manifest.mf	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/manifest.mf	2011-08-04 21:48:28.768407458 +0100
@@ -1,6 +1,6 @@
 Manifest-version: 1.0
 OpenIDE-Module: org.netbeans.modules.java.hints/1
-OpenIDE-Module-Implementation-Version: 5
+OpenIDE-Module-Implementation-Version: 4
 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/hints/resources/Bundle.properties
 OpenIDE-Module-Layer: org/netbeans/modules/java/hints/resources/layer.xml
 AutoUpdate-Show-In-Client: false
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/StaticAccess.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/StaticAccess.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/StaticAccess.java	2011-08-04 21:48:28.768407458 +0100
@@ -94,7 +94,7 @@
             return null;
         }
         Element el = info.getTypes().asElement(tm);
-        if (el == null || (!el.getKind().isClass() && !el.getKind().isInterface())) {
+        if (el == null || el.getKind() != ElementKind.CLASS) {
             return null;
         }
         
@@ -135,7 +135,10 @@
             return null;
         }
         
-        int[] span = info.getTreeUtilities().findNameSpan(mst);
+        int[] span = {
+            (int)info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), expression),
+            (int)info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), expression),
+        };
         
         if (span[0] == (-1) || span[1] == (-1)) {
             return null;
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/ExportNonAccessibleElement.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/ExportNonAccessibleElement.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/ExportNonAccessibleElement.java	2011-08-04 21:48:28.768407458 +0100
@@ -57,6 +57,7 @@
 import javax.lang.model.element.VariableElement;
 import javax.lang.model.type.ArrayType;
 import javax.lang.model.type.DeclaredType;
+import javax.lang.model.type.DisjunctiveType;
 import javax.lang.model.type.ErrorType;
 import javax.lang.model.type.ExecutableType;
 import javax.lang.model.type.NoType;
@@ -66,7 +67,6 @@
 import javax.lang.model.type.TypeMirror;
 import javax.lang.model.type.TypeVariable;
 import javax.lang.model.type.TypeVisitor;
-import javax.lang.model.type.UnionType;
 import javax.lang.model.type.WildcardType;
 import javax.swing.JComponent;
 import org.netbeans.api.java.source.Task;
@@ -350,7 +350,7 @@
     }
 
     @Override
-    public Boolean visitUnion(UnionType tm, Void p) {
+    public Boolean visitDisjunctive(DisjunctiveType tm, Void p) {
         for (TypeMirror t : tm.getAlternatives()) {
             if (stop) {
                 return false;
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/ConvertAnonymousToInner.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/ConvertAnonymousToInner.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/ConvertAnonymousToInner.java	2011-08-04 21:48:28.768407458 +0100
@@ -166,9 +166,6 @@
     public List<ErrorDescription> run(CompilationInfo compilationInfo, TreePath treePath) {
         int pos = CaretAwareJavaSourceTaskFactory.getLastPosition(compilationInfo.getFileObject());
         int[] selection = SelectionAwareJavaSourceTaskFactory.getLastSelection(compilationInfo.getFileObject());
-
-        if (selection == null) return null;
-        
         Fix f = computeFix(compilationInfo, selection[0], selection[1], true);
         
         if (f == null)
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/HideField.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/HideField.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/HideField.java	2011-08-04 21:48:28.768407458 +0100
@@ -42,8 +42,6 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.prefs.Preferences;
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ElementKind;
@@ -66,7 +64,6 @@
 import org.openide.loaders.DataObjectNotFoundException;
 import org.openide.util.Exceptions;
 import org.openide.util.NbBundle;
-import org.openide.util.Utilities;
 
 /**
  *
@@ -188,7 +185,7 @@
     protected static synchronized Iterable<? extends Element> getAllMembers(CompilationInfo info, TypeElement clazz) {
         class CleaningWR extends WeakReference<CompilationInfo> implements Runnable {
             public CleaningWR(CompilationInfo info) {
-                super(info, Utilities.activeReferenceQueue());
+                super(info);
             }
             @Override public void run() {
                 synchronized (HideField.class) {
@@ -206,13 +203,7 @@
         if (origInfo == info) {
             map = allMembersCacheTo;
         } else {
-            allMembersCacheFrom = new CleaningWR(info);
             map = allMembersCacheTo = new HashMap<TypeElement, Iterable<? extends Element>>();
-
-            if (info.getFileObject() != null) {
-                Logger.getLogger("TIMER").log(Level.FINE, "HideField.allMembersCacheTo",    //NOI18N
-                        new Object[] {info.getFileObject(), map});
-            }
         }
 
         Iterable<? extends Element> members = map.get(clazz);
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/UtilityClass.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/UtilityClass.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/UtilityClass.java	2011-08-04 21:48:28.778408976 +0100
@@ -59,7 +59,6 @@
 import javax.lang.model.element.VariableElement;
 import javax.lang.model.type.TypeKind;
 import javax.lang.model.type.TypeMirror;
-import javax.lang.model.util.Types;
 import javax.swing.JComponent;
 import org.netbeans.api.java.source.Task;
 import org.netbeans.api.java.source.CompilationInfo;
@@ -154,17 +153,8 @@
             if (e.getKind() != ElementKind.CONSTRUCTOR) {
                 return null;
             }
-            TypeElement jlThrowable = compilationInfo.getElements().getTypeElement("java.lang.Throwable");
-            if (jlThrowable == null) {//no bootclasspath? - better do nothing:
-                return null;
-            }
             ExecutableElement x = (ExecutableElement)e;
-            Element enclosingType = x.getEnclosingElement();
-            Types t = compilationInfo.getTypes();
-            if (t.isSubtype(t.erasure(enclosingType.asType()), t.erasure(jlThrowable.asType()))) {
-                return null;//#197721
-            }
-            List<? extends Element> allElements = enclosingType.getEnclosedElements();
+            List<? extends Element> allElements = x.getEnclosingElement().getEnclosedElements();
             List<Element> enclosedElements = new ArrayList<Element>(allElements.size());
             
             for (Element el : allElements) {
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/bugs/CollectionRemove.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/bugs/CollectionRemove.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/bugs/CollectionRemove.java	2011-08-04 21:48:28.778408976 +0100
@@ -45,7 +45,6 @@
 import com.sun.source.tree.MemberSelectTree;
 import com.sun.source.tree.MethodInvocationTree;
 import com.sun.source.tree.Scope;
-import com.sun.source.tree.Tree.Kind;
 import com.sun.source.util.TreePath;
 import java.util.Iterator;
 import java.util.LinkedList;
@@ -232,15 +231,6 @@
                     warningKey = "HINT_SuspiciousCallIncompatibleTypes"; //NOI18N
                 }
 
-                ExecutableElement checkMethodElement = resolveMethod(ctx.getInfo(), checkMethod);
-                ExecutableElement enclosingMethod = findEnclosingMethod(ctx.getInfo(), ctx.getPath());
-
-                if (   enclosingMethod != null
-                    && checkMethodElement != null
-                    && ctx.getInfo().getElements().overrides(enclosingMethod, checkMethodElement, (TypeElement) checkMethodElement.getEnclosingElement())) {
-                    continue;
-                }
-                
                 String semiFQN = checkMethod.substring(0, checkMethod.indexOf('('));
 
                 String warning = NbBundle.getMessage(CollectionRemove.class,
@@ -314,22 +304,6 @@
         return null;
     }
 
-    private static ExecutableElement findEnclosingMethod(CompilationInfo info, TreePath path) {
-        while (path != null && path.getLeaf().getKind() != Kind.CLASS && path.getLeaf().getKind() != Kind.METHOD) {
-            path = path.getParentPath();
-        }
-
-        if (path != null && path.getLeaf().getKind() == Kind.METHOD) {
-            Element el = info.getTrees().getElement(path);
-
-            if (el != null && el.getKind() == ElementKind.METHOD) {
-                return (ExecutableElement) el;
-            }
-        }
-
-        return null;
-    }
-
     public static final class CollectionRemoveCustomizerImpl extends OneCheckboxCustomizerProvider {
         public CollectionRemoveCustomizerImpl() {
             super(NbBundle.getMessage(CollectionRemove.class, "LBL_CollectionRemoveCustomizer.warnForCastable"),
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jdk/JoinCatches.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/jdk/JoinCatches.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jdk/JoinCatches.java	2011-08-04 21:48:28.778408976 +0100
@@ -164,7 +164,7 @@
 
             for (CatchTree ct : tt.getCatches()) {
                 if (c == first) {
-                    wc.rewrite(ct.getParameter().getType(), wc.getTreeMaker().UnionType(disjointTypes));
+                    wc.rewrite(ct.getParameter().getType(), wc.getTreeMaker().DisjunctiveType(disjointTypes));
                 }
                 
                 if (duplicates.contains(c++)) continue;
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jdk/UseSpecificCatch.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/jdk/UseSpecificCatch.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jdk/UseSpecificCatch.java	2011-08-04 21:48:28.778408976 +0100
@@ -173,7 +173,7 @@
 
             VariableTree excVar = ((CatchTree) tp.getLeaf()).getParameter();
 
-            wc.rewrite(excVar.getType(), wc.getTreeMaker().UnionType(exceptions));
+            wc.rewrite(excVar.getType(), wc.getTreeMaker().DisjunctiveType(exceptions));
         }
 
     }
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/perf/Bundle.properties
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/perf/Bundle.properties	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/perf/Bundle.properties	2011-08-04 21:48:28.778408976 +0100
@@ -108,7 +108,7 @@
 DN_org.netbeans.modules.java.hints.perf.Tiny.enumSet=Set replaceable with EnumSet
 DESC_org.netbeans.modules.java.hints.perf.Tiny.enumSet=Finds instantiations of Sets that can be replaced with EnumSet
 DN_org.netbeans.modules.java.hints.perf.Tiny.enumMap=Map replaceable with EnumMap
-DESC_org.netbeans.modules.java.hints.perf.Tiny.enumMap=Finds instantiations of Maps that can be replaced with EnumMap
+DESC_org.netbeans.modules.java.hints.perf.Tiny.enumMap=Finds instantiations of Maps that can be replaced with EnumSet
 ERR_Tiny_enumSet=Set can be replaced with java.util.EnumSet
 ERR_Tiny_enumMap=Map can be replaced with java.util.EnumMap
 FIX_Tiny_enumMap=Replace Map with java.util.EnumMap
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/perf/Tiny.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/perf/Tiny.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/perf/Tiny.java	2011-08-04 21:48:28.778408976 +0100
@@ -247,7 +247,7 @@
             String displayName = NbBundle.getMessage(Tiny.class, "FIX_Tiny_enumMap");
 
             fixes = new Fix[] {
-                JavaFix.rewriteFix(ctx, displayName, ctx.getPath(), "new java.util.EnumMap<$param, $to>($param.class)")
+                JavaFix.rewriteFix(ctx, displayName, ctx.getPath(), "new $coll<$param, $to>($param.class)")
             };
         } else {
             fixes = new Fix[0];
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/MatcherUtilities.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/MatcherUtilities.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jackpot/spi/MatcherUtilities.java	2011-08-04 21:48:28.778408976 +0100
@@ -51,7 +51,6 @@
 import org.netbeans.api.annotations.common.NonNull;
 import org.netbeans.modules.java.hints.jackpot.impl.Utilities;
 import org.netbeans.modules.java.hints.introduce.CopyFinder;
-import org.netbeans.modules.java.hints.introduce.CopyFinder.Options;
 
 /**
  *
@@ -69,7 +68,7 @@
         Tree  patternTree = Utilities.parseAndAttribute(ctx.getInfo(), pattern, s);
         TreePath patternTreePath = new TreePath(new TreePath(ctx.getInfo().getCompilationUnit()), patternTree);
         
-        return CopyFinder.isDuplicate(ctx.getInfo(), patternTreePath, variable, true, ctx, fillInVariables, null, new AtomicBoolean()/*XXX*/, Options.ALLOW_VARIABLES_IN_PATTERN);
+        return CopyFinder.isDuplicate(ctx.getInfo(), patternTreePath, variable, true, ctx, fillInVariables, new AtomicBoolean()/*XXX*/);
     }
 
 }
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jackpot/impl/pm/CopyFinderBasedBulkSearch.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/jackpot/impl/pm/CopyFinderBasedBulkSearch.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/jackpot/impl/pm/CopyFinderBasedBulkSearch.java	2011-08-04 21:48:28.778408976 +0100
@@ -56,7 +56,6 @@
 import javax.lang.model.type.TypeMirror;
 import org.netbeans.api.java.source.CompilationInfo;
 import org.netbeans.modules.java.hints.introduce.CopyFinder;
-import org.netbeans.modules.java.hints.introduce.CopyFinder.Options;
 
 /**
  *
@@ -75,7 +74,7 @@
         
         for (Entry<Tree, String> e : ((BulkPatternImpl) pattern).pattern2Code.entrySet()) {
             
-            for (TreePath r : CopyFinder.computeDuplicates(info, new TreePath(topLevel, e.getKey()), toSearch, false, new AtomicBoolean(), Collections.<String, TypeMirror>emptyMap(), Options.ALLOW_VARIABLES_IN_PATTERN).keySet()) {
+            for (TreePath r : CopyFinder.computeDuplicates(info, new TreePath(topLevel, e.getKey()), toSearch, false, new AtomicBoolean(), Collections.<String, TypeMirror>emptyMap()).keySet()) {
                 Collection<TreePath> c = result.get(e.getValue());
 
                 if (c == null) {
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/analyzer/Analyzer.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/analyzer/Analyzer.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/analyzer/Analyzer.java	2011-08-04 21:48:28.778408976 +0100
@@ -79,7 +79,6 @@
 import org.openide.util.Lookup;
 import org.openide.util.NbBundle;
 import org.openide.util.RequestProcessor;
-import org.openide.util.UserQuestionException;
 import org.openide.util.lookup.Lookups;
 
 /**
@@ -140,14 +139,7 @@
                         
                         DataObject d = DataObject.find(cc.getFileObject());
                         EditorCookie ec = d.getLookup().lookup(EditorCookie.class);
-                        Document doc;
-                        
-                        try {
-                            doc = ec.openDocument();
-                        } catch (UserQuestionException uqe) {
-                            uqe.confirmed();
-                            doc = ec.openDocument();
-                        }
+                        Document doc = ec.openDocument();
                         
                         try {
                             handle.progress(FileUtil.getFileDisplayName(cc.getFileObject()));
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/CopyFinder.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/introduce/CopyFinder.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/CopyFinder.java	2011-08-04 21:48:28.778408976 +0100
@@ -74,7 +74,6 @@
 import com.sun.source.util.SourcePositions;
 import com.sun.source.util.TreePath;
 import com.sun.source.util.TreeScanner;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.EnumSet;
@@ -118,26 +117,23 @@
     private boolean nocheckOnAllowVariablesRemap = false;
     private AtomicBoolean cancel;
     private static final String CLASS = "class"; //NOI18N
-    private final Set<Options> options;
 
     private Map<String, TypeMirror> designedTypeHack;
 
-    private CopyFinder(TreePath searchingFor, CompilationInfo info, AtomicBoolean cancel, Options... options) {
+    private CopyFinder(TreePath searchingFor, CompilationInfo info, AtomicBoolean cancel) {
         this.searchingFor = searchingFor;
         this.info = info;
         this.cancel = cancel;
-        this.options = EnumSet.noneOf(Options.class);
-        this.options.addAll(Arrays.asList(options));
     }
 
     public static Map<TreePath, VariableAssignments> computeDuplicates(CompilationInfo info, TreePath searchingFor, TreePath scope, AtomicBoolean cancel, Map<String, TypeMirror> designedTypeHack) {
         return computeDuplicates(info, searchingFor, scope, true, cancel, designedTypeHack);
     }
 
-    public static Map<TreePath, VariableAssignments> computeDuplicates(final CompilationInfo info, TreePath searchingFor, TreePath scope, boolean fullElementVerify, AtomicBoolean cancel, Map<String, TypeMirror> designedTypeHack, Options... options) {
+    public static Map<TreePath, VariableAssignments> computeDuplicates(final CompilationInfo info, TreePath searchingFor, TreePath scope, boolean fullElementVerify, AtomicBoolean cancel, Map<String, TypeMirror> designedTypeHack) {
         CopyFinder f =   fullElementVerify
-                       ? new CopyFinder(searchingFor, info, cancel, options)
-                       : new UnattributedCopyFinder(searchingFor, info, cancel, options);
+                       ? new CopyFinder(searchingFor, info, cancel)
+                       : new UnattributedCopyFinder(searchingFor, info, cancel);
 
         f.designedTypeHack = designedTypeHack;
 
@@ -151,9 +147,11 @@
             return null;
         }
 
-        CopyFinder f = new CopyFinder(searchingFor, info, cancel, Options.ALLOW_VARIABLES_IN_PATTERN);
+        CopyFinder f = new CopyFinder(searchingFor, info, cancel);
 
         f.allowGoDeeper = false;
+
+
         f.designedTypeHack = designedTypeHack;
 
         if (f.scan(scope, searchingFor)) {
@@ -175,14 +173,14 @@
         return isDuplicate(info, one, second, fullElementVerify, inVariables, fillInVariables, null, cancel);
     }
 
-    public static boolean isDuplicate(final CompilationInfo info, TreePath one, TreePath second, boolean fullElementVerify, HintContext inVariables, boolean fillInVariables, Set<VariableElement> variablesWithAllowedRemap, AtomicBoolean cancel, Options... options) {
+    public static boolean isDuplicate(final CompilationInfo info, TreePath one, TreePath second, boolean fullElementVerify, HintContext inVariables, boolean fillInVariables, Set<VariableElement> variablesWithAllowedRemap, AtomicBoolean cancel) {
         if (one.getLeaf().getKind() != second.getLeaf().getKind()) {
             return false;
         }
 
         CopyFinder f =   fullElementVerify
-                       ? new CopyFinder(one, info, cancel, options)
-                       : new UnattributedCopyFinder(one, info, cancel, options);
+                       ? new CopyFinder(one, info, cancel)
+                       : new UnattributedCopyFinder(one, info, cancel);
 
         if (inVariables != null) {
             if (fillInVariables) {
@@ -345,7 +343,7 @@
         if (p != null && p.getLeaf().getKind() == Kind.IDENTIFIER) {
             String ident = ((IdentifierTree) p.getLeaf()).getName().toString();
 
-            if (ident.startsWith("$") && options.contains(Options.ALLOW_VARIABLES_IN_PATTERN)) {
+            if (ident.startsWith("$")) {
                 if (bindState.variables2Names.containsKey(ident)) {
                     if (node.getKind() == Kind.IDENTIFIER)
                         return ((IdentifierTree) node).getName().toString().equals(bindState.variables2Names.get(ident));
@@ -379,10 +377,8 @@
                         boolean oldAllowGoDeeper = allowGoDeeper;
 
                         try {
-                            options.remove(Options.ALLOW_VARIABLES_IN_PATTERN);
                             return scan(node, original);
                         } finally {
-                            options.add(Options.ALLOW_VARIABLES_IN_PATTERN);
                             allowGoDeeper = oldAllowGoDeeper;
                         }
                     }
@@ -501,7 +497,7 @@
         if (p.getLeaf().getKind() == Kind.IDENTIFIER) {
             String ident = ((IdentifierTree) p.getLeaf()).getName().toString();
 
-            if (ident.startsWith("$") && options.contains(Options.ALLOW_VARIABLES_IN_PATTERN)) {
+            if (ident.startsWith("$")) {
                 return scan(node, p);
             }
         }
@@ -1556,8 +1552,8 @@
     }
 
     private static final class UnattributedCopyFinder extends CopyFinder {
-        private UnattributedCopyFinder(TreePath searchingFor, CompilationInfo info, AtomicBoolean cancel, Options... options) {
-            super(searchingFor, info, cancel, options);
+        private UnattributedCopyFinder(TreePath searchingFor, CompilationInfo info, AtomicBoolean cancel) {
+            super(searchingFor, info, cancel);
         }
         @Override
         protected VerifyResult verifyElements(TreePath node, TreePath p) {
@@ -1576,8 +1572,4 @@
             return Collections.singleton(new TreePath(tp, thisTree));
         }
     }
-
-    public enum Options {
-        ALLOW_VARIABLES_IN_PATTERN
-    }
 }
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceHint.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceHint.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/IntroduceHint.java	2011-08-04 21:48:28.788408634 +0100
@@ -49,11 +49,13 @@
 import com.sun.source.tree.BreakTree;
 import com.sun.source.tree.CaseTree;
 import com.sun.source.tree.ClassTree;
+import com.sun.source.tree.CompoundAssignmentTree;
 import com.sun.source.tree.ContinueTree;
 import com.sun.source.tree.DoWhileLoopTree;
 import com.sun.source.tree.ExpressionTree;
 import com.sun.source.tree.ForLoopTree;
 import com.sun.source.tree.IdentifierTree;
+import com.sun.source.tree.IfTree;
 import com.sun.source.tree.MethodInvocationTree;
 import com.sun.source.tree.MethodTree;
 import com.sun.source.tree.ModifiersTree;
@@ -69,6 +71,7 @@
 import com.sun.source.tree.UnaryTree;
 import com.sun.source.tree.VariableTree;
 import com.sun.source.tree.WhileLoopTree;
+import com.sun.source.util.SourcePositions;
 import com.sun.source.util.TreePath;
 import com.sun.source.util.TreePathScanner;
 import java.awt.Color;
@@ -82,14 +85,11 @@
 import java.util.HashSet;
 import java.util.IdentityHashMap;
 import java.util.Iterator;
-import java.util.LinkedHashMap;
 import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
-import java.util.Map.Entry;
 import java.util.Set;
-import java.util.concurrent.Callable;
 import java.util.concurrent.atomic.AtomicBoolean;
 import java.util.logging.Logger;
 import javax.lang.model.element.Element;
@@ -125,12 +125,9 @@
 import org.netbeans.api.java.source.support.CaretAwareJavaSourceTaskFactory;
 import org.netbeans.api.java.source.support.SelectionAwareJavaSourceTaskFactory;
 import org.netbeans.api.lexer.TokenSequence;
-import org.netbeans.lib.editor.util.swing.DocumentUtilities;
 import org.netbeans.modules.java.editor.codegen.GeneratorUtils;
 import org.netbeans.modules.java.hints.errors.Utilities;
-import org.netbeans.modules.java.hints.infrastructure.JavaHintsPositionRefresher;
 import org.netbeans.modules.java.hints.introduce.CopyFinder.MethodDuplicateDescription;
-import org.netbeans.modules.java.hints.introduce.Flow.FlowResult;
 import org.netbeans.spi.editor.highlighting.HighlightsLayer;
 import org.netbeans.spi.editor.highlighting.HighlightsLayerFactory;
 import org.netbeans.spi.editor.highlighting.ZOrder;
@@ -355,11 +352,6 @@
             HintsController.setErrors(info.getFileObject(), IntroduceHint.class.getName(), Collections.<ErrorDescription>emptyList());
         } else {
             HintsController.setErrors(info.getFileObject(), IntroduceHint.class.getName(), computeError(info, selection[0], selection[1], null, new EnumMap<IntroduceKind, String>(IntroduceKind.class), cancel));
-
-            Document doc = info.getSnapshot().getSource().getDocument(false);
-            long version = doc != null ? DocumentUtilities.getDocumentVersion(doc) : 0;
-            
-            JavaHintsPositionRefresher.introduceHintsUpdated(doc, version, selection[0], selection[1]);
         }
     }
 
@@ -410,7 +402,7 @@
         return false;
     }
 
-    public static List<ErrorDescription> computeError(CompilationInfo info, int start, int end, Map<IntroduceKind, Fix> fixesMap, Map<IntroduceKind, String> errorMessage, AtomicBoolean cancel) {
+    static List<ErrorDescription> computeError(CompilationInfo info, int start, int end, Map<IntroduceKind, Fix> fixesMap, Map<IntroduceKind, String> errorMessage, AtomicBoolean cancel) {
         List<ErrorDescription> hints = new LinkedList<ErrorDescription>();
         List<Fix> fixes = new LinkedList<Fix>();
         TreePath resolved = validateSelection(info, start, end);
@@ -457,7 +449,7 @@
 
                     prepareTypeVars(method, info, typeVar2Def, typeVars);
 
-                    ScanStatement scanner = new ScanStatement(info, resolved.getLeaf(), resolved.getLeaf(), typeVar2Def, Collections.<Tree, Iterable<? extends TreePath>>emptyMap(), cancel);
+                    ScanStatement scanner = new ScanStatement(info, resolved.getLeaf(), resolved.getLeaf(), typeVar2Def, cancel);
 
                     if (methodEl != null && (methodEl.getKind() == ElementKind.METHOD || methodEl.getKind() == ElementKind.CONSTRUCTOR)) {
                         ExecutableElement ee = (ExecutableElement) methodEl;
@@ -470,7 +462,7 @@
                     List<TreePathHandle> params = new LinkedList<TreePathHandle>();
 
                     boolean error186980 = false;
-                    for (VariableElement ve : scanner.usedLocalVariables.keySet()) {
+                    for (VariableElement ve : scanner.usedLocalVariables) {
                         TreePath path = info.getTrees().getPath(ve);
                         if (path == null) {
                             error186980 = true;
@@ -489,7 +481,7 @@
                             exceptionHandles.add(TypeMirrorHandle.create(tm));
                         }
 
-                        int duplicatesCount = CopyFinder.computeDuplicatesAndRemap(info, Collections.singletonList(resolved), new TreePath(info.getCompilationUnit()), scanner.usedLocalVariables.keySet(), cancel).size();
+                        int duplicatesCount = CopyFinder.computeDuplicatesAndRemap(info, Collections.singletonList(resolved), new TreePath(info.getCompilationUnit()), scanner.usedLocalVariables, cancel).size();
 
                         typeVars.retainAll(scanner.usedTypeVariables);
 
@@ -573,14 +565,7 @@
         Element methodEl = info.getTrees().getElement(method);
         List<? extends StatementTree> parentStatements = CopyFinder.getStatements(block);
         List<? extends StatementTree> statementsToWrap = parentStatements.subList(statements[0], statements[1] + 1);
-        FlowResult flow = Flow.assignmentsForUse(info, method, cancel);
-
-        if (flow == null || cancel.get()) {
-            return null;
-        }
-
-        Map<Tree, Iterable<? extends TreePath>> assignmentsForUse = flow.getAssignmentsForUse();
-        ScanStatement scanner = new ScanStatement(info, statementsToWrap.get(0), statementsToWrap.get(statementsToWrap.size() - 1), typeVar2Def, assignmentsForUse, cancel);
+        ScanStatement scanner = new ScanStatement(info, statementsToWrap.get(0), statementsToWrap.get(statementsToWrap.size() - 1), typeVar2Def, cancel);
         Set<TypeMirror> exceptions = new HashSet<TypeMirror>();
         int index = 0;
         TypeMirror methodReturnType = info.getTypes().getNoType(TypeKind.VOID);
@@ -615,42 +600,16 @@
             errorMessage.put(IntroduceKind.CREATE_METHOD, exitsError);
             return null;
         }
-        
-        Map<VariableElement, Boolean> mergedVariableUse = new LinkedHashMap<VariableElement, Boolean>(scanner.usedLocalVariables);
-
-        for (Entry<VariableElement, Boolean> e : scanner.usedAfterSelection.entrySet()) {
-            if (cancel.get()) return null;
-
-            Boolean usedLocal = mergedVariableUse.get(e.getKey());
-
-            if (usedLocal == null && Flow.definitellyAssigned(info, e.getKey(), pathsOfStatementsToWrap, cancel)) {
-                mergedVariableUse.put(e.getKey(), true);
-            } else {
-                mergedVariableUse.put(e.getKey(), !(usedLocal == Boolean.FALSE) && e.getValue());
-            }
-        }
-
-        if (cancel.get()) return null;
-
-        Set<VariableElement> additionalLocalVariables = new LinkedHashSet<VariableElement>();
-        Set<VariableElement> paramsVariables = new LinkedHashSet<VariableElement>();
-
-        for (Entry<VariableElement, Boolean> e : mergedVariableUse.entrySet()) {
-            if (e.getValue()) {
-                additionalLocalVariables.add(e.getKey());
-            } else {
-                paramsVariables.add(e.getKey());
-                additionalLocalVariables.remove(e.getKey());
-            }
-        }
 
         List<TreePathHandle> params = new LinkedList<TreePathHandle>();
 
-        for (VariableElement ve : paramsVariables) {
+        for (VariableElement ve : scanner.usedLocalVariables) {
             params.add(TreePathHandle.create(info.getTrees().getPath(ve), info));
         }
 
-        additionalLocalVariables.removeAll(paramsVariables);//needed?
+        List<VariableElement> additionalLocalVariables = new LinkedList<VariableElement>(scanner.selectionWrittenLocalVariables);
+
+        additionalLocalVariables.removeAll(scanner.usedLocalVariables);
         additionalLocalVariables.removeAll(scanner.selectionLocalVariables);
 
         List<TypeMirrorHandle> additionaLocalTypes = new LinkedList<TypeMirrorHandle>();
@@ -672,10 +631,10 @@
         TreePathHandle returnAssignTo;
         boolean declareVariableForReturnValue;
 
-        int duplicatesCount = CopyFinder.computeDuplicatesAndRemap(info, pathsOfStatementsToWrap, new TreePath(info.getCompilationUnit()), scanner.usedLocalVariables.keySet(), cancel).size();
+        int duplicatesCount = CopyFinder.computeDuplicatesAndRemap(info, pathsOfStatementsToWrap, new TreePath(info.getCompilationUnit()), scanner.usedLocalVariables, cancel).size();
 
-        if (!scanner.usedAfterSelection.isEmpty()) {
-            VariableElement result = scanner.usedAfterSelection.keySet().iterator().next();
+        if (!scanner.usedSelectionLocalVariables.isEmpty()) {
+            VariableElement result = scanner.usedSelectionLocalVariables.iterator().next();
 
             returnType = result.asType();
             returnAssignTo = TreePathHandle.create(info.getTrees().getPath(result), info);
@@ -1088,13 +1047,13 @@
         private Tree firstInSelection;
         private Tree lastInSelection;
         private Set<VariableElement> localVariables = new HashSet<VariableElement>();
-        private Map<VariableElement, Boolean> usedLocalVariables = new LinkedHashMap<VariableElement, Boolean>(); /*true if all uses have been definitelly assigned inside selection*/
+        private Set<VariableElement> usedLocalVariables = new LinkedHashSet<VariableElement>();
         private Set<VariableElement> selectionLocalVariables = new HashSet<VariableElement>();
-        private Map<VariableElement, Boolean> usedAfterSelection = new LinkedHashMap<VariableElement, Boolean>(); /*true if all uses have been definitelly assigned inside selection*/
+        private Set<VariableElement> selectionWrittenLocalVariables = new HashSet<VariableElement>();
+        private Set<VariableElement> usedSelectionLocalVariables = new HashSet<VariableElement>();
         private Set<TreePath> selectionExits = new HashSet<TreePath>();
         private Set<Tree> treesSeensInSelection = new HashSet<Tree>();
         private final Map<TypeMirror, TreePathHandle> typeVar2Def;
-        private final Map<Tree, Iterable<? extends TreePath>> assignmentsForUse;
         private Set<TreePathHandle> usedTypeVariables = new HashSet<TreePathHandle>();
         private boolean hasReturns = false;
         private boolean hasBreaks = false;
@@ -1103,12 +1062,11 @@
         private boolean stopSecondPass = false;
         private final AtomicBoolean cancel;
 
-        public ScanStatement(CompilationInfo info, Tree firstInSelection, Tree lastInSelection, Map<TypeMirror, TreePathHandle> typeVar2Def, Map<Tree, Iterable<? extends TreePath>> assignmentsForUse, AtomicBoolean cancel) {
+        public ScanStatement(CompilationInfo info, Tree firstInSelection, Tree lastInSelection, Map<TypeMirror, TreePathHandle> typeVar2Def, AtomicBoolean cancel) {
             this.info = info;
             this.firstInSelection = firstInSelection;
             this.lastInSelection = lastInSelection;
             this.typeVar2Def = typeVar2Def;
-            this.assignmentsForUse = assignmentsForUse;
             this.cancel = cancel;
         }
 
@@ -1161,6 +1119,14 @@
 
         @Override
         public Void visitAssignment(AssignmentTree node, Void p) {
+            if (phase == PHASE_INSIDE_SELECTION) {
+                Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getVariable()));
+
+                if (e != null && LOCAL_VARIABLES.contains(e.getKind()) && localVariables.contains(e)) {
+                    selectionWrittenLocalVariables.add((VariableElement) e);
+                }
+            }
+
             //make sure the variable on the left side is not considered to be read
             //#162163: but dereferencing array is a read
             if (node.getVariable() != null && node.getVariable().getKind() != Kind.IDENTIFIER) {
@@ -1171,6 +1137,36 @@
         }
 
         @Override
+        public Void visitCompoundAssignment(CompoundAssignmentTree node, Void p) {
+            if (phase == PHASE_INSIDE_SELECTION) {
+                Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getVariable()));
+
+                if (e != null && LOCAL_VARIABLES.contains(e.getKind())) {
+                    selectionWrittenLocalVariables.add((VariableElement) e);
+                }
+            }
+
+            return super.visitCompoundAssignment(node, p);
+        }
+
+        @Override
+        public Void visitUnary(UnaryTree node, Void p) {
+            Kind k = node.getKind();
+
+            if (k == Kind.POSTFIX_DECREMENT || k == Kind.POSTFIX_INCREMENT || k == Kind.PREFIX_DECREMENT || k == Kind.PREFIX_INCREMENT) {
+                //#109663:
+                if (phase == PHASE_INSIDE_SELECTION) {
+                    Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getExpression()));
+
+                    if (e != null && LOCAL_VARIABLES.contains(e.getKind())) {
+                        selectionWrittenLocalVariables.add((VariableElement) e);
+                    }
+                }
+            }
+            return super.visitUnary(node, p);
+        }
+
+        @Override
         public Void visitIdentifier(IdentifierTree node, Void p) {
             Element e = info.getTrees().getElement(getCurrentPath());
 
@@ -1178,42 +1174,13 @@
                 if (LOCAL_VARIABLES.contains(e.getKind())) {
                     switch (phase) {
                         case PHASE_INSIDE_SELECTION:
-                            if (localVariables.contains(e) && !usedLocalVariables.containsKey(e)) {
-                                Iterable<? extends TreePath> writes = assignmentsForUse.get(getCurrentPath().getLeaf());
-                                boolean definitellyAssignedInSelection = true;
-
-                                if (writes != null) {
-                                    for (TreePath w : writes) {
-                                        if (w == null || !treesSeensInSelection.contains(w.getLeaf())) {
-                                            definitellyAssignedInSelection = false;
-                                            break;
-                                        }
-                                    }
-                                } else {
-                                    definitellyAssignedInSelection = false;
-                                }
-
-                                usedLocalVariables.put((VariableElement) e, definitellyAssignedInSelection);
+                            if (localVariables.contains(e)) {
+                                usedLocalVariables.add((VariableElement) e);
                             }
                             break;
                         case PHASE_AFTER_SELECTION:
-                            Iterable<? extends TreePath> writes = assignmentsForUse.get(getCurrentPath().getLeaf());
-                            boolean assignedInSelection = false;
-                            boolean definitellyAssignedInSelection = true;
-
-                            if (writes != null) {
-                                for (TreePath w : writes) {
-                                    if (w != null && treesSeensInSelection.contains(w.getLeaf())) {
-                                        assignedInSelection = true;
-                                    }
-                                    if (w == null || !treesSeensInSelection.contains(w.getLeaf())) {
-                                        definitellyAssignedInSelection = false;
-                                    }
-                                }
-                            }
-
-                            if (assignedInSelection) {
-                                usedAfterSelection.put((VariableElement) e, definitellyAssignedInSelection);
+                            if (selectionLocalVariables.contains(e) || selectionWrittenLocalVariables.contains(e)) {
+                                usedSelectionLocalVariables.add((VariableElement) e);
                             }
                             break;
                     }
@@ -1331,7 +1298,7 @@
                 return "ERR_Too_Many_Different_Exits"; // NOI18N
             }
 
-            if ((exitsFromAllBranches ? 0 : i) + usedAfterSelection.size() > 1) {
+            if ((exitsFromAllBranches ? 0 : i) + usedSelectionLocalVariables.size() > 1) {
                 return "ERR_Too_Many_Return_Values"; // NOI18N
             }
 
@@ -1896,8 +1863,8 @@
                     Tree returnTypeTree = make.Type(returnType);
                     ExpressionTree invocation = make.MethodInvocation(Collections.<ExpressionTree>emptyList(), make.Identifier(name), realArguments);
 
-                    Callable<ReturnTree> ret = null;
-                    final VariableElement returnAssignTo;
+                    ReturnTree ret = null;
+                    VariableElement returnAssignTo = null;
 
                     if (IntroduceMethodFix.this.returnAssignTo != null) {
                         returnAssignTo = (VariableElement) IntroduceMethodFix.this.returnAssignTo.resolveElement(copy);
@@ -1905,16 +1872,10 @@
                         if (returnAssignTo == null) {
                             return; //TODO...
                         }
-                    } else {
-                        returnAssignTo = null;
                     }
 
                     if (returnAssignTo != null) {
-                        ret = new Callable<ReturnTree>() {
-                            @Override public ReturnTree call() throws Exception {
-                                return make.Return(make.Identifier(returnAssignTo.getSimpleName()));
-                            }
-                        };
+                        ret = make.Return(make.Identifier(returnAssignTo.getSimpleName()));
                         if (declareVariableForReturnValue) {
                             nueStatements.add(make.Variable(make.Modifiers(EnumSet.noneOf(Modifier.class)), returnAssignTo.getSimpleName(), returnTypeTree, invocation));
                             invocation = null;
@@ -1934,19 +1895,15 @@
 
                         assert handle != null;
 
-                        if (exitsFromAllBranches && handle.getLeaf().getKind() == Kind.RETURN && returnAssignTo == null && returnType.getKind() != TypeKind.VOID) {
+                        if (exitsFromAllBranches && handle.getLeaf().getKind() == Kind.RETURN) {
                             nueStatements.add(make.Return(invocation));
                         } else {
                             if (ret == null) {
-                                ret = new Callable<ReturnTree>() {
-                                    @Override public ReturnTree call() throws Exception {
-                                        if (exitsFromAllBranches) {
-                                            return make.Return(null);
-                                        } else {
-                                            return make.Return(make.Literal(true));
-                                        }
-                                    }
-                                };
+                                if (exitsFromAllBranches) {
+                                    ret = make.Return(null);
+                                } else {
+                                    ret = make.Return(make.Literal(true));
+                                }
                             }
 
                             for (TreePathHandle h : exists) {
@@ -1956,12 +1913,7 @@
                                     return ; //TODO...
                                 }
 
-                                ReturnTree r = ret.call();
-
-                                GeneratorUtilities.get(copy).copyComments(resolved.getLeaf(), r, false);
-                                GeneratorUtilities.get(copy).copyComments(resolved.getLeaf(), r, true);
-                                
-                                copy.rewrite(resolved.getLeaf(), r);
+                                copy.rewrite(resolved.getLeaf(), ret);
                             }
 
                             StatementTree branch = null;
@@ -1990,7 +1942,7 @@
                         invocation = null;
                     } else {
                         if (ret != null) {
-                            methodStatements.add(ret.call());
+                            methodStatements.add(ret);
                         }
                     }
 
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/ErrorHintsProvider.java	2011-08-04 21:48:28.788408634 +0100
@@ -323,9 +323,7 @@
             "compiler.err.report.access",
             "compiler.err.does.not.override.abstract",
             "compiler.err.abstract.cant.be.instantiated",
-            "compiler.warn.missing.SVUID",
-            "compiler.warn.has.been.deprecated",
-            "compiler.warn.raw.class.use"
+            "compiler.warn.missing.SVUID"
     ));
 
     private static final Set<JavaTokenId> WHITESPACE = EnumSet.of(JavaTokenId.BLOCK_COMMENT, JavaTokenId.JAVADOC_COMMENT, JavaTokenId.LINE_COMMENT, JavaTokenId.WHITESPACE);
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresher.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresher.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresher.java	2011-08-04 21:48:28.788408634 +0100
@@ -48,7 +48,6 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
-import java.util.EnumMap;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -62,18 +61,14 @@
 import org.netbeans.api.java.source.CompilationController;
 import org.netbeans.api.java.source.JavaSource;
 import org.netbeans.api.java.source.Task;
-import org.netbeans.api.java.source.support.SelectionAwareJavaSourceTaskFactory;
 import org.netbeans.api.progress.ProgressUtils;
 import org.netbeans.editor.BaseDocument;
 import org.netbeans.editor.Utilities;
 import org.netbeans.lib.editor.util.swing.DocumentUtilities;
-import org.netbeans.modules.java.hints.introduce.IntroduceHint;
-import org.netbeans.modules.java.hints.introduce.IntroduceKind;
 import org.netbeans.modules.java.hints.jackpot.impl.hints.HintsInvoker;
 import org.netbeans.modules.java.hints.jackpot.impl.hints.HintsTask;
 import org.netbeans.spi.editor.hints.Context;
 import org.netbeans.spi.editor.hints.ErrorDescription;
-import org.netbeans.spi.editor.hints.Fix;
 import org.netbeans.spi.editor.hints.LazyFixList;
 import org.netbeans.spi.editor.hints.PositionRefresher;
 import org.openide.util.Exceptions;
@@ -149,7 +144,7 @@
             //SuggestionsTask
             if ((version > 0 && holder.suggestions < version) || holder.suggestionsCaret != position) {
                 LOG.fine("Computing suggestions");
-                eds.put(HintsTask.KEY_SUGGESTIONS, new HintsInvoker(controller, position, ctx.getCancel()).computeHints(controller));
+                eds.put(HintsTask.KEY_SUGGESTIONS, new HintsInvoker(controller, position, new AtomicBoolean()).computeHints(controller));
             } else {
                 LOG.fine("Suggestions already computed");
             }
@@ -165,7 +160,7 @@
                 int rowStart = Utilities.getRowStart((BaseDocument) doc, position);
                 int rowEnd = Utilities.getRowEnd((BaseDocument) doc, position);
 
-                eds.put(HintsTask.KEY_HINTS, new HintsInvoker(controller, rowStart, rowEnd, ctx.getCancel()).computeHints(controller));
+                eds.put(HintsTask.KEY_HINTS, new HintsInvoker(controller, rowStart, rowEnd, new AtomicBoolean()).computeHints(controller));
             } else {
                 LOG.fine("Hints already computed");
             }
@@ -174,25 +169,6 @@
                 return;
             }
 
-            //IntroduceHints:
-            int[] selection = SelectionAwareJavaSourceTaskFactory.getLastSelection(controller.getFileObject());
-
-            if (selection != null) {
-                if ((version > 0 && holder.introduce < version) || holder.introduceSelStart != selection[0] || holder.introduceSelEnd != selection[1]) {
-                    LOG.fine("Computing introduce hints");
-
-                    eds.put(IntroduceHint.class.getName(), IntroduceHint.computeError(controller, selection[0], selection[1], new EnumMap<IntroduceKind, Fix>(IntroduceKind.class), new EnumMap<IntroduceKind, String>(IntroduceKind.class), ctx.getCancel()));
-                } else {
-                    LOG.fine("Introduce hints already computed");
-                }
-            } else {
-                LOG.fine("No selection, not computing introduce hints");
-            }
-
-            if (ctx.isCanceled()) {
-                return;
-            }
-
             //ErrorHints
             if (version > 0 && holder.errors < version) {
                 LOG.fine("Computing errors");
@@ -234,13 +210,6 @@
         getHolder(doc).suggestionsCaret = caret;
     }
 
-    public static void introduceHintsUpdated(Document doc, long version, int selStart, int selEnd) {
-        if (doc == null) return;
-        getHolder(doc).introduce = version;
-        getHolder(doc).introduceSelStart = selStart;
-        getHolder(doc).introduceSelEnd = selEnd;
-    }
-
     public static void errorsUpdated(Document doc, long version, List<ErrorDescription> errors) {
         if (doc == null) return;
         getHolder(doc).errors = version;
@@ -262,9 +231,6 @@
         private int suggestionsCaret;
         private long hints;
         private long errors;
-        private long introduce;
-        private long introduceSelStart;
-        private long introduceSelEnd;
         private List<ErrorDescription> errorsContent;
     }
 }
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/errors/ChangeTypeFix.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/errors/ChangeTypeFix.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/errors/ChangeTypeFix.java	2011-08-04 21:48:28.788408634 +0100
@@ -124,4 +124,8 @@
         return s;
     }
 
+    static {
+        NbBundle.setBranding("test");
+    }
+    
 }
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/errors/Utilities.java	2011-08-04 21:48:28.788408634 +0100
@@ -1119,10 +1119,7 @@
         }
         public static Visibility forTree(Tree t) {
             switch (t.getKind()) {
-                case ANNOTATION_TYPE:
-                case CLASS:
-                case ENUM:
-                case INTERFACE: return forModifiers(((ClassTree) t).getModifiers());
+                case CLASS: return forModifiers(((ClassTree) t).getModifiers());
                 case VARIABLE: return forModifiers(((VariableTree) t).getModifiers());
                 case METHOD: return forModifiers(((MethodTree) t).getModifiers());
                 default: return null;
Index: netbeans-7.0.1+dfsg1/java.hints/nbproject/project.properties
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/nbproject/project.properties	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/nbproject/project.properties	2011-08-04 21:48:28.788408634 +0100
@@ -40,7 +40,7 @@
 # Version 2 license, then the option applies only if the new code is
 # made subject to such option by the copyright holder.
 
-spec.version.base=1.54.1
+spec.version.base=1.49.1
 
 javac.source=1.6
 
Index: netbeans-7.0.1+dfsg1/java.hints/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/nbproject/project.xml	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/nbproject/project.xml	2011-08-04 21:48:28.788408634 +0100
@@ -43,6 +43,8 @@
 Version 2 license, then the option applies only if the new code is
 made subject to such option by the copyright holder.
 -->
+<!--Do NOT use Project/Properties to edit this file! Will remove <build-prerequisite/> from java.hints.processor below.
+    See bug #180717-->
 <project xmlns="http://www.netbeans.org/ns/project/1">
     <type>org.netbeans.modules.apisupport.project</type>
     <configuration>
@@ -55,7 +57,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.9.1</specification-version>
+                        <specification-version>1.4</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -64,7 +66,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.33.1</specification-version>
+                        <specification-version>1.18</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -73,7 +75,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.29.1</specification-version>
+                        <specification-version>1.24</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -82,7 +84,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.24.1</specification-version>
+                        <specification-version>1.16</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -90,7 +92,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.6.1.3</specification-version>
+                        <specification-version>7.3</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -99,7 +101,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>0.22.1.15</specification-version>
+                        <specification-version>0.14</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -108,7 +110,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>
@@ -117,7 +119,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>3</release-version>
-                        <specification-version>1.57.1.5.13.10</specification-version>
+                        <specification-version>1.53</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -126,7 +128,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>2.16.1.1</specification-version>
+                        <specification-version>2.3</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -135,7 +137,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>
@@ -144,7 +146,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.43.1.10</specification-version>
+                        <specification-version>1.8</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -153,7 +155,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.22.1</specification-version>
+                        <specification-version>1.15</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -162,7 +164,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.28</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -171,7 +173,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.42.1</specification-version>
+                        <specification-version>1.33</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -186,9 +188,8 @@
                 <dependency>
                     <code-name-base>org.netbeans.modules.java.hints.processor</code-name-base>
                     <build-prerequisite/>
-                    <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.7.1.1.15</specification-version>
+                        <specification-version>1.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -197,7 +198,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>
@@ -206,7 +207,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.21.1</specification-version>
+                        <specification-version>1.16</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -214,7 +215,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.18.1.1</specification-version>
+                        <specification-version>1.12</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -231,7 +232,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>
@@ -240,7 +241,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>
@@ -249,7 +250,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>
@@ -267,7 +268,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.28</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -276,7 +277,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.51.1.8</specification-version>
+                        <specification-version>1.40</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -285,7 +286,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.23.1</specification-version>
+                        <specification-version>1.18</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -293,7 +294,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.16.1</specification-version>
+                        <specification-version>1.9</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -302,7 +303,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.20.1.1</specification-version>
+                        <specification-version>1.10</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -311,7 +312,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>0-1</release-version>
-                        <specification-version>1.18.1.7.10</specification-version>
+                        <specification-version>1.13</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -319,7 +320,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.22.1</specification-version>
+                        <specification-version>6.15</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -327,7 +328,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.31.1</specification-version>
+                        <specification-version>6.10</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -335,7 +336,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.20.1</specification-version>
+                        <specification-version>7.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -343,7 +344,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.35.1</specification-version>
+                        <specification-version>6.22</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -351,7 +352,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.47.1</specification-version>
+                        <specification-version>7.19</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -365,7 +366,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.23.1</specification-version>
+                        <specification-version>7.3</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -373,7 +374,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -381,7 +382,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.37.1</specification-version>
+                        <specification-version>6.16</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -389,7 +390,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.15.1</specification-version>
+                        <specification-version>8.10</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -397,7 +398,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.8.1</specification-version>
+                        <specification-version>8.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -405,7 +406,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.40.1</specification-version>
+                        <specification-version>6.16</specification-version>
                     </run-dependency>
                 </dependency>
             </module-dependencies>
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/StaticAccessTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/StaticAccessTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/StaticAccessTest.java	2011-08-04 21:48:28.798408740 +0100
@@ -83,7 +83,7 @@
         String golden = (before + after).replace('\n', ' ').replace("b.value", "Boolean.value");
         
         performFixTest("test/Test.java", before + after, before.length(), 
-            "3:6-3:13:verifier:AS1valueOf",
+            "3:4-3:5:verifier:AS1valueOf",
             "MSG_StaticAccessText",
             golden
         );
@@ -107,7 +107,7 @@
         
         
         performFixTest("test/Test.java", before + after, before.length(), 
-            "3:6-3:13:verifier:AS1valueOf",
+            "3:4-3:5:verifier:AS1valueOf",
             "MSG_StaticAccessText",
             golden
         );
@@ -143,7 +143,7 @@
         String after = "UE;";
         
         performAnalysisTest("test/Test.java", before + after, before.length(), 
-            "0:52-0:56:verifier:AS0TRUE"
+            "0:50-0:51:verifier:AS0TRUE"
         );
     }
     public void testOkAccessingStaticField() throws Exception {
@@ -163,7 +163,7 @@
         String after = "UE;";
         
         performAnalysisTest("test/Test.java", before + after, before.length(), 
-            "0:78-0:82:verifier:AS0TRUE"
+            "0:74-0:77:verifier:AS0TRUE"
         );
     }
     public void testOkToCallEqualsOnString() throws Exception {
@@ -190,7 +190,7 @@
             "}";
         
         performAnalysisTest("test/Test.java", before + after, before.length(),
-                "2:2-2:6:verifier:AS1test"
+                "2:0-2:1:verifier:AS1test"
         );
     }
     
@@ -233,33 +233,6 @@
         
         performAnalysisTest("test/Test.java", code);
     }
-
-    public void testInterface198646() throws Exception {
-        String code = "package test; class Test {\n" +
-            "public void run(A a) {\n" +
-            "int i = a.I|II;\n" +
-            "}\n" +
-            "}\n" +
-            "interface A {\n" +
-            "    public static final int III = 0;\n" +
-            "}";
-
-        performAnalysisTest("test/Test.java", code, "2:10-2:13:verifier:AS0III");
-    }
-
-    public void testEnum198646() throws Exception {
-        String code = "package test; class Test {\n" +
-            "public void run(A a) {\n" +
-            "int i = a.I|II;\n" +
-            "}\n" +
-            "}\n" +
-            "enum A {\n" +
-            "    A;\n" +
-            "    public static final int III = 0;\n" +
-            "}";
-
-        performAnalysisTest("test/Test.java", code, "2:10-2:13:verifier:AS0III");
-    }
     
     protected List<ErrorDescription> computeErrors(CompilationInfo info, TreePath path) {
         SourceUtilsTestUtil.setSourceLevel(info.getFileObject(), sourceLevel);
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/UtilityClassWithConstructorTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/UtilityClassWithConstructorTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/UtilityClassWithConstructorTest.java	2011-08-04 21:48:28.798408740 +0100
@@ -139,15 +139,6 @@
                             "}");
     }
 
-    public void testException197721() throws Exception {
-        performAnalysisTest("test/Test.java",
-                            "package test; public class Test extends Exception {\n" +
-                            "    private static final long serialVersionUID = 1L;\n" +
-                            "    public Te|st() { }\n" +
-                            "    public Test(int i) { }\n" +
-                            "}");
-    }
-
     protected List<ErrorDescription> computeErrors(CompilationInfo info, TreePath path) {
         SourceUtilsTestUtil.setSourceLevel(info.getFileObject(), sourceLevel);
         return UtilityClass.withConstructor().run(info, path);
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/TestUtilities.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/TestUtilities.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/TestUtilities.java	2011-08-04 21:48:28.798408740 +0100
@@ -42,12 +42,8 @@
     }
 
     public static String detectOffsets(String source, int[] positionOrSpan) {
-        return detectOffsets(source, positionOrSpan, "\\|");
-    }
-
-    public static String detectOffsets(String source, int[] positionOrSpan, String delimiter) {
         //for now, the position/span delimiter is '|', without possibility of escaping:
-        String[] split = source.split(delimiter);
+        String[] split = source.split("\\|");
         
         Assert.assertTrue("incorrect number of position markers (|)", positionOrSpan.length == split.length - 1);
         
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/bugs/CollectionRemoveTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/bugs/CollectionRemoveTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/bugs/CollectionRemoveTest.java	2011-08-04 21:48:28.798408740 +0100
@@ -242,16 +242,6 @@
                             "}");
     }
 
-    public void testInsideItsOverride196606() throws Exception {
-        performAnalysisTest("test/Test.java",
-                            "package test;" +
-                            "public class Test extends java.util.ArrayList<String> {" +
-                            "    @Override public boolean remove(Object o) {" +
-                            "        return super.remove(o);\n" +
-                            "    }" +
-                            "}");
-    }
-
     static {
         NbBundle.setBranding("test");
     }
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/encapsulation/ClassEncapsulationTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/encapsulation/ClassEncapsulationTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/encapsulation/ClassEncapsulationTest.java	2011-08-04 21:48:28.798408740 +0100
@@ -155,16 +155,6 @@
                             "}");
     }
 
-    public void test197590() throws Exception {
-        performAnalysisTest("test/Test.java",
-                            "package test;\n" +
-                            "public class Test {\n" +
-                            "    private enum A {\n"+
-                            "        E\n"+
-                            "    }\n"+
-                            "}");
-    }
-
     public void testEnumIgnore() throws Exception {
         Preferences p = RulesManager.getPreferences(ClassEncapsulation.class.getName() + ".publicCls", HintsSettings.getCurrentProfileId());
 
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/perf/TinyTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/perf/TinyTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/perf/TinyTest.java	2011-08-04 21:48:28.798408740 +0100
@@ -344,10 +344,9 @@
                        "3:16-3:86:verifier:ERR_Tiny_enumMap",
                        "FIX_Tiny_enumMap",
                        ("package test;\n" +
-                        "import java.util.EnumMap;\n" +
                         "public class Test {\n" +
                         "     private java.util.Map<java.lang.annotation.RetentionPolicy, Boolean> test() {\n" +
-                        "         return new EnumMap<java.lang.annotation.RetentionPolicy, Boolean>(java.lang.annotation.RetentionPolicy.class);\n" +
+                        "         return new java.util.HashMap<java.lang.annotation.RetentionPolicy, Boolean>(java.lang.annotation.RetentionPolicy.class);\n" +
                         "     }\n" +
                         "}\n").replaceAll("[\t\n ]+", " "));
     }
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/CopyFinderTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/CopyFinderTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/CopyFinderTest.java	2011-08-04 21:48:28.798408740 +0100
@@ -63,7 +63,6 @@
 import org.netbeans.junit.NbTestCase;
 import org.netbeans.junit.NbTestSuite;
 import org.netbeans.modules.java.hints.introduce.CopyFinder.MethodDuplicateDescription;
-import org.netbeans.modules.java.hints.introduce.CopyFinder.Options;
 import org.netbeans.modules.java.hints.introduce.CopyFinder.VariableAssignments;
 import org.netbeans.modules.java.hints.jackpot.impl.pm.BulkSearch;
 import org.netbeans.modules.java.hints.jackpot.impl.pm.BulkSearch.BulkPattern;
@@ -796,26 +795,6 @@
                              true);
     }
 
-    public void testDisableVariablesWhenVerifyingDuplicates1() throws Exception {
-        performVariablesTest("package test; public class Test { public void test() { int $i = 1, $j = 2; int k = $i + $i; } }",
-                             "$i + $i",
-                             new Pair[] {new Pair<String, int[]>("$i", new int[] {83, 85})},
-                             new Pair[0],
-                             new Pair[0],
-                             false,
-                             true);
-    }
-
-    public void testDisableVariablesWhenVerifyingDuplicates2() throws Exception {
-        performVariablesTest("package test; public class Test { public void test() { int $i = 1, $j = 2; int k = $i + $i; } }",
-                             "$i + $i",
-                             new Pair[] {new Pair<String, int[]>("$i", new int[] {83, 85})},
-                             new Pair[0],
-                             new Pair[0],
-                             false,
-                             false);
-    }
-
     protected void prepareTest(String code) throws Exception {
         prepareTest(code, -1);
     }
@@ -1064,7 +1043,7 @@
     }
 
     protected Map<TreePath, VariableAssignments> computeDuplicates(CompilationInfo info, TreePath searchingFor, TreePath scope, AtomicBoolean cancel, Map<String, TypeMirror> designedTypeHack) {
-        return CopyFinder.computeDuplicates(info, searchingFor, scope, true, cancel, designedTypeHack, Options.ALLOW_VARIABLES_IN_PATTERN);
+        return CopyFinder.computeDuplicates(info, searchingFor, scope, cancel, designedTypeHack);
     }
 
     private void performRemappingTest(String code, String... remappableVariables) throws Exception {
@@ -1144,7 +1123,7 @@
     }
 
     protected Collection<TreePath> computeDuplicates(TreePath path) {
-        return CopyFinder.computeDuplicates(info, path, new TreePath(info.getCompilationUnit()), new AtomicBoolean(), null).keySet();
+        return computeDuplicates(info, path, new TreePath(info.getCompilationUnit()), new AtomicBoolean(), null).keySet();
     }
 
     public static final class Pair<A, B> {
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/IntroduceHintTest.java	2011-08-04 21:48:28.798408740 +0100
@@ -972,52 +972,20 @@
                        new DialogDisplayerImpl3("name", EnumSet.of(Modifier.PRIVATE), true));
     }
     
-    public void testIntroduceMethod114371() throws Exception {
-        performFixTest("package test;\n" +
-                       "public class Test {\n" +
-                       "    public static void test(boolean arg) {\n" +
-                       "        int c = 0;\n" +
-                       "        \n" +
-                       "        |if (arg) c = 3;|\n" +
-                       "        \n" +
-                       "        System.err.println(c);\n" +
-                       "    }\n" +
-                       "}",
-                       "package test; public class Test { public static void test(boolean arg) { int c = 0; c = name(arg, c); System.err.println(c); } private static int name(boolean arg, int c) { if (arg) c = 3; return c; } }",
-                       new DialogDisplayerImpl3("name", EnumSet.of(Modifier.PRIVATE), true));
-    }
-
-    public void testIntroduceMethod179258() throws Exception {
-        performFixTest("package test;\n" +
-                       "public class Test {\n" +
-                       "    public static void test() {\n" +
-                       "        String test = null;\n" +
-                       "        |test = \"foo\";\n" +
-                       "        if (test == null) {\n" +
-                       "            System.err.println(1);\n" +
-                       "        } else {\n" +
-                       "            System.err.println(2);\n" +
-                       "        }|\n" +
-                       "    }\n" +
-                       "}",
-                       ("package test;\n" +
-                        "public class Test {\n" +
-                        "    public static void test() {\n" +
-                        "        String test = null;\n" +
-                        "        name();\n" +
-                        "    }\n" +
-                        "    private static void name() {\n" +
-                        "        String test;\n" +
-                        "        test = \"foo\";\n" +
-                        "        if (test == null) {\n" +
-                        "            System.err.println(1);\n" +
-                        "        } else {\n" +
-                        "            System.err.println(2);\n" +
-                        "        }\n" +
-                        "    }\n" +
-                        "}").replaceAll("[ \t\n]+", " "),
-                       new DialogDisplayerImpl3("name", EnumSet.of(Modifier.PRIVATE), true));
-    }
+//    public void testIntroduceMethod114371() throws Exception {
+//        performFixTest("package test;\n" +
+//                       "public class Test {\n" +
+//                       "    public static void test(boolean arg) {\n" +
+//                       "        int c = 0;\n" +
+//                       "        \n" +
+//                       "        |if (arg) c = 3;|\n" +
+//                       "        \n" +
+//                       "        System.err.println(c);\n" +
+//                       "    }\n" +
+//                       "}",
+//                       "package test; public class Test { public static void test(boolean arg) { int c = 0; c = name(arg); System.err.println(c); } private static int name(boolean arg, int c) { if (arg) { c = 3; } return c; } }",
+//                       new DialogDisplayerImpl3("name", EnumSet.of(Modifier.PRIVATE), true));
+//    }
     
     public void testIntroduceMethod116199() throws Exception {
         performFixTest("package test;\n" +
@@ -1427,53 +1395,6 @@
                        3, 0);
     }
 
-    public void test196683() throws Exception {
-        performFixTest("package test;\n" +
-                       "import java.util.ArrayList;\n" +
-                       "public class Test {\n" +
-                       "    public void loop(int a) {\n" +
-                       "        String s= \"\";\n" +
-                       "        while(--a>0) {\n" +
-                       "            |//6\n" +
-                       "            if (a%3 != 0) {\n" +
-                       "                s = s+\"--, \";\n" +
-                       "                return;\n" +
-                       "            }\n" +
-                       "            //7\n" +
-                       "            s = s+a+\", \";\n" +
-                       "            return;\n" +
-                       "            //8|\n" +
-                       "        }\n" +
-                       "        System.err.println(s);\n" +
-                       "    }\n" +
-                       "}",
-                       ("package test;\n" +
-                       "import java.util.ArrayList;\n" +
-                       "public class Test {\n" +
-                       "    public void loop(int a) {\n" +
-                       "        String s= \"\";\n" +
-                       "        while(--a>0) {\n" +
-                       "            foo(a, s);\n" +
-                       "            return;\n" +
-                       "        }\n" +
-                       "        System.err.println(s);\n" +
-                       "    }\n" +
-                       "    private void foo(int a, String s) {\n" +
-                       "        //6\n" +
-                       "        if (a%3 != 0) {\n" +
-                       "            s = s+\"--, \";\n" +
-                       "            return;\n" +
-                       "        }\n" +
-                       "        //7\n" +
-                       "        s = s+a+\", \";\n" +
-                       "        return;\n" +
-                       "        //8\n" +
-                       "    }\n" +
-                       "}").replaceAll("[ \t\n]+", " "),
-                       new DialogDisplayerImpl3("foo", EnumSet.of(Modifier.PRIVATE), true),
-                       1, 0);
-    }
-
     public void test193775() throws Exception {
         performCheckFixesTest("package test; import java.util.Collection; import java.util.Map.Entry; public class Test { public void test(|Collection<Entry> e|) {} }");
     }
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresherTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresherTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/infrastructure/JavaHintsPositionRefresherTest.java	2011-08-04 21:48:28.798408740 +0100
@@ -207,7 +207,7 @@
 
     public void testHintCount173282() throws Exception {
         performTest("test/Test.java", "class Test { static int statField; int field; public void method() { \n|String field = \"\"; \nSystem.out.println(field); Integer.parseInt(\"1\"); if(\"\"== \"\") { System.out.println(\"ok\"); } this.statField = 23; } }",
-                new String[] {"2:53-2:60:verifier:Comparing Strings using == or !=", "1:7-1:12:verifier:Local variable hides a field", "2:97-2:106:verifier:AS0statField"});
+                new String[] {"2:53-2:60:verifier:Comparing Strings using == or !=", "1:7-1:12:verifier:Local variable hides a field", "2:92-2:96:verifier:AS0statField"});
     }
 
     public void testEmptyStatement() throws Exception {
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ChangeTypeTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ChangeTypeTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ChangeTypeTest.java	2011-08-04 21:48:28.808408834 +0100
@@ -49,7 +49,6 @@
 import java.util.List;
 import org.netbeans.modules.java.hints.infrastructure.ErrorHintsTestBase;
 import org.netbeans.spi.editor.hints.Fix;
-import org.openide.util.NbBundle;
 
 
 /**
@@ -209,8 +208,4 @@
         return ((ChangeTypeFix) f).getText();
     }
     
-    static {
-        NbBundle.setBranding("test");
-    }
-
 }
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java	2011-07-28 20:45:56.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/errors/ErrorHintsTest.java	2011-08-04 21:48:28.808408834 +0100
@@ -44,7 +44,6 @@
 package org.netbeans.modules.java.hints.errors;
 
 import org.netbeans.modules.java.hints.infrastructure.*;
-import org.openide.util.NbBundle;
 
 /**
  * @author Jan Lahoda
@@ -462,8 +461,4 @@
         performTest("org.netbeans.test.java.hints.MakeClassAbstract3", "abstract", 3, 1);
     }
     
-    static {
-        NbBundle.setBranding("test");
-    }
-
 }
Index: netbeans-7.0.1+dfsg1/java.navigation/manifest.mf
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.navigation/manifest.mf	2011-07-28 20:45:58.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.navigation/manifest.mf	2011-08-04 21:48:28.808408834 +0100
@@ -2,6 +2,6 @@
 OpenIDE-Module: org.netbeans.modules.java.navigation/1
 OpenIDE-Module-Layer: org/netbeans/modules/java/navigation/resources/layer.xml
 OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/navigation/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.21.1
+OpenIDE-Module-Specification-Version: 1.20.1
 AutoUpdate-Show-In-Client: false
 
Index: netbeans-7.0.1+dfsg1/java.navigation/src/org/netbeans/modules/java/navigation/ElementScanningTask.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.navigation/src/org/netbeans/modules/java/navigation/ElementScanningTask.java	2011-07-28 20:45:58.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.navigation/src/org/netbeans/modules/java/navigation/ElementScanningTask.java	2011-08-04 21:48:28.808408834 +0100
@@ -235,7 +235,7 @@
             return null;
         
         boolean inherited = isParentInherited || (null != parent && !parent.equals( e.getEnclosingElement() ));
-        Description d = new Description( ui, e.getSimpleName().toString(), ElementHandle.create(e), e.getKind(), inherited );
+        Description d = new Description( ui, e.getSimpleName().toString(), ElementHandle.create(e), e.getKind(), TreePathHandle.create(e, info), inherited );
         
         if( e instanceof TypeElement ) {
             d.subs = new HashSet<Description>();
@@ -250,7 +250,10 @@
         
         d.modifiers = e.getModifiers();
         d.pos = getPosition(e, info, pos);
-        d.cpInfo = info.getClasspathInfo();
+        
+        if( inherited ) {
+            d.cpInfo = info.getClasspathInfo();
+        }
         
         return d;
     }
Index: netbeans-7.0.1+dfsg1/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java	2011-07-28 20:45:58.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.navigation/src/org/netbeans/modules/java/navigation/ElementNode.java	2011-08-04 21:48:28.808408834 +0100
@@ -77,7 +77,6 @@
 import org.openide.util.datatransfer.PasteType;
 import org.openide.util.lookup.AbstractLookup;
 import org.openide.util.lookup.InstanceContent;
-import org.openide.util.lookup.InstanceContent.Convertor;
 
 /** Node representing an Element
  *
@@ -93,7 +92,7 @@
            
     /** Creates a new instance of TreeNode */
     public ElementNode( Description description ) {
-        super(description.subs == null ? Children.LEAF: new ElementChilren(description.subs, description.ui.getFilters()), prepareLookup(description));
+        super(description.subs == null ? Children.LEAF: new ElementChilren(description.subs, description.ui.getFilters()), description.treePathHandle==null ? null : prepareLookup(description));
         this.description = description;
         setDisplayName( description.name ); 
     }
@@ -286,63 +285,44 @@
     private static Lookup prepareLookup(Description d) {
         InstanceContent ic = new InstanceContent();
 
-        ic.add(d, ConvertDescription2TreePathHandle);
-        ic.add(d, ConvertDescription2FileObject);
-        ic.add(d, ConvertDescription2DataObject);
+        ic.add(d.treePathHandle);
+        ic.add(d, new InstanceContent.Convertor<Description, FileObject>() {
+            public FileObject convert(Description d) {
+                return d.getFileObject();
+            }
+            public Class<? extends FileObject> type(Description obj) {
+                return FileObject.class;
+            }
+            public String id(Description obj) {
+                return "IL[" + obj.toString();
+            }
+            public String displayName(Description obj) {
+                return id(obj);
+            }
+        });
+        ic.add(d,new InstanceContent.Convertor<Description, DataObject>(){
+            public DataObject convert(Description d) {
+                try {
+                    final FileObject fo = d.getFileObject();
+                    return fo == null ? null : DataObject.find(fo);
+                } catch (DataObjectNotFoundException ex) {
+                    return null;
+                }
+            }
+            public Class<? extends DataObject> type(Description obj) {
+                return DataObject.class;
+            }
+            public String id(Description obj) {
+                return "IL[" + obj.toString();
+            }
+            public String displayName(Description obj) {
+                return id(obj);
+            }
+        });
 
         return new AbstractLookup(ic);
     }
     
-    private static final Convertor<Description, TreePathHandle> ConvertDescription2TreePathHandle = new InstanceContent.Convertor<Description, TreePathHandle>() {
-        @Override public TreePathHandle convert(Description obj) {
-            return TreePathHandle.from(obj.elementHandle, obj.cpInfo);
-        }
-        @Override public Class<? extends TreePathHandle> type(Description obj) {
-            return TreePathHandle.class;
-        }
-        @Override public String id(Description obj) {
-            return "IL[" + obj.toString();
-        }
-        @Override public String displayName(Description obj) {
-            return id(obj);
-        }
-    };
-
-    private static final Convertor<Description, FileObject> ConvertDescription2FileObject = new InstanceContent.Convertor<Description, FileObject>() {
-        public FileObject convert(Description d) {
-            return d.getFileObject();
-        }
-        public Class<? extends FileObject> type(Description obj) {
-            return FileObject.class;
-        }
-        public String id(Description obj) {
-            return "IL[" + obj.toString();
-        }
-        public String displayName(Description obj) {
-            return id(obj);
-        }
-    };
-
-    private static final Convertor<Description, DataObject> ConvertDescription2DataObject = new InstanceContent.Convertor<Description, DataObject>(){
-        public DataObject convert(Description d) {
-            try {
-                final FileObject fo = d.getFileObject();
-                return fo == null ? null : DataObject.find(fo);
-            } catch (DataObjectNotFoundException ex) {
-                return null;
-            }
-        }
-        public Class<? extends DataObject> type(Description obj) {
-            return DataObject.class;
-        }
-        public String id(Description obj) {
-            return "IL[" + obj.toString();
-        }
-        public String displayName(Description obj) {
-            return id(obj);
-        }
-    };
-
     private static final class ElementChilren extends Children.Keys<Description> {
             
         public ElementChilren(Collection<Description> descriptions, ClassMemberFilters filters ) {
@@ -376,6 +356,7 @@
         
         final String name;
         final ElementHandle<? extends Element> elementHandle;
+        final TreePathHandle treePathHandle;
         final ElementKind kind;
         Set<Modifier> modifiers;        
         Collection<Description> subs; 
@@ -388,6 +369,7 @@
             this.ui = ui;
             this.name = null;
             this.elementHandle = null;
+            this.treePathHandle = null;
             this.kind = null;
             this.isInherited = false;
         }
@@ -396,12 +378,14 @@
                     String name,
                     ElementHandle<? extends Element> elementHandle,
                     ElementKind kind,
+                    TreePathHandle tpHandle,
                     boolean inherited ) {
             this.ui = ui;
             this.name = name;
             this.elementHandle = elementHandle;
             this.kind = kind;
             this.isInherited = inherited;
+            this.treePathHandle = tpHandle;
         }
 
         public FileObject getFileObject() {
@@ -430,12 +414,12 @@
                 return false;
             }
             
-            if (this.name != d.name && (this.name == null || !this.name.equals(d.name))) {
+            if ( !name.equals(d.name) ) {
                 // System.out.println("- name");
                 return false;
             }
-
-            if (this.elementHandle != d.elementHandle && (this.elementHandle == null || !this.elementHandle.equals(d.elementHandle))) {
+            
+            if ( !this.elementHandle.signatureEquals(d.elementHandle) ) {
                 return false;
             }
             
Index: netbeans-7.0.1+dfsg1/java.navigation/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.navigation/nbproject/project.xml	2011-07-28 20:45:58.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.navigation/nbproject/project.xml	2011-08-04 21:48:28.808408834 +0100
@@ -55,7 +55,15 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.17.1</specification-version>
+                        <specification-version>1.4</specification-version>
+                    </run-dependency>
+                </dependency>
+                <dependency>
+                    <code-name-base>org.openide.text</code-name-base>
+                    <build-prerequisite/>
+                    <compile-dependency/>
+                    <run-dependency>
+                        <specification-version>6.16</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -64,7 +72,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.33.1</specification-version>
+                        <specification-version>1.18</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -73,7 +81,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>
@@ -81,7 +89,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.6.1.3</specification-version>
+                        <specification-version>0.5</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -90,7 +98,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>3</release-version>
-                        <specification-version>1.57.1.5.13.10</specification-version>
+                        <specification-version>1.53</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -99,7 +107,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>
@@ -108,7 +116,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.43.1.10</specification-version>
+                        <specification-version>1.4</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -117,7 +125,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.22.1</specification-version>
+                        <specification-version>1.10</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -126,7 +134,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.19</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -135,7 +143,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.14.1</specification-version>
+                        <specification-version>1.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -143,7 +151,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>0.79.1.17.15.6</specification-version>
+                        <specification-version>0.3.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -152,7 +160,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.22.1.1.17</specification-version>
+                        <specification-version>1.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -161,7 +169,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>2</release-version>
-                        <specification-version>1.39.1.1</specification-version>
+                        <specification-version>1.22</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -170,7 +178,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.36.1</specification-version>
+                        <specification-version>1.12</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -179,7 +187,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.51.1.8</specification-version>
+                        <specification-version>1.22</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -187,7 +195,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>1.16.1</specification-version>
+                        <specification-version>1.3</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -203,7 +211,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.31.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -211,7 +219,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>6.35.1</specification-version>
+                        <specification-version>6.21</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -219,7 +227,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.47.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -227,7 +235,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
+                        <specification-version>4.15</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -235,15 +243,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>7.21.1</specification-version>
-                    </run-dependency>
-                </dependency>
-                <dependency>
-                    <code-name-base>org.openide.text</code-name-base>
-                    <build-prerequisite/>
-                    <compile-dependency/>
-                    <run-dependency>
-                        <specification-version>6.37.1</specification-version>
+                        <specification-version>6.2</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -251,7 +251,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.15.1</specification-version>
+                        <specification-version>8.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -259,7 +259,7 @@
                     <build-prerequisite/>
                     <compile-dependency/>
                     <run-dependency>
-                        <specification-version>8.8.1</specification-version>
+                        <specification-version>8.0</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
@@ -267,7 +267,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>
Index: netbeans-7.0.1+dfsg1/java.navigation/test/unit/src/org/netbeans/modules/java/navigation/ElementNodeTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.navigation/test/unit/src/org/netbeans/modules/java/navigation/ElementNodeTest.java	2011-07-28 20:45:58.000000000 +0100
+++ netbeans-7.0.1+dfsg1/java.navigation/test/unit/src/org/netbeans/modules/java/navigation/ElementNodeTest.java	2011-08-04 21:48:28.808408834 +0100
@@ -85,7 +85,7 @@
                 counter.incrementAndGet();
                 return info.getFileObject();
             }
-        }, "test", ElementHandle.create(el), el.getKind(), false);
+        }, "test", ElementHandle.create(el), el.getKind(), tph, false);
 
         d.cpInfo = info.getClasspathInfo();
         
@@ -96,7 +96,7 @@
         assertEquals(info.getFileObject(), n.getLookup().lookup(FileObject.class));
         assertEquals(1, counter.get());
 
-        assertEquals(tph.resolve(info).getLeaf(), n.getLookup().lookup(TreePathHandle.class).resolve(info).getLeaf());
+        assertEquals(tph, n.getLookup().lookup(TreePathHandle.class));
     }
     
     public void testNoFileObject() throws Exception {
@@ -114,7 +114,7 @@
                 counter.incrementAndGet();
                 return null;
             }
-        }, "test", ElementHandle.create(el), el.getKind(), false);
+        }, "test", ElementHandle.create(el), el.getKind(), TreePathHandle.create(tp, info), false);
 
         d.cpInfo = info.getClasspathInfo();
 
@@ -134,8 +134,6 @@
     private CompilationInfo info;
 
     private void prepareTest(String filename, String code) throws Exception {
-        clearWorkDir();
-        
         File work = getWorkDir();
         FileObject workFO = FileUtil.toFileObject(work);
 
Index: netbeans-7.0.1+dfsg1/javadoc/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/javadoc/nbproject/project.xml	2011-07-28 20:46:00.000000000 +0100
+++ netbeans-7.0.1+dfsg1/javadoc/nbproject/project.xml	2011-08-04 21:48:28.808408834 +0100
@@ -117,7 +117,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.54.1.5.8.17.6</specification-version>
+                        <specification-version>1.49.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
Index: netbeans-7.0.1+dfsg1/beans/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/beans/nbproject/project.xml	2011-07-28 20:44:54.000000000 +0100
+++ netbeans-7.0.1+dfsg1/beans/nbproject/project.xml	2011-08-04 21:48:28.808408834 +0100
@@ -142,7 +142,7 @@
                     <code-name-base>org.netbeans.modules.java.navigation</code-name-base>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.21.1</specification-version>
+                        <specification-version>1.20.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
Index: netbeans-7.0.1+dfsg1/apisupport.refactoring/nbproject/project.xml
===================================================================
--- netbeans-7.0.1+dfsg1.orig/apisupport.refactoring/nbproject/project.xml	2011-07-28 20:44:54.000000000 +0100
+++ netbeans-7.0.1+dfsg1/apisupport.refactoring/nbproject/project.xml	2011-08-04 21:48:28.808408834 +0100
@@ -117,7 +117,7 @@
                     <compile-dependency/>
                     <run-dependency>
                         <release-version>1</release-version>
-                        <specification-version>1.54.1.5.8.17.6</specification-version>
+                        <specification-version>1.49.1</specification-version>
                     </run-dependency>
                 </dependency>
                 <dependency>
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/introduce/Flow.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/introduce/Flow.java	2011-08-05 18:22:09.049993145 +0100
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,867 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 1997-2011 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common
- * Development and Distribution License("CDDL") (collectively, the
- * "License"). You may not use this file except in compliance with the
- * License. You can obtain a copy of the License at
- * http://www.netbeans.org/cddl-gplv2.html
- * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
- * specific language governing permissions and limitations under the
- * License.  When distributing the software, include this License Header
- * Notice in each file and include the License file at
- * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the
- * License Header, with the fields enclosed by brackets [] replaced by
- * your own identifying information:
- * "Portions Copyrighted [year] [name of copyright owner]"
- *
- * Contributor(s):
- *
- * The Original Software is NetBeans. The Initial Developer of the Original
- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2011 Sun
- * Microsystems, Inc. All Rights Reserved.
- *
- * If you wish your version of this file to be governed by only the CDDL
- * or only the GPL Version 2, indicate your decision by adding
- * "[Contributor] elects to include this software in this distribution
- * under the [CDDL or GPL Version 2] license." If you do not indicate a
- * single choice of license, a recipient has the option to distribute
- * your version of this file under either the CDDL, the GPL Version 2 or
- * to extend the choice of license to its licensees as provided above.
- * However, if you add GPL Version 2 code and therefore, elected the GPL
- * Version 2 license, then the option applies only if the new code is
- * made subject to such option by the copyright holder.
- */
-
-package org.netbeans.modules.java.hints.introduce;
-
-import com.sun.source.tree.AnnotationTree;
-import com.sun.source.tree.ArrayAccessTree;
-import com.sun.source.tree.ArrayTypeTree;
-import com.sun.source.tree.AssertTree;
-import com.sun.source.tree.AssignmentTree;
-import com.sun.source.tree.BinaryTree;
-import com.sun.source.tree.BlockTree;
-import com.sun.source.tree.BreakTree;
-import com.sun.source.tree.CaseTree;
-import com.sun.source.tree.CatchTree;
-import com.sun.source.tree.ClassTree;
-import com.sun.source.tree.CompilationUnitTree;
-import com.sun.source.tree.CompoundAssignmentTree;
-import com.sun.source.tree.ConditionalExpressionTree;
-import com.sun.source.tree.ContinueTree;
-import com.sun.source.tree.DoWhileLoopTree;
-import com.sun.source.tree.EmptyStatementTree;
-import com.sun.source.tree.EnhancedForLoopTree;
-import com.sun.source.tree.ErroneousTree;
-import com.sun.source.tree.ExpressionStatementTree;
-import com.sun.source.tree.ForLoopTree;
-import com.sun.source.tree.IdentifierTree;
-import com.sun.source.tree.IfTree;
-import com.sun.source.tree.ImportTree;
-import com.sun.source.tree.InstanceOfTree;
-import com.sun.source.tree.LabeledStatementTree;
-import com.sun.source.tree.LiteralTree;
-import com.sun.source.tree.MemberSelectTree;
-import com.sun.source.tree.MethodInvocationTree;
-import com.sun.source.tree.MethodTree;
-import com.sun.source.tree.ModifiersTree;
-import com.sun.source.tree.NewArrayTree;
-import com.sun.source.tree.NewClassTree;
-import com.sun.source.tree.ParameterizedTypeTree;
-import com.sun.source.tree.ParenthesizedTree;
-import com.sun.source.tree.PrimitiveTypeTree;
-import com.sun.source.tree.ReturnTree;
-import com.sun.source.tree.StatementTree;
-import com.sun.source.tree.SwitchTree;
-import com.sun.source.tree.SynchronizedTree;
-import com.sun.source.tree.ThrowTree;
-import com.sun.source.tree.Tree;
-import com.sun.source.tree.Tree.Kind;
-import com.sun.source.tree.TryTree;
-import com.sun.source.tree.TypeCastTree;
-import com.sun.source.tree.TypeParameterTree;
-import com.sun.source.tree.UnaryTree;
-import com.sun.source.tree.UnionTypeTree;
-import com.sun.source.tree.VariableTree;
-import com.sun.source.tree.WhileLoopTree;
-import com.sun.source.tree.WildcardTree;
-import com.sun.source.util.TreePath;
-import com.sun.source.util.TreePathScanner;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.EnumSet;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.IdentityHashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-import javax.lang.model.element.Element;
-import javax.lang.model.element.ElementKind;
-import javax.lang.model.element.VariableElement;
-import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.api.java.source.support.CancellableTreePathScanner;
-
-/**
- *
- * @author lahvac
- */
-public class Flow {
-
-    public static FlowResult assignmentsForUse(CompilationInfo info, AtomicBoolean cancel) {
-        return assignmentsForUse(info, new TreePath(info.getCompilationUnit()), cancel);
-    }
-
-    public static FlowResult assignmentsForUse(CompilationInfo info, TreePath from, AtomicBoolean cancel) {
-        Map<Tree, Iterable<? extends TreePath>> result = new HashMap<Tree, Iterable<? extends TreePath>>();
-        VisitorImpl v = new VisitorImpl(info, cancel);
-
-        v.scan(from, null);
-
-        if (cancel.get()) return null;
-
-        for (Entry<Tree, State> e : v.use2Values.entrySet()) {
-            result.put(e.getKey(), e.getValue() != null ? e.getValue().assignments : Collections.<TreePath>emptyList());
-        }
-
-        v.deadBranches.remove(null);
-
-        return new FlowResult(result, v.deadBranches);
-    }
-
-    public static final class FlowResult {
-        private final Map<Tree, Iterable<? extends TreePath>> assignmentsForUse;
-        private final Set<? extends Tree> deadBranches;
-        private FlowResult(Map<Tree, Iterable<? extends TreePath>> assignmentsForUse, Set<Tree> deadBranches) {
-            this.assignmentsForUse = assignmentsForUse;
-            this.deadBranches = deadBranches;
-        }
-        public Map<Tree, Iterable<? extends TreePath>> getAssignmentsForUse() {
-            return assignmentsForUse;
-        }
-        public Set<? extends Tree> getDeadBranches() {
-            return deadBranches;
-        }
-    }
-
-    public static boolean definitellyAssigned(CompilationInfo info, VariableElement var, Iterable<? extends TreePath> trees, AtomicBoolean cancel) {
-        VisitorImpl v = new VisitorImpl(info, cancel);
-
-        v.variable2State.put(var, State.create(null));
-
-        for (TreePath tp : trees) {
-            if (cancel.get()) return false;
-            
-            v.scan(tp, null);
-
-            if (!v.variable2State.get(var).assignments.contains(null)) return true;
-        }
-
-        return false;
-    }
-
-    private static final class VisitorImpl extends CancellableTreePathScanner<Boolean, Void> {
-        
-        private final CompilationInfo info;
-        
-        private Map<VariableElement, State> variable2State = new HashMap<VariableElement, Flow.State>();
-        private Map<Tree, State> use2Values = new IdentityHashMap<Tree, State>();
-        private Map<Tree, Collection<Map<VariableElement, State>>> resumeAfter = new IdentityHashMap<Tree, Collection<Map<VariableElement, State>>>();
-        private boolean inParameters;
-        private Tree nearestMethod;
-        private Set<VariableElement> currentMethodVariables = Collections.newSetFromMap(new IdentityHashMap<VariableElement, Boolean>());
-        private final Set<Tree> deadBranches = new HashSet<Tree>();
-
-        public VisitorImpl(CompilationInfo info, AtomicBoolean cancel) {
-            super(cancel);
-            this.info = info;
-        }
-
-        @Override
-        public Boolean scan(Tree tree, Void p) {
-            Boolean result = super.scan(tree, p);
-
-            Collection<Map<VariableElement, State>> toResume = resumeAfter.remove(tree);
-
-            if (toResume != null) {
-                for (Map<VariableElement, State> s : toResume) {
-                    variable2State = mergeOr(variable2State, s);
-                }
-            }
-
-            return result;
-        }
-
-        @Override
-        public Boolean visitAssignment(AssignmentTree node, Void p) {
-            switch (node.getVariable().getKind()) {
-                case MEMBER_SELECT:
-                    scan(((MemberSelectTree) node.getVariable()).getExpression(), null); //XXX: this will not create a correct TreePath
-                    break;
-                case ARRAY_ACCESS:
-                    scan(node.getVariable(), null);
-                    break;
-                case IDENTIFIER:
-                    break;
-                default:
-                    //#198233: ignore
-            }
-
-            scan(node.getExpression(), p);
-
-            Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getVariable()));
-            
-            if (e != null && LOCAL_VARIABLES.contains(e.getKind())) {
-                variable2State.put((VariableElement) e, State.create(new TreePath(getCurrentPath(), node.getExpression())));
-            }
-            
-            return null;
-        }
-
-        @Override
-        public Boolean visitCompoundAssignment(CompoundAssignmentTree node, Void p) {
-            switch (node.getVariable().getKind()) {
-                case MEMBER_SELECT:
-                    scan(((MemberSelectTree) node.getVariable()).getExpression(), null); //XXX: this will not create a correct TreePath
-                    break;
-                case ARRAY_ACCESS:
-                    scan(node.getVariable(), null);
-                    break;
-                case IDENTIFIER:
-                    break;
-                default:
-                    //#198975: ignore
-            }
-
-            scan(node.getExpression(), p);
-
-            Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getVariable()));
-
-            if (e != null && LOCAL_VARIABLES.contains(e.getKind())) {
-                use2Values.put(node.getVariable(), variable2State.get((VariableElement) e)); //XXX
-                variable2State.put((VariableElement) e, State.create(getCurrentPath()));
-            }
-
-            return null;
-        }
-
-        @Override
-        public Boolean visitVariable(VariableTree node, Void p) {
-            super.visitVariable(node, p);
-
-            Element e = info.getTrees().getElement(getCurrentPath());
-            
-            if (e != null && LOCAL_VARIABLES.contains(e.getKind())) {
-                variable2State.put((VariableElement) e, State.create(node.getInitializer() != null ? new TreePath(getCurrentPath(), node.getInitializer()) : inParameters ? getCurrentPath() : null));
-                currentMethodVariables.add((VariableElement) e);
-            }
-            
-            return null;
-        }
-
-        @Override
-        public Boolean visitMemberSelect(MemberSelectTree node, Void p) {
-            super.visitMemberSelect(node, p);
-
-            Element e = info.getTrees().getElement(getCurrentPath());
-
-            if (e != null && LOCAL_VARIABLES.contains(e.getKind())) {
-                use2Values.put(node, variable2State.get((VariableElement) e));
-            }
-            
-            return null;
-        }
-
-        @Override
-        public Boolean visitLiteral(LiteralTree node, Void p) {
-            Object val = node.getValue();
-
-            if (val instanceof Boolean) {
-                return (Boolean) val;
-            } else {
-                return null;
-            }
-        }
-
-        @Override
-        public Boolean visitIf(IfTree node, Void p) {
-            Boolean result = scan(node.getCondition(), p);
-
-            if (result != null) {
-                if (result) {
-                    scan(node.getThenStatement(), null);
-                    deadBranches.add(node.getElseStatement());
-                } else {
-                    scan(node.getElseStatement(), null);
-                    deadBranches.add(node.getThenStatement());
-                }
-
-                return null;
-            }
-
-            Map<VariableElement, State> oldVariable2State = variable2State;
-            
-            variable2State = new HashMap<VariableElement, Flow.State>(oldVariable2State);
-
-            scan(node.getThenStatement(), null);
-            
-            if (node.getElseStatement() != null) {
-                Map<VariableElement, State> variableStatesAfterThen = new HashMap<VariableElement, Flow.State>(variable2State);
-
-                variable2State = new HashMap<VariableElement, Flow.State>(oldVariable2State);
-
-                scan(node.getElseStatement(), null);
-
-                variable2State = mergeOr(variable2State, variableStatesAfterThen);
-            } else {
-                variable2State = mergeOr(variable2State, oldVariable2State);
-            }
-            
-            return null;
-        }
-
-        @Override
-        public Boolean visitBinary(BinaryTree node, Void p) {
-            Boolean left = scan(node.getLeftOperand(), p);
-
-            if (left != null && (node.getKind() == Kind.CONDITIONAL_AND || node.getKind() == Kind.CONDITIONAL_OR)) {
-                if (left) {
-                    if (node.getKind() == Kind.CONDITIONAL_AND) {
-                        return scan(node.getRightOperand(), p);
-                    } else {
-                        return true;
-                    }
-                } else {
-                    if (node.getKind() == Kind.CONDITIONAL_AND) {
-                        return false;
-                    } else {
-                        return scan(node.getRightOperand(), p);
-                    }
-                }
-            }
-
-            Map<VariableElement, State> oldVariable2State = variable2State;
-
-            variable2State = new HashMap<VariableElement, Flow.State>(oldVariable2State);
-            
-            Boolean right = scan(node.getRightOperand(), p);
-
-            variable2State = mergeOr(variable2State, oldVariable2State);
-
-            if (left == null || right == null) {
-                return null;
-            }
-
-            switch (node.getKind()) {
-                case AND: case CONDITIONAL_AND: return left && right;
-                case OR: case CONDITIONAL_OR: return left || right;
-                case EQUAL_TO: return left == right;
-                case NOT_EQUAL_TO: return left != right;
-            }
-            
-            return null;
-        }
-
-        @Override
-        public Boolean visitConditionalExpression(ConditionalExpressionTree node, Void p) {
-            Boolean result = scan(node.getCondition(), p);
-
-            if (result != null) {
-                if (result) {
-                    scan(node.getTrueExpression(), null);
-                } else {
-                    scan(node.getFalseExpression(), null);
-                }
-
-                return null;
-            }
-
-            Map<VariableElement, State> oldVariable2State = variable2State;
-
-            variable2State = new HashMap<VariableElement, Flow.State>(oldVariable2State);
-
-            scan(node.getTrueExpression(), null);
-
-            if (node.getFalseExpression() != null) {
-                Map<VariableElement, State> variableStatesAfterThen = new HashMap<VariableElement, Flow.State>(variable2State);
-
-                variable2State = new HashMap<VariableElement, Flow.State>(oldVariable2State);
-
-                scan(node.getFalseExpression(), null);
-
-                variable2State = mergeOr(variable2State, variableStatesAfterThen);
-            } else {
-                variable2State = mergeOr(variable2State, oldVariable2State);
-            }
-
-            return null;
-        }
-
-        @Override
-        public Boolean visitIdentifier(IdentifierTree node, Void p) {
-            super.visitIdentifier(node, p);
-
-            Element e = info.getTrees().getElement(getCurrentPath());
-
-            if (e != null && LOCAL_VARIABLES.contains(e.getKind())) {
-                use2Values.put(node, variable2State.get((VariableElement) e));
-            }
-            
-            return null;
-        }
-
-        @Override
-        public Boolean visitUnary(UnaryTree node, Void p) {
-            Boolean val = super.visitUnary(node, p);
-
-            if (val != null && node.getKind() == Kind.LOGICAL_COMPLEMENT) {
-                return !val;
-            }
-
-            if (    node.getKind() == Kind.PREFIX_DECREMENT
-                 || node.getKind() == Kind.PREFIX_INCREMENT
-                 || node.getKind() == Kind.POSTFIX_DECREMENT
-                 || node.getKind() == Kind.POSTFIX_INCREMENT) {
-                Element e = info.getTrees().getElement(new TreePath(getCurrentPath(), node.getExpression()));
-
-                if (e != null && LOCAL_VARIABLES.contains(e.getKind())) {
-                    State prev = variable2State.get((VariableElement) e);
-
-                    use2Values.put(node.getExpression(), prev);
-                    variable2State.put((VariableElement) e, State.create(getCurrentPath()));
-                }
-            }
-
-
-            return null;
-        }
-
-        @Override
-        public Boolean visitMethod(MethodTree node, Void p) {
-            Tree oldNearestMethod = nearestMethod;
-            Set<VariableElement> oldCurrentMethodVariables = currentMethodVariables;
-
-            nearestMethod = node;
-            currentMethodVariables = Collections.newSetFromMap(new IdentityHashMap<VariableElement, Boolean>());
-            
-            try {
-                scan(node.getModifiers(), p);
-                scan(node.getReturnType(), p);
-                scan(node.getTypeParameters(), p);
-
-                inParameters = true;
-
-                try {
-                    scan(node.getParameters(), p);
-                } finally {
-                    inParameters = false;
-                }
-
-                scan(node.getThrows(), p);
-                scan(node.getBody(), p);
-                scan(node.getDefaultValue(), p);
-            } finally {
-                nearestMethod = oldNearestMethod;
-                currentMethodVariables = oldCurrentMethodVariables;
-            }
-            
-            return null;
-        }
-
-        @Override
-        public Boolean visitWhileLoop(WhileLoopTree node, Void p) {
-            Boolean condValue = scan(node.getCondition(), null);
-
-            if (condValue != null) {
-                if (condValue) {
-                    //XXX: handle possibly infinite loop
-                } else {
-                    //will not run at all, skip:
-                    return null;
-                }
-            }
-            
-            Map<VariableElement, State> beforeLoop = variable2State;
-
-            variable2State = new HashMap<VariableElement, Flow.State>(beforeLoop);
-
-            scan(node.getStatement(), null);
-
-            beforeLoop = new HashMap<VariableElement, State>(variable2State = mergeOr(beforeLoop, variable2State));
-
-            scan(node.getCondition(), null);
-            scan(node.getStatement(), null);
-            
-            variable2State = beforeLoop;
-
-            return null;
-        }
-
-        @Override
-        public Boolean visitDoWhileLoop(DoWhileLoopTree node, Void p) {
-            Map<VariableElement, State> beforeLoop = variable2State;
-
-            variable2State = new HashMap<VariableElement, Flow.State>(beforeLoop);
-
-            scan(node.getStatement(), null);
-            Boolean condValue = scan(node.getCondition(), null);
-
-            if (condValue != null) {
-                if (condValue) {
-                    //XXX: handle possibly infinite loop
-                } else {
-                    //will not run more than once, skip:
-                    return null;
-                }
-            }
-
-            beforeLoop = new HashMap<VariableElement, State>(variable2State = mergeOr(beforeLoop, variable2State));
-
-            scan(node.getStatement(), null);
-            scan(node.getCondition(), null);
-
-            variable2State = beforeLoop;
-
-            return null;
-        }
-
-        @Override
-        public Boolean visitForLoop(ForLoopTree node, Void p) {
-            scan(node.getInitializer(), null);
-            Boolean condValue = scan(node.getCondition(), null);
-
-            if (condValue != null) {
-                if (condValue) {
-                    //XXX: handle possibly infinite loop
-                } else {
-                    //will not run at all, skip:
-                    return null;
-                }
-            }
-
-            Map<VariableElement, State> beforeLoop = variable2State;
-
-            variable2State = new HashMap<VariableElement, Flow.State>(beforeLoop);
-
-            scan(node.getStatement(), null);
-            scan(node.getUpdate(), null);
-
-            beforeLoop = new HashMap<VariableElement, State>(variable2State = mergeOr(beforeLoop, variable2State));
-
-            scan(node.getCondition(), null);
-            scan(node.getStatement(), null);
-            scan(node.getUpdate(), null);
-
-            variable2State = mergeOr(beforeLoop, variable2State);
-
-            return null;
-        }
-
-        public Boolean visitTry(TryTree node, Void p) {
-            scan(node.getResources(), null);
-
-            Map<VariableElement, State> oldVariable2State = variable2State;
-
-            variable2State = new HashMap<VariableElement, Flow.State>(oldVariable2State);
-
-            scan(node.getBlock(), null);
-
-            HashMap<VariableElement, State> afterBlockVariable2State = new HashMap<VariableElement, Flow.State>(variable2State);
-
-            for (CatchTree ct : node.getCatches()) {
-                Map<VariableElement, State> variable2StateBeforeCatch = variable2State;
-
-                variable2State = new HashMap<VariableElement, Flow.State>(oldVariable2State);
-
-                scan(ct, null);
-
-                variable2State = mergeOr(variable2StateBeforeCatch, variable2State);
-            }
-
-            if (node.getFinallyBlock() != null) {
-                variable2State = mergeOr(mergeOr(oldVariable2State, variable2State), afterBlockVariable2State);
-
-                scan(node.getFinallyBlock(), null);
-            }
-            
-            return null;
-        }
-
-        public Boolean visitReturn(ReturnTree node, Void p) {
-            super.visitReturn(node, p);
-            variable2State = new HashMap<VariableElement, State>(variable2State);
-            //performance: limit ammount of held variables and their mapping:
-            for (VariableElement ve : currentMethodVariables) {
-                variable2State.remove(ve);
-            }
-            resumeAfter(nearestMethod, variable2State);
-            variable2State = new HashMap<VariableElement, State>();
-            return null;
-        }
-
-        public Boolean visitBreak(BreakTree node, Void p) {
-            super.visitBreak(node, p);
-
-            StatementTree target = info.getTreeUtilities().getBreakContinueTarget(getCurrentPath());
-            
-            resumeAfter(target, variable2State);
-
-            variable2State = new HashMap<VariableElement, State>();
-            
-            return null;
-        }
-
-        public Boolean visitSwitch(SwitchTree node, Void p) {
-            scan(node.getExpression(), null);
-
-            Map<VariableElement, State> origVariable2State = new HashMap<VariableElement, State>(variable2State);
-
-            variable2State = new HashMap<VariableElement, State>();
-
-            boolean exhaustive = false;
-
-            for (CaseTree ct : node.getCases()) {
-                variable2State = mergeOr(variable2State, origVariable2State);
-
-                if (ct.getExpression() == null) {
-                    exhaustive = true;
-                }
-
-                scan(ct, null);
-            }
-
-            if (!exhaustive) {
-                variable2State = mergeOr(variable2State, origVariable2State);
-            }
-            
-            return null;
-        }
-
-        public Boolean visitEnhancedForLoop(EnhancedForLoopTree node, Void p) {
-            scan(node.getVariable(), null);
-            scan(node.getExpression(), null);
-
-            Map<VariableElement, State> beforeLoop = variable2State;
-
-            variable2State = new HashMap<VariableElement, Flow.State>(beforeLoop);
-
-            scan(node.getStatement(), null);
-
-            beforeLoop = new HashMap<VariableElement, State>(variable2State = mergeOr(beforeLoop, variable2State));
-
-            scan(node.getStatement(), null);
-
-            variable2State = mergeOr(beforeLoop, variable2State);
-
-            return null;
-        }
-
-        private void resumeAfter(Tree target, Map<VariableElement, State> state) {
-            Collection<Map<VariableElement, State>> r = resumeAfter.get(target);
-
-            if (r == null) {
-                resumeAfter.put(target, r = new ArrayList<Map<VariableElement, State>>());
-            }
-
-            r.add(new HashMap<VariableElement, State>(state));
-        }
-
-        public Boolean visitWildcard(WildcardTree node, Void p) {
-            super.visitWildcard(node, p);
-            return null;
-        }
-
-        public Boolean visitUnionType(UnionTypeTree node, Void p) {
-            super.visitUnionType(node, p);
-            return null;
-        }
-
-        public Boolean visitTypeParameter(TypeParameterTree node, Void p) {
-            super.visitTypeParameter(node, p);
-            return null;
-        }
-
-        public Boolean visitTypeCast(TypeCastTree node, Void p) {
-            super.visitTypeCast(node, p);
-            return null;
-        }
-
-        public Boolean visitThrow(ThrowTree node, Void p) {
-            super.visitThrow(node, p);
-            return null;
-        }
-
-        public Boolean visitSynchronized(SynchronizedTree node, Void p) {
-            super.visitSynchronized(node, p);
-            return null;
-        }
-
-        public Boolean visitPrimitiveType(PrimitiveTypeTree node, Void p) {
-            super.visitPrimitiveType(node, p);
-            return null;
-        }
-
-        public Boolean visitParenthesized(ParenthesizedTree node, Void p) {
-            super.visitParenthesized(node, p);
-            return null;
-        }
-
-        public Boolean visitParameterizedType(ParameterizedTypeTree node, Void p) {
-            super.visitParameterizedType(node, p);
-            return null;
-        }
-
-        public Boolean visitOther(Tree node, Void p) {
-            super.visitOther(node, p);
-            return null;
-        }
-
-        public Boolean visitNewClass(NewClassTree node, Void p) {
-            super.visitNewClass(node, p);
-            return null;
-        }
-
-        public Boolean visitNewArray(NewArrayTree node, Void p) {
-            super.visitNewArray(node, p);
-            return null;
-        }
-
-        public Boolean visitModifiers(ModifiersTree node, Void p) {
-            super.visitModifiers(node, p);
-            return null;
-        }
-
-        public Boolean visitMethodInvocation(MethodInvocationTree node, Void p) {
-            super.visitMethodInvocation(node, p);
-            return null;
-        }
-
-        public Boolean visitLabeledStatement(LabeledStatementTree node, Void p) {
-            super.visitLabeledStatement(node, p);
-            return null;
-        }
-
-        public Boolean visitInstanceOf(InstanceOfTree node, Void p) {
-            super.visitInstanceOf(node, p);
-            return null;
-        }
-
-        public Boolean visitImport(ImportTree node, Void p) {
-            super.visitImport(node, p);
-            return null;
-        }
-
-        public Boolean visitExpressionStatement(ExpressionStatementTree node, Void p) {
-            super.visitExpressionStatement(node, p);
-            return null;
-        }
-
-        public Boolean visitErroneous(ErroneousTree node, Void p) {
-            super.visitErroneous(node, p);
-            return null;
-        }
-
-        public Boolean visitEmptyStatement(EmptyStatementTree node, Void p) {
-            super.visitEmptyStatement(node, p);
-            return null;
-        }
-
-        public Boolean visitContinue(ContinueTree node, Void p) {
-            super.visitContinue(node, p);
-            return null;
-        }
-
-        public Boolean visitCompilationUnit(CompilationUnitTree node, Void p) {
-            super.visitCompilationUnit(node, p);
-            return null;
-        }
-
-        public Boolean visitClass(ClassTree node, Void p) {
-            super.visitClass(node, p);
-            return null;
-        }
-
-        public Boolean visitCatch(CatchTree node, Void p) {
-            super.visitCatch(node, p);
-            return null;
-        }
-
-        public Boolean visitCase(CaseTree node, Void p) {
-            super.visitCase(node, p);
-            return null;
-        }
-
-        public Boolean visitBlock(BlockTree node, Void p) {
-            super.visitBlock(node, p);
-            return null;
-        }
-
-        public Boolean visitAssert(AssertTree node, Void p) {
-            super.visitAssert(node, p);
-            return null;
-        }
-
-        public Boolean visitArrayType(ArrayTypeTree node, Void p) {
-            super.visitArrayType(node, p);
-            return null;
-        }
-
-        public Boolean visitArrayAccess(ArrayAccessTree node, Void p) {
-            super.visitArrayAccess(node, p);
-            return null;
-        }
-
-        public Boolean visitAnnotation(AnnotationTree node, Void p) {
-            super.visitAnnotation(node, p);
-            return null;
-        }
-
-        private Map<VariableElement, State> mergeOr(Map<VariableElement, State> into, Map<VariableElement, State> what) {
-            for (Entry<VariableElement, State> e : what.entrySet()) {
-                State stt = into.get(e.getKey());
-
-                if (stt != null) {
-                    into.put(e.getKey(), stt.merge(e.getValue()));
-                } else {
-                    into.put(e.getKey(), e.getValue());
-                }
-            }
-
-            return into;
-        }
-    }
-    
-    private static final Set<ElementKind> LOCAL_VARIABLES = EnumSet.of(ElementKind.EXCEPTION_PARAMETER, ElementKind.LOCAL_VARIABLE, ElementKind.PARAMETER);
-    
-    static class State {
-        private final Set<TreePath> assignments;
-        private State(Set<TreePath> assignments) {
-            this.assignments = assignments;
-        }
-        public static State create(TreePath assignment) {
-            return new State(Collections.singleton(assignment));
-        }
-
-        public State merge(State value) {
-            @SuppressWarnings("LocalVariableHidesMemberVariable")
-            Set<TreePath> assignments = new HashSet<TreePath>(this.assignments);
-
-            assignments.addAll(value.assignments);
-
-            return new State(assignments);
-        }
-    }
-
-}
Index: netbeans-7.0.1+dfsg1/java.hints/src/org/netbeans/modules/java/hints/infrastructure/NoClassLoaderProblemCustomizerProvider.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/src/org/netbeans/modules/java/hints/infrastructure/NoClassLoaderProblemCustomizerProvider.java	2011-08-05 18:24:38.080825099 +0100
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,74 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common
- * Development and Distribution License("CDDL") (collectively, the
- * "License"). You may not use this file except in compliance with the
- * License. You can obtain a copy of the License at
- * http://www.netbeans.org/cddl-gplv2.html
- * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
- * specific language governing permissions and limitations under the
- * License.  When distributing the software, include this License Header
- * Notice in each file and include the License file at
- * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the
- * License Header, with the fields enclosed by brackets [] replaced by
- * your own identifying information:
- * "Portions Copyrighted [year] [name of copyright owner]"
- *
- * If you wish your version of this file to be governed by only the CDDL
- * or only the GPL Version 2, indicate your decision by adding
- * "[Contributor] elects to include this software in this distribution
- * under the [CDDL or GPL Version 2] license." If you do not indicate a
- * single choice of license, a recipient has the option to distribute
- * your version of this file under either the CDDL, the GPL Version 2 or
- * to extend the choice of license to its licensees as provided above.
- * However, if you add GPL Version 2 code and therefore, elected the GPL
- * Version 2 license, then the option applies only if the new code is
- * made subject to such option by the copyright holder.
- *
- * Contributor(s):
- *
- * Portions Copyrighted 2011 Sun Microsystems, Inc.
- */
-package org.netbeans.modules.java.hints.infrastructure;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.prefs.Preferences;
-import javax.swing.JComponent;
-import javax.swing.JPanel;
-import org.netbeans.modules.java.hints.jackpot.spi.CustomizerProvider;
-
-/**Hack to workaround classloader issues while loading CustomizerProviders from other modules.
- *
- * @author lahvac
- */
-public class NoClassLoaderProblemCustomizerProvider implements CustomizerProvider {
-
-    private static final Map<String, CustomizerProvider> id2CustomizerProvider = new HashMap<String, CustomizerProvider>();
-
-    public static void register(String id, CustomizerProvider customizer) {
-        id2CustomizerProvider.put(id, customizer);
-    }
-
-    @Override
-    public JComponent getCustomizer(Preferences prefs) {
-        CustomizerProvider p = id2CustomizerProvider.get(prefs.name());
-
-        if (p != null) {
-            return p.getCustomizer(prefs);
-        } else {
-            return new JPanel();
-        }
-    }
-
-}
Index: netbeans-7.0.1+dfsg1/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/FlowTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.hints/test/unit/src/org/netbeans/modules/java/hints/introduce/FlowTest.java	2011-08-05 18:25:06.459991592 +0100
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,531 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common
- * Development and Distribution License("CDDL") (collectively, the
- * "License"). You may not use this file except in compliance with the
- * License. You can obtain a copy of the License at
- * http://www.netbeans.org/cddl-gplv2.html
- * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
- * specific language governing permissions and limitations under the
- * License.  When distributing the software, include this License Header
- * Notice in each file and include the License file at
- * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the
- * License Header, with the fields enclosed by brackets [] replaced by
- * your own identifying information:
- * "Portions Copyrighted [year] [name of copyright owner]"
- *
- * If you wish your version of this file to be governed by only the CDDL
- * or only the GPL Version 2, indicate your decision by adding
- * "[Contributor] elects to include this software in this distribution
- * under the [CDDL or GPL Version 2] license." If you do not indicate a
- * single choice of license, a recipient has the option to distribute
- * your version of this file under either the CDDL, the GPL Version 2 or
- * to extend the choice of license to its licensees as provided above.
- * However, if you add GPL Version 2 code and therefore, elected the GPL
- * Version 2 license, then the option applies only if the new code is
- * made subject to such option by the copyright holder.
- *
- * Contributor(s):
- *
- * Portions Copyrighted 2011 Sun Microsystems, Inc.
- */
-package org.netbeans.modules.java.hints.introduce;
-
-import com.sun.source.tree.Tree;
-import com.sun.source.util.TreePath;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Set;
-import java.util.concurrent.atomic.AtomicBoolean;
-import java.util.regex.Pattern;
-import javax.swing.text.Document;
-import static org.junit.Assert.*;
-import org.netbeans.api.java.lexer.JavaTokenId;
-import org.netbeans.api.java.source.CompilationInfo;
-import org.netbeans.api.java.source.JavaSource;
-import org.netbeans.api.java.source.JavaSource.Phase;
-import org.netbeans.api.java.source.SourceUtilsTestUtil;
-import org.netbeans.api.lexer.Language;
-import org.netbeans.junit.NbTestCase;
-import org.netbeans.modules.java.hints.TestUtilities;
-import org.netbeans.modules.java.hints.introduce.Flow.FlowResult;
-import org.openide.cookies.EditorCookie;
-import org.openide.filesystems.FileObject;
-import org.openide.filesystems.FileUtil;
-import org.openide.loaders.DataObject;
-
-/**TODO: mostly tested indirectly through IntroduceHintTest, should be rather tested here
- *
- * @author lahvac
- */
-public class FlowTest extends NbTestCase {
-
-    public FlowTest(String name) {
-        super(name);
-    }
-
-    @Override
-    protected void setUp() throws Exception {
-        SourceUtilsTestUtil.prepareTest(new String[0], new Object[0]);
-        super.setUp();
-    }
-
-    public void testSimple() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(int i) {\n" +
-                    "        int ii = 1;\n" +
-                    "        ii = 2;\n" +
-                    "        if (i == 0) ii = 3;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "2",
-                    "3");
-    }
-
-    public void testBinary1() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(int i) {\n" +
-                    "        int ii = 1;\n" +
-                    "        ii = 2;\n" +
-                    "        boolean b = i == 0 && (ii = 3) != 0;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "2",
-                    "3");
-    }
-
-    public void testBinary2() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii = 1;\n" +
-                    "        ii = 2;\n" +
-                    "        boolean b = true && (ii = 3) != 0;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "3");
-    }
-
-    public void testBinary3() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii = 1;\n" +
-                    "        ii = 2;\n" +
-                    "        boolean b = false && (ii = 3) != 0;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "2");
-    }
-
-    public void testBinary4() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(int i) {\n" +
-                    "        int ii = 1;\n" +
-                    "        ii = 2;\n" +
-                    "        boolean b = i == 0 || (ii = 3) != 0;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "2",
-                    "3");
-    }
-
-    public void testBinary5() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii = 1;\n" +
-                    "        ii = 2;\n" +
-                    "        boolean b = false || (ii = 3) != 0;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "3");
-    }
-
-    public void testBinary6() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii = 1;\n" +
-                    "        ii = 2;\n" +
-                    "        boolean b = true || (ii = 3) != 0;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "2");
-    }
-
-    public void test197666() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(int i) {\n" +
-                    "        int ii = 1;\n" +
-                    "        boolean b = i == 1 && true;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "1");
-    }
-
-    public void test198233() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii = 1;\n" +
-                    "        boolean b = i == 1 && true;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "        ===\n" +
-                    "    }\n" +
-                    "}\n",
-                    true,
-                    "1");
-    }
-
-    public void testIncorrectDeadBranch() throws Exception {
-        performDeadBranchTest("package test;\n" +
-                              "public class Test {\n" +
-                              "    public void i() {\n" +
-                              "        if (!i.getAndSet(true)) {\n" +
-                              "            System.err.println(\"\");\n" +
-                              "        }\n" +
-                              "    }\n" +
-                              "    private final java.util.concurrent.atomic.AtomicBoolean i = new java.util.concurrent.atomic.AtomicBoolean();\n" +
-                              "}\n");
-    }
-
-    public void testTryCatch() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii;\n" +
-                    "        try {\n" +
-                    "            ii = 1;\n" +
-                    "        } catch (Exception e) {\n" +
-                    "            ii = 2;\n" +
-                    "        }\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "1",
-                    "2");
-    }
-
-    public void testTryCatchFinally() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii;\n" +
-                    "        try {\n" +
-                    "            ii = 1;\n" +
-                    "        } catch (Exception e) {\n" +
-                    "            ii = 2;\n" +
-                    "        } finally {\n" +
-                    "            ii = 3;\n" +
-                    "        }\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "3");
-    }
-
-    public void testTryFinally() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii;\n" +
-                    "        try {\n" +
-                    "            ii = 1;\n" +
-                    "        } finally {\n" +
-                    "            ii = 3;\n" +
-                    "        }\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "3");
-    }
-
-    public void testTryFinally2() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii = 0;\n" +
-                    "        try {\n" +
-                    "            ii = 1;\n" +
-                    "        } catch (Exception e) {\n" +
-                    "            ii = 2;\n" +
-                    "        } finally {\n" +
-                    "            System.err.println(i`i);\n" +
-                    "        }\n" +
-                    "    }\n" +
-                    "}\n",
-                    "0",
-                    "1",
-                    "2");
-    }
-
-    public void testSwitch1() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(int p, int r) {\n" +
-                    "        int ii;\n" +
-                    "        switch (p) {\n" +
-                    "            case 0: ii = 1; break;\n" +
-                    "            case 1: if (r > 5) {\n" +
-                    "                         ii = 5;\n" +
-                    "                         break;\n" +
-                    "                    }\n" +
-                    "                    ii = 2;\n" +
-                    "            case 2: ii = 3; break;\n" +
-                    "            default: ii = 4; break;\n" +
-                    "        }\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "1",
-                    "5",
-                    "3",
-                    "4");
-    }
-
-    public void testSwitch2() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(int p) {\n" +
-                    "        int ii;\n" +
-                    "        switch (p) {\n" +
-                    "            case 0: ii = 1; break;\n" +
-                    "            case 1: ii = 2;\n" +
-                    "            case 2: ii = 3; return;\n" +
-                    "            default: ii = 4; break;\n" +
-                    "        }\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "1",
-                    "4");
-    }
-
-    public void testSwitch3() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(int p) {\n" +
-                    "        int ii = 0;\n" +
-                    "        switch (p) {\n" +
-                    "            case 0: ii = 1; break;\n" +
-                    "        }\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "0",
-                    "1");
-    }
-
-    public void testSwitch4() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(String str) {\n" +
-                    "        final int mm = 1;\n" +
-                    "        int b = 0;\n" +
-                    "        switch (str.length()) {\n" +
-                    "            case 0: break;\n" +
-                    "            case 1: b |= m`m; break;\n" +
-                    "        }\n" +
-                    "    }\n" +
-                    "}\n",
-                    "1");
-    }
-
-    public void testForUpdate() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        for (int ii = 0; ii < 100; ii = ii + 1) {\n" +
-                    "            System.err.println(i`i);\n" +
-                    "        }\n" +
-                    "    }\n" +
-                    "}\n",
-                    "0",
-                    "ii + 1");
-    }
-
-    public void testForEach() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t(String... args) {\n" +
-                    "        boolean ff = true;\n" +
-                    "        for (String a : args) {\n" +
-                    "            if (!f`f) System.err.println(1);\n" +
-                    "            ff = false;\n" +
-                    "        }\n" +
-                    "    }\n" +
-                    "}\n",
-                    "true",
-                    "false");
-    }
-
-    public void testAnonymous() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        final String model = \"\";\n" +
-                    "        java.util.Collections.sort(java.util.Collections.emptyList(), new java.util.Comparator<Object>() {\n" +
-                    "            public int compare(Object o1, Object o2) {\n" +
-                    "                return 0;\n" +
-                    "            }\n" +
-                    "        });\n" +
-                    "        System.err.println(mod`el);\n" +
-                    "    }\n" +
-                    "}\n",
-                    "\"\"");
-    }
-
-    public void test198975() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        int ii = 1;\n" +
-                    "        ii + +=;\n" +
-                    "        System.err.println(i`i);\n" +
-                    "    }\n" +
-                    "}\n",
-                    true,
-                    "1");
-    }
-
-    public void test199335() throws Exception {
-        performTest("package test;\n" +
-                    "public class Test {\n" +
-                    "    static void t() {\n" +
-                    "        List<Object> ll = null;\n" +
-                    "        for (Object str : ll) {\n" +
-                    "            if (str instanceof String) {\n" +
-                    "                System.err.println(st`r);\n" +
-                    "            }\n" +
-                    "        }\n" +
-                    "    }\n" +
-                    "}\n",
-                    true,
-                    "<null>");
-    }
-
-    private void prepareTest(String code, boolean allowErrors) throws Exception {
-        clearWorkDir();
-
-        FileObject workFO = FileUtil.toFileObject(getWorkDir());
-
-        assertNotNull(workFO);
-
-        FileObject sourceRoot = workFO.createFolder("src");
-        FileObject buildRoot  = workFO.createFolder("build");
-        FileObject cache = workFO.createFolder("cache");
-
-        FileObject data = FileUtil.createData(sourceRoot, "test/Test.java");
-
-        org.netbeans.api.java.source.TestUtilities.copyStringToFile(FileUtil.toFile(data), code);
-
-        data.refresh();
-
-        SourceUtilsTestUtil.prepareTest(sourceRoot, buildRoot, cache);
-
-        DataObject od = DataObject.find(data);
-        EditorCookie ec = od.getCookie(EditorCookie.class);
-
-        assertNotNull(ec);
-
-        doc = ec.openDocument();
-
-        doc.putProperty(Language.class, JavaTokenId.language());
-        doc.putProperty("mimeType", "text/x-java");
-
-        JavaSource js = JavaSource.forFileObject(data);
-
-        assertNotNull(js);
-
-        info = SourceUtilsTestUtil.getCompilationInfo(js, Phase.RESOLVED);
-
-        assertNotNull(info);
-
-        if (!allowErrors) {
-            assertTrue(info.getDiagnostics().toString(), info.getDiagnostics().isEmpty());
-        }
-    }
-
-    private CompilationInfo info;
-    private Document doc;
-
-    private void performTest(String code, String... assignments) throws Exception {
-        performTest(code, false, assignments);
-    }
-
-    private void performTest(String code, boolean allowErrors, String... assignments) throws Exception {
-        int[] span = new int[1];
-
-        code = TestUtilities.detectOffsets(code, span, "`");
-
-        prepareTest(code, allowErrors);
-
-        FlowResult flow = Flow.assignmentsForUse(info, new AtomicBoolean());
-        TreePath sel = info.getTreeUtilities().pathFor(span[0]);
-
-        Set<String> actual = new HashSet<String>();
-
-        for (TreePath tp : flow.getAssignmentsForUse().get(sel.getLeaf())) {
-            if (tp == null) {
-                actual.add("<null>");
-            } else {
-                actual.add(tp.getLeaf().toString());
-            }
-        }
-
-        assertEquals(new HashSet<String>(Arrays.asList(assignments)), actual);
-    }
-
-    private void performDeadBranchTest(String code) throws Exception {
-        List<String> splitted = new LinkedList<String>(Arrays.asList(code.split(Pattern.quote("|"))));
-        List<Integer> goldenSpans = new ArrayList<Integer>(splitted.size() - 1);
-        StringBuilder realCode = new StringBuilder();
-
-        realCode.append(splitted.remove(0));
-
-        for (String s : splitted) {
-            goldenSpans.add(realCode.length());
-            realCode.append(s);
-        }
-
-        prepareTest(realCode.toString(), false);
-
-        FlowResult flow = Flow.assignmentsForUse(info, new AtomicBoolean());
-
-        List<Integer> actual = new ArrayList<Integer>(2 * flow.getDeadBranches().size());
-
-        for (Tree dead : flow.getDeadBranches()) {
-            actual.add((int) info.getTrees().getSourcePositions().getStartPosition(info.getCompilationUnit(), dead));
-            actual.add((int) info.getTrees().getSourcePositions().getEndPosition(info.getCompilationUnit(), dead));
-        }
-
-        assertEquals(goldenSpans, actual);
-    }
-
-}
Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/RewriteMultipleExpressionsTest.java
===================================================================
--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/RewriteMultipleExpressionsTest.java	2011-08-05 18:27:33.390824824 +0100
+++ /dev/null	1970-01-01 00:00:00.000000000 +0000
@@ -1,141 +0,0 @@
-/*
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
- *
- * Copyright 2011 Oracle and/or its affiliates. All rights reserved.
- *
- * Oracle and Java are registered trademarks of Oracle and/or its affiliates.
- * Other names may be trademarks of their respective owners.
- *
- * The contents of this file are subject to the terms of either the GNU
- * General Public License Version 2 only ("GPL") or the Common
- * Development and Distribution License("CDDL") (collectively, the
- * "License"). You may not use this file except in compliance with the
- * License. You can obtain a copy of the License at
- * http://www.netbeans.org/cddl-gplv2.html
- * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
- * specific language governing permissions and limitations under the
- * License.  When distributing the software, include this License Header
- * Notice in each file and include the License file at
- * nbbuild/licenses/CDDL-GPL-2-CP.  Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the GPL Version 2 section of the License file that
- * accompanied this code. If applicable, add the following below the
- * License Header, with the fields enclosed by brackets [] replaced by
- * your own identifying information:
- * "Portions Copyrighted [year] [name of copyright owner]"
- *
- * If you wish your version of this file to be governed by only the CDDL
- * or only the GPL Version 2, indicate your decision by adding
- * "[Contributor] elects to include this software in this distribution
- * under the [CDDL or GPL Version 2] license." If you do not indicate a
- * single choice of license, a recipient has the option to distribute
- * your version of this file under either the CDDL, the GPL Version 2 or
- * to extend the choice of license to its licensees as provided above.
- * However, if you add GPL Version 2 code and therefore, elected the GPL
- * Version 2 license, then the option applies only if the new code is
- * made subject to such option by the copyright holder.
- *
- * Contributor(s):
- *
- * Portions Copyrighted 2011 Sun Microsystems, Inc.
- */
-package org.netbeans.api.java.source.gen;
-
-import com.sun.source.tree.BlockTree;
-import com.sun.source.tree.ClassTree;
-import com.sun.source.tree.CompilationUnitTree;
-import com.sun.source.tree.MethodTree;
-import com.sun.source.tree.StatementTree;
-import com.sun.source.tree.Tree;
-import java.io.File;
-import java.util.LinkedList;
-import java.util.List;
-import org.junit.Test;
-import org.netbeans.api.java.source.JavaSource;
-import org.netbeans.api.java.source.Task;
-import org.netbeans.api.java.source.TestUtilities;
-import org.netbeans.api.java.source.TreeMaker;
-import org.netbeans.api.java.source.WorkingCopy;
-
-/**
- *
- * @author Ralph Ruijs
- */
-public class RewriteMultipleExpressionsTest extends GeneratorTestBase {
-    
-    
-    public RewriteMultipleExpressionsTest(String aName) {
-        super(aName);
-    }
-    
-    @Test
-    public void testRewriteMultipleExpressions() throws Exception {
-        File testFile = new File(getWorkDir(), "Test.java");
-        TestUtilities.copyStringToFile(testFile,
-                "\n" +
-                        "public class MultipleExpressionsTest {\n" +
-                        "    public void testMethod() {\n" +
-                        "        printGreeting();\n" +
-                        "        printGreeting();\n" +
-                        "        printGreeting();\n" +
-                        "    }\n" +
-                        "    public void printGreeting() {\n" +
-                        "        System.out.println(\"Hello World!\");\n" +
-                        "    }\n" +
-                        "}\n");
-        String golden = "\n" +
-                "public class MultipleExpressionsTest {\n" +
-                "    public void testMethod() {\n" +
-                "        System.out.println(\"Hello World!\");\n" +
-                "        System.out.println(\"Hello World!\");\n" +
-                "        System.out.println(\"Hello World!\");\n" +
-                "    }\n" +
-                "    public void printGreeting() {\n" +
-                "        System.out.println(\"Hello World!\");\n" +
-                "    }\n" +
-                "}\n";
-
-        JavaSource src = getJavaSource(testFile);
-        Task<WorkingCopy> task = new Task<WorkingCopy>() {
-
-            public void run(WorkingCopy workingCopy) throws Exception {
-                workingCopy.toPhase(JavaSource.Phase.RESOLVED);
-                CompilationUnitTree cut = workingCopy.getCompilationUnit();
-                TreeMaker make = workingCopy.getTreeMaker();
-                
-                List<? extends Tree> classes = cut.getTypeDecls();
-                ClassTree clazz = (ClassTree) classes.get(0);
-                List<? extends Tree> trees = clazz.getMembers();
-                
-                MethodTree testMethod = (MethodTree) trees.get(1);
-                BlockTree body = testMethod.getBody();
-                
-                MethodTree printMethod = (MethodTree) trees.get(2);
-                BlockTree printBody = printMethod.getBody();
-                
-                List<StatementTree> statements = new LinkedList<StatementTree>();
-                statements.add(printBody.getStatements().get(0));
-                statements.add(printBody.getStatements().get(0));
-                statements.add(printBody.getStatements().get(0));
-                
-                BlockTree modified = make.Block(statements, false);
-                
-                workingCopy.rewrite(body, modified);
-            }
-
-        };
-
-        src.runModificationTask(task).commit();
-        String res = TestUtilities.copyFileToString(testFile);
-        System.out.println(res);
-        assertEquals(golden, res);
-    }
-    
-    String getGoldenPckg() {
-        return "";
-    }
-
-    String getSourcePckg() {
-        return "";
-    }
-}
