[SCM] netbeans packaging branch, master, updated. upstream/7.0.1+dfsg1-9-gbac77a1

Andrew Ross rockclimb-guest at alioth.debian.org
Wed Aug 10 18:35:54 UTC 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "netbeans packaging".

The branch, master has been updated
       via  bac77a1f3cc4e6a69f004ad65591a1b0db32cdb8 (commit)
      from  45dbfd6fcd09930faa713f443db12c9ed16429ee (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit bac77a1f3cc4e6a69f004ad65591a1b0db32cdb8
Author: Andrew Ross <ubuntu at rossfamily.co.uk>
Date:   Wed Aug 10 19:35:08 2011 +0100

    Updated to packaging for 7.0.1.

-----------------------------------------------------------------------

Summary of changes:
 debian/changelog                                   |   19 +
 debian/control                                     |  135 +-
 debian/copyright                                   | 1772 ++++--
 debian/libnb-platform-devel-java.lintian-overrides |   12 +
 debian/libnb-platform13-java.lintian-overrides     |   12 +
 debian/linked-jars                                 |   47 +
 debian/netbeans.desktop                            |    4 +-
 debian/orig-tar.sh                                 |  143 +
 debian/patches/netbeans-6.9~00-updatecenters.patch |   44 -
 ...netbeans-6.9~10-o.apache.tools.ant.module.patch |   30 -
 debian/patches/netbeans-6.9~30-build-xml.patch     |   18 -
 debian/patches/netbeans-6.9~40-ide-launcher.patch  |   51 -
 .../patches/netbeans-6.9~41-log4j-classpath.patch  |   10 -
 debian/patches/netbeans-6.9~50-build-copy.patch    |  264 -
 debian/patches/netbeans-6.9~60-nosvnkit.patch      |   33 -
 .../netbeans-6.9~70-small-ide-cluster.patch        |  165 -
 .../netbeans-6.9~71-cluster-properties.patch       |  264 -
 debian/patches/netbeans-6.9~80-config.patch        |   11 -
 .../patches/netbeans-6.9~90-junit-migration.patch  |  190 -
 .../netbeans-6.9~autogenerated-changes.patch       |  236 -
 .../netbeans-6.9~ini4j-0.5.2-SNAPSHOT.patch        |   81 -
 .../netbeans-6.9~original-svnclientadapter.patch   |  116 -
 debian/patches/netbeans-6.9~servlet-api-2.5.patch  |   18 -
 .../patches/netbeans-platform~include-extras.patch |   53 +
 debian/patches/netbeans-platform~launcher.patch    |   24 +
 debian/patches/netbeans-platform~nbi.patch         |   15 +
 .../patches/netbeans-platform~nojnabinaries.patch  |   21 +
 debian/patches/netbeans-platform~properties.patch  |   14 +
 .../netbeans-platform~windowslauncher.patch        |  168 +
 debian/patches/netbeans~build.patch                |   24 +
 debian/patches/netbeans~cluster-properties.patch   |  250 +
 debian/patches/netbeans~empty-binaries-list.patch  |  728 +++
 debian/patches/netbeans~ide-launcher.patch         |   69 +
 debian/patches/netbeans~no-rhino.patch             |   34 +
 debian/patches/netbeans~no-test-clean.patch        |   18 +
 debian/patches/netbeans~nocopy.patch               |   56 +
 debian/patches/netbeans~o.a.tools.ant.patch        |   36 +
 debian/patches/netbeans~old-java-modules.patch     | 6874 ++++++++++++++++++++
 .../patches/netbeans~old-java.source-module.patch  | 4783 ++++++++++++++
 debian/patches/netbeans~small-ide.patch            |  179 +
 debian/patches/netbeans~svnclient.patch            |   87 +
 debian/patches/netbeans~updatecenters.patch        |   33 +
 debian/patches/series                              |   34 +-
 debian/pom/openide-modules.xml                     |   21 +
 debian/pom/openide-util-lookup.xml                 |    9 +
 debian/pom/openide-util.xml                        |   16 +
 debian/rules                                       |  284 +-
 debian/watch                                       |    3 +-
 48 files changed, 15424 insertions(+), 2084 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1d5807e..2f4bc6a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+netbeans (7.0.1+dfsg1-1) unstable; urgency=low
+
+  * New upstream release
+  * Build NetBeans platform from this source too. (Closes: #610927)
+  * Bump to Standards-Version 3.9.2.
+  * Added myself to Uploaders.
+  * Build Windows launcher using mingw.
+  * Move utilility libraries to their own packages. (Closes: #490433)
+  * Also close some bugs which were fixed in the 6.9 series which never
+    entered the Debian archives:
+    - Use packaged swinglayout.jar. (Closes: #448922)
+    - Depend on generic Java. (Closes: #499417)
+    - Package for Debian Main. (Closes: #531952)
+  * Update Copyright file to cover all files correctly.
+  * TODO - copyright
+  * TODO - lintian overrides
+
+ -- Andrew Ross <ubuntu at rossfamily.co.uk>  Tue, 02 Aug 2011 23:58:58 +0100
+
 netbeans (6.9-1) unstable; urgency=low
 
   * New upstream version based off of Ubuntu packages.
diff --git a/debian/control b/debian/control
index 7b05e90..ed0afe5 100644
--- a/debian/control
+++ b/debian/control
@@ -1,28 +1,107 @@
 Source: netbeans
-Section: contrib/java
+Section: java
 Priority: optional
 Maintainer: Debian Java Maintainers <pkg-java-maintainers at lists.alioth.debian.org>
 Uploaders: Yulia Novozhilova <Yulia.Novozhilova at sun.com>,
- Andres Mejia <mcitadel at gmail.com>
+ Andres Mejia <mcitadel at gmail.com>, Andrew Ross <ubuntu at rossfamily.co.uk>
 Build-Depends: debhelper (>= 7.0.50~), javahelper, ant (>= 1.7.0),
- ant-optional (>= 1.7.0), default-jdk, javahelp2,
- libswing-layout-java (>= 1.0.3), libnb-platform12-java (>= 6.9),
- libnb-platform-devel-java (>= 6.9), libnb-javaparser-java (>= 6.9),
- libsvnclientadapter-java, libfreemarker-java, libjsch-java (>= 0.1.42),
- libxml-commons-resolver1.1-java (>= 1.2-3), libxerces2-java,
- liblucene2-java (>= 2.4.1), libbetter-appframework-java, libbeansbinding-java,
- junit4, libcommons-logging-java, libini4j-java (>=0.4.1), libsvn-java,
- liboro-java, libcommons-net-java, jruby (>=1.5.1), libswingx-java (>=0.9.5),
- libjzlib-java (>= 1.0.7), libservlet2.5-java, w3c-dtd-xhtml, libjvyamlb-java
-Standards-Version: 3.9.1
+ ant-optional (>= 1.7.0), default-jdk, mingw32, maven-repo-helper,
+ w3c-dtd-xhtml,
+ libjemmy2-java, javahelp2, libbindex-java,
+ libswing-layout-java (>= 1.0.3), libjna-java (>= 3.2.7-2~),
+ libfelix-framework-java, libfelix-main-java, libequinox-osgi-java,
+ antlr3 (>= 3.2), libstringtemplate-java, junit4 (>= 4.6), libhamcrest-java,
+ libcommons-codec-java, libbytelist-java, libcommons-logging-java,
+ libcommons-net-java, libflute-1.3-jfree-java, libfreemarker-java,
+ libini4j-java (>=0.5), liboro-java, libjsch-java (>= 0.1.42),
+ libjvyamlb-java (>= 0.2.5-2~), libjzlib-java (>= 1.0.7), 
+ liblucene2-java (>= 2.4.1), libxml-commons-resolver1.1-java (>= 1.2-3),
+ libsac-java, libservlet2.5-java, libsvnclientadapter-java, libsvn-java,
+ libsvnkit-java, libswingx-java (>=0.9.5), libtrilead-ssh2-java,
+ libsimple-validation-java, libxerces2-java,
+ libbetter-appframework-java,  libbeansbinding-java, libcglib-java,
+ libnb-javaparser-java (>= 7.0~)
+Standards-Version: 3.9.2
 Homepage: http://netbeans.org/
 Vcs-Browser: http://git.debian.org/?p=pkg-java/netbeans.git
 Vcs-Git: git://git.debian.org/git/pkg-java/netbeans.git
 
+Package: libnb-platform13-java
+Architecture: all
+Depends: ${misc:Depends}, ${java:Depends}, javahelp2,
+ libswing-layout-java (>= 1.0.3), libjna-java(>= 3.2.7-2~), junit4 (>= 4.6),
+ libfelix-framework-java, libfelix-main-java, libequinox-osgi-java,
+ libnb-org-openide-util-java, libnb-org-openide-util-lookup-java, 
+ libnb-org-openide-modules-java
+Suggests: libnb-platform13-java-doc
+Description: NetBeans Platform for building rich desktop applications in Java
+ The NetBeans Platform is a framework for building rich desktop applications
+ in Java. It provides the code that is required to connect actions to menu 
+ items, toolbar items, keyboard shortcuts and more. It is the core of the 
+ NetBeans IDE.
+ .
+ This package provides the platform itself.
+
+Package: libnb-platform-devel-java
+Architecture: all
+Depends: ${misc:Depends}, ${java:Depends}, libnb-platform13-java,
+ libjemmy2-java, javahelp2, libbindex-java,
+Replaces: libnb-platform8-devel-java, libnb-platform7-devel-java
+Conflicts: libnb-platform8-devel-java, libnb-platform7-devel-java
+Description: Build harness for NetBeans Platform
+ The NetBeans Platform is a framework for building rich desktop applications
+ in Java. It provides the code that is required to connect actions to menu 
+ items, toolbar items, keyboard shortcuts and more. It is the core of the 
+ NetBeans IDE.
+ .
+ This package contains the NetBeans Platform Harness containing the build 
+ scripts and ant tasks required to build an application on top of NetBeans 
+ Platform.
+
+Package: libnb-platform13-java-doc
+Architecture: all
+Section: doc
+Depends: ${misc:Depends}
+Recommends: ${java:Recommends}
+Suggests: libnb-platform13-java
+Enhances: libnb-platform13-java
+Description: NetBeans Platform javadoc 
+ NetBeans Platform is a set of modules, each providing their own APIs
+ and working together or in a standalone mode. This package provides
+ one master javadoc to all of them.
+
+Package: libnb-org-openide-util-java
+Architecture: all
+Depends: ${misc:Depends}, ${java:Depends}, libnb-org-openide-util-lookup-java
+Replaces: libopenide-util-java
+Conflicts: libopenide-util-java
+Description: Utility classes from the NetBeans Platform
+ The NetBeans Platform is a set of modules, each providing their own 
+ APIs and working together or in a standalone mode. This package provides
+ some utility functions used by the modules that make up the platform.
+
+Package: libnb-org-openide-util-lookup-java
+Architecture: all
+Depends: ${misc:Depends}, ${java:Depends}
+Description: Utility lookup classes from the NetBeans Platform
+ The NetBeans Platform is a set of modules, each providing their own 
+ APIs and working together or in a standalone mode. This package provides
+ some utility functions for lookups and is used by the modules that make 
+ up the platform.
+
+Package: libnb-org-openide-modules-java
+Architecture: all
+Depends: ${misc:Depends}, ${java:Depends}, libnb-org-openide-util-java,
+ libnb-org-openide-util-lookup-java
+Description: Utility classes for modules from the NetBeans Platform
+ The NetBeans Platform is a set of modules, each providing their own 
+ APIs and working together or in a standalone mode. This package provides
+ some utility functions for managing NetBeans modules.
+
 Package: netbeans
 Architecture: all
-Depends: ${java:Depends}, ${misc:Depends}, libnb-platform12-java (>= 6.9),
- libnb-ide13-java (= ${binary:Version}),
+Depends: ${java:Depends}, ${misc:Depends}, libnb-platform13-java (>= 7.0),
+ libnb-ide13-java (= ${binary:Version}), 
  libnb-java4-java (= ${binary:Version}),
  libnb-apisupport2-java (= ${binary:Version})
 Conflicts: netbeans5.5, netbeans-ide
@@ -35,30 +114,32 @@ Description: Extensible Java IDE
 
 Package: libnb-ide13-java
 Architecture: all
-Depends: ${java:Depends}, ${misc:Depends}, libnb-platform12-java (>= 6.9),
- libfreemarker-java, libjsch-java (>=0.1.42),
- libxml-commons-resolver1.1-java (>= 1.2-3), libsvnclientadapter-java,
- libxerces2-java, libcommons-logging-java, libini4j-java (>=0.4.1),
- liblucene2-java (>=2.3.2), libsvn-java, liboro-java, libcommons-net-java,
- jruby (>=1.5.1), libswingx-java (>=0.9.5), libjzlib-java (>= 1.0.7),
- libservlet2.5-java, liblog4j1.2-java
+Depends: ${java:Depends}, ${misc:Depends}, libnb-platform13-java (>= 7.0),
+ antlr3 (>= 3.2), libcommons-codec-java, libbytelist-java,
+ libcommons-logging-java, libcommons-net-java, libflute-1.3-jfree-java,
+ libfreemarker-java, libini4j-java (>= 0.5), liboro-java,
+ libjsch-java (>= 0.1.42), libjvyamlb-java (>= 0.2.5-2~),
+ libjzlib-java (>= 1.0.7), liblucene2-java (>= 2.4.1),
+ libxml-commons-resolver1.1-java (>= 1.2-3), libsac-java,
+ libservlet2.5-java, libsvnclientadapter-java, libsvn-java,
+ libsvnkit-java, libswingx-java (>=0.9.5), libtrilead-ssh2-java,
+ libsimple-validation-java, libxerces2-java
 Description: Common Integrated Development Environment Libraries for NetBeans
  Common languages independent libraries for use in the NetBeans IDE.
 
 Package: libnb-java4-java
 Architecture: all
 Depends: ${java:Depends}, ${misc:Depends}, default-jdk,
- libnb-platform12-java (>= 6.9), libnb-ide13-java (= ${binary:Version}),
- libnb-javaparser-java (>= 6.9), libbetter-appframework-java,
- ant (>= 1.7.0), ant-optional (>= 1.7.0), libbeansbinding-java, junit4,
- default-jdk-doc
+ libnb-platform13-java (>= 7.0), libnb-ide13-java (= ${binary:Version}),
+ libbetter-appframework-java,  libbeansbinding-java, libcglib-java,
+ libnb-javaparser-java (>= 7.0~), ant (>= 1.7.0), ant-optional (>= 1.7.0)
 Description: Common Java Related Libraries for NetBeans
  Common libraries for the NetBeans Java IDE.
 
 Package: libnb-apisupport2-java
 Architecture: all
-Depends: ${java:Depends}, ${misc:Depends}, libnb-platform12-java (>= 6.9),
- libnb-platform-devel-java (>= 6.9), libnb-ide13-java (= ${binary:Version}),
+Depends: ${java:Depends}, ${misc:Depends}, libnb-platform13-java (>= 7.0),
+ libnb-platform-devel-java (>= 7.0), libnb-ide13-java (= ${binary:Version}),
  libnb-java4-java (= ${binary:Version})
 Description: Common NetBeans Platform Development Related Libraries for NetBeans
  Common libraries for development of NetBeans Platform modular extensions.
diff --git a/debian/copyright b/debian/copyright
index 3689bad..d0dfeb1 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -1,6 +1,6 @@
 Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=59
-Name: libnb-platform-java
-Source: http://netbeans.org/projects/installer/downloads/directory/netbeans-6.9
+Name: netbeans
+Source: http://dlc.sun.com.edgesuite.net/netbeans/
 
 Files: *
 Copyright: Copyright 1997-2010 Oracle and/or its affiliates. 
@@ -40,12 +40,13 @@ Copyright: 2008-2010, Yulia Novozhilova <Yulia.Novozhilova at sun.com>
 License: GPL-2
 
 Files: ./options.keymap/build.xml,
-./openide.awt/test/unit/src/org/openide/awt/ActionsTest.java,
-./o.n.bootstrap/test/unit/src/org/netbeans/ModuleMixedOnClasspathTest.java,
-./o.n.bootstrap/test/unit/src/org/netbeans/ModuleFactoryTest.java,
-./o.n.bootstrap/src/org/netbeans/ModuleFactory.java,
-./apisupport.harness/jnlp-src/org/netbeans/modules/apisupport/jnlplauncher/RuntimePolicy.java,
-./apisupport.harness/test/unit/src/org/netbeans/modules/apisupport/jnlplauncher/FixPolicyTest.java
+ ./openide.awt/test/unit/src/org/openide/awt/ActionsTest.java,
+ ./o.n.bootstrap/test/unit/src/org/netbeans/ModuleMixedOnClasspathTest.java,
+ ./o.n.bootstrap/test/unit/src/org/netbeans/ModuleFactoryTest.java,
+ ./o.n.bootstrap/test/unit/src/org/netbeans/ModuleFactoryAlienTest.java,
+ ./o.n.bootstrap/src/org/netbeans/ModuleFactory.java,
+ ./apisupport.harness/jnlp-src/org/netbeans/modules/apisupport/jnlplauncher/RuntimePolicy.java,
+ ./apisupport.harness/test/unit/src/org/netbeans/modules/apisupport/jnlplauncher/FixPolicyTest.java
 Copyright: Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
            Portions Copyrihgt 2005-2006 Nokia
 License: CDDL-1 or GPL-2 with CLASSPATH exception
@@ -61,384 +62,1397 @@ Files: ./jemmy/*
 Copyright: Copyright 1997-2008 Sun Microsystems, Inc.    
 License: CDDL-1 or GPL-2 with CLASSPATH exception
 
-
-License: GPL-2
-     On Debian systems the full text of the GNU General Public 
-     License can be found in the `/usr/share/common-licenses/GPL-2'
-     file.
-
+Files: ./spi.quicksearch/arch.xml,
+ ./o.n.swing.outline/arch.xml,
+ ./core.startup/src/org/netbeans/core/startup/instance-mime-resolver.xml,
+ ./core.startup/arch.xml,
+ ./nbjunit/test/unit/src/org/netbeans/junit/TestBundle.properties,
+ ./core.ui/arch.xml,
+ ./libs.nbi.ant/stub/build.properties,
+ ./api.annotations.common/arch.xml,
+ ./spi.actions/arch.xml,
+ ./nbi/engine/nbproject/genfiles.properties,
+ ./sendopts/test/unit/src/org/netbeans/api/sendopts/StreamingTest.java,
+Copyright: Copyright 1997-2009 Sun Microsystems, Inc.    
 License: CDDL-1
-COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
- Version 1.0
-
-1. Definitions.
-
-1.1. "Contributor" means each individual or entity that
-creates or contributes to the creation of Modifications.
-
-1.2. "Contributor Version" means the combination of the
-Original Software, prior Modifications used by a Contributor
-(if any), and the Modifications made by that particular
-Contributor.
-
-1.3. "Covered Software" means (a) the Original Software, or
-(b) Modifications, or (c) the combination of files
-containing Original Software with files containing
-Modifications, in each case including portions thereof.
-
-1.4. "Executable" means the Covered Software in any form
-other than Source Code. 
-
-1.5. "Initial Developer" means the individual or entity that
-first makes Original Software available under this License. 
-
-1.6. "Larger Work" means a work which combines Covered
-Software or portions thereof with code not governed by the
-terms of this License.
-
-1.7. "License" means this document.
-
-1.8. "Licensable" means having the right to grant, to the
-maximum extent possible, whether at the time of the initial
-grant or subsequently acquired, any and all of the rights
-conveyed herein.
-
-1.9. "Modifications" means the Source Code and Executable
-form of any of the following:
- 
-A. Any file that results from an addition to, deletion from
-or modification of the contents of a file containing
-Original Software or previous Modifications; 
-
-B. Any new file that contains any part of the Original
-Software or previous Modification; or 
-
-C. Any new file that is contributed or otherwise made
-available under the terms of this License.
-
-1.10. "Original Software" means the Source Code and
-Executable form of computer software code that is originally
-released under this License. 
-
-1.11. "Patent Claims" means any patent claim(s), now owned
-or hereafter acquired, including without limitation, method,
-process, and apparatus claims, in any patent Licensable by
-grantor. 
-
-1.12. "Source Code" means (a) the common form of computer
-software code in which modifications are made and (b)
-associated documentation included in or with such code.
-
-1.13. "You" (or "Your") means an individual or a legal
-entity exercising rights under, and complying with all of
-the terms of, this License. For legal entities, "You"
-includes any entity which controls, is controlled by, or is
-under common control with You. For purposes of this
-definition, "control" means (a) the power, direct or
-indirect, to cause the direction or management of such
-entity, whether by contract or otherwise, or (b) ownership
-of more than fifty percent (50%) of the outstanding shares
-or beneficial ownership of such entity.
-
-2. License Grants. 
-
-2.1. The Initial Developer Grant. Conditioned upon Your
-compliance with Section 3.1 below and subject to third party
-intellectual property claims, the Initial Developer hereby
-grants You a world-wide, royalty-free, non-exclusive
-license: 
-
-(a) under intellectual property rights (other than patent or
-trademark) Licensable by Initial Developer, to use,
-reproduce, modify, display, perform, sublicense and
-distribute the Original Software (or portions thereof), with
-or without Modifications, and/or as part of a Larger Work;
-and 
-
-(b) under Patent Claims infringed by the making, using or
-selling of Original Software, to make, have made, use,
-practice, sell, and offer for sale, and/or otherwise dispose
-of the Original Software (or portions thereof). 
-
-(c) The licenses granted in Sections 2.1(a) and (b) are
-effective on the date Initial Developer first distributes or
-otherwise makes the Original Software available to a third
-party under the terms of this License. 
-
-(d) Notwithstanding Section 2.1(b) above, no patent license
-is granted: (1) for code that You delete from the Original
-Software, or (2) for infringements caused by: (i) the
-modification of the Original Software, or (ii) the
-combination of the Original Software with other software or
-devices. 
-
-2.2. Contributor Grant. Conditioned upon Your compliance
-with Section 3.1 below and subject to third party
-intellectual property claims, each Contributor hereby grants
-You a world-wide, royalty-free, non-exclusive license:
-
-(a) under intellectual property rights (other than patent or
-trademark) Licensable by Contributor to use, reproduce,
-modify, display, perform, sublicense and distribute the
-Modifications created by such Contributor (or portions
-thereof), either on an unmodified basis, with other
-Modifications, as Covered Software and/or as part of a
-Larger Work; and
-
-(b) under Patent Claims infringed by the making, using, or
-selling of Modifications made by that Contributor either
-alone and/or in combination with its Contributor Version (or
-portions of such combination), to make, use, sell, offer for
-sale, have made, and/or otherwise dispose of: (1)
-Modifications made by that Contributor (or portions
-thereof); and (2) the combination of Modifications made by
-that Contributor with its Contributor Version (or portions
-of such combination). 
-
-(c) The licenses granted in Sections 2.2(a) and 2.2(b) are
-effective on the date Contributor first distributes or
-otherwise makes the Modifications available to a third
-party. 
-
-(d) Notwithstanding Section 2.2(b) above, no patent license
-is granted: (1) for any code that Contributor has deleted
-from the Contributor Version; (2) for infringements caused
-by: (i) third party modifications of Contributor Version, or
-(ii) the combination of Modifications made by that
-Contributor with other software (except as part of the
-Contributor Version) or other devices; or (3) under Patent
-Claims infringed by Covered Software in the absence of
-Modifications made by that Contributor. 
-
-3. Distribution Obligations.
 
-3.1. Availability of Source Code.
-
-Any Covered Software that You distribute or otherwise make
-available in Executable form must also be made available in
-Source Code form and that Source Code form must be
-distributed only under the terms of this License. You must
-include a copy of this License with every copy of the Source
-Code form of the Covered Software You distribute or
-otherwise make available. You must inform recipients of any
-such Covered Software in Executable form as to how they can
-obtain such Covered Software in Source Code form in a
-reasonable manner on or through a medium customarily used
-for software exchange.
-
-3.2. Modifications.
-
-The Modifications that You create or to which You contribute
-are governed by the terms of this License. You represent
-that You believe Your Modifications are Your original
-creation(s) and/or You have sufficient rights to grant the
-rights conveyed by this License.
-
-3.3. Required Notices.
-
-You must include a notice in each of Your Modifications that
-identifies You as the Contributor of the Modification. You
-may not remove or alter any copyright, patent or trademark
-notices contained within the Covered Software, or any
-notices of licensing or any descriptive text giving
-attribution to any Contributor or the Initial Developer.
-
-3.4. Application of Additional Terms.
-
-You may not offer or impose any terms on any Covered
-Software in Source Code form that alters or restricts the
-applicable version of this License or the recipients' rights
-hereunder. You may choose to offer, and to charge a fee for,
-warranty, support, indemnity or liability obligations to one
-or more recipients of Covered Software. However, you may do
-so only on Your own behalf, and not on behalf of the Initial
-Developer or any Contributor. You must make it absolutely
-clear that any such warranty, support, indemnity or
-liability obligation is offered by You alone, and You hereby
-agree to indemnify the Initial Developer and every
-Contributor for any liability incurred by the Initial
-Developer or such Contributor as a result of warranty,
-support, indemnity or liability terms You offer.
-
-3.5. Distribution of Executable Versions.
-
-You may distribute the Executable form of the Covered
-Software under the terms of this License or under the terms
-of a license of Your choice, which may contain terms
-different from this License, provided that You are in
-compliance with the terms of this License and that the
-license for the Executable form does not attempt to limit or
-alter the recipient's rights in the Source Code form from
-the rights set forth in this License. If You distribute the
-Covered Software in Executable form under a different
-license, You must make it absolutely clear that any terms
-which differ from this License are offered by You alone, not
-by the Initial Developer or Contributor. You hereby agree to
-indemnify the Initial Developer and every Contributor for
-any liability incurred by the Initial Developer or such
-Contributor as a result of any such terms You offer.
-
-3.6. Larger Works.
-
-You may create a Larger Work by combining Covered Software
-with other code not governed by the terms of this License
-and distribute the Larger Work as a single product. In such
-a case, You must make sure the requirements of this License
-are fulfilled for the Covered Software. 
-
-4. Versions of the License. 
-
-4.1. New Versions.
-
-Oracle Corp. is the initial license steward and may publish
-revised and/or new versions of this License from time to
-time. Each version will be given a distinguishing version
-number. Except as provided in Section 4.3, no one other than
-the license steward has the right to modify this License. 
-
-4.2. Effect of New Versions.
-
-You may always continue to use, distribute or otherwise make
-the Covered Software available under the terms of the
-version of the License under which You originally received
-the Covered Software. If the Initial Developer includes a
-notice in the Original Software prohibiting it from being
-distributed or otherwise made available under any subsequent
-version of the License, You must distribute and make the
-Covered Software available under the terms of the version of
-the License under which You originally received the Covered
-Software. Otherwise, You may also choose to use, distribute
-or otherwise make the Covered Software available under the
-terms of any subsequent version of the License published by
-the license steward. 
-
-4.3. Modified Versions.
-
-When You are an Initial Developer and You want to create a
-new license for Your Original Software, You may create and
-use a modified version of this License if You: (a) rename
-the license and remove any references to the name of the
-license steward (except to note that the license differs
-from this License); and (b) otherwise make it clear that the
-license contains terms which differ from this License.
-
-5. DISCLAIMER OF WARRANTY.
-
-COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS
-IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
-IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE
-COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A
-PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO
-THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH
-YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY
-RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
-CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING,
-REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
-CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
-COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
-DISCLAIMER. 
-
-6. TERMINATION. 
-
-6.1. This License and the rights granted hereunder will
-terminate automatically if You fail to comply with terms
-herein and fail to cure such breach within 30 days of
-becoming aware of the breach. Provisions which, by their
-nature, must remain in effect beyond the termination of this
-License shall survive.
-
-6.2. If You assert a patent infringement claim (excluding
-declaratory judgment actions) against Initial Developer or a
-Contributor (the Initial Developer or Contributor against
-whom You assert such claim is referred to as "Participant")
-alleging that the Participant Software (meaning the
-Contributor Version where the Participant is a Contributor
-or the Original Software where the Participant is the
-Initial Developer) directly or indirectly infringes any
-patent, then any and all rights granted directly or
-indirectly to You by such Participant, the Initial Developer
-(if the Initial Developer is not the Participant) and all
-Contributors under Sections 2.1 and/or 2.2 of this License
-shall, upon 60 days notice from Participant terminate
-prospectively and automatically at the expiration of such 60
-day notice period, unless if within such 60 day period You
-withdraw Your claim with respect to the Participant Software
-against such Participant either unilaterally or pursuant to
-a written agreement with Participant.
-
-6.3. In the event of termination under Sections 6.1 or 6.2
-above, all end user licenses that have been validly granted
-by You or any distributor hereunder prior to termination
-(excluding licenses granted to You by any distributor) shall
-survive termination.
+Files: ./nbjunit/test/unit/src/org/netbeans/junit/TestBundle.properties
+Copyright: Copyright (C) 2006 Jaroslav Tulach.
+License: CDDL-1
 
-7. LIMITATION OF LIABILITY.
+Files: ./openide.util/test/unit/src/org/openide/util/UtilitiesTranslate29878.txt,
+ ./nbbuild/test/unit/src/org/netbeans/nbbuild/testdist/TestDistFilterTest.java
+Copyright: Copyright 1997-2010 Oracle and/or its affiliates.
+ Portions Copyright 1997-2006 Sun Microsystems, Inc.
+License: CDDL-1
 
-UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER
-TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL
-YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY
-DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF
-SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT,
-SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
-CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST
-PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE
-OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR
-LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE
-POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY
-SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
-RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT
-APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
-DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
-CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY
-NOT APPLY TO YOU.
+Files: ./openide.loaders/test/unit/src/org/openide/loaders/DataShadowLookupTest.java,
+ ./nbbuild/test/unit/src/org/netbeans/nbbuild/CheckLicenseXmlExample.xml,
+ ./nbbuild/test/unit/src/org/netbeans/nbbuild/ShorterPathsTest.xml,
+ ./nbbuild/test/unit/src/org/netbeans/nbbuild/CheckLicenseHtmlExample.xml,
+ ./nbbuild/test/unit/src/org/netbeans/nbbuild/CheckLicensePropertiesExample.properties
+Copyright: Copyright 1997-2006 Sun Microsystems, Inc.
+License: SPL-1
+
+Files: ./o.n.core/external/nsProxyAutoConfig.js
+Copyright: Copyright (C) 1998 Netscape Communications Corporation.
+ Contributor(s):
+    Akhil Arora <akhil.arora at sun.com>
+    Tomi Leppikangas <Tomi.Leppikangas at oulu.fi>
+    Darin Fisher <darin at meer.net>
+License: MPL-1.1 or GPL-2 or LGPL-2.1
+ The contents of this file are subject to the Mozilla Public License Version
+ 1.1 (the "License"); you may not use this file except in compliance with
+ the License. You may obtain a copy of the License at
+ http://www.mozilla.org/MPL/
+ .
+ Software distributed under the License is distributed on an "AS IS" basis,
+ WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ for the specific language governing rights and limitations under the
+ License.
+ .
+ Alternatively, the contents of this file may be used under the terms of
+ either the GNU General Public License Version 2 or later (the "GPL"), or
+ the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+ in which case the provisions of the GPL or the LGPL are applicable instead
+ of those above. If you wish to allow use of your version of this file only
+ under the terms of either the GPL or the LGPL, and not to allow others to
+ use your version of this file under the terms of the MPL, indicate your
+ decision by deleting the provisions above and replace them with the notice
+ and other provisions required by the GPL or the LGPL. If you do not delete
+ the provisions above, a recipient may use your version of this file under
+ the terms of any one of the MPL, the GPL or the LGPL.
 
-8. U.S. GOVERNMENT END USERS.
 
-The Covered Software is a "commercial item," as that term is
-defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
-"commercial computer software" (as that term is defined at
-48 C.F.R. 252.227-7014(a)(1)) and "commercial computer
-software documentation" as such terms are used in 48 C.F.R.
-12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48
-C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
-Government End Users acquire Covered Software with only
-those rights set forth herein. This U.S. Government Rights
-clause is in lieu of, and supersedes, any other FAR, DFAR,
-or other clause or provision that addresses Government
-rights in computer software under this License.
 
-9. MISCELLANEOUS.
+License: GPL-2
+     On Debian systems the full text of the GNU General Public 
+     License can be found in the `/usr/share/common-licenses/GPL-2'
+     file.
 
-This License represents the complete agreement concerning
-subject matter hereof. If any provision of this License is
-held to be unenforceable, such provision shall be reformed
-only to the extent necessary to make it enforceable. This
-License shall be governed by the law of the jurisdiction
-specified in a notice contained within the Original Software
-(except to the extent applicable law, if any, provides
-otherwise), excluding such jurisdiction's conflict-of-law
-provisions. Any litigation relating to this License shall be
-subject to the jurisdiction of the courts located in the
-jurisdiction and venue specified in a notice contained
-within the Original Software, with the losing party
-responsible for costs, including, without limitation, court
-costs and reasonable attorneys' fees and expenses. The
-application of the United Nations Convention on Contracts
-for the International Sale of Goods is expressly excluded.
-Any law or regulation which provides that the language of a
-contract shall be construed against the drafter shall not
-apply to this License. You agree that You alone are
-responsible for compliance with the United States export
-administration regulations (and the export control laws and
-regulation of any other countries) when You use, distribute
-or otherwise make available any Covered Software.
+License LGPL-2.1
+     On Debian systems the full text of the GNU General Public 
+     License can be found in the `/usr/share/common-licenses/LGPL-2.1'
+     file.
 
-10. RESPONSIBILITY FOR CLAIMS.
+License: SPL-1
+ SUN PUBLIC LICENSE Version 1.0 
+ .
+ 1. Definitions. 
+ .
+	1.0.1. "Commercial Use" means distribution or otherwise making the 
+	Covered Code available to a third party. 
+ .
+	1.1. "Contributor" means each entity that creates or contributes to 
+	the creation of Modifications. 
+ .
+	1.2. "Contributor Version" means the combination of the Original Code, 
+	prior Modifications used by a Contributor, and the Modifications made 
+	by that particular Contributor. 
+ .
+	1.3. "Covered Code" means the Original Code or Modifications or the 
+	combination of the Original Code and Modifications, in each case 
+	including portions thereof and corresponding documentation released 
+	with the source code. 
+ .
+	1.4. "Electronic Distribution Mechanism" means a mechanism generally 
+	accepted in the software development community for the electronic 
+	transfer of data. 
+ .
+	1.5. "Executable" means Covered Code in any form other than Source 
+	Code. 
+ .
+	1.6. "Initial Developer" means the individual or entity identified as 
+	the Initial Developer in the Source Code notice required by Exhibit A. 
+ .
+	1.7. "Larger Work" means a work which combines Covered Code or 
+	portions thereof with code not governed by the terms of this License. 
+ .
+	1.8. "License" means this document. 
+ .
+	1.8.1. "Licensable" means having the right to grant, to the maximum 
+	extent possible, whether at the time of the initial grant or 
+	subsequently acquired, any and all of the rights conveyed herein. 
+ .
+	1.9. "Modifications" means any addition to or deletion from the 
+	substance or structure of either the Original Code or any previous 
+	Modifications. When Covered Code is released as a series of files, a 
+	Modification is: 
+ .
+	A. Any addition to or deletion from the contents of a file containing 
+	Original Code or previous Modifications. 
+ .
+	B. Any new file that contains any part of the Original Code or 
+	previous Modifications. 
+ .
+	1.10. "Original Code" means Source Code of computer software code 
+	which is described in the Source Code notice required by Exhibit A as 
+	Original Code, and which, at the time of its release under this 
+	License is not already Covered Code governed by this License. 
+ .
+	1.10.1. "Patent Claims" means any patent claim(s), now owned or 
+	hereafter acquired, including without limitation, method, process, and 
+	apparatus claims, in any patent Licensable by grantor. 
+ .
+	1.11. "Source Code" means the preferred form of the Covered Code for 
+	making modifications to it, including all modules it contains, plus 
+	any associated documentation, interface definition files, scripts used 
+	to control compilation and installation of an Executable, or source 
+	code differential comparisons against either the Original Code or 
+	another well known, available Covered Code of the Contributor's 
+	choice. The Source Code can be in a compressed or archival form, 
+	provided the appropriate decompression or de-archiving software is 
+	widely available for no charge. 
+ .
+	1.12. "You" (or "Your") means an individual or a legal entity 
+	exercising rights under, and complying with all of the terms of, this 
+	License or a future version of this License issued under Section 6.1. 
+	For legal entities, "You" includes any entity which controls, is 
+	controlled by, or is under common control with You. For purposes of 
+	this definition, "control" means (a) the power, direct or indirect, to 
+	cause the direction or management of such entity, whether by contract 
+	or otherwise, or (b) ownership of more than fifty percent (50%) of the 
+	outstanding shares or beneficial ownership of such entity.
+ .
+ 2. Source Code License. 
+ .
+ 2.1 The Initial Developer Grant. 
+ .
+	The Initial Developer hereby grants You a world-wide, royalty-free, 
+	non-exclusive license, subject to third party intellectual property 
+	claims: 
+ .
+	(a)  under intellectual property rights (other than patent or 
+	trademark) Licensable by Initial Developer to use, reproduce, modify, 
+	display, perform, sublicense and distribute the Original Code (or 
+	portions thereof) with or without Modifications, and/or as part of a 
+	Larger Work; and 
+ .
+	(b) under Patent Claims infringed by the making, using or selling of 
+	Original Code, to make, have made, use, practice, sell, and offer for 
+	sale, and/or otherwise dispose of the Original Code (or portions 
+	thereof). 
+ .
+	(c) the licenses granted in this Section 2.1(a) and (b) are effective 
+	on the date Initial Developer first distributes Original Code under 
+	the terms of this License. 
+ .
+	(d) Notwithstanding Section 2.1(b) above, no patent license is 
+	granted: 1) 	for code that You delete from the Original Code; 2) 
+	separate from the 	Original Code; or 3) for infringements caused by: 
+	i) the modification of the Original Code or ii) the combination of the 
+	Original Code with other software or devices. 
+ .
+ 2.2. Contributor Grant. 
+ .
+	Subject to third party intellectual property claims, each Contributor 
+	hereby grants You a world-wide, royalty-free, non-exclusive license 
+ .
+	(a) under intellectual property rights (other than patent or 
+	trademark) Licensable by Contributor, to use, reproduce,  modify, 
+	display, perform, sublicense and distribute the Modifications created 
+	by such Contributor (or portions thereof) either on an unmodified 
+	basis, with other Modifications, as Covered Code and/or as part of a 
+	Larger Work; and 
+ .
+	(b) under Patent Claims infringed by the making, using, or selling of  
+	Modifications made by that Contributor either alone and/or in 
+	combination with its Contributor Version (or portions of such 
+	combination), to make, use, sell, offer for sale, have made, and/or 
+	otherwise dispose of: 1) Modifications made by that Contributor (or 
+	portions thereof); and 2) the combination of Modifications made by 
+	that Contributor with its Contributor Version (or portions of such 
+	combination). 
+ .
+	(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective 
+	on the date Contributor first makes Commercial Use of the Covered 
+	Code. 
+ .
+	(d)  notwithstanding Section 2.2(b) above, no patent license is 
+	granted: 1) for any code that Contributor has deleted from the 
+	Contributor Version; 2)  separate from the Contributor Version; 3) for 
+	infringements caused by: i) third party modifications of Contributor 
+	Version or ii) the combination of Modifications made by that 
+	Contributor with other software (except as part of the Contributor 
+	Version) or other devices; or 4) under Patent Claims infringed by 
+	Covered Code in the absence of Modifications made by that Contributor.
+ .
+ 3. Distribution Obligations. 
+ .
+ 3.1. Application of License.
+ .
+	The Modifications which You create or to which You contribute are 
+	governed by the terms of this License, including without limitation 
+	Section 2.2. The Source Code version of Covered Code may be 
+	distributed only under the terms of this License or a future version 
+	of this License released under Section 6.1, and You must include a 
+	copy of this License with every copy of the Source Code You 
+	distribute. You may not offer or impose any terms on any Source Code 
+	version that alters or restricts the applicable version of this 
+	License or the recipients' rights hereunder. However, You may include 
+	an additional document offering the additional rights described in 
+	Section 3.5. 
+ .
+ 3.2. Availability of Source Code.
+ .
+	Any Modification which You create or to which You contribute must be 
+	made available in Source Code form under the terms of this License 
+	either on the same media as an Executable version or via an accepted 
+	Electronic Distribution Mechanism to anyone to whom you made an 
+	Executable version available; and if made available via Electronic 
+	Distribution Mechanism, must remain available for at least twelve (12) 
+	months after the date it initially became available, or at least six 
+	(6) months after a subsequent version of that particular Modification 
+	has been made available to such recipients. You are responsible for 
+	ensuring that the Source Code version remains available even if the 
+	Electronic Distribution Mechanism is maintained by a third party. 
+ .
+ 3.3. Description of Modifications.
+ .
+	You must cause all Covered Code to which You contribute to contain a 
+	file documenting the changes You made to create that Covered Code and 
+	the date of any change. You must include a prominent statement that 
+	the Modification is derived, directly or indirectly, from Original 
+	Code provided by the Initial Developer and including the name of the 
+	Initial Developer in (a) the Source Code, and (b) in any notice in an 
+	Executable version or related documentation in which You describe the 
+	origin or ownership of the Covered Code. 
+ .
+ 3.4. Intellectual Property Matters.
+ .
+	(a) Third Party Claims.
+ .
+	If Contributor has knowledge that a license under a third party's 
+	intellectual property rights is required to exercise the rights 
+	granted by such Contributor under Sections 2.1 or 2.2, Contributor 
+	must include a text file with the Source Code distribution titled 
+	"LEGAL'' which describes the claim and the party making the claim in 
+	sufficient detail that a recipient will know whom to contact. If 
+	Contributor obtains such knowledge after the Modification is made 
+	available as described in Section 3.2, Contributor shall promptly 
+	modify the LEGAL file in all copies Contributor makes available 
+	thereafter and shall take other steps (such as notifying appropriate 
+	mailing lists or newsgroups) reasonably calculated to inform those who 
+	received the Covered Code that new knowledge has been obtained. 
+ .
+	(b) Contributor APIs.
+ .
+	If Contributor's Modifications include an application programming 
+	interface ("API") and Contributor has knowledge of patent licenses 
+	which are reasonably necessary to implement that API, Contributor must 
+	also include this information in the LEGAL file. 
+ .
+	(c) Representations.
+ .
+	Contributor represents that, except as disclosed pursuant to Section 
+	3.4(a) above, Contributor believes that Contributor's Modifications 
+	are Contributor's original creation(s) and/or Contributor has 
+	sufficient rights to grant the rights conveyed by this License.
+ .
+ 3.5. Required Notices.
+ .
+	You must duplicate the notice in Exhibit A in each file of the Source 
+	Code. If it is not possible to put such notice in a particular Source 
+	Code file due to its structure, then You must include such notice in a 
+	location (such as a relevant directory) where a user would be likely 
+	to look for such a notice.  If You created one or more Modification(s) 
+	You may add your name as a Contributor to the notice described in 
+	Exhibit A. You must also duplicate this License in any documentation 
+	for the Source Code where You describe recipients' rights or ownership 
+	rights relating to Covered Code. You may choose to offer, and to 
+	charge a fee for, warranty, support, indemnity or liability 
+	obligations to one or more recipients of Covered Code. However, You 
+	may do so only on Your own behalf, and not on behalf of the Initial 
+	Developer or any Contributor. You must make it absolutely clear than 
+	any such warranty, support, indemnity or liability obligation is 
+	offered by You alone, and You hereby agree to indemnify the Initial 
+	Developer and every Contributor for any liability incurred by the 
+	Initial Developer or such Contributor as a result of warranty, 
+	support, indemnity or liability terms You offer. 
+ .
+ 3.6. Distribution of Executable Versions.
+ .
+	You may distribute Covered Code in Executable form only if the 
+	requirements of Section 3.1-3.5 have been met for that Covered Code, 
+	and if You include a notice stating that the Source Code version of 
+	the Covered Code is available under the terms of this License, 
+	including a description of how and where You have fulfilled the 
+	obligations of Section 3.2. The notice must be conspicuously included 
+	in any notice in an Executable version, related documentation or 
+	collateral in which You describe recipients' rights relating to the 
+	Covered Code. You may distribute the Executable version of Covered 
+	Code or ownership rights under a license of Your choice, which may 
+	contain terms different from this License, provided that You are in 
+	compliance with the terms of this License and that the license for the 
+	Executable version does not attempt to limit or alter the recipient's 
+	rights in the Source Code version from the rights set forth in this 
+	License. If You distribute the Executable version under a different 
+	license You must make it absolutely clear that any terms which differ 
+	from this License are offered by You alone, not by the Initial 
+	Developer or any Contributor. You hereby agree to indemnify the 
+	Initial Developer and every Contributor for any liability incurred by 
+	the Initial Developer or such Contributor as a result of any such 
+	terms You offer. 
+ .
+ 3.7. Larger Works.
+ .
+	You may create a Larger Work by combining Covered Code with other code 
+	not governed by the terms of this License and distribute the Larger 
+	Work as a single product. In such a case, You must make sure the 
+	requirements of this License are fulfilled for the Covered Code.
+ .
+ 4. Inability to Comply Due to Statute or Regulation. 
+ .
+	If it is impossible for You to comply with any of the terms of this 
+	License with respect to some or all of the Covered Code due to 
+	statute, judicial order, or regulation then You must: (a) comply with 
+	the terms of this License to the maximum extent possible; and (b) 
+	describe the limitations and the code they affect. Such description 
+	must be included in the LEGAL file described in Section 3.4 and must 
+	be included with all distributions of the Source Code. Except to the 
+	extent prohibited by statute or regulation, such description must be 
+	sufficiently detailed for a recipient of ordinary skill to be able to 
+	understand it.
+ .
+ 5. Application of this License. 
+ .
+	This License applies to code to which the Initial Developer has 
+	attached the notice in Exhibit A and to related Covered Code.
+ .
+ 6. Versions of the License. 
+ .
+ 6.1. New Versions.
+ .
+	Sun Microsystems, Inc. ("Sun") may publish revised and/or new versions 
+	of the License from time to time. Each version will be given a 
+	distinguishing version number. 
+ .
+ 6.2. Effect of New Versions.
+ .
+	Once Covered Code has been published under a particular version of the 
+	License, You may always continue to use it under the terms of that 
+	version. You may also choose to use such Covered Code under the terms 
+	of any subsequent version of the License published by Sun. No one 
+	other than Sun has the right to modify the terms applicable to Covered 
+	Code created under this License. 
+ .
+ 6.3. Derivative Works.
+ .
+	If You create or use a modified version of this License (which you may 
+	only do in order to apply it to code which is not already Covered Code 
+	governed by this License), You must: (a) rename Your license so that 
+	the phrases "Sun," "Sun Public License," or "SPL" or any confusingly 
+	similar phrase do not appear in your license (except to note that your 
+	license differs from this License) and (b) otherwise make it clear 
+	that Your version of the license contains terms which differ from the 
+	Sun Public License. (Filling in the name of the Initial Developer, 
+	Original Code or Contributor in the notice described in Exhibit A 
+	shall not of themselves be deemed to be modifications of this 
+	License.)
+ .
+ 7. DISCLAIMER OF WARRANTY. 
+ .
+	COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, 
+	WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, 
+	WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF 
+	DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. 
+	THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE 
+	IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, 
+	YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE 
+	COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER 
+	OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF 
+	ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+ .
+ 8. TERMINATION. 
+ .
+	8.1. This License and the rights granted hereunder will terminate 
+	automatically if You fail to comply with terms herein and fail to cure 
+	such breach within 30 days of becoming aware of the breach. All 
+	sublicenses to the Covered Code which are properly granted shall 
+	survive any termination of this License. Provisions which, by their 
+	nature, must remain in effect beyond the termination of this License 
+	shall survive. 
+ .
+	8.2. If You initiate litigation by asserting a patent infringement 
+	claim (excluding declaratory judgment actions) against Initial Developer 
+	or a Contributor (the Initial Developer or Contributor against whom 
+	You file such action is referred to as "Participant")  alleging that: 
+ .
+	(a) such Participant's Contributor Version directly or indirectly 
+	infringes any patent, then any and all rights granted by such 
+	Participant to You under Sections 2.1 and/or 2.2 of this License 
+	shall, upon 60 days notice from Participant terminate prospectively, 
+	unless if within 60 days after receipt of notice You either: (i)  
+	agree in writing to pay Participant a mutually agreeable reasonable 
+	royalty for Your past and future use of Modifications made by such 
+	Participant, or (ii) withdraw Your litigation claim with respect to 
+	the Contributor Version against such Participant.  If within 60 days 
+	of notice, a reasonable royalty and payment arrangement are not 
+	mutually agreed upon in writing by the parties or the litigation claim 
+	is not withdrawn, the rights granted by Participant to You under 
+	Sections 2.1 and/or 2.2 automatically terminate at the expiration of 
+	the 60 day notice period specified above. 
+ .
+	(b) any software, hardware, or device, other than such Participant's 
+	Contributor Version, directly or indirectly infringes any patent, then 
+	any rights granted to You by such Participant under Sections 2.1(b) 
+	and 2.2(b) are revoked effective as of the date You first made, used, 
+	sold, distributed, or had made, Modifications made by that 
+	Participant. 
+ .
+	8.3. If You assert a patent infringement claim against Participant 
+	alleging that such Participant's Contributor Version directly or 
+	indirectly infringes any patent where such claim is resolved (such as 
+	by license or settlement) prior to the initiation of patent 
+	infringement litigation, then the reasonable value of the licenses 
+	granted by such Participant under Sections 2.1 or 2.2 shall be taken 
+	into account in determining the amount or value of any payment or 
+	license. 
+ .
+	8.4. In the event of termination under Sections 8.1 or 8.2 above,  all 
+	end user license agreements (excluding distributors and resellers) 
+	which have been validly granted by You or any distributor hereunder 
+	prior to termination shall survive termination.
+ .
+ 9. LIMITATION OF LIABILITY. 
+ .
+	UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT 
+	(INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL 
+	DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, 
+	OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR 
+	ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY 
+	CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, 
+	WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER 
+	COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN 
+	INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF 
+	LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY 
+	RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW 
+	PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE 
+	EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO 
+	THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+ .
+ 10. U.S. GOVERNMENT END USERS. 
+ .
+	The Covered Code is a "commercial item," as that term is defined in 48 
+	C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" 
+	and "commercial computer software documentation," as such terms are 
+	used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 
+	12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all 
+	U.S. Government End Users acquire Covered Code with only those rights 
+	set forth herein.
+ .
+ 11. MISCELLANEOUS. 
+ .
+	This License represents the complete agreement concerning subject 
+	matter hereof. If any provision of this License is held to be 
+	unenforceable, such provision shall be reformed only to the extent 
+	necessary to make it enforceable. This License shall be governed by 
+	California law provisions (except to the extent applicable law, if 
+	any, provides otherwise), excluding its conflict-of-law provisions. 
+	With respect to disputes in which at least one party is a citizen of, 
+	or an entity chartered or registered to do business in the United 
+	States of America, any litigation relating to this License shall be 
+	subject to the jurisdiction of the Federal Courts of the Northern 
+	District of California, with venue lying in Santa Clara County, 
+	California, with the losing party responsible for costs, including 
+	without limitation, court costs and reasonable attorneys' fees and 
+	expenses. The application of the United Nations Convention on 
+	Contracts for the International Sale of Goods is expressly excluded. 
+	Any law or regulation which provides that the language of a contract 
+	shall be construed against the drafter shall not apply to this 
+	License.
+ .
+ 12. RESPONSIBILITY FOR CLAIMS. 
+ .
+	As between Initial Developer and the Contributors, each party is 
+	responsible for claims and damages arising, directly or indirectly, 
+	out of its utilization of rights under this License and You agree to 
+	work with Initial Developer and Contributors to distribute such 
+	responsibility on an equitable basis. Nothing herein is intended or 
+	shall be deemed to constitute any admission of liability.
+ .
+ 13. MULTIPLE-LICENSED CODE. 
+ .
+	Initial Developer may designate portions of the Covered Code as 
+	?Multiple-Licensed?. ?Multiple-Licensed? means that the Initial 
+	Developer permits you to utilize portions of the Covered Code under 
+	Your choice of the alternative licenses, if any, specified by the 
+	Initial Developer in the file described in Exhibit A.
+ .
+ Exhibit A -Sun Public License Notice. 
+ .
+	The contents of this file are subject to the Sun Public License 
+	Version 1.0 (the "License"); you may not use this file except in 
+	compliance with the License. A copy of the License is available at 
+	http://www.sun.com/
+ .
+	The Original Code is _________________. The Initial Developer of the 
+	Original Code is ___________. Portions created by ______ are Copyright 
+	(C)_________. All Rights Reserved.
+ .
+	Contributor(s): ______________________________________. 
+ .
+	Alternatively, the contents of this file may be used under the terms 
+	of the _____ license (the  ?[___] License?), in which case the 
+	provisions of [______] License are applicable  instead of those above.  
+	If you wish to allow use of your version of this file only under the 
+	terms of the [____] License and not to allow others to use your 
+	version of this file under the SPL, indicate your decision by deleting  
+	the provisions above and replace  them with the notice and other 
+	provisions required by the [___] License. If you do not delete the 
+	provisions above, a recipient may use your version of this file under 
+	either the SPL or the [___] License." 
+ .
+	[NOTE: The text of this Exhibit A may differ slightly from the text of 
+	the notices in the Source Code files of the Original Code. You should 
+	use the text of this Exhibit A rather than the text found in the 
+	Original Code Source Code for Your Modifications.] 
+
+
+
+License: MPL-1.1
+                          MOZILLA PUBLIC LICENSE
+                                Version 1.1
+ .
+                              ---------------
+ .
+ 1. Definitions.
+ .
+     1.0.1. "Commercial Use" means distribution or otherwise making the
+     Covered Code available to a third party.
+ .
+     1.1. "Contributor" means each entity that creates or contributes to
+     the creation of Modifications.
+ .
+     1.2. "Contributor Version" means the combination of the Original
+     Code, prior Modifications used by a Contributor, and the Modifications
+     made by that particular Contributor.
+ .
+     1.3. "Covered Code" means the Original Code or Modifications or the
+     combination of the Original Code and Modifications, in each case
+     including portions thereof.
+ .
+     1.4. "Electronic Distribution Mechanism" means a mechanism generally
+     accepted in the software development community for the electronic
+     transfer of data.
+ .
+     1.5. "Executable" means Covered Code in any form other than Source
+     Code.
+ .
+     1.6. "Initial Developer" means the individual or entity identified
+     as the Initial Developer in the Source Code notice required by Exhibit
+     A.
+ .
+     1.7. "Larger Work" means a work which combines Covered Code or
+     portions thereof with code not governed by the terms of this License.
+ .
+     1.8. "License" means this document.
+ .
+     1.8.1. "Licensable" means having the right to grant, to the maximum
+     extent possible, whether at the time of the initial grant or
+     subsequently acquired, any and all of the rights conveyed herein.
+ .
+     1.9. "Modifications" means any addition to or deletion from the
+     substance or structure of either the Original Code or any previous
+     Modifications. When Covered Code is released as a series of files, a
+     Modification is:
+          A. Any addition to or deletion from the contents of a file
+          containing Original Code or previous Modifications.
+ .
+          B. Any new file that contains any part of the Original Code or
+          previous Modifications.
+ .
+     1.10. "Original Code" means Source Code of computer software code
+     which is described in the Source Code notice required by Exhibit A as
+     Original Code, and which, at the time of its release under this
+     License is not already Covered Code governed by this License.
+ .
+     1.10.1. "Patent Claims" means any patent claim(s), now owned or
+     hereafter acquired, including without limitation,  method, process,
+     and apparatus claims, in any patent Licensable by grantor.
+ .
+     1.11. "Source Code" means the preferred form of the Covered Code for
+     making modifications to it, including all modules it contains, plus
+     any associated interface definition files, scripts used to control
+     compilation and installation of an Executable, or source code
+     differential comparisons against either the Original Code or another
+     well known, available Covered Code of the Contributor's choice. The
+     Source Code can be in a compressed or archival form, provided the
+     appropriate decompression or de-archiving software is widely available
+     for no charge.
+ .
+     1.12. "You" (or "Your")  means an individual or a legal entity
+     exercising rights under, and complying with all of the terms of, this
+     License or a future version of this License issued under Section 6.1.
+     For legal entities, "You" includes any entity which controls, is
+     controlled by, or is under common control with You. For purposes of
+     this definition, "control" means (a) the power, direct or indirect,
+     to cause the direction or management of such entity, whether by
+     contract or otherwise, or (b) ownership of more than fifty percent
+     (50%) of the outstanding shares or beneficial ownership of such
+     entity.
+ .
+ 2. Source Code License.
+ .
+     2.1. The Initial Developer Grant.
+     The Initial Developer hereby grants You a world-wide, royalty-free,
+     non-exclusive license, subject to third party intellectual property
+     claims:
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Initial Developer to use, reproduce,
+          modify, display, perform, sublicense and distribute the Original
+          Code (or portions thereof) with or without Modifications, and/or
+          as part of a Larger Work; and
+ .
+          (b) under Patents Claims infringed by the making, using or
+          selling of Original Code, to make, have made, use, practice,
+          sell, and offer for sale, and/or otherwise dispose of the
+          Original Code (or portions thereof).
+ .
+          (c) the licenses granted in this Section 2.1(a) and (b) are
+          effective on the date Initial Developer first distributes
+          Original Code under the terms of this License.
+ .
+          (d) Notwithstanding Section 2.1(b) above, no patent license is
+          granted: 1) for code that You delete from the Original Code; 2)
+          separate from the Original Code;  or 3) for infringements caused
+          by: i) the modification of the Original Code or ii) the
+          combination of the Original Code with other software or devices.
+ .
+     2.2. Contributor Grant.
+     Subject to third party intellectual property claims, each Contributor
+     hereby grants You a world-wide, royalty-free, non-exclusive license
+ .
+          (a)  under intellectual property rights (other than patent or
+          trademark) Licensable by Contributor, to use, reproduce, modify,
+          display, perform, sublicense and distribute the Modifications
+          created by such Contributor (or portions thereof) either on an
+          unmodified basis, with other Modifications, as Covered Code
+          and/or as part of a Larger Work; and
+ .
+          (b) under Patent Claims infringed by the making, using, or
+          selling of  Modifications made by that Contributor either alone
+          and/or in combination with its Contributor Version (or portions
+          of such combination), to make, use, sell, offer for sale, have
+          made, and/or otherwise dispose of: 1) Modifications made by that
+          Contributor (or portions thereof); and 2) the combination of
+          Modifications made by that Contributor with its Contributor
+          Version (or portions of such combination).
+ .
+          (c) the licenses granted in Sections 2.2(a) and 2.2(b) are
+          effective on the date Contributor first makes Commercial Use of
+          the Covered Code.
+ .
+          (d)    Notwithstanding Section 2.2(b) above, no patent license is
+          granted: 1) for any code that Contributor has deleted from the
+          Contributor Version; 2)  separate from the Contributor Version;
+          3)  for infringements caused by: i) third party modifications of
+          Contributor Version or ii)  the combination of Modifications made
+          by that Contributor with other software  (except as part of the
+          Contributor Version) or other devices; or 4) under Patent Claims
+          infringed by Covered Code in the absence of Modifications made by
+          that Contributor.
+ .
+ 3. Distribution Obligations.
+ .
+     3.1. Application of License.
+     The Modifications which You create or to which You contribute are
+     governed by the terms of this License, including without limitation
+     Section 2.2. The Source Code version of Covered Code may be
+     distributed only under the terms of this License or a future version
+     of this License released under Section 6.1, and You must include a
+     copy of this License with every copy of the Source Code You
+     distribute. You may not offer or impose any terms on any Source Code
+     version that alters or restricts the applicable version of this
+     License or the recipients' rights hereunder. However, You may include
+     an additional document offering the additional rights described in
+     Section 3.5.
+ .
+     3.2. Availability of Source Code.
+     Any Modification which You create or to which You contribute must be
+     made available in Source Code form under the terms of this License
+     either on the same media as an Executable version or via an accepted
+     Electronic Distribution Mechanism to anyone to whom you made an
+     Executable version available; and if made available via Electronic
+     Distribution Mechanism, must remain available for at least twelve (12)
+     months after the date it initially became available, or at least six
+     (6) months after a subsequent version of that particular Modification
+     has been made available to such recipients. You are responsible for
+     ensuring that the Source Code version remains available even if the
+     Electronic Distribution Mechanism is maintained by a third party.
+ .
+     3.3. Description of Modifications.
+     You must cause all Covered Code to which You contribute to contain a
+     file documenting the changes You made to create that Covered Code and
+     the date of any change. You must include a prominent statement that
+     the Modification is derived, directly or indirectly, from Original
+     Code provided by the Initial Developer and including the name of the
+     Initial Developer in (a) the Source Code, and (b) in any notice in an
+     Executable version or related documentation in which You describe the
+     origin or ownership of the Covered Code.
+ .
+     3.4. Intellectual Property Matters
+          (a) Third Party Claims.
+          If Contributor has knowledge that a license under a third party's
+          intellectual property rights is required to exercise the rights
+          granted by such Contributor under Sections 2.1 or 2.2,
+          Contributor must include a text file with the Source Code
+          distribution titled "LEGAL" which describes the claim and the
+          party making the claim in sufficient detail that a recipient will
+          know whom to contact. If Contributor obtains such knowledge after
+          the Modification is made available as described in Section 3.2,
+          Contributor shall promptly modify the LEGAL file in all copies
+          Contributor makes available thereafter and shall take other steps
+          (such as notifying appropriate mailing lists or newsgroups)
+          reasonably calculated to inform those who received the Covered
+          Code that new knowledge has been obtained.
+ .
+          (b) Contributor APIs.
+          If Contributor's Modifications include an application programming
+          interface and Contributor has knowledge of patent licenses which
+          are reasonably necessary to implement that API, Contributor must
+          also include this information in the LEGAL file.
+ .
+          (c) Representations.
+          Contributor represents that, except as disclosed pursuant to
+          Section 3.4(a) above, Contributor believes that Contributor's
+          Modifications are Contributor's original creation(s) and/or
+          Contributor has sufficient rights to grant the rights conveyed by
+          this License.
+ .
+     3.5. Required Notices.
+     You must duplicate the notice in Exhibit A in each file of the Source
+     Code.  If it is not possible to put such notice in a particular Source
+     Code file due to its structure, then You must include such notice in a
+     location (such as a relevant directory) where a user would be likely
+     to look for such a notice.  If You created one or more Modification(s)
+     You may add your name as a Contributor to the notice described in
+     Exhibit A.  You must also duplicate this License in any documentation
+     for the Source Code where You describe recipients' rights or ownership
+     rights relating to Covered Code.  You may choose to offer, and to
+     charge a fee for, warranty, support, indemnity or liability
+     obligations to one or more recipients of Covered Code. However, You
+     may do so only on Your own behalf, and not on behalf of the Initial
+     Developer or any Contributor. You must make it absolutely clear than
+     any such warranty, support, indemnity or liability obligation is
+     offered by You alone, and You hereby agree to indemnify the Initial
+     Developer and every Contributor for any liability incurred by the
+     Initial Developer or such Contributor as a result of warranty,
+     support, indemnity or liability terms You offer.
+ .
+     3.6. Distribution of Executable Versions.
+     You may distribute Covered Code in Executable form only if the
+     requirements of Section 3.1-3.5 have been met for that Covered Code,
+     and if You include a notice stating that the Source Code version of
+     the Covered Code is available under the terms of this License,
+     including a description of how and where You have fulfilled the
+     obligations of Section 3.2. The notice must be conspicuously included
+     in any notice in an Executable version, related documentation or
+     collateral in which You describe recipients' rights relating to the
+     Covered Code. You may distribute the Executable version of Covered
+     Code or ownership rights under a license of Your choice, which may
+     contain terms different from this License, provided that You are in
+     compliance with the terms of this License and that the license for the
+     Executable version does not attempt to limit or alter the recipient's
+     rights in the Source Code version from the rights set forth in this
+     License. If You distribute the Executable version under a different
+     license You must make it absolutely clear that any terms which differ
+     from this License are offered by You alone, not by the Initial
+     Developer or any Contributor. You hereby agree to indemnify the
+     Initial Developer and every Contributor for any liability incurred by
+     the Initial Developer or such Contributor as a result of any such
+     terms You offer.
+ .
+     3.7. Larger Works.
+     You may create a Larger Work by combining Covered Code with other code
+     not governed by the terms of this License and distribute the Larger
+     Work as a single product. In such a case, You must make sure the
+     requirements of this License are fulfilled for the Covered Code.
+ .
+ 4. Inability to Comply Due to Statute or Regulation.
+ .
+     If it is impossible for You to comply with any of the terms of this
+     License with respect to some or all of the Covered Code due to
+     statute, judicial order, or regulation then You must: (a) comply with
+     the terms of this License to the maximum extent possible; and (b)
+     describe the limitations and the code they affect. Such description
+     must be included in the LEGAL file described in Section 3.4 and must
+     be included with all distributions of the Source Code. Except to the
+     extent prohibited by statute or regulation, such description must be
+     sufficiently detailed for a recipient of ordinary skill to be able to
+     understand it.
+ .
+ 5. Application of this License.
+
+     This License applies to code to which the Initial Developer has
+     attached the notice in Exhibit A and to related Covered Code.
+ .
+ 6. Versions of the License.
+ .
+     6.1. New Versions.
+     Netscape Communications Corporation ("Netscape") may publish revised
+     and/or new versions of the License from time to time. Each version
+     will be given a distinguishing version number.
+ .
+     6.2. Effect of New Versions.
+     Once Covered Code has been published under a particular version of the
+     License, You may always continue to use it under the terms of that
+     version. You may also choose to use such Covered Code under the terms
+     of any subsequent version of the License published by Netscape. No one
+     other than Netscape has the right to modify the terms applicable to
+     Covered Code created under this License.
+ .
+     6.3. Derivative Works.
+     If You create or use a modified version of this License (which you may
+     only do in order to apply it to code which is not already Covered Code
+     governed by this License), You must (a) rename Your license so that
+     the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape",
+     "MPL", "NPL" or any confusingly similar phrase do not appear in your
+     license (except to note that your license differs from this License)
+     and (b) otherwise make it clear that Your version of the license
+     contains terms which differ from the Mozilla Public License and
+     Netscape Public License. (Filling in the name of the Initial
+     Developer, Original Code or Contributor in the notice described in
+     Exhibit A shall not of themselves be deemed to be modifications of
+     this License.)
+ .
+ 7. DISCLAIMER OF WARRANTY.
+ .
+     COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS,
+     WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+     WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF
+     DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING.
+     THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE
+     IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT,
+     YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE
+     COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
+     OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF
+     ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER.
+ .
+ 8. TERMINATION.
+ .
+     8.1.  This License and the rights granted hereunder will terminate
+     automatically if You fail to comply with terms herein and fail to cure
+     such breach within 30 days of becoming aware of the breach. All
+     sublicenses to the Covered Code which are properly granted shall
+     survive any termination of this License. Provisions which, by their
+     nature, must remain in effect beyond the termination of this License
+     shall survive.
+ .
+     8.2.  If You initiate litigation by asserting a patent infringement
+     claim (excluding declatory judgment actions) against Initial Developer
+     or a Contributor (the Initial Developer or Contributor against whom
+     You file such action is referred to as "Participant")  alleging that:
+ .
+     (a)  such Participant's Contributor Version directly or indirectly
+     infringes any patent, then any and all rights granted by such
+     Participant to You under Sections 2.1 and/or 2.2 of this License
+     shall, upon 60 days notice from Participant terminate prospectively,
+     unless if within 60 days after receipt of notice You either: (i)
+     agree in writing to pay Participant a mutually agreeable reasonable
+     royalty for Your past and future use of Modifications made by such
+     Participant, or (ii) withdraw Your litigation claim with respect to
+     the Contributor Version against such Participant.  If within 60 days
+     of notice, a reasonable royalty and payment arrangement are not
+     mutually agreed upon in writing by the parties or the litigation claim
+     is not withdrawn, the rights granted by Participant to You under
+     Sections 2.1 and/or 2.2 automatically terminate at the expiration of
+     the 60 day notice period specified above.
+ .
+     (b)  any software, hardware, or device, other than such Participant's
+     Contributor Version, directly or indirectly infringes any patent, then
+     any rights granted to You by such Participant under Sections 2.1(b)
+     and 2.2(b) are revoked effective as of the date You first made, used,
+     sold, distributed, or had made, Modifications made by that
+     Participant.
+ .
+     8.3.  If You assert a patent infringement claim against Participant
+     alleging that such Participant's Contributor Version directly or
+     indirectly infringes any patent where such claim is resolved (such as
+     by license or settlement) prior to the initiation of patent
+     infringement litigation, then the reasonable value of the licenses
+     granted by such Participant under Sections 2.1 or 2.2 shall be taken
+     into account in determining the amount or value of any payment or
+     license.
+ .
+     8.4.  In the event of termination under Sections 8.1 or 8.2 above,
+     all end user license agreements (excluding distributors and resellers)
+     which have been validly granted by You or any distributor hereunder
+     prior to termination shall survive termination.
+ .
+ 9. LIMITATION OF LIABILITY.
+ .
+     UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT
+     (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL
+     DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE,
+     OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR
+     ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+     CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL,
+     WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER
+     COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN
+     INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF
+     LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+     RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW
+     PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE
+     EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO
+     THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU.
+ .
+ 10. U.S. GOVERNMENT END USERS.
+ .
+     The Covered Code is a "commercial item," as that term is defined in
+     48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer
+     software" and "commercial computer software documentation," as such
+     terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48
+     C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995),
+     all U.S. Government End Users acquire Covered Code with only those
+     rights set forth herein.
+ .
+ 11. MISCELLANEOUS.
+ .
+     This License represents the complete agreement concerning subject
+     matter hereof. If any provision of this License is held to be
+     unenforceable, such provision shall be reformed only to the extent
+     necessary to make it enforceable. This License shall be governed by
+     California law provisions (except to the extent applicable law, if
+     any, provides otherwise), excluding its conflict-of-law provisions.
+     With respect to disputes in which at least one party is a citizen of,
+     or an entity chartered or registered to do business in the United
+     States of America, any litigation relating to this License shall be
+     subject to the jurisdiction of the Federal Courts of the Northern
+     District of California, with venue lying in Santa Clara County,
+     California, with the losing party responsible for costs, including
+     without limitation, court costs and reasonable attorneys' fees and
+     expenses. The application of the United Nations Convention on
+     Contracts for the International Sale of Goods is expressly excluded.
+     Any law or regulation which provides that the language of a contract
+     shall be construed against the drafter shall not apply to this
+     License.
+ .
+ 12. RESPONSIBILITY FOR CLAIMS.
+ .
+     As between Initial Developer and the Contributors, each party is
+     responsible for claims and damages arising, directly or indirectly,
+     out of its utilization of rights under this License and You agree to
+     work with Initial Developer and Contributors to distribute such
+     responsibility on an equitable basis. Nothing herein is intended or
+     shall be deemed to constitute any admission of liability.
+ .
+ 13. MULTIPLE-LICENSED CODE.
+ .
+     Initial Developer may designate portions of the Covered Code as
+     "Multiple-Licensed".  "Multiple-Licensed" means that the Initial
+     Developer permits you to utilize portions of the Covered Code under
+     Your choice of the NPL or the alternative licenses, if any, specified
+     by the Initial Developer in the file described in Exhibit A.
+ .
+ EXHIBIT A -Mozilla Public License.
+ .
+     ``The contents of this file are subject to the Mozilla Public License
+     Version 1.1 (the "License"); you may not use this file except in
+     compliance with the License. You may obtain a copy of the License at
+     http://www.mozilla.org/MPL/
+ .
+     Software distributed under the License is distributed on an "AS IS"
+     basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
+     License for the specific language governing rights and limitations
+     under the License.
+ .
+     The Original Code is ______________________________________.
+ .
+     The Initial Developer of the Original Code is ________________________.
+     Portions created by ______________________ are Copyright (C) ______
+     _______________________. All Rights Reserved.
+ .
+     Contributor(s): ______________________________________.
+ .
+     Alternatively, the contents of this file may be used under the terms
+     of the _____ license (the  "[___] License"), in which case the
+     provisions of [______] License are applicable instead of those
+     above.  If you wish to allow use of your version of this file only
+     under the terms of the [____] License and not to allow others to use
+     your version of this file under the MPL, indicate your decision by
+     deleting  the provisions above and replace  them with the notice and
+     other provisions required by the [___] License.  If you do not delete
+     the provisions above, a recipient may use your version of this file
+     under either the MPL or the [___] License."
+ .
+     [NOTE: The text of this Exhibit A may differ slightly from the text of
+     the notices in the Source Code files of the Original Code. You should
+     use the text of this Exhibit A rather than the text found in the
+     Original Code Source Code for Your Modifications.]
 
-As between Initial Developer and the Contributors, each
-party is responsible for claims and damages arising,
-directly or indirectly, out of its utilization of rights
-under this License and You agree to work with Initial
-Developer and Contributors to distribute such responsibility
-on an equitable basis. Nothing herein is intended or shall
-be deemed to constitute any admission of liability.
+License: CDDL-1
+    COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL)
+    Version 1.0
+    .
+    1. Definitions.
+    .
+    1.1. "Contributor" means each individual or entity that
+    creates or contributes to the creation of Modifications.
+    .
+    1.2. "Contributor Version" means the combination of the
+    Original Software, prior Modifications used by a Contributor
+    (if any), and the Modifications made by that particular
+    Contributor.
+    .
+    1.3. "Covered Software" means (a) the Original Software, or
+    (b) Modifications, or (c) the combination of files
+    containing Original Software with files containing
+    Modifications, in each case including portions thereof.
+    .
+    1.4. "Executable" means the Covered Software in any form
+    other than Source Code. 
+    .
+    1.5. "Initial Developer" means the individual or entity that
+    first makes Original Software available under this License. 
+    .
+    1.6. "Larger Work" means a work which combines Covered
+    Software or portions thereof with code not governed by the
+    terms of this License.
+    .
+    1.7. "License" means this document.
+    .
+    1.8. "Licensable" means having the right to grant, to the
+    maximum extent possible, whether at the time of the initial
+    grant or subsequently acquired, any and all of the rights
+    conveyed herein.
+    .
+    1.9. "Modifications" means the Source Code and Executable
+    form of any of the following:
+    .
+    A. Any file that results from an addition to, deletion from
+    or modification of the contents of a file containing
+    Original Software or previous Modifications; 
+    .
+    B. Any new file that contains any part of the Original
+    Software or previous Modification; or 
+    .
+    C. Any new file that is contributed or otherwise made
+    available under the terms of this License.
+    .
+    1.10. "Original Software" means the Source Code and
+    Executable form of computer software code that is originally
+    released under this License. 
+    .
+    1.11. "Patent Claims" means any patent claim(s), now owned
+    or hereafter acquired, including without limitation, method,
+    process, and apparatus claims, in any patent Licensable by
+    grantor. 
+    .
+    1.12. "Source Code" means (a) the common form of computer
+    software code in which modifications are made and (b)
+    associated documentation included in or with such code.
+    .
+    1.13. "You" (or "Your") means an individual or a legal
+    entity exercising rights under, and complying with all of
+    the terms of, this License. For legal entities, "You"
+    includes any entity which controls, is controlled by, or is
+    under common control with You. For purposes of this
+    definition, "control" means (a) the power, direct or
+    indirect, to cause the direction or management of such
+    entity, whether by contract or otherwise, or (b) ownership
+    of more than fifty percent (50%) of the outstanding shares
+    or beneficial ownership of such entity.
+    .
+    2. License Grants. 
+    .
+    2.1. The Initial Developer Grant. Conditioned upon Your
+    compliance with Section 3.1 below and subject to third party
+    intellectual property claims, the Initial Developer hereby
+    grants You a world-wide, royalty-free, non-exclusive
+    license: 
+    .
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Initial Developer, to use,
+    reproduce, modify, display, perform, sublicense and
+    distribute the Original Software (or portions thereof), with
+    or without Modifications, and/or as part of a Larger Work;
+    and 
+    .
+    (b) under Patent Claims infringed by the making, using or
+    selling of Original Software, to make, have made, use,
+    practice, sell, and offer for sale, and/or otherwise dispose
+    of the Original Software (or portions thereof). 
+    .
+    (c) The licenses granted in Sections 2.1(a) and (b) are
+    effective on the date Initial Developer first distributes or
+    otherwise makes the Original Software available to a third
+    party under the terms of this License. 
+    .
+    (d) Notwithstanding Section 2.1(b) above, no patent license
+    is granted: (1) for code that You delete from the Original
+    Software, or (2) for infringements caused by: (i) the
+    modification of the Original Software, or (ii) the
+    combination of the Original Software with other software or
+    devices. 
+    .
+    2.2. Contributor Grant. Conditioned upon Your compliance
+    with Section 3.1 below and subject to third party
+    intellectual property claims, each Contributor hereby grants
+    You a world-wide, royalty-free, non-exclusive license:
+    .
+    (a) under intellectual property rights (other than patent or
+    trademark) Licensable by Contributor to use, reproduce,
+    modify, display, perform, sublicense and distribute the
+    Modifications created by such Contributor (or portions
+    thereof), either on an unmodified basis, with other
+    Modifications, as Covered Software and/or as part of a
+    Larger Work; and
+    .
+    (b) under Patent Claims infringed by the making, using, or
+    selling of Modifications made by that Contributor either
+    alone and/or in combination with its Contributor Version (or
+    portions of such combination), to make, use, sell, offer for
+    sale, have made, and/or otherwise dispose of: (1)
+    Modifications made by that Contributor (or portions
+    thereof); and (2) the combination of Modifications made by
+    that Contributor with its Contributor Version (or portions
+    of such combination). 
+    .
+    (c) The licenses granted in Sections 2.2(a) and 2.2(b) are
+    effective on the date Contributor first distributes or
+    otherwise makes the Modifications available to a third
+    party. 
+    .
+    (d) Notwithstanding Section 2.2(b) above, no patent license
+    is granted: (1) for any code that Contributor has deleted
+    from the Contributor Version; (2) for infringements caused
+    by: (i) third party modifications of Contributor Version, or
+    (ii) the combination of Modifications made by that
+    Contributor with other software (except as part of the
+    Contributor Version) or other devices; or (3) under Patent
+    Claims infringed by Covered Software in the absence of
+    Modifications made by that Contributor. 
+    .
+    3. Distribution Obligations.
+    .
+    3.1. Availability of Source Code.
+    .
+    Any Covered Software that You distribute or otherwise make
+    available in Executable form must also be made available in
+    Source Code form and that Source Code form must be
+    distributed only under the terms of this License. You must
+    include a copy of this License with every copy of the Source
+    Code form of the Covered Software You distribute or
+    otherwise make available. You must inform recipients of any
+    such Covered Software in Executable form as to how they can
+    obtain such Covered Software in Source Code form in a
+    reasonable manner on or through a medium customarily used
+    for software exchange.
+    .
+    3.2. Modifications.
+    .
+    The Modifications that You create or to which You contribute
+    are governed by the terms of this License. You represent
+    that You believe Your Modifications are Your original
+    creation(s) and/or You have sufficient rights to grant the
+    rights conveyed by this License.
+    .
+    3.3. Required Notices.
+    .
+    You must include a notice in each of Your Modifications that
+    identifies You as the Contributor of the Modification. You
+    may not remove or alter any copyright, patent or trademark
+    notices contained within the Covered Software, or any
+    notices of licensing or any descriptive text giving
+    attribution to any Contributor or the Initial Developer.
+    .
+    3.4. Application of Additional Terms.
+    .
+    You may not offer or impose any terms on any Covered
+    Software in Source Code form that alters or restricts the
+    applicable version of this License or the recipients' rights
+    hereunder. You may choose to offer, and to charge a fee for,
+    warranty, support, indemnity or liability obligations to one
+    or more recipients of Covered Software. However, you may do
+    so only on Your own behalf, and not on behalf of the Initial
+    Developer or any Contributor. You must make it absolutely
+    clear that any such warranty, support, indemnity or
+    liability obligation is offered by You alone, and You hereby
+    agree to indemnify the Initial Developer and every
+    Contributor for any liability incurred by the Initial
+    Developer or such Contributor as a result of warranty,
+    support, indemnity or liability terms You offer.
+    .
+    3.5. Distribution of Executable Versions.
+    .
+    You may distribute the Executable form of the Covered
+    Software under the terms of this License or under the terms
+    of a license of Your choice, which may contain terms
+    different from this License, provided that You are in
+    compliance with the terms of this License and that the
+    license for the Executable form does not attempt to limit or
+    alter the recipient's rights in the Source Code form from
+    the rights set forth in this License. If You distribute the
+    Covered Software in Executable form under a different
+    license, You must make it absolutely clear that any terms
+    which differ from this License are offered by You alone, not
+    by the Initial Developer or Contributor. You hereby agree to
+    indemnify the Initial Developer and every Contributor for
+    any liability incurred by the Initial Developer or such
+    Contributor as a result of any such terms You offer.
+    .
+    3.6. Larger Works.
+    .
+    You may create a Larger Work by combining Covered Software
+    with other code not governed by the terms of this License
+    and distribute the Larger Work as a single product. In such
+    a case, You must make sure the requirements of this License
+    are fulfilled for the Covered Software. 
+    .
+    4. Versions of the License. 
+    .
+    4.1. New Versions.
+    .
+    Oracle Corp. is the initial license steward and may publish
+    revised and/or new versions of this License from time to
+    time. Each version will be given a distinguishing version
+    number. Except as provided in Section 4.3, no one other than
+    the license steward has the right to modify this License. 
+    .
+    4.2. Effect of New Versions.
+    .
+    You may always continue to use, distribute or otherwise make
+    the Covered Software available under the terms of the
+    version of the License under which You originally received
+    the Covered Software. If the Initial Developer includes a
+    notice in the Original Software prohibiting it from being
+    distributed or otherwise made available under any subsequent
+    version of the License, You must distribute and make the
+    Covered Software available under the terms of the version of
+    the License under which You originally received the Covered
+    Software. Otherwise, You may also choose to use, distribute
+    or otherwise make the Covered Software available under the
+    terms of any subsequent version of the License published by
+    the license steward. 
+    .
+    4.3. Modified Versions.
+    .
+    When You are an Initial Developer and You want to create a
+    new license for Your Original Software, You may create and
+    use a modified version of this License if You: (a) rename
+    the license and remove any references to the name of the
+    license steward (except to note that the license differs
+    from this License); and (b) otherwise make it clear that the
+    license contains terms which differ from this License.
+    .
+    5. DISCLAIMER OF WARRANTY.
+    .
+    COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS
+    IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
+    IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE
+    COVERED SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A
+    PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO
+    THE QUALITY AND PERFORMANCE OF THE COVERED SOFTWARE IS WITH
+    YOU. SHOULD ANY COVERED SOFTWARE PROVE DEFECTIVE IN ANY
+    RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER
+    CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING,
+    REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY
+    CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY
+    COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS
+    DISCLAIMER. 
+    .
+    6. TERMINATION. 
+    .
+    6.1. This License and the rights granted hereunder will
+    terminate automatically if You fail to comply with terms
+    herein and fail to cure such breach within 30 days of
+    becoming aware of the breach. Provisions which, by their
+    nature, must remain in effect beyond the termination of this
+    License shall survive.
+    .
+    6.2. If You assert a patent infringement claim (excluding
+    declaratory judgment actions) against Initial Developer or a
+    Contributor (the Initial Developer or Contributor against
+    whom You assert such claim is referred to as "Participant")
+    alleging that the Participant Software (meaning the
+    Contributor Version where the Participant is a Contributor
+    or the Original Software where the Participant is the
+    Initial Developer) directly or indirectly infringes any
+    patent, then any and all rights granted directly or
+    indirectly to You by such Participant, the Initial Developer
+    (if the Initial Developer is not the Participant) and all
+    Contributors under Sections 2.1 and/or 2.2 of this License
+    shall, upon 60 days notice from Participant terminate
+    prospectively and automatically at the expiration of such 60
+    day notice period, unless if within such 60 day period You
+    withdraw Your claim with respect to the Participant Software
+    against such Participant either unilaterally or pursuant to
+    a written agreement with Participant.
+    .
+    6.3. In the event of termination under Sections 6.1 or 6.2
+    above, all end user licenses that have been validly granted
+    by You or any distributor hereunder prior to termination
+    (excluding licenses granted to You by any distributor) shall
+    survive termination.
+    .
+    7. LIMITATION OF LIABILITY.
+    .
+    UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER
+    TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL
+    YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY
+    DISTRIBUTOR OF COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF
+    SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT,
+    SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY
+    CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOST
+    PROFITS, LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE
+    OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR
+    LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE
+    POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY
+    SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY
+    RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT
+    APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS
+    DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR
+    CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY
+    NOT APPLY TO YOU.
+    .
+    8. U.S. GOVERNMENT END USERS.
+    .
+    The Covered Software is a "commercial item," as that term is
+    defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of
+    "commercial computer software" (as that term is defined at
+    48 C.F.R. 252.227-7014(a)(1)) and "commercial computer
+    software documentation" as such terms are used in 48 C.F.R.
+    12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48
+    C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S.
+    Government End Users acquire Covered Software with only
+    those rights set forth herein. This U.S. Government Rights
+    clause is in lieu of, and supersedes, any other FAR, DFAR,
+    or other clause or provision that addresses Government
+    rights in computer software under this License.
+    .
+    9. MISCELLANEOUS.
+    .
+    This License represents the complete agreement concerning
+    subject matter hereof. If any provision of this License is
+    held to be unenforceable, such provision shall be reformed
+    only to the extent necessary to make it enforceable. This
+    License shall be governed by the law of the jurisdiction
+    specified in a notice contained within the Original Software
+    (except to the extent applicable law, if any, provides
+    otherwise), excluding such jurisdiction's conflict-of-law
+    provisions. Any litigation relating to this License shall be
+    subject to the jurisdiction of the courts located in the
+    jurisdiction and venue specified in a notice contained
+    within the Original Software, with the losing party
+    responsible for costs, including, without limitation, court
+    costs and reasonable attorneys' fees and expenses. The
+    application of the United Nations Convention on Contracts
+    for the International Sale of Goods is expressly excluded.
+    Any law or regulation which provides that the language of a
+    contract shall be construed against the drafter shall not
+    apply to this License. You agree that You alone are
+    responsible for compliance with the United States export
+    administration regulations (and the export control laws and
+    regulation of any other countries) when You use, distribute
+    or otherwise make available any Covered Software.
+    .
+    10. RESPONSIBILITY FOR CLAIMS.
+    .
+    As between Initial Developer and the Contributors, each
+    party is responsible for claims and damages arising,
+    directly or indirectly, out of its utilization of rights
+    under this License and You agree to work with Initial
+    Developer and Contributors to distribute such responsibility
+    on an equitable basis. Nothing herein is intended or shall
+    be deemed to constitute any admission of liability.
diff --git a/debian/libnb-platform-devel-java.lintian-overrides b/debian/libnb-platform-devel-java.lintian-overrides
new file mode 100644
index 0000000..affa279
--- /dev/null
+++ b/debian/libnb-platform-devel-java.lintian-overrides
@@ -0,0 +1,12 @@
+# Netbeans builds lots of codeless jars on purpose, so don't warn us about them
+libnb-platform-devel-java: codeless-jar
+
+# Netbeans uses relative paths in its jar files. It would be too much work to 
+# fix this so we instead put symlinks in the right place. This is useful when 
+# you build a package to export too.
+libnb-platform-devel-java: classpath-contains-relative-path
+
+# This is a library package in the sense that it doesn't by itself provide an 
+# application. But the jar files don't live in /usr/share/java since they are 
+# specific to the NetBeans platform and need to live in a "cluster"
+libnb-platform-devel-java: javalib-but-no-public-jars
diff --git a/debian/libnb-platform13-java.lintian-overrides b/debian/libnb-platform13-java.lintian-overrides
new file mode 100644
index 0000000..6699b0a
--- /dev/null
+++ b/debian/libnb-platform13-java.lintian-overrides
@@ -0,0 +1,12 @@
+# Netbeans builds lots of codeless jars on purpose, so don't warn us about them
+libnb-platform13-java: codeless-jar
+
+# Netbeans uses relative paths in its jar files. It would be too much work to 
+# fix this so we instead put symlinks in the right place. This is useful when 
+# you build a package to export too.
+libnb-platform13-java: classpath-contains-relative-path
+
+# This is a library package in the sense that it doesn't by itself provide an 
+# application. But the jar files don't live in /usr/share/java since they are 
+# specific to the NetBeans platform and need to live in a "cluster"
+libnb-platform13-java: javalib-but-no-public-jars
diff --git a/debian/linked-jars b/debian/linked-jars
new file mode 100644
index 0000000..e9ed3b4
--- /dev/null
+++ b/debian/linked-jars
@@ -0,0 +1,47 @@
+$JAVADIR/jemmy2.jar jemmy/external harness/modules/ext jemmy-2.3.0.0.jar
+$JAVADIR/jsearch.jar apisupport.harness/external harness/antlib jsearch-2.0_05.jar
+$JAVADIR/bindex.jar apisupport.harness/external harness/antlib bindex-2.2.jar
+
+$JAVADIR/swing-layout.jar o.jdesktop.layout/external platform/modules/ext swing-layout-1.0.4.jar
+$JAVADIR/jhall.jar javahelp/external platform/modules/ext jhall-2.0_05.jar
+$JAVADIR/jna.jar libs.jna/external platform/modules/ext jna-3.2.7.jar
+$JAVADIR/jna-platform.jar core.nativeaccess/external platform/modules/ext platform-3.2.7.jar
+$JAVADIR/org.apache.felix.framework.jar libs.felix/external platform/modules/ext felix-2.0.3.jar
+$JAVADIR/org.apache.felix.main.jar libs.felix/external platform/modules/ext felix-main-2.0.2.jar
+$JAVADIR/org.eclipse.osgi.services.jar libs.osgi/external platform/modules/ext osgi.cmpn-4.2.jar
+$JAVADIR/antlr3.jar libs.antlr3.devel/external platform/modules/ext antlr-3.1.3.jar
+$JAVADIR/stringtemplate.jar libs.antlr3.devel/external platform/modules/ext stringtemplate-3.2.jar
+$JAVADIR/junit4.jar libs.junit4/external platform/modules/ext junit-4.8.2.jar
+$JAVADIR/hamcrest-core.jar libs.junit4/external platform/modules/ext hamcrest-core.jar
+
+$JAVADIR/antlr3-runtime.jar libs.antlr3.runtime/external ide/modules/ext antlr-runtime-3.1.3.jar
+$JAVADIR/commons-codec.jar libs.commons_codec/external ide/modules/ext apache-commons-codec-1.3.jar
+$JAVADIR/bytelist.jar libs.bytelist/external ide/modules/ext bytelist-0.1.jar
+$JAVADIR/commons-logging.jar libs.commons_logging/external ide/modules/ext commons-logging-1.1.jar
+$JAVADIR/commons-net.jar libs.commons_net/external ide/modules/ext commons-net-1.4.1.jar
+$JAVADIR/flute-1.3-jfree.jar css.visual/external ide/modules/ext flute-1.3.jar
+$JAVADIR/freemarker.jar libs.freemarker/external ide/modules/ext freemarker-2.3.8.jar
+$JAVADIR/ini4j.jar libs.ini4j/external ide/modules/ext ini4j-0.5.1.jar
+$JAVADIR/oro.jar libs.jakarta_oro/external ide/modules/ext jakarta-oro-2.0.8.jar
+$JAVADIR/jsch.jar libs.jsch/external ide/modules/ext jsch-0.1.44.jar
+$JAVADIR/jvyamlb.jar libs.jvyamlb/external ide/modules/ext jvyamlb-0.2.3.jar
+$JAVADIR/jzlib.jar libs.jzlib/external ide/modules/ext jzlib-1.0.7.jar
+$JAVADIR/lucene-core.jar libs.lucene/external ide/modules/ext lucene-core-3.0.3.jar
+$JAVADIR/xml-resolver-1.2.jar o.apache.xml.resolver/external ide/modules/ext resolver-1.2.jar
+$JAVADIR/sac.jar css.visual/external ide/modules/ext sac-1.3.jar
+$JAVADIR/servlet-api-2.5.jar servletapi/external ide/modules/ext servlet-2.2.jar
+$JAVADIR/svnClientAdapter.jar libs.svnClientAdapter/external ide/modules/ext svnClientAdapter-main-1.6.13.jar
+$JAVADIR/svn-javahl.jar libs.svnClientAdapter.javahl/external ide/modules/ext svnjavahl-1.6.0.jar
+$JAVADIR/svnkit.jar libs.svnClientAdapter.svnkit/external ide/modules/ext svnkit-1.3.4.jar
+$JAVADIR/svnkit-javahl.jar libs.svnClientAdapter.svnkit/external ide/modules/ext svnkit-javahl.jar
+$JAVADIR/swingx.jar libs.swingx/external ide/modules/ext swingx-0.9.5.jar
+$JAVADIR/trilead-ssh2.jar libs.svnClientAdapter.svnkit/external ide/modules/ext trilead.jar
+$JAVADIR/simple-validation.jar swing.validation/external ide/modules/ext ValidationAPI.jar
+$JAVADIR/xercesImpl.jar libs.xerces/external ide/modules/ext xerces-2.8.0.jar
+
+$JAVADIR/bsaf.jar swingapp/external java/modules/ext appframework-1.0.3.jar
+$JAVADIR/beansbinding.jar o.jdesktop.beansbinding/external java/modules/ext beansbinding-1.2.1.jar
+$JAVADIR/cglib.jar libs.cglib/external java/modules/ext cglib-2.2.jar
+$JAVADIR/javac-api.jar libs.javacapi/external java/modules/ext javac-api-nb-7.0-b07.jar
+$JAVADIR/javac-impl.jar libs.javacimpl/external java/modules/ext javac-impl-nb-7.0-b07.jar
+$JAVA_HOME/jre/lib/rt.jar swingapp/external java/modules/ext swing-worker-1.1.jar
diff --git a/debian/netbeans.desktop b/debian/netbeans.desktop
index a4f5829..d42b036 100644
--- a/debian/netbeans.desktop
+++ b/debian/netbeans.desktop
@@ -1,9 +1,9 @@
 [Desktop Entry]
-Name=NetBeans IDE 6.9
+Name=NetBeans IDE 7.0
 Comment=Integrated Development Environment
 TryExec=/usr/bin/netbeans
 Exec=/usr/bin/netbeans
-Icon=/usr/share/netbeans/6.9/nb/netbeans.png
+Icon=/usr/share/netbeans/7.0/nb/netbeans.png
 Categories=Development;IDE;Java;
 Terminal=false
 Type=Application
diff --git a/debian/orig-tar.sh b/debian/orig-tar.sh
new file mode 100755
index 0000000..70b18ac
--- /dev/null
+++ b/debian/orig-tar.sh
@@ -0,0 +1,143 @@
+#!/bin/bash -e
+
+VERSION=$2
+FILE=$3
+
+FILENAME=`basename $FILE`
+BASE=`basename $FILE .zip`
+DIR=`dirname $FILE`
+
+if [ "x$BASE.zip" != "x$FILENAME" ]
+then
+# The file isn't the real file, but we can use it to find the real
+# file and download it.
+    SITE="http://dlc.sun.com.edgesuite.net/netbeans/$VERSION/final/zip/"
+    DL_FILE=`perl -ne 'if(/HREF="(netbeans-[0-9.]+-\d+-src.zip)"/) {print $1."\n" }' $FILE`
+    rm -f $FILE
+    FILE="$DIR/$DL_FILE"
+
+    if [ ! -e $FILE ] 
+    then
+	echo "Downloading real file $DL_FILE from $SITE"
+	wget -O "$FILE" "$SITE/$DL_FILE"
+    fi
+
+fi
+
+TAR=../netbeans_$VERSION+dfsg1.orig.tar.gz
+# Resolve symbolic links
+FILE=`readlink -f $FILE`
+BASE="netbeans-$VERSION"
+
+echo "Extracting zip file..."
+mkdir $BASE
+unzip -q -d $BASE $FILE
+
+echo "Cleaning source code..."
+
+# Remove jar files - we'll use debian packaged jars from
+# /usr/share/java
+find $BASE/ -name "*.jar" -type f -execdir rm \{\} \;
+
+# Remove windows executables and libraries - we'll try and build those
+# which we need.
+find $BASE/ \( -name "*.exe" -o -name "*.dll" -o -name "*.res" \) -execdir rm \{\} \;
+
+# Remove Visual Studio files
+find $BASE/ \( -name "*.sln" -o -name "*.suo" -o -name "*.ncb" -o -name "*.idb" \) -execdir rm \{\} \;
+
+# Remove Mac specific files. We can't regenerate these.
+find $BASE/ \( -name "*.dylib" -o -name "*.dmg" -o -name "objects.nib" \) -execdir rm \{\} \;
+
+# Remove shared library (.so) files. Hopefully we don't need them
+find $BASE/ -name "*.so" -type f -execdir rm \{\} \;
+
+# remove unzipsfx binaries
+find $BASE/ -name "unzipsfx" -type f -execdir rm \{\} \;
+
+# Remove files containing serialized java objects (maybe we can
+# re-create these if we need)
+find $BASE/ -name "*.ser" -type f -execdir rm \{\} \;
+
+# Remove class files
+find $BASE/ -name "*.class" -type f -execdir rm \{\} \;
+
+# Remove some files where it's not clear how they were generated, and
+# which we (hopefully) don't need
+find $BASE/ -name "url.url" -type f -execdir rm \{\} \;
+find $BASE/ -name "unrecognized" -type f -execdir rm \{\} \;
+
+# Remove all the .nbm files. They are only used in unit testing, and
+# we'd ideally need to generate them as part of the build.
+find $BASE/ -name "*.nbm" -type f -execdir rm \{\} \;
+
+# Remove object files
+find $BASE/ -name "*.o" -type f -execdir rm \{\} \;
+
+# Remove .data files
+find $BASE/ -name "*.data" -type f -execdir rm \{\} \;
+
+# Remove data files
+find $BASE/ -name "data" -type f -execdir rm \{\} \;
+
+# Remove .bin files
+find $BASE/ -name "*.bin" -type f -execdir rm \{\} \;
+
+# Remove .cfs files
+find $BASE/ -name "*.cfs" -type f -execdir rm \{\} \;
+
+# Remove .gen files
+find $BASE/ -name "*.gen" -type f -execdir rm \{\} \;
+
+# Remove .gen files
+find $BASE/ -name "segments_2" -type f -execdir rm \{\} \;
+
+# Remove some ELF binaries
+rm -rf $BASE/dlight.tools/release/tools/*
+
+find $BASE/cnd.gizmo/test/unit/data/org/netbeans/modules/cnd/gizmo/addr2line/ -not -name "*.bash" -type f -execdir rm \{\} \;
+find $BASE/ -name "*.sl" -type f -execdir rm \{\} \;
+find $BASE/ -name "*.jnilib" -type f -execdir rm \{\} \;
+find $BASE/dlight.nativeexecution/release/bin/nativeexecution/ -not -name "*.sh" -type f -execdir rm \{\} \;
+
+rm -f $BASE/cnd.dwarfdiscovery/test/unit/data/org/netbeans/modules/cnd/dwarfdiscovery/provider/*
+
+# Remove framemaker files and the pdf they build, since we can't edit them
+# with software in Debian.
+rm -f $BASE/usersguide/tutorials/j2ee-tut/fm/*
+
+# remove .gz files. We could re-create at least some if we need, but they're only
+# used in unit tests.
+find $BASE/ -name "*.gz" -type f -execdir rm \{\} \;
+
+# Remove .warContent files since they are binary files we can't build.
+find $BASE/ -name "*.warContent" -type f -execdir rm \{\} \;
+
+# Remove .jts media files as we don't appear to have a codec for them
+find $BASE/ -name "*.jts" -type f -execdir rm \{\} \;
+
+# Remove .pdf media files. We can recreate the ones in ide.branding
+find $BASE/ -name "*.pdf" -type f -execdir rm \{\} \;
+
+# Remove binary .out files.
+find $BASE/ -name "*.out" -type f -execdir rm \{\} \;
+
+# Remove zip files. We'll have to reproduce some.
+find $BASE/ -name "*.zip" -type f -execdir rm \{\} \;
+find $BASE/ -name "*.cap" -type f -execdir rm \{\} \;
+find $BASE/ -name "*.eap" -type f -execdir rm \{\} \;
+find $BASE/ -name "*.war" -type f -execdir rm \{\} \;
+find $BASE/ -name "*.ear" -type f -execdir rm \{\} \;
+
+
+# Remove bits of a version control repository
+rm -rf $BASE/versioning.util/test/unit/data/
+
+
+# Make our ".orig.tar.gz"
+tar -czf $TAR $BASE
+
+# Remove our unpack directory
+rm -rf $BASE
+
+echo "Done."
diff --git a/debian/patches/netbeans-6.9~00-updatecenters.patch b/debian/patches/netbeans-6.9~00-updatecenters.patch
deleted file mode 100644
index f4edead..0000000
--- a/debian/patches/netbeans-6.9~00-updatecenters.patch
+++ /dev/null
@@ -1,44 +0,0 @@
---- a/updatecenters/src/org/netbeans/modules/updatecenters/resources/Bundle.properties
-+++ b/updatecenters/src/org/netbeans/modules/updatecenters/resources/Bundle.properties
-@@ -53,9 +53,11 @@
- Services/AutoupdateType/beta-update-provider.instance=NetBeans Beta
- Services/AutoupdateType/thirdparty-update-provider.instance=3rd Party Plugins
- Services/AutoupdateType/pluginportal-update-provider.instance=Plugin Portal
-+Services/AutoupdateType/standard-update-provider-ubuntu.instance=NetBeans for Ubuntu
- #NOI18N
- URL_Standard=http://updates.netbeans.org/netbeans/updates/6.9/uc/final/stable/catalog.xml.gz?{$netbeans.hash.code}
- URL_Beta=http://updates.netbeans.org/netbeans/updates/6.9/uc/final/beta/catalog.xml.gz?{$netbeans.hash.code}
- URL_ThirdParty=http://updates.netbeans.org/netbeans/updates/6.9/uc/final/thirdparty/catalog.xml.gz?{$netbeans.hash.code}
- URL_PluginPortal=http://plugins.netbeans.org/nbpluginportal/updates/6.9/catalog.xml.gz
-+URL_Standard_Ubuntu=http://updates.netbeans.org/netbeans/updates/6.9/uc/final/ubuntu/catalog.xml.gz?{$netbeans.hash.code}
- 
---- a/updatecenters/src/org/netbeans/modules/updatecenters/resources/mf-layer.xml
-+++ b/updatecenters/src/org/netbeans/modules/updatecenters/resources/mf-layer.xml
-@@ -55,7 +55,7 @@
-         <attr name="iconBase" stringvalue="org/netbeans/modules/updatecenters/resources/updateAction.gif"/>
-         <attr name="url" bundlevalue="org.netbeans.modules.updatecenters.resources.Bundle#URL_Standard"/>
-         <attr name="category" stringvalue="STANDARD"/>
--        <attr name="enabled" boolvalue="true"/>
-+        <attr name="enabled" boolvalue="false"/>
-         <attr name="instanceOf" stringvalue="org.netbeans.spi.autoupdate.UpdateProvider" />
-         <attr name="instanceCreate" methodvalue="org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogFactory.createUpdateProvider" />
-       </file>
-@@ -89,7 +89,17 @@
-         <attr name="instanceOf" stringvalue="org.netbeans.spi.autoupdate.UpdateProvider" />
-         <attr name="instanceCreate" methodvalue="org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogFactory.createUpdateProvider" />
-       </file>
--      
-+       
-+      <file name="standard-update-provider-ubuntu.instance">
-+        <attr name="SystemFileSystem.localizingBundle" stringvalue="org.netbeans.modules.updatecenters.resources.Bundle"/>
-+        <attr name="SystemFileSystem.icon" urlvalue="nbresloc:/org/netbeans/modules/updatecenters/resources/updateAction.gif"/>
-+        <attr name="url_key" stringvalue="URL_Standard_Ubuntu"/>
-+        <attr name="category" stringvalue="STANDARD"/>
-+        <attr name="enabled" boolvalue="true"/>
-+        <attr name="instanceOf" stringvalue="org.netbeans.spi.autoupdate.UpdateProvider" />
-+        <attr name="instanceCreate" methodvalue="org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogFactory.createUpdateProvider" />
-+      </file>
-+
-    </folder>
-     
-   </folder> <!-- Services -->
diff --git a/debian/patches/netbeans-6.9~10-o.apache.tools.ant.module.patch b/debian/patches/netbeans-6.9~10-o.apache.tools.ant.module.patch
deleted file mode 100644
index 82baabe..0000000
--- a/debian/patches/netbeans-6.9~10-o.apache.tools.ant.module.patch
+++ /dev/null
@@ -1,30 +0,0 @@
---- a/o.apache.tools.ant.module/build.xml
-+++ b/o.apache.tools.ant.module/build.xml
-@@ -78,6 +78,7 @@
-     </target>
- 
-     <target name="netbeans-extra" depends="jar-bridge">
-+<!--
-         <mkdir dir="${cluster}/ant/lib"/>
-         <copy todir="${cluster}/ant/lib">
-             <fileset dir="external/lib"/>
-@@ -87,6 +88,7 @@
-                 <include name="ant-misc-*.zip"/>
-             </fileset>
-         </unzip>
-+-->
-     </target>
- 
-     <target name="test-build" depends="jar-bridge,projectized-common.test-build"/>
---- a/o.apache.tools.ant.module/external/build.xml
-+++ b/o.apache.tools.ant.module/external/build.xml
-@@ -45,7 +45,9 @@
- -->
- <project name="o.apache.tools.ant.module/external" default="unzip" basedir=".">
-     <target name="unzip">
-+<!--
-         <unzip src="ant-libs-1.8.0.zip" dest="lib"/>
-+-->
-     </target>
-     <target name="clean">
-         <delete dir="lib"/>
diff --git a/debian/patches/netbeans-6.9~30-build-xml.patch b/debian/patches/netbeans-6.9~30-build-xml.patch
deleted file mode 100644
index b6f6ba1..0000000
--- a/debian/patches/netbeans-6.9~30-build-xml.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- a/nbbuild/build.xml
-+++ b/nbbuild/build.xml
-@@ -149,7 +149,6 @@
- 
-   <target name="init-module-list" depends="bootstrap,init-tasks">
-     <!-- Define modules. -->
--    <checkmoduleconfigs nbroot=".."/>
-     <resolvelist name="allmodules" list="${nb.clusters.list}"/>
-     <pathconvert property="modules.fullpath" >
-         <path>
-@@ -299,7 +298,6 @@
-     <mkdir dir="${netbeans.dest.dir}/bin" />
-     <copy file="../ide/launcher/unix/netbeans" todir="${netbeans.dest.dir}/bin" />
-     <chmod file="${netbeans.dest.dir}/bin/netbeans" perm="ugo+rx"/>
--    <copy file="../ide/launcher/windows/netbeans.exe" todir="${netbeans.dest.dir}/bin" />
-     <!-- if anybody knows better place for icons, let me know: jtulach at netbeans.org -->
- 
-     <mkdir dir="${netbeans.dest.dir}/etc" />
diff --git a/debian/patches/netbeans-6.9~40-ide-launcher.patch b/debian/patches/netbeans-6.9~40-ide-launcher.patch
deleted file mode 100644
index 6b4745e..0000000
--- a/debian/patches/netbeans-6.9~40-ide-launcher.patch
+++ /dev/null
@@ -1,51 +0,0 @@
---- a/ide/launcher/unix/netbeans
-+++ b/ide/launcher/unix/netbeans
-@@ -41,6 +41,17 @@
- # Version 2 license, then the option applies only if the new code is
- # made subject to such option by the copyright holder.
- 
-+# The Startup Notification Protocol Specification established by freedesktop.org
-+# recommends to unset the DESKTOP_STARTUP_ID environment variable to avoid
-+# possible reuse by some process started later by this process, e.g. when a browser
-+# will be started after clicking a hyperlink in the NetBeans.
-+if [ ! -z $DESKTOP_STARTUP_ID ] ; then
-+    # Save a value for later using in the NB_DESKTOP_STARTUP_ID
-+    NB_DESKTOP_STARTUP_ID=$DESKTOP_STARTUP_ID; export NB_DESKTOP_STARTUP_ID
-+
-+    unset DESKTOP_STARTUP_ID
-+fi
-+
- #
- # resolve symlinks
- #
-@@ -57,16 +68,18 @@
-     fi
- done
- 
--progdir=`dirname "$PRG"`
-+#progdir=`dirname "$PRG"`
-+# Patch for Debian/Ubuntu/Fedora where launcher is in /usr/bin
-+progdir=/usr/share/netbeans/6.9/bin
- 
- if [ -f "$progdir"/../etc/netbeans.conf ] ; then
-     . "$progdir"/../etc/netbeans.conf
- fi
- 
- # following should be done just in RPM or Solaris Launcher
--# if [ -f /etc/netbeans.conf ] ; then
--#     . /etc/netbeans.conf
--# fi
-+if [ -f /etc/netbeans.conf ] ; then
-+     . /etc/netbeans.conf
-+fi
- 
- 
- # #68373: look for userdir, but do not modify "$@"
-@@ -198,7 +211,6 @@
-             --branding nb \
-             --clusters '"$netbeans_clusters"' \
-             -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade \
--            -J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense \
-             ${netbeans_default_options} \
-             '"$@"'
-         ;;
diff --git a/debian/patches/netbeans-6.9~41-log4j-classpath.patch b/debian/patches/netbeans-6.9~41-log4j-classpath.patch
deleted file mode 100644
index ac59cad..0000000
--- a/debian/patches/netbeans-6.9~41-log4j-classpath.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- a/ide/launcher/unix/netbeans
-+++ b/ide/launcher/unix/netbeans
-@@ -211,6 +211,7 @@
-             --branding nb \
-             --clusters '"$netbeans_clusters"' \
-             -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade \
-+            --cp:p /usr/share/java/log4j-1.2.jar \
-             ${netbeans_default_options} \
-             '"$@"'
-         ;;
diff --git a/debian/patches/netbeans-6.9~50-build-copy.patch b/debian/patches/netbeans-6.9~50-build-copy.patch
deleted file mode 100644
index cf5225a..0000000
--- a/debian/patches/netbeans-6.9~50-build-copy.patch
+++ /dev/null
@@ -1,264 +0,0 @@
---- a/css.editor/nbproject/project.properties
-+++ b/css.editor/nbproject/project.properties
-@@ -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.
- 
--release.external/css21-spec.zip=docs/css21-spec.zip
-+#release.external/css21-spec.zip=docs/css21-spec.zip
- jnlp.indirect.jars=docs/css21-spec.zip
- 
- javac.compilerargs=-Xlint -Xlint:-serial
---- a/html.editor/nbproject/project.properties
-+++ b/html.editor/nbproject/project.properties
-@@ -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.
- 
--release.external/html-4.01.zip=docs/html-4.01.zip
-+#release.external/html-4.01.zip=docs/html-4.01.zip
- 
- javac.compilerargs=-Xlint:unchecked
- javac.source=1.6
---- a/junit/nbproject/project.properties
-+++ b/junit/nbproject/project.properties
-@@ -45,11 +45,11 @@
- javadoc.arch=${basedir}/arch.xml
- javadoc.apichanges=${basedir}/apichanges.xml
- 
--release.external/junit-3.8.2.jar=modules/ext/junit-3.8.2.jar
--release.external/junit-3.8.2-api.zip=docs/junit-3.8.2-api.zip
--release.external/junit-4.5-api.zip=docs/junit-4.5-api.zip
--release.external/junit-4.5-src.jar=docs/junit-4.5-src.jar
--release.external/Ant-1.8.0-binary-patch-72080.jar=ant/patches/72080.jar
-+#release.external/junit-3.8.2.jar=modules/ext/junit-3.8.2.jar
-+#release.external/junit-3.8.2-api.zip=docs/junit-3.8.2-api.zip
-+#release.external/junit-4.5-api.zip=docs/junit-4.5-api.zip
-+#release.external/junit-4.5-src.jar=docs/junit-4.5-src.jar
-+#release.external/Ant-1.8.0-binary-patch-72080.jar=ant/patches/72080.jar
- 
- # XXX AntBridge.createMainClassPath probably would not find this anyway:
- jnlp.verify.excludes=ant/patches/72080.jar
---- a/libs.bytelist/nbproject/project.properties
-+++ b/libs.bytelist/nbproject/project.properties
-@@ -41,5 +41,5 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/bytelist-0.1.jar=modules/ext/bytelist-0.1.jar
-+#release.external/bytelist-0.1.jar=modules/ext/bytelist-0.1.jar
- spec.version.base=0.7.1
---- a/libs.commons_logging/nbproject/project.properties
-+++ b/libs.commons_logging/nbproject/project.properties
-@@ -41,5 +41,5 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/commons-logging-1.1.jar=modules/ext/commons-logging-1.1.jar
-+#release.external/commons-logging-1.1.jar=modules/ext/commons-logging-1.1.jar
- spec.version.base=1.13.1
---- a/libs.commons_net/nbproject/project.properties
-+++ b/libs.commons_net/nbproject/project.properties
-@@ -41,5 +41,5 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/commons-net-1.4.1.jar=modules/ext/commons-net-1.4.1.jar
-+#release.external/commons-net-1.4.1.jar=modules/ext/commons-net-1.4.1.jar
- spec.version.base=1.8.1
---- a/libs.freemarker/nbproject/project.properties
-+++ b/libs.freemarker/nbproject/project.properties
-@@ -44,6 +44,6 @@
- 
- javac.compilerargs=-Xlint:unchecked
- javac.source=1.6
--release.external/freemarker-2.3.8.jar=modules/ext/freemarker-2.3.8.jar
-+#release.external/freemarker-2.3.8.jar=modules/ext/freemarker-2.3.8.jar
- module.jar.verifylinkageignores=freemarker.((ext.ant.FreemarkerXmlTask)|(template.DefaultObjectWrapper))
- spec.version.base=2.11.1
---- a/libs.ini4j/nbproject/project.properties
-+++ b/libs.ini4j/nbproject/project.properties
-@@ -41,7 +41,7 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/ini4j-0.4.1.jar=modules/ext/ini4j-0.4.1.jar
-+#release.external/ini4j-0.4.1.jar=modules/ext/ini4j-0.4.1.jar
- module.jar.verifylinkageignores=org.ini4j.IniPreferencesFactoryListener
- 
- # Fatal error: class javax.servlet.ServletContextListener not found
---- a/libs.jakarta_oro/nbproject/project.properties
-+++ b/libs.jakarta_oro/nbproject/project.properties
-@@ -41,5 +41,5 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/jakarta-oro-2.0.8.jar=modules/ext/jakarta-oro-2.0.8.jar
-+#release.external/jakarta-oro-2.0.8.jar=modules/ext/jakarta-oro-2.0.8.jar
- spec.version.base=1.7.1
---- a/libs.javacapi/nbproject/project.properties
-+++ b/libs.javacapi/nbproject/project.properties
-@@ -47,6 +47,6 @@
- nbm.homepage=http://jackpot.netbeans.org/
- nbm.module.author=Petr Hrebejk, Sun Microsystems, Inc.
- spec.version.base=0.13.1
--release.external/javac-api-nb-7.0-b07.jar=modules/ext/javac-api-nb-7.0-b07.jar
-+#release.external/javac-api-nb-7.0-b07.jar=modules/ext/javac-api-nb-7.0-b07.jar
- javadoc.arch=${basedir}/arch.xml
- module.javadoc.packages=com.sun.source.tree,com.sun.source.util
---- a/libs.javacimpl/nbproject/project.properties
-+++ b/libs.javacimpl/nbproject/project.properties
-@@ -44,7 +44,7 @@
- nbm.homepage=http://jackpot.netbeans.org/
- nbm.module.author=Petr Hrebejk, Sun Microsystems, Inc.
- spec.version.base=0.16.1
--release.external/javac-impl-nb-7.0-b07.jar=modules/ext/javac-impl-nb-7.0-b07.jar
-+#release.external/javac-impl-nb-7.0-b07.jar=modules/ext/javac-impl-nb-7.0-b07.jar
- javadoc.arch=${basedir}/arch.xml
- 
- 
---- a/libs.jna/nbproject/project.properties
-+++ b/libs.jna/nbproject/project.properties
-@@ -40,4 +40,4 @@
- # Version 2 license, then the option applies only if the new code is
- # made subject to such option by the copyright holder.
- 
--release.external/jna-3.0.9.jar=modules/ext/jna-3.0.9.jar
-+#release.external/jna-3.0.9.jar=modules/ext/jna-3.0.9.jar
---- a/libs.jsch/nbproject/project.properties
-+++ b/libs.jsch/nbproject/project.properties
-@@ -41,6 +41,6 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/jsch-0.1.41.jar=modules/ext/jsch-0.1.41.jar
-+#release.external/jsch-0.1.41.jar=modules/ext/jsch-0.1.41.jar
- sigtest.gen.fail.on.error=false
- 
---- a/libs.junit4/nbproject/project.properties
-+++ b/libs.junit4/nbproject/project.properties
-@@ -41,7 +41,7 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/junit-4.5.jar=modules/ext/junit-4.5.jar
-+#release.external/junit-4.5.jar=modules/ext/junit-4.5.jar
- 
- 
- sigtest.skip.check=true
---- a/libs.jvyamlb/nbproject/project.properties
-+++ b/libs.jvyamlb/nbproject/project.properties
-@@ -41,6 +41,6 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/jvyamlb-0.2.3.jar=modules/ext/jvyamlb-0.2.3.jar
-+#release.external/jvyamlb-0.2.3.jar=modules/ext/jvyamlb-0.2.3.jar
- 
- sigtest.gen.fail.on.error=false
---- a/libs.jzlib/nbproject/project.properties
-+++ b/libs.jzlib/nbproject/project.properties
-@@ -41,6 +41,6 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/jzlib-1.0.7.jar=modules/ext/jzlib-1.0.7.jar
-+#release.external/jzlib-1.0.7.jar=modules/ext/jzlib-1.0.7.jar
- spec.version.base=1.4.1
- sigtest.gen.fail.on.error=false
---- a/libs.lucene/nbproject/project.properties
-+++ b/libs.lucene/nbproject/project.properties
-@@ -41,5 +41,5 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/lucene-core-2.4.1.jar=modules/ext/lucene-core-2.4.1.jar
-+#release.external/lucene-core-2.4.1.jar=modules/ext/lucene-core-2.4.1.jar
- spec.version.base=2.10.1
---- a/libs.svnClientAdapter/nbproject/project.properties
-+++ b/libs.svnClientAdapter/nbproject/project.properties
-@@ -43,8 +43,8 @@
- is.autoload=true
- 
- javac.source=1.6
--release.external/svnClientAdapter-1.6.0.jar=modules/ext/svnClientAdapter-1.6.0.jar
--release.external/svnjavahl-1.6.0.jar=modules/ext/svnjavahl-1.6.0.jar
-+#release.external/svnClientAdapter-1.6.0.jar=modules/ext/svnClientAdapter-1.6.0.jar
-+#release.external/svnjavahl-1.6.0.jar=modules/ext/svnjavahl-1.6.0.jar
- 
- # Hidden class found: org.tigris.subversion.svnclientadapter.commandline.CommandLine$CmdArguments in method protected byte[] org.tigris.subversion.svnclientadapter.commandline.SvnCommandLine.execBytes(org.tigris.subversion.svnclientadapter.commandline.CommandLine$CmdArguments,boolean) throws java.lang.Exception in class org.tigris.subversion.svnclientadapter.commandline.SvnCommandLine
- # Hidden class found: org.tigris.subversion.svnclientadapter.commandline.CommandLine$CmdArguments in method protected java.lang.String org.tigris.subversion.svnclientadapter.commandline.SvnAdminCommandLine.execString(org.tigris.subversion.svnclientadapter.commandline.CommandLine$CmdArguments,boolean) throws java.lang.Exception in class org.tigris.subversion.svnclientadapter.commandline.SvnAdminCommandLine
---- a/libs.swingx/nbproject/project.properties
-+++ b/libs.swingx/nbproject/project.properties
-@@ -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.
- 
--release.external/swingx-0.9.5.jar=modules/ext/swingx-0.9.5.jar
-+#release.external/swingx-0.9.5.jar=modules/ext/swingx-0.9.5.jar
- sigtest.gen.fail.on.error=false
- 
---- a/libs.xerces/nbproject/project.properties
-+++ b/libs.xerces/nbproject/project.properties
-@@ -41,6 +41,6 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/xerces-2.8.0.jar=modules/ext/xerces-2.8.0.jar
-+#release.external/xerces-2.8.0.jar=modules/ext/xerces-2.8.0.jar
- module.jar.verifylinkageignores=org.apache.xerces.util.XMLCatalogResolver
- spec.version.base=1.18.1
---- a/o.apache.xml.resolver/nbproject/project.properties
-+++ b/o.apache.xml.resolver/nbproject/project.properties
-@@ -41,5 +41,5 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/resolver-1.2.jar=modules/ext/resolver-1.2.jar
-+#release.external/resolver-1.2.jar=modules/ext/resolver-1.2.jar
- spec.version.base=1.11.1
---- a/o.jdesktop.beansbinding/nbproject/project.properties
-+++ b/o.jdesktop.beansbinding/nbproject/project.properties
-@@ -41,7 +41,7 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/beansbinding-1.2.1.jar=modules/ext/beansbinding-1.2.1.jar
--release.external/beansbinding-1.2.1-doc.zip=docs/beansbinding-1.2.1-doc.zip
-+#release.external/beansbinding-1.2.1.jar=modules/ext/beansbinding-1.2.1.jar
-+#release.external/beansbinding-1.2.1-doc.zip=docs/beansbinding-1.2.1-doc.zip
- jnlp.indirect.jars=docs/beansbinding-1.2.1-doc.zip
- spec.version.base=1.7.1
---- a/o.jdesktop.layout/nbproject/project.properties
-+++ b/o.jdesktop.layout/nbproject/project.properties
-@@ -41,7 +41,7 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/swing-layout-1.0.4.jar=modules/ext/swing-layout-1.0.4.jar
--release.external/swing-layout-1.0.4-doc.zip=docs/swing-layout-1.0.4-doc.zip
--release.external/swing-layout-1.0.4-src.zip=docs/swing-layout-1.0.4-src.zip
-+#release.external/swing-layout-1.0.4.jar=modules/ext/swing-layout-1.0.4.jar
-+#release.external/swing-layout-1.0.4-doc.zip=docs/swing-layout-1.0.4-doc.zip
-+#release.external/swing-layout-1.0.4-src.zip=docs/swing-layout-1.0.4-src.zip
- jnlp.indirect.jars=docs/swing-layout-1.0.4-doc.zip, docs/swing-layout-1.0.4-src.zip
---- a/servletapi/nbproject/project.properties
-+++ b/servletapi/nbproject/project.properties
-@@ -41,4 +41,4 @@
- # made subject to such option by the copyright holder.
- 
- is.autoload=true
--release.external/servlet-2.2.jar=modules/ext/servlet-2.2.jar
-+#release.external/servlet-2.2.jar=modules/ext/servlet-2.2.jar
---- a/swingapp/nbproject/project.properties
-+++ b/swingapp/nbproject/project.properties
-@@ -1,6 +1,6 @@
--extra.module.files=modules/ext/appframework-1.0.3.jar,\
--                   docs/appframework-1.0.3-doc.zip,\
--                   modules/ext/swing-worker-1.1.jar
-+#extra.module.files=modules/ext/appframework-1.0.3.jar,\
-+#                   docs/appframework-1.0.3-doc.zip,\
-+#                   modules/ext/swing-worker-1.1.jar
- jnlp.indirect.jars=docs/appframework-1.0.3-doc.zip
- javac.source=1.6
- spec.version.base=1.9.1
diff --git a/debian/patches/netbeans-6.9~60-nosvnkit.patch b/debian/patches/netbeans-6.9~60-nosvnkit.patch
deleted file mode 100644
index cf8d5e2..0000000
--- a/debian/patches/netbeans-6.9~60-nosvnkit.patch
+++ /dev/null
@@ -1,33 +0,0 @@
---- a/libs.svnClientAdapter/src/org/netbeans/libs/svnclientadapter/SvnClientAdapterFactory.java
-+++ b/libs.svnClientAdapter/src/org/netbeans/libs/svnclientadapter/SvnClientAdapterFactory.java
-@@ -48,7 +48,7 @@
- import org.tigris.subversion.svnclientadapter.SVNClientException;
- import org.tigris.subversion.svnclientadapter.javahl.JhlClientAdapter;
- import org.tigris.subversion.svnclientadapter.javahl.JhlClientAdapterFactory;
--import org.tigris.subversion.svnclientadapter.svnkit.SvnKitClientAdapterFactory;
-+//import org.tigris.subversion.svnclientadapter.svnkit.SvnKitClientAdapterFactory;
- 
- /**
-  *
-@@ -101,8 +101,9 @@
-                 return JhlClientAdapterFactory.isAvailable();
-             }
-             case svnkit: {
--                SvnKitClientAdapterFactory.setup();
--                return SvnKitClientAdapterFactory.isAvailable();
-+//                SvnKitClientAdapterFactory.setup();
-+//                return SvnKitClientAdapterFactory.isAvailable();
-+                return false;
-             }
-         }
-         return false;
-@@ -114,7 +115,8 @@
-                 return JhlClientAdapterFactory.createSVNClient(JhlClientAdapterFactory.JAVAHL_CLIENT);
-             }
-             case svnkit: {
--                return SvnKitClientAdapterFactory.createSVNClient(SvnKitClientAdapterFactory.SVNKIT_CLIENT); 
-+//                return SvnKitClientAdapterFactory.createSVNClient(SvnKitClientAdapterFactory.SVNKIT_CLIENT);
-+                return null;
-             }
-         }
-         return null;
diff --git a/debian/patches/netbeans-6.9~70-small-ide-cluster.patch b/debian/patches/netbeans-6.9~70-small-ide-cluster.patch
deleted file mode 100644
index de27118..0000000
--- a/debian/patches/netbeans-6.9~70-small-ide-cluster.patch
+++ /dev/null
@@ -1,165 +0,0 @@
---- a/apisupport.kit/nbproject/project.xml
-+++ b/apisupport.kit/nbproject/project.xml
-@@ -12,41 +12,16 @@
-                     </run-dependency>
-                 </dependency>
-                 <dependency>
--                    <code-name-base>org.netbeans.modules.apisupport.crudsample</code-name-base>
--                    <run-dependency>
--                        <specification-version>1.0</specification-version>
--                    </run-dependency>
--                </dependency>
--                <dependency>
--                    <code-name-base>org.netbeans.modules.apisupport.feedreader</code-name-base>
--                    <run-dependency>
--                        <release-version>1</release-version>
--                        <specification-version>1.4</specification-version>
--                    </run-dependency>
--                </dependency>
--                <dependency>
-                     <code-name-base>org.netbeans.modules.apisupport.harness</code-name-base>
-                     <run-dependency>
-                         <specification-version>1.10</specification-version>
-                     </run-dependency>
-                 </dependency>
-                 <dependency>
--                    <code-name-base>org.netbeans.modules.apisupport.installer</code-name-base>
--                    <run-dependency>
--                        <specification-version>1.0</specification-version>
--                    </run-dependency>
--                </dependency>
--                <dependency>
-                     <code-name-base>org.netbeans.modules.apisupport.osgidemo</code-name-base>
-                     <run-dependency>
-                         <specification-version>1.1</specification-version>
-                     </run-dependency>
--                </dependency>
--                <dependency>
--                    <code-name-base>org.netbeans.modules.apisupport.paintapp</code-name-base>
--                    <run-dependency>
--                        <specification-version>1.1</specification-version>
--                    </run-dependency>
-                 </dependency>
-                 <dependency>
-                     <code-name-base>org.netbeans.modules.apisupport.project</code-name-base>
---- a/editor.kit/nbproject/project.xml
-+++ b/editor.kit/nbproject/project.xml
-@@ -6,13 +6,6 @@
-             <code-name-base>org.netbeans.modules.editor.kit</code-name-base>
-             <module-dependencies>
-                 <dependency>
--                    <code-name-base>org.netbeans.modules.css.visual</code-name-base>
--                    <run-dependency>
--                        <release-version>1</release-version>
--                        <specification-version>2.4</specification-version>
--                    </run-dependency>
--                </dependency>
--                <dependency>
-                     <code-name-base>org.netbeans.modules.editor.actions</code-name-base>
-                     <run-dependency>
-                         <release-version>1</release-version>
-@@ -40,13 +33,7 @@
-                         <specification-version>1.19</specification-version>
-                     </run-dependency>
-                 </dependency>
--                <dependency>
--                    <code-name-base>org.netbeans.modules.javascript.kit</code-name-base>
--                    <run-dependency>
--                        <release-version>1</release-version>
--                        <specification-version>0.103</specification-version>
--                    </run-dependency>
--                </dependency>
-+
-                 <dependency>
-                     <code-name-base>org.netbeans.modules.languages.diff</code-name-base>
-                     <run-dependency>
-@@ -80,13 +67,6 @@
-                     </run-dependency>
-                 </dependency>
-                 <dependency>
--                    <code-name-base>org.netbeans.modules.web.flyingsaucer</code-name-base>
--                    <run-dependency>
--                        <release-version>1</release-version>
--                        <specification-version>1</specification-version>
--                    </run-dependency>
--                </dependency>
--                <dependency>
-                     <code-name-base>org.netbeans.modules.xml.core</code-name-base>
-                     <run-dependency>
-                         <release-version>2</release-version>
-@@ -119,13 +99,6 @@
-                         <specification-version>1.13</specification-version>
-                     </run-dependency>
-                 </dependency>
--                <dependency>
--                    <code-name-base>org.netbeans.modules.xsl</code-name-base>
--                    <run-dependency>
--                        <release-version>1</release-version>
--                        <specification-version>1.13</specification-version>
--                    </run-dependency>
--                </dependency>
-             </module-dependencies>
-             <public-packages/>
-         </data>
---- a/ide.kit/nbproject/project.xml
-+++ b/ide.kit/nbproject/project.xml
-@@ -129,6 +129,7 @@
-                         <specification-version>1.11</specification-version>
-                     </run-dependency>
-                 </dependency>
-+<!--
-                 <dependency>
-                     <code-name-base>org.netbeans.modules.httpserver</code-name-base>
-                     <run-dependency>
-@@ -136,6 +137,7 @@
-                         <specification-version>2.7</specification-version>
-                     </run-dependency>
-                 </dependency>
-+-->
-                 <dependency>
-                     <code-name-base>org.netbeans.modules.jumpto</code-name-base>
-                     <run-dependency>
-@@ -222,12 +224,14 @@
-                         <specification-version>1.0</specification-version>
-                     </run-dependency>
-                 </dependency>
-+<!--
-                 <dependency>
-                     <code-name-base>org.netbeans.modules.dlight.terminal</code-name-base>
-                     <run-dependency>
-                         <specification-version>1.0</specification-version>
-                     </run-dependency>
-                 </dependency>
-+-->
-             </module-dependencies>
-             <test-dependencies>
-                 <test-type>
---- a/java.kit/nbproject/project.xml
-+++ b/java.kit/nbproject/project.xml
-@@ -205,26 +205,6 @@
-                     </run-dependency>
-                 </dependency>
-                 <dependency>
--                    <code-name-base>org.netbeans.modules.websvc.jaxws21</code-name-base>
--                    <run-dependency>
--                        <release-version>1</release-version>
--                        <specification-version>1.1</specification-version>
--                    </run-dependency>
--                </dependency>
--                <dependency>
--                    <code-name-base>org.netbeans.modules.websvc.jaxws21api</code-name-base>
--                    <run-dependency>
--                        <release-version>1</release-version>
--                    </run-dependency>
--                </dependency>
--                <dependency>
--                    <code-name-base>org.netbeans.modules.xml.jaxb</code-name-base>
--                    <run-dependency>
--                        <release-version>1</release-version>
--                        <specification-version>1.0</specification-version>
--                    </run-dependency>
--                </dependency>
--                <dependency>
-                     <code-name-base>org.netbeans.modules.xml.tools.java</code-name-base>
-                     <run-dependency>
-                         <specification-version>1.3</specification-version>
diff --git a/debian/patches/netbeans-6.9~71-cluster-properties.patch b/debian/patches/netbeans-6.9~71-cluster-properties.patch
deleted file mode 100644
index 85ea9f4..0000000
--- a/debian/patches/netbeans-6.9~71-cluster-properties.patch
+++ /dev/null
@@ -1,264 +0,0 @@
---- a/nbbuild/cluster.properties
-+++ b/nbbuild/cluster.properties
-@@ -112,9 +112,7 @@
- clusters.config.java.list=\
-         ${clusters.config.platform.list},\
-         nb.cluster.ide,\
--        nb.cluster.websvccommon,\
-         nb.cluster.java,\
--        nb.cluster.profiler,\
-         nb.cluster.nb
- 
- clusters.config.enterprise.list=\
-@@ -275,30 +273,12 @@
-         api.debugger,\
-         api.java.classpath,\
-         api.xml,\
--        bugtracking,\
--        bugtracking.bridge,\
--        bugtracking.kenai,\
--        bugzilla,\
-         core.browser,\
-         core.ide,\
-         csl.api,\
-         css.editor,\
--        css.visual,\
--        db,\
--        db.core,\
--        db.dataview,\
--        db.drivers,\
--        db.kit,\
--        db.metadata.model,\
--        db.mysql,\
--        db.sql.editor,\
--        db.sql.visualeditor,\
--        dbapi,\
-         defaults,\
--        derby,\
-         diff,\
--        dlight.nativeexecution,\
--        dlight.terminal,\
-         editor,\
-         editor.actions,\
-         editor.bookmarks,\
-@@ -324,8 +304,6 @@
-         editor.util,\
-         extbrowser,\
-         extexecution,\
--        extexecution.destroy,\
--        glassfish.common,\
-         gototest,\
-         gsf,\
-         gsf.api,\
-@@ -336,21 +314,13 @@
-         html.editor,\
-         html.editor.lib,\
-         html.lexer,\
--        httpserver,\
-         hudson,\
--        hudson.kenai,\
-         hudson.mercurial,\
-         hudson.subversion,\
-         ide.kit,\
-         image,\
--        javascript.editing,\
--        javascript.hints,\
--        javascript.kit,\
--        javascript.refactoring,\
-         jellytools.ide,\
-         jumpto,\
--        kenai,\
--        kenai.ui,\
-         languages,\
-         languages.diff,\
-         languages.manifest,\
-@@ -359,28 +329,22 @@
-         lexer.nbbridge,\
-         lib.cvsclient,\
-         lib.terminalemulator,\
--        libs.bugtracking,\
--        libs.bugzilla,\
-         libs.bytelist,\
--        libs.commons_codec,\
-         libs.commons_logging,\
-         libs.commons_net,\
-         libs.freemarker,\
-         libs.ini4j,\
-         libs.jakarta_oro,\
--        libs.jaxb,\
-         libs.jsch,\
-         libs.jvyamlb,\
-         libs.jzlib,\
-         libs.lucene,\
--        libs.smack,\
-         libs.svnClientAdapter,\
-         libs.swingx,\
-         libs.xerces,\
-         localhistory,\
-         mercurial,\
-         o.apache.xml.resolver,\
--        o.mozilla.rhino.patched,\
-         o.n.swing.dirchooser,\
-         o.openidex.util,\
-         options.editor,\
-@@ -402,7 +366,6 @@
-         spellchecker.apimodule,\
-         spellchecker.bindings.htmlxml,\
-         spellchecker.bindings.properties,\
--        spellchecker.dictionary_en,\
-         spellchecker.kit,\
-         spi.debugger.ui,\
-         spi.editor.hints,\
-@@ -411,30 +374,25 @@
-         spi.tasklist,\
-         spi.viewmodel,\
-         subversion,\
--        swing.validation,\
-         target.iterator,\
-         tasklist.kit,\
-         tasklist.projectint,\
-         tasklist.todo,\
-         tasklist.ui,\
--        team.kit,\
-         terminal,\
-         usersguide,\
-         utilities,\
-         utilities.project,\
-         versioning,\
-         versioning.indexingbridge,\
--        versioning.kenai,\
-         versioning.system.cvss,\
-         versioning.util,\
-         web.client.tools.api,\
-         web.common,\
--        web.flyingsaucer,\
-         xml,\
-         xml.axi,\
-         xml.catalog,\
-         xml.core,\
--        xml.jaxb.api,\
-         xml.lexer,\
-         xml.multiview,\
-         xml.retriever,\
-@@ -445,8 +403,7 @@
-         xml.tools,\
-         xml.wsdl.model,\
-         xml.xam,\
--        xml.xdm,\
--        xsl
-+        xml.xdm
- validation.nb.cluster.ide=\
-         ide.kit
- 
-@@ -454,7 +411,6 @@
- nb.cluster.java.depends=\
-         nb.cluster.ide,\
-         nb.cluster.platform,\
--        nb.cluster.websvccommon,\
-         nb.cluster.harness
- nb.cluster.java=\
-         ant.browsetask,\
-@@ -466,30 +422,19 @@
-         api.java,\
-         beans,\
-         classfile,\
--        dbschema,\
-         debugger.jpda,\
-         debugger.jpda.ant,\
-         debugger.jpda.projects,\
-         debugger.jpda.ui,\
-         form,\
--        form.j2ee,\
-         form.kit,\
--        hibernate,\
--        hibernatelib,\
-         hudson.ant,\
--        hudson.maven,\
-         i18n,\
-         i18n.form,\
-         j2ee.core.utilities,\
--        j2ee.eclipselink,\
--        j2ee.jpa.refactoring,\
--        j2ee.jpa.verification,\
-         j2ee.metadata,\
-         j2ee.metadata.model.support,\
--        j2ee.persistence,\
--        j2ee.persistence.kit,\
-         j2ee.persistenceapi,\
--        j2ee.toplinklib,\
-         java.api.common,\
-         java.debug,\
-         java.editor,\
-@@ -516,37 +461,15 @@
-         jellytools,\
-         jellytools.java,\
-         junit,\
--        kenai.maven,\
--        libs.cglib,\
-         libs.javacapi,\
-         libs.javacimpl,\
--        libs.springframework,\
--        maven,\
--        maven.embedder,\
--        maven.grammar,\
--        maven.graph,\
--        maven.hints,\
--        maven.indexer,\
--        maven.junit,\
--        maven.kit,\
--        maven.model,\
--        maven.osgi,\
--        maven.persistence,\
--        maven.repository,\
--        maven.search,\
--        maven.spring,\
-         o.apache.tools.ant.module,\
-         o.jdesktop.beansbinding,\
-         projectimport.eclipse.core,\
-         projectimport.eclipse.j2se,\
-         refactoring.java,\
-         spellchecker.bindings.java,\
--        spring.beans,\
-         swingapp,\
--        websvc.jaxws21,\
--        websvc.jaxws21api,\
--        websvc.saas.codegen.java,\
--        xml.jaxb,\
-         xml.tools.java
- validation.nb.cluster.java=\
-         java.kit
-@@ -684,16 +607,10 @@
-         nb.cluster.harness
- nb.cluster.apisupport=\
-         apisupport.ant,\
--        apisupport.crudsample,\
--        apisupport.feedreader,\
--        apisupport.installer,\
--        apisupport.installer.maven,\
-         apisupport.kit,\
-         apisupport.osgidemo,\
--        apisupport.paintapp,\
-         apisupport.project,\
--        apisupport.refactoring,\
--        maven.apisupport
-+        apisupport.refactoring
- 
- nb.cluster.enterprise.dir=enterprise
- nb.cluster.enterprise.depends=\
-@@ -810,7 +727,6 @@
- nb.cluster.nb.depends=nb.cluster.ide,nb.cluster.harness
- nb.cluster.nb=\
-         autoupdate.pluginimporter,\
--        bugzilla.exceptionreporter,\
-         ide.branding,\
-         ide.branding.kit,\
-         lib.uihandler,\
-@@ -829,8 +745,6 @@
-         apisupport.tc.cobertura,\
-         jellytools.platform,\
-         jemmy,\
--        libs.nbi.ant,\
--        libs.nbi.engine,\
-         nbjunit,\
-         o.n.insane
- 
diff --git a/debian/patches/netbeans-6.9~80-config.patch b/debian/patches/netbeans-6.9~80-config.patch
deleted file mode 100644
index d7c32d7..0000000
--- a/debian/patches/netbeans-6.9~80-config.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/ide/launcher/netbeans.conf
-+++ b/ide/launcher/netbeans.conf
-@@ -3,7 +3,7 @@
- 
- # Options used by NetBeans launcher by default, can be overridden by explicit
- # command line switches:
--netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true"
-+netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-XX:MaxPermSize=200m -J-Dapple.laf.useScreenMenuBar=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.pmoffscreen=false"
- # Note that a default -Xmx is selected for you automatically.
- # You can find this value in var/log/messages.log file in your userdir.
- # The automatically selected value can be overridden by specifying -J-Xmx here
diff --git a/debian/patches/netbeans-6.9~90-junit-migration.patch b/debian/patches/netbeans-6.9~90-junit-migration.patch
deleted file mode 100644
index c046af6..0000000
--- a/debian/patches/netbeans-6.9~90-junit-migration.patch
+++ /dev/null
@@ -1,190 +0,0 @@
---- a/junit/src/org/netbeans/modules/junit/Bundle.properties
-+++ b/junit/src/org/netbeans/modules/junit/Bundle.properties
-@@ -399,7 +399,7 @@
- 
- #names of the JUnit libraries
- junit=JUnit 3.8.2
--junit_4=JUnit 4.5
-+junit_4=JUnit 4.8
- 
- MSG_MISSING_TEST=The directory for tests was not found. Use source directory instead?
- MSG_MISSING_TEST_TITLE=Missing Test Directory
---- a/junit/src/org/netbeans/modules/junit/resources/junit_4_5_lib.xml
-+++ /dev/null
-@@ -1,68 +0,0 @@
--<?xml version="1.0" encoding="UTF-8"?>
--<!--
--DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
--
--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.
--
--
--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-2008 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.
---->
--<!DOCTYPE library PUBLIC "-//NetBeans//DTD Library Declaration 1.0//EN" "http://www.netbeans.org/dtds/library-declaration-1_0.dtd">
--<library version="1.0">
--    <name>junit_4</name>
--    <type>j2se</type>
--    <localizing-bundle>org.netbeans.modules.junit.Bundle</localizing-bundle>
--    <volume>
--        <type>classpath</type>
--        <resource>jar:nbinst://org.netbeans.libs.junit4/modules/ext/junit-4.5.jar!/</resource>
--    </volume>
--    <volume>
--        <type>javadoc</type>
--        <resource>jar:nbinst://org.netbeans.modules.junit/docs/junit-4.5-api.zip!/</resource>
--    </volume>
--    <volume>
--        <type>src</type>
--        <resource>jar:nbinst://org.netbeans.modules.junit/docs/junit-4.5-src.jar!/</resource>
--    </volume>
--    <volume>
--        <!-- please check with mkleint at netbeans.org before/after updating this or "classpath" section -->
--        <type>maven-pom</type>
--        <resource>http://repo1.maven.org/maven2/junit/junit/4.4/junit-4.4.pom</resource>
--    </volume>
--</library>
---- /dev/null
-+++ b/junit/src/org/netbeans/modules/junit/resources/junit_4_8_lib.xml
-@@ -0,0 +1,66 @@
-+<?xml version="1.0" encoding="UTF-8"?>
-+<!--
-+DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-+
-+Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
-+
-+
-+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.  Sun designates this
-+particular file as subject to the "Classpath" exception as provided
-+by Sun 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-2008 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.
-+-->
-+<!DOCTYPE library PUBLIC "-//NetBeans//DTD Library Declaration 1.0//EN" "http://www.netbeans.org/dtds/library-declaration-1_0.dtd">
-+<library version="1.0">
-+    <name>junit_4</name>
-+    <type>j2se</type>
-+    <localizing-bundle>org.netbeans.modules.junit.Bundle</localizing-bundle>
-+    <volume>
-+        <type>classpath</type>
-+        <resource>jar:nbinst://org.netbeans.libs.junit4/modules/ext/junit-4.8.jar!/</resource>
-+        <resource>jar:nbinst://org.netbeans.libs.junit4/modules/ext/hamcrest-core.jar!/</resource>
-+    </volume>
-+    <!--volume>
-+        <type>javadoc</type>
-+        <resource>jar:nbinst://org.netbeans.modules.junit/docs/junit-4.8-api.zip!/</resource>
-+    </volume>
-+    <volume>
-+        <type>src</type>
-+        <resource>jar:nbinst://org.netbeans.modules.junit/docs/junit-4.8-src.jar!/</resource>
-+    </volume-->
-+    <volume>
-+        <!-- please check with mkleint at netbeans.org before/after updating this or "classpath" section -->
-+        <type>maven-pom</type>
-+        <resource>http://repo1.maven.org/maven2/junit/junit/4.4/junit-4.4.pom</resource>
-+    </volume>
-+</library>
---- a/junit/src/org/netbeans/modules/junit/resources/layer.xml
-+++ b/junit/src/org/netbeans/modules/junit/resources/layer.xml
-@@ -50,7 +50,7 @@
-             <file name="junit-3.8.2.xml" url="junit_3_8_2_lib.xml">
-                 <attr name="displayName" bundlevalue="org.netbeans.modules.junit.Bundle#junit"/>
-             </file>
--            <file name="junit-4.5.xml" url="junit_4_5_lib.xml">
-+            <file name="junit-4.5.xml" url="junit_4_8_lib.xml">
-                 <attr name="displayName" bundlevalue="org.netbeans.modules.junit.Bundle#junit_4"/>
-             </file>
-         </folder>
---- a/libs.junit4/nbproject/project.xml
-+++ b/libs.junit4/nbproject/project.xml
-@@ -63,8 +63,12 @@
-                 <package>org.junit.runners</package>
-             </public-packages>
-             <class-path-extension>
--                <runtime-relative-path>ext/junit-4.5.jar</runtime-relative-path>
--                <binary-origin>external/junit-4.5.jar</binary-origin>
-+                <runtime-relative-path>ext/hamcrest-core.jar</runtime-relative-path>
-+                <binary-origin>external/hamcrest-core.jar</binary-origin>
-+                </class-path-extension>
-+                <class-path-extension>
-+                <runtime-relative-path>ext/junit-4.8.jar</runtime-relative-path>
-+                <binary-origin>external/junit-4.8.jar</binary-origin>
-             </class-path-extension>
-         </data>
-     </configuration>
---- a/nbbuild/build.properties
-+++ b/nbbuild/build.properties
-@@ -79,7 +79,7 @@
- stop.when.clean.error=true
- 
- test.unit.cp=\
--    ../libs.junit4/external/junit-4.5.jar:\
-+    ../libs.junit4/external/junit-4.8.jar:\
-     netbeans/harness/modules/org-netbeans-modules-nbjunit.jar:\
-     netbeans/harness/modules/org-netbeans-insane.jar:\
-     ../o.apache.tools.ant.module/external/lib/ant-nodeps.jar:\
diff --git a/debian/patches/netbeans-6.9~autogenerated-changes.patch b/debian/patches/netbeans-6.9~autogenerated-changes.patch
deleted file mode 100644
index caeb107..0000000
--- a/debian/patches/netbeans-6.9~autogenerated-changes.patch
+++ /dev/null
@@ -1,236 +0,0 @@
-Description: Changes made by netbeans build system. These are not meant to be
- forwared to upstream.
-Forwarded: not-needed
-Last-Update: 2011-01-23
-
---- a/nbbuild/build.properties
-+++ b/nbbuild/build.properties
-@@ -150,7 +150,6 @@
-     lexer,\
-     api.xml,\
-     o.apache.tools.ant.module,\
--    db,\
-     spi.quicksearch,\
-     print,\
-     extexecution
---- /dev/null
-+++ b/nbbuild/build.properties_orig
-@@ -0,0 +1,218 @@
-+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
-+#
-+# 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.
-+#
-+# 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-2008 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.
-+
-+netbeans.dest=netbeans
-+test.dist.dir=build/testdist
-+
-+test.user.dir=testuserdir
-+nb.run.validation=true
-+# Options to pass to NetBeans when starting it with "ant tryme":
-+build.compiler.debug=on
-+tryme.args=-J-Dnetbeans.full.hack=true
-+
-+# Information about branch of previous release
-+# needed to help us generate list of changes since then
-+previous.release.year=2009
-+previous.release.month=12
-+previous.release.day=10
-+
-+# Useful for "always successful" build, when you don't care of some
-+# particular (and currently broken) modules
-+stop.when.broken.modules=true
-+
-+# resolve compile time dependencies and merge all dependent modules
-+# set to true and command `ant -Dmodules=javacvs` will build IDE
-+# with working module javacvs
-+merge.dependent.modules=true
-+
-+# usefull for NBM build. <nbmerge> can set it to the list
-+# of successfuly built modules => can create NBM for them
-+# the most powerful combination is to set value to "modules"
-+# and set stop.when.broken.modules to false
-+built.modules.property=
-+
-+# resolve compile-time dependencies during cleaning working repository
-+# set it to true if you want to clean also modules, your module(s) depends on
-+resolve.clean.dependencies=false
-+
-+# stop, if the module have got wrong "clean" target
-+# if set to false, clean build never fail on calls of the clean targets.
-+stop.when.clean.error=true
-+
-+test.unit.cp=\
-+    ../libs.junit4/external/junit-4.8.jar:\
-+    netbeans/harness/modules/org-netbeans-modules-nbjunit.jar:\
-+    netbeans/harness/modules/org-netbeans-insane.jar:\
-+    ../o.apache.tools.ant.module/external/lib/ant-nodeps.jar:\
-+    ../o.apache.tools.ant.module/external/lib/ant-junit.jar:\
-+    ../o.apache.tools.ant.module/external/lib/ant-launcher.jar:\
-+    ../o.apache.tools.ant.module/external/lib/ant.jar:\
-+    nbantext.jar
-+
-+# make javadoc for these packages
-+# - the list will be shared for signature API tests!
-+# - for javadoc you may specify org.foo.*, the trailing ".*"
-+#     will be stripped for signature API tests
-+javadoc.packages=\
-+    org.netbeans.api.*,\
-+    org.netbeans.spi.*
-+
-+# List of modules that provide stable javadoc
-+config.javadoc.stable=\
-+    api.annotations.common,\
-+    autoupdate.services,\
-+    core.ide,\
-+    openide.util,\
-+    openide.util.lookup,\
-+    openide.actions,\
-+    openide.awt,\
-+    openide.dialogs,\
-+    openide.nodes,\
-+    openide.explorer,\
-+    openide.filesystems,\
-+    openide.modules,\
-+    openide.text,\
-+    openide.windows,\
-+    openide.loaders,\
-+    openide.io,\
-+    api.progress,\
-+    sendopts,\
-+    settings,\
-+    javahelp,\
-+    keyring,\
-+    spi.palette,\
-+    options.api,\
-+    spi.tasklist,\
-+    openide.execution,\
-+    queries,\
-+    editor.codetemplates,\
-+    editor.errorstripe.api,\
-+    editor.mimelookup,\
-+    editor.settings,\
-+    spi.navigator,\
-+    diff,\
-+    projectapi,\
-+    projectuiapi,\
-+    project.libraries,\
-+    api.debugger,\
-+    spi.viewmodel,\
-+    spi.debugger.ui,\
-+    api.debugger.jpda,\
-+    project.ant,\
-+    api.visual,\
-+    api.java,\
-+    api.java.classpath,\
-+    java.platform,\
-+    java.project,\
-+    java.source,\
-+    java.sourceui,\
-+    editor.fold,\
-+    editor.completion,\
-+    lexer,\
-+    api.xml,\
-+    o.apache.tools.ant.module,\
-+    db,\
-+    spi.quicksearch,\
-+    print,\
-+    extexecution
-+
-+#FIXME: changes for retouche merge:
-+#   editor/codetemplates,\
-+
-+# List of javadocs under development
-+config.javadoc.devel=\
-+    nbjunit,\
-+    o.openidex.util,\
-+    core.netigso,\
-+    core.multiview,\
-+    o.n.swing.outline,\
-+    o.n.swing.tabcontrol,\
-+    editor.indent,\
-+    editor.lib2,\
-+    editor.bracesmatching,\
-+    editor.guards,\
-+    j2ee.metadata,\
-+    parsing.api,\
-+    refactoring.api,\
-+    refactoring.java,\
-+    server,\
-+    spi.editor.hints,\
-+    api.web.webmodule
-+
-+# List of javadocs dedicated just for friend usage
-+config.javadoc.friend=\
-+    o.n.bootstrap,\
-+    core.startup,\
-+    classfile,\
-+    o.n.swing.plaf,\
-+    editor.util,\
-+    editor.settings.storage,\
-+    editor.lib,\
-+    editor,\
-+    j2ee.dd,\
-+    j2eeserver,\
-+    java.api.common,\
-+    java.j2seproject,\
-+    junit,\
-+    uihandler,\
-+    lib.uihandler,\
-+    masterfs,\
-+    projectui
-+
-+# List of old and deprecated APIs for building complete javadoc
-+
-+config.javadoc.deprecated=\
-+    openide.compat,\
-+    openide.options,\
-+    openide.util.enumerations
-+
-+# List of all javadocs for development version
-+# is composed from the javadocs split by stability
-+# categories, for release it shall contain just stable ones
-+config.javadoc.all=\
-+    ${config.javadoc.stable}
-+
-+# list of modules for jnlp:
-+config.jnlp.stable=\
-+    ${nb.cluster.platform},\
-+    ${nb.cluster.ide},\
-+    ${nb.cluster.java}
diff --git a/debian/patches/netbeans-6.9~ini4j-0.5.2-SNAPSHOT.patch b/debian/patches/netbeans-6.9~ini4j-0.5.2-SNAPSHOT.patch
deleted file mode 100644
index 0745494..0000000
--- a/debian/patches/netbeans-6.9~ini4j-0.5.2-SNAPSHOT.patch
+++ /dev/null
@@ -1,81 +0,0 @@
-Description: Changes to get netbeans working with ini4j-0.5.2-SNAPSHOT. Patch
- is based off of upstream hg commit.
-Author: Andres Mejia <mcitadel at gmail.com>
-Origin: upstream, http://hg.netbeans.org/main-silver?cmd=changeset;node=b52ba606f1ce
-Forwarded: not-needed
-Last-Update: 2011-01-23
-
---- a/hudson.mercurial/src/org/netbeans/modules/hudson/mercurial/HudsonMercurialSCM.java
-+++ b/hudson.mercurial/src/org/netbeans/modules/hudson/mercurial/HudsonMercurialSCM.java
-@@ -55,7 +55,7 @@
- import java.util.logging.Level;
- import java.util.logging.Logger;
- import org.ini4j.Ini;
--import org.ini4j.InvalidIniFormatException;
-+import org.ini4j.InvalidFileFormatException;
- import org.netbeans.modules.hudson.api.ConnectionBuilder;
- import org.netbeans.modules.hudson.api.HudsonJob;
- import org.netbeans.modules.hudson.spi.HudsonJobChangeItem;
-@@ -212,7 +212,7 @@
-             } finally {
-                 is.close();
-             }
--        } catch (InvalidIniFormatException x) {
-+        } catch (InvalidFileFormatException x) {
-             LOG.log(Level.FINE, "{0} was malformed, perhaps no workspace: {1}", new Object[] {hgrc, x});
-             return null;
-         } catch (FileNotFoundException x) {
---- a/libs.ini4j/nbproject/project.xml
-+++ b/libs.ini4j/nbproject/project.xml
-@@ -63,10 +63,11 @@
-                 <friend>org.netbeans.modules.mercurial</friend>
-                 <friend>org.netbeans.modules.subversion</friend>
-                 <package>org.ini4j</package>
-+                <package>org.ini4j.spi</package>
-             </friend-packages>
-             <class-path-extension>
--                <runtime-relative-path>ext/ini4j-0.4.1.jar</runtime-relative-path>
--                <binary-origin>external/ini4j-0.4.1.jar</binary-origin>
-+                <runtime-relative-path>ext/ini4j-0.5.2-SNAPSHOT.jar</runtime-relative-path>
-+                <binary-origin>external/ini4j-0.5.2-SNAPSHOT.jar</binary-origin>
-             </class-path-extension>
-         </data>
-     </configuration>
---- a/mercurial/src/org/netbeans/modules/mercurial/config/HgConfigFiles.java
-+++ b/mercurial/src/org/netbeans/modules/mercurial/config/HgConfigFiles.java
-@@ -56,7 +56,8 @@
- import java.util.logging.Level;
- import org.ini4j.Config;
- import org.ini4j.Ini;
--import org.ini4j.InvalidIniFormatException;
-+import org.ini4j.InvalidFileFormatException;
-+import org.ini4j.Profile.Section;
- import org.netbeans.modules.mercurial.HgModuleConfig;
- import org.netbeans.modules.mercurial.Mercurial;
- import org.netbeans.modules.mercurial.util.HgRepositoryContextCache;
-@@ -96,7 +97,7 @@
-     private static final String WINDOWS_HG_RC_FILE = "Mercurial.ini";                                 // NOI18N
-     private static final String WINDOWS_DEFAULT_MECURIAL_INI_PATH = "C:\\Mercurial\\Mercurial.ini";                                 // NOI18N
-     private boolean bIsProjectConfig;
--    private InvalidIniFormatException initException;
-+    private IOException initException;
-     /**
-      * fileName of the configuration file
-      */
-@@ -345,14 +346,14 @@
-             }
-         } catch (FileNotFoundException ex) {
-             // ignore
--        } catch (InvalidIniFormatException ex) {
-+        } catch (InvalidFileFormatException ex) {
-             Mercurial.LOG.log(Level.INFO, "Cannot parse configuration file", ex); // NOI18N
-             initException = ex;
-         } catch (IOException ex) {
-             Mercurial.LOG.log(Level.INFO, null, ex);
-         } catch (Exception ex) {
-             Mercurial.LOG.log(Level.INFO, "Cannot parse configuration file", ex); // NOI18N
--            initException = new InvalidIniFormatException(ex);
-+            initException = new IOException(ex);
-         } finally {
-             Thread.currentThread().setContextClassLoader(cl);
-         }
diff --git a/debian/patches/netbeans-6.9~original-svnclientadapter.patch b/debian/patches/netbeans-6.9~original-svnclientadapter.patch
deleted file mode 100644
index 98ee13e..0000000
--- a/debian/patches/netbeans-6.9~original-svnclientadapter.patch
+++ /dev/null
@@ -1,116 +0,0 @@
-Description: Patch to get netbeans building with original svnclientadapter which
- is a part of subclipse project.
-Author: Andres Mejia <mcitadel at gmail.com>
-Forwarded: no
-Last-Update: 2011-01-23
-
---- a/subversion/src/org/netbeans/modules/subversion/client/cli/CommandlineClient.java
-+++ b/subversion/src/org/netbeans/modules/subversion/client/cli/CommandlineClient.java
-@@ -91,6 +91,7 @@
- import org.tigris.subversion.svnclientadapter.ISVNClientAdapter;
- import org.tigris.subversion.svnclientadapter.ISVNConflictResolver;
- import org.tigris.subversion.svnclientadapter.ISVNDirEntry;
-+import org.tigris.subversion.svnclientadapter.ISVNDirEntryWithLock;
- import org.tigris.subversion.svnclientadapter.ISVNInfo;
- import org.tigris.subversion.svnclientadapter.ISVNLogMessage;
- import org.tigris.subversion.svnclientadapter.ISVNLogMessageCallback;
-@@ -105,6 +106,7 @@
- import org.tigris.subversion.svnclientadapter.SVNKeywords;
- import org.tigris.subversion.svnclientadapter.SVNNotificationHandler;
- import org.tigris.subversion.svnclientadapter.SVNRevision;
-+import org.tigris.subversion.svnclientadapter.SVNRevision.Kind;
- import org.tigris.subversion.svnclientadapter.SVNRevision.Number;
- import org.tigris.subversion.svnclientadapter.SVNRevisionRange;
- import org.tigris.subversion.svnclientadapter.SVNScheduleKind;
-@@ -636,6 +638,10 @@
-         super.setIgnoredPatterns(file, l);
-     }
- 
-+    public String getRevProperty(SVNUrl path, SVNRevision.Number revisionNo, String propName) throws SVNClientException {
-+        throw new UnsupportedOperationException("Not supported yet.");
-+    }
-+
-     public ISVNAnnotations annotate(SVNUrl url, SVNRevision revStart, SVNRevision revEnd) throws SVNClientException {
-         return annotate(new BlameCommand(url, revStart, revEnd), new CatCommand(url, revEnd, null));
-     }
-@@ -692,6 +698,17 @@
-         return props.toArray(new ISVNProperty[props.size()]);
-     }
- 
-+    public ISVNProperty[] getProperties(SVNUrl url, SVNRevision revision, SVNRevision peg) throws SVNClientException {
-+        ListPropertiesCommand cmd = new ListPropertiesCommand(url, false);
-+        exec(cmd);
-+        List<String> names = cmd.getPropertyNames();
-+        List<ISVNProperty> props = new ArrayList<ISVNProperty>(names.size());
-+        for (String name : names) {
-+            props.add(propertyGet(url, revision, peg, name));
-+        }
-+        return props.toArray(new ISVNProperty[props.size()]);
-+    }
-+
-     public ISVNProperty[] getProperties(SVNUrl url) throws SVNClientException {
-         ListPropertiesCommand cmd = new ListPropertiesCommand(url, false);
-         exec(cmd);
-@@ -703,6 +720,10 @@
-         return props.toArray(new ISVNProperty[props.size()]);
-     }
- 
-+    public ISVNProperty[] getRevProperties(SVNUrl url, SVNRevision.Number revision) throws SVNClientException {
-+        throw new UnsupportedOperationException("Not supported yet.");
-+    }
-+
-     public void resolved(File file) throws SVNClientException {
-         ResolvedCommand cmd = new ResolvedCommand(file, false);
-         exec(cmd);
-@@ -1000,6 +1021,10 @@
-         throw new UnsupportedOperationException("Not supported yet.");
-     }
- 
-+    public ISVNDirEntryWithLock[] getListWithLocks(SVNUrl arg0, SVNRevision arg1, SVNRevision arg2, boolean arg3) throws SVNClientException {
-+        throw new UnsupportedOperationException("Not supported yet.");
-+    }
-+
-     /**
-      * Copies all files from <code>files</code> to repository URL at <code>targetUrl</code>.
-      * @param files array of files which will be copied
-@@ -1029,6 +1054,10 @@
-         throw new UnsupportedOperationException("Not supported yet.");
-     }
- 
-+    public void copy(SVNUrl arg0, File arg1, SVNRevision arg2, SVNRevision arg3, boolean arg4, boolean arg5) throws SVNClientException {
-+        throw new UnsupportedOperationException("Not supported yet.");
-+    }
-+
-     public long update(File arg0, SVNRevision arg1, int arg2, boolean arg3, boolean arg4, boolean arg5) throws SVNClientException {
-         throw new UnsupportedOperationException("Not supported yet.");
-     }
-@@ -1063,10 +1092,18 @@
-         throw new UnsupportedOperationException("Not supported yet.");
-     }
- 
-+    public ISVNAnnotations annotate(SVNUrl arg0, SVNRevision arg1, SVNRevision arg2, SVNRevision arg3, boolean arg4, boolean arg5) throws SVNClientException {
-+        throw new UnsupportedOperationException("Not supported yet.");
-+    }
-+
-     public ISVNAnnotations annotate(File arg0, SVNRevision arg1, SVNRevision arg2, boolean arg3, boolean arg4) throws SVNClientException {
-         throw new UnsupportedOperationException("Not supported yet.");
-     }
- 
-+    public ISVNAnnotations annotate(File arg0, SVNRevision arg1, SVNRevision arg2, SVNRevision arg3, boolean arg4, boolean arg5) throws SVNClientException {
-+        throw new UnsupportedOperationException("Not supported yet.");
-+    }
-+
-     public void resolve(File arg0, int arg1) throws SVNClientException {
-         throw new UnsupportedOperationException("Not supported yet.");
-     }
-@@ -1115,6 +1152,10 @@
-         throw new UnsupportedOperationException("Not supported yet.");
-     }
- 
-+    public SVNDiffSummary[] diffSummarize(File arg0, SVNUrl arg1, SVNRevision arg2, boolean arg3) throws SVNClientException {
-+        throw new UnsupportedOperationException("Not supported yet.");
-+    }
-+
-     public String[] suggestMergeSources(File arg0) throws SVNClientException {
-         throw new UnsupportedOperationException("Not supported yet.");
-     }
diff --git a/debian/patches/netbeans-6.9~servlet-api-2.5.patch b/debian/patches/netbeans-6.9~servlet-api-2.5.patch
deleted file mode 100644
index 326eb9a..0000000
--- a/debian/patches/netbeans-6.9~servlet-api-2.5.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Description: Simple patch to build netbeans with servlet-api-2.5.jar.
-Author: Andres Mejia <mcitadel at gmail.com>
-Forwarded: no
-Last-Update: 2011-01-23
-
---- a/servletapi/nbproject/project.xml
-+++ b/servletapi/nbproject/project.xml
-@@ -54,8 +54,8 @@
-                 <subpackages>javax.servlet</subpackages>
-             </public-packages>
-             <class-path-extension>
--                <runtime-relative-path>ext/servlet-2.2.jar</runtime-relative-path>
--                <binary-origin>external/servlet-2.2.jar</binary-origin>
-+                <runtime-relative-path>ext/servlet-api-2.5.jar</runtime-relative-path>
-+                <binary-origin>external/servlet-api-2.5.jar</binary-origin>
-             </class-path-extension>
-         </data>
-     </configuration>
diff --git a/debian/patches/netbeans-platform~include-extras.patch b/debian/patches/netbeans-platform~include-extras.patch
new file mode 100644
index 0000000..999492e
--- /dev/null
+++ b/debian/patches/netbeans-platform~include-extras.patch
@@ -0,0 +1,53 @@
+Include the extra modules libs.junit4 and libs.antlr3.devel.
+
+Index: netbeans-7.0.1+dfsg1/libs.junit4/nbproject/project.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.junit4/nbproject/project.xml	2011-07-28 20:46:08.000000000 +0100
++++ netbeans-7.0.1+dfsg1/libs.junit4/nbproject/project.xml	2011-08-02 23:37:27.294165081 +0100
+@@ -63,6 +63,10 @@
+                 <package>org.junit.runners</package>
+             </public-packages>
+             <class-path-extension>
++                <runtime-relative-path>ext/hamcrest-core.jar</runtime-relative-path>
++                <binary-origin>external/hamcrest-core.jar</binary-origin>
++            </class-path-extension>
++            <class-path-extension>
+                 <runtime-relative-path>ext/junit-4.8.2.jar</runtime-relative-path>
+                 <binary-origin>external/junit-4.8.2.jar</binary-origin>
+             </class-path-extension>
+Index: netbeans-7.0.1+dfsg1/libs.junit4/nbproject/project.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.junit4/nbproject/project.properties	2011-07-28 20:46:08.000000000 +0100
++++ netbeans-7.0.1+dfsg1/libs.junit4/nbproject/project.properties	2011-08-02 23:37:27.294165081 +0100
+@@ -42,6 +42,7 @@
+ 
+ is.autoload=true
+ release.external/junit-4.8.2.jar=modules/ext/junit-4.8.2.jar
++release.external/hamcrest-core.jar=modules/ext/hamcrest-core.jar
+ nbm.target.cluster=platform
+ sigtest.skip.check=true
+ 
+Index: netbeans-7.0.1+dfsg1/nbbuild/cluster.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/nbbuild/cluster.properties	2011-07-28 20:46:12.000000000 +0100
++++ netbeans-7.0.1+dfsg1/nbbuild/cluster.properties	2011-08-02 23:37:27.294165081 +0100
+@@ -166,9 +166,11 @@
+         javahelp,\
+         keyring,\
+         keyring.impl,\
++        libs.antlr3.devel,\
+         libs.felix,\
+         libs.jna,\
+         libs.jsr223,\
++        libs.junit4,\
+         libs.osgi,\
+         masterfs,\
+         o.jdesktop.layout,\
+@@ -929,7 +931,6 @@
+         kenai.maven,\
+         kenai.ui,\
+         libs.jira,\
+-        libs.junit4,\
+         libs.svnjavahlwin32,\
+         loadgenerator,\
+         mobility.proguard,\
diff --git a/debian/patches/netbeans-platform~launcher.patch b/debian/patches/netbeans-platform~launcher.patch
new file mode 100644
index 0000000..b95d7ec
--- /dev/null
+++ b/debian/patches/netbeans-platform~launcher.patch
@@ -0,0 +1,24 @@
+Include the jni path /usr/lib/jni on the library search path.
+
+Index: libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/unix/nbexec
+===================================================================
+--- libnb-platform-java-7.0+dfsg1.orig/o.n.bootstrap/launcher/unix/nbexec	2011-04-08 00:33:00.000000000 +0100
++++ libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/unix/nbexec	2011-06-12 21:16:28.031368069 +0100
+@@ -180,7 +180,7 @@
+ fi
+ 
+ # if heap dump on OOME is supported enable it
+-if "${jdkhome}/bin/java" -XX:+HeapDumpOnOutOfMemoryError > /dev/null 2>&1 ; then
++if "${jdkhome}/bin/java" -XX:+HeapDumpOnOutOfMemoryError &> /dev/null 2>&1 ; then
+    jargs="$jargs -XX:+HeapDumpOnOutOfMemoryError"
+    if echo $jargs | grep -v -- "-XX:HeapDumpPath=" > /dev/null ; then
+       jargs="$jargs -XX:HeapDumpPath=\"${userdir}/var/log/heapdump.hprof\""
+@@ -541,7 +541,7 @@
+     #
+     delete_new_clusters_file
+     rm -f "${restart_file}"
+-    eval ${_NB_PROFILE_CMD} "\"${jdkhome}/bin/java\"" -Djdk.home="\"${jdkhome}\"" -classpath "\"$cp\"" \
++    eval ${_NB_PROFILE_CMD} "\"${jdkhome}/bin/java\"" -Djdk.home="\"${jdkhome}\"" -Djava.library.path="/usr/lib/jni" -classpath "\"$cp\"" \
+         "$jargs" org.netbeans.Main "$args" '<&0' '&'
+     PID=$!
+     trap "kill $PID" EXIT
diff --git a/debian/patches/netbeans-platform~nbi.patch b/debian/patches/netbeans-platform~nbi.patch
new file mode 100644
index 0000000..cc16968
--- /dev/null
+++ b/debian/patches/netbeans-platform~nbi.patch
@@ -0,0 +1,15 @@
+Don't build the Netbeans Installer modules.
+
+Index: netbeans-7.0.1+dfsg1/nbbuild/cluster.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/nbbuild/cluster.properties	2011-08-02 23:37:27.294165081 +0100
++++ netbeans-7.0.1+dfsg1/nbbuild/cluster.properties	2011-08-02 23:37:32.884164057 +0100
+@@ -648,8 +648,6 @@
+         apisupport.harness,\
+         jellytools.platform,\
+         jemmy,\
+-        libs.nbi.ant,\
+-        libs.nbi.engine,\
+         nbjunit,\
+         o.n.insane
+ 
diff --git a/debian/patches/netbeans-platform~nojnabinaries.patch b/debian/patches/netbeans-platform~nojnabinaries.patch
new file mode 100644
index 0000000..fd323d5
--- /dev/null
+++ b/debian/patches/netbeans-platform~nojnabinaries.patch
@@ -0,0 +1,21 @@
+We don't need to install any JNA binaries, since they're already installed.
+
+Index: platform/libs.jna/nbproject/project.properties
+===================================================================
+--- platform.orig/libs.jna/nbproject/project.properties	2011-05-22 19:51:45.514338125 +0100
++++ platform/libs.jna/nbproject/project.properties	2011-05-22 21:56:53.854338968 +0100
+@@ -41,9 +41,9 @@
+ # made subject to such option by the copyright holder.
+ 
+ release.external/jna-3.2.7.jar=modules/ext/jna-3.2.7.jar
+-release.external/jna-3.2.7.jar!/com/sun/jna/darwin/libjnidispatch.jnilib=modules/lib/libjnidispatch.jnilib
+-release.external/jna-3.2.7.jar!/com/sun/jna/linux-amd64/libjnidispatch.so=modules/lib/amd64/Linux/libjnidispatch.so
+-release.external/jna-3.2.7.jar!/com/sun/jna/linux-i386/libjnidispatch.so=modules/lib/i386/Linux/libjnidispatch.so
+-release.external/jna-3.2.7.jar!/com/sun/jna/win32-amd64/jnidispatch.dll=modules/lib/amd64/jnidispatch.dll
+-release.external/jna-3.2.7.jar!/com/sun/jna/win32-x86/jnidispatch.dll=modules/lib/x86/jnidispatch.dll
++#release.external/jna-3.2.7.jar!/com/sun/jna/darwin/libjnidispatch.jnilib=modules/lib/libjnidispatch.jnilib
++#release.external/jna-3.2.7.jar!/com/sun/jna/linux-amd64/libjnidispatch.so=modules/lib/amd64/Linux/libjnidispatch.so
++#release.external/jna-3.2.7.jar!/com/sun/jna/linux-i386/libjnidispatch.so=modules/lib/i386/Linux/libjnidispatch.so
++#release.external/jna-3.2.7.jar!/com/sun/jna/win32-amd64/jnidispatch.dll=modules/lib/amd64/jnidispatch.dll
++#release.external/jna-3.2.7.jar!/com/sun/jna/win32-x86/jnidispatch.dll=modules/lib/x86/jnidispatch.dll
+ jnlp.indirect.files=modules/lib/**/*jnidispatch*
diff --git a/debian/patches/netbeans-platform~properties.patch b/debian/patches/netbeans-platform~properties.patch
new file mode 100644
index 0000000..2b5fec1
--- /dev/null
+++ b/debian/patches/netbeans-platform~properties.patch
@@ -0,0 +1,14 @@
+We don't include the swing layout source zip.
+
+diff -Nur netbeans-platform-6.9/o.jdesktop.layout/nbproject/project.properties netbeans-platform-6.9.new/o.jdesktop.layout/nbproject/project.properties
+--- netbeans-platform-6.9/o.jdesktop.layout/nbproject/project.properties	2010-05-31 20:58:16.000000000 +0400
++++ netbeans-platform-6.9.new/o.jdesktop.layout/nbproject/project.properties	2010-06-10 09:34:11.689150157 +0400
+@@ -42,6 +42,6 @@
+ 
+ is.autoload=true
+ release.external/swing-layout-1.0.4.jar=modules/ext/swing-layout-1.0.4.jar
+-release.external/swing-layout-1.0.4-doc.zip=docs/swing-layout-1.0.4-doc.zip
+-release.external/swing-layout-1.0.4-src.zip=docs/swing-layout-1.0.4-src.zip
++#release.external/swing-layout-1.0.4-doc.zip=docs/swing-layout-1.0.4-doc.zip
++#release.external/swing-layout-1.0.4-src.zip=docs/swing-layout-1.0.4-src.zip
+ jnlp.indirect.jars=docs/swing-layout-1.0.4-doc.zip, docs/swing-layout-1.0.4-src.zip
diff --git a/debian/patches/netbeans-platform~windowslauncher.patch b/debian/patches/netbeans-platform~windowslauncher.patch
new file mode 100644
index 0000000..f667fb8
--- /dev/null
+++ b/debian/patches/netbeans-platform~windowslauncher.patch
@@ -0,0 +1,168 @@
+Use mingw32 to build the windows launchers. These are useful if the Netbeans platform is used to build 
+another application on Debian which you want to be able to run on a Windows system.
+
+Index: libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/Makefile
+===================================================================
+--- libnb-platform-java-7.0+dfsg1.orig/o.n.bootstrap/launcher/windows/Makefile	2011-06-13 21:39:36.107758898 +0100
++++ libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/Makefile	2011-06-14 23:46:57.388989761 +0100
+@@ -34,7 +34,7 @@
+ MKDIR=mkdir
+ CP=cp
+ CCADMIN=CCadmin
+-RANLIB=ranlib
++RANLIB=i586-mingw32msvc-ranlib
+ 
+ # build
+ build: .build-post
+@@ -48,8 +48,8 @@
+ 	cp nbexec.dll ../../../nbbuild/netbeans/platform/lib/
+ 
+ nbexec.exe: nbexecexe.cpp nbexecloader.h utilsfuncs.cpp nbexec_exe.rc
+-	windres.exe -Ocoff nbexec_exe.rc nbexec_exe.res
+-	g++ -s -mno-cygwin nbexecexe.cpp utilsfuncs.cpp nbexec_exe.res -o nbexec.exe
++	i586-mingw32msvc-windres -Ocoff nbexec_exe.rc nbexec_exe.res
++	i586-mingw32msvc-g++ -s -mno-cygwin nbexecexe.cpp utilsfuncs.cpp nbexec_exe.res -o nbexec.exe
+ 
+ # clean
+ clean: .clean-post
+Index: libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec.mk
+===================================================================
+--- libnb-platform-java-7.0+dfsg1.orig/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec.mk	2011-06-13 21:39:36.137760501 +0100
++++ libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/nbproject/Makefile-nbexec.mk	2011-06-14 23:47:19.998990498 +0100
+@@ -11,12 +11,12 @@
+ MKDIR=mkdir
+ CP=cp
+ CCADMIN=CCadmin
+-RANLIB=ranlib
+-CC=gcc
+-CCC=g++
+-CXX=g++
++RANLIB=i586-mingw32msvc-ranlib
++CC=i586-mingw32msvc-gcc
++CCC=i586-mingw32msvc-g++
++CXX=i586-mingw32msvc-g++
+ FC=
+-AS=as
++AS=i586-mingw32msvc-as
+ 
+ # Macros
+ CND_PLATFORM=Cygwin-Windows
+@@ -65,22 +65,22 @@
+ ${OBJECTDIR}/platformlauncher.o: nbproject/Makefile-${CND_CONF}.mk platformlauncher.cpp 
+ 	${MKDIR} -p ${OBJECTDIR}
+ 	${RM} $@.d
+-	$(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/platformlauncher.o platformlauncher.cpp
++	$(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/platformlauncher.o platformlauncher.cpp
+ 
+ ${OBJECTDIR}/nbexec.o: nbproject/Makefile-${CND_CONF}.mk nbexec.cpp 
+ 	${MKDIR} -p ${OBJECTDIR}
+ 	${RM} $@.d
+-	$(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexec.o nbexec.cpp
++	$(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexec.o nbexec.cpp
+ 
+ ${OBJECTDIR}/nbexec.res: nbproject/Makefile-${CND_CONF}.mk nbexec.rc version.h
+ 	${MKDIR} -p ${OBJECTDIR}
+ 	@echo Compiling Resource files...
+-	windres.exe -Ocoff nbexec.rc ${OBJECTDIR}/nbexec.res
++	i586-mingw32msvc-windres -Ocoff nbexec.rc ${OBJECTDIR}/nbexec.res
+ 
+ ${OBJECTDIR}/nbexecexe.o: nbproject/Makefile-${CND_CONF}.mk nbexecexe.cpp 
+ 	${MKDIR} -p ${OBJECTDIR}
+ 	${RM} $@.d
+-	$(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexecexe.o nbexecexe.cpp
++	$(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/nbexecexe.o nbexecexe.cpp
+ 
+ : nbproject/Makefile-${CND_CONF}.mk nbexec_exe.rc 
+ 	@echo 
+@@ -89,12 +89,12 @@
+ ${OBJECTDIR}/jvmlauncher.o: nbproject/Makefile-${CND_CONF}.mk jvmlauncher.cpp 
+ 	${MKDIR} -p ${OBJECTDIR}
+ 	${RM} $@.d
+-	$(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/jvmlauncher.o jvmlauncher.cpp
++	$(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/jvmlauncher.o jvmlauncher.cpp
+ 
+ ${OBJECTDIR}/utilsfuncs.o: nbproject/Makefile-${CND_CONF}.mk utilsfuncs.cpp 
+ 	${MKDIR} -p ${OBJECTDIR}
+ 	${RM} $@.d
+-	$(COMPILE.cc) -O2 -Wall -s -I/cygdrive/c/cygwin/usr/include/mingw -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include/win32 -I/cygdrive/D/Program\ Files/Java/jdk1.6.0_22/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/utilsfuncs.o utilsfuncs.cpp
++	$(COMPILE.cc) -O2 -Wall -s -I/usr/lib/jvm/default-java/include -fPIC  -MMD -MP -MF $@.d -o ${OBJECTDIR}/utilsfuncs.o utilsfuncs.cpp
+ 
+ # Subprojects
+ .build-subprojects:
+Index: libnb-platform-java-7.0+dfsg1/apisupport.harness/windows-launcher-src/Makefile
+===================================================================
+--- libnb-platform-java-7.0+dfsg1.orig/apisupport.harness/windows-launcher-src/Makefile	2011-06-14 23:46:57.338990509 +0100
++++ libnb-platform-java-7.0+dfsg1/apisupport.harness/windows-launcher-src/Makefile	2011-06-14 23:56:49.309005828 +0100
+@@ -34,7 +34,7 @@
+ MKDIR=mkdir
+ CP=cp
+ CCADMIN=CCadmin
+-RANLIB=ranlib
++RANLIB=i586-mingw32msvc-ranlib
+ 
+ 
+ # build
+@@ -47,10 +47,11 @@
+ # Add your post 'build' code here...
+ 
+ app.res : app.rc
+-	windres -o$@ -Ocoff app.rc
++	i586-mingw32msvc-windres -o$@ -Ocoff app.rc
+ 
+ # clean
+ clean: .clean-post
++	rm -f app.res
+ 
+ .clean-pre:
+ # Add your pre 'clean' code here...
+Index: libnb-platform-java-7.0+dfsg1/apisupport.harness/windows-launcher-src/nbproject/Makefile-Release.mk
+===================================================================
+--- libnb-platform-java-7.0+dfsg1.orig/apisupport.harness/windows-launcher-src/nbproject/Makefile-Release.mk	2011-06-14 23:46:57.358990425 +0100
++++ libnb-platform-java-7.0+dfsg1/apisupport.harness/windows-launcher-src/nbproject/Makefile-Release.mk	2011-06-14 23:47:19.998990498 +0100
+@@ -11,10 +11,10 @@
+ MKDIR=mkdir
+ CP=cp
+ CCADMIN=CCadmin
+-RANLIB=ranlib
+-CC=gcc.exe
+-CCC=g++.exe
+-CXX=g++.exe
++RANLIB=i586-mingw32msvc-ranlib
++CC=i586-mingw32msvc-gcc
++CCC=i586-mingw32msvc-g++
++CXX=i586-mingw32msvc-g++
+ FC=
+ AS=
+ 
+@@ -84,7 +84,7 @@
+ # Clean Targets
+ .clean-conf:
+ 	${RM} -r build/Release
+-	${RM} ../release/launchers/app.exe.exe
++	${RM} ../release/launchers/app.exe
+ 
+ # Subprojects
+ .clean-subprojects:
+Index: libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/jvmlauncher.h
+===================================================================
+--- libnb-platform-java-7.0+dfsg1.orig/o.n.bootstrap/launcher/windows/jvmlauncher.h	2011-06-14 23:46:57.428989809 +0100
++++ libnb-platform-java-7.0+dfsg1/o.n.bootstrap/launcher/windows/jvmlauncher.h	2011-06-15 18:56:36.509511571 +0100
+@@ -50,6 +50,18 @@
+ #include <windows.h>
+ #include <string>
+ #include <list>
++
++// Use the definitions below rather than the linux jdk ones
++#define _JAVASOFT_JNI_MD_H_
++// imports, exports, and calling conventions need to match those used in a dll
++#define JNIEXPORT __declspec(dllexport)
++#define JNIIMPORT __declspec(dllimport)
++#define JNICALL __stdcall
++// Correct types for the windows platform
++typedef long jint;
++typedef __int64 jlong;
++typedef signed char jbyte;
++
+ #include "jni.h"
+ #include "utilsfuncs.h"
+ 
diff --git a/debian/patches/netbeans~build.patch b/debian/patches/netbeans~build.patch
new file mode 100644
index 0000000..b7a627c
--- /dev/null
+++ b/debian/patches/netbeans~build.patch
@@ -0,0 +1,24 @@
+Build process changes.
+
+Index: netbeans-7.0+dfsg1/nbbuild/build.xml
+===================================================================
+--- netbeans-7.0+dfsg1.orig/nbbuild/build.xml	2011-07-08 23:34:20.569768712 +0100
++++ netbeans-7.0+dfsg1/nbbuild/build.xml	2011-07-10 10:58:36.542404713 +0100
+@@ -142,7 +142,7 @@
+ 
+   <target name="init-module-list" depends="bootstrap,init-tasks">
+     <!-- Define modules. -->
+-    <checkmoduleconfigs nbroot=".."/>
++    <!--<checkmoduleconfigs nbroot=".."/>-->
+     <resolvelist name="allmodules" list="${nb.clusters.list}"/>
+     <pathconvert property="modules.fullpath" >
+         <path>
+@@ -293,7 +293,7 @@
+     <mkdir dir="${netbeans.dest.dir}/bin" />
+     <copy file="../ide/launcher/unix/netbeans" todir="${netbeans.dest.dir}/bin" />
+     <chmod file="${netbeans.dest.dir}/bin/netbeans" perm="ugo+rx"/>
+-    <copy file="../ide/launcher/windows/netbeans.exe" todir="${netbeans.dest.dir}/bin" />
++<!--    <copy file="../ide/launcher/windows/netbeans.exe" todir="${netbeans.dest.dir}/bin" />-->
+     <!-- if anybody knows better place for icons, let me know: jtulach at netbeans.org -->
+ 
+     <mkdir dir="${netbeans.dest.dir}/etc" />
diff --git a/debian/patches/netbeans~cluster-properties.patch b/debian/patches/netbeans~cluster-properties.patch
new file mode 100644
index 0000000..fa69e9e
--- /dev/null
+++ b/debian/patches/netbeans~cluster-properties.patch
@@ -0,0 +1,250 @@
+Modify the list of modules included in the Debian package.
+
+Index: netbeans-7.0.1+dfsg1/nbbuild/cluster.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/nbbuild/cluster.properties	2011-08-02 23:37:32.884164057 +0100
++++ netbeans-7.0.1+dfsg1/nbbuild/cluster.properties	2011-08-02 23:49:51.693331403 +0100
+@@ -95,9 +95,7 @@
+ clusters.config.java.list=\
+         ${clusters.config.platform.list},\
+         nb.cluster.ide,\
+-        nb.cluster.websvccommon,\
+         nb.cluster.java,\
+-        nb.cluster.profiler,\
+         nb.cluster.nb
+ 
+ clusters.config.enterprise.list=\
+@@ -218,29 +216,17 @@
+         api.debugger,\
+         api.java.classpath,\
+         api.xml,\
+-        bugtracking,\
+-        bugtracking.bridge,\
+-        bugzilla,\
+         core.browser,\
+         core.ide,\
+         csl.api,\
+         css.editor,\
+         css.visual,\
+         db,\
+-        db.core,\
+-        db.dataview,\
+-        db.drivers,\
+-        db.kit,\
+         db.metadata.model,\
+-        db.mysql,\
+-        db.sql.editor,\
+-        db.sql.visualeditor,\
+         dbapi,\
+         defaults,\
+         derby,\
+         diff,\
+-        dlight.nativeexecution,\
+-        dlight.terminal,\
+         editor,\
+         editor.actions,\
+         editor.bookmarks,\
+@@ -266,7 +252,6 @@
+         editor.util,\
+         extbrowser,\
+         extexecution,\
+-        extexecution.destroy,\
+         glassfish.common,\
+         gototest,\
+         gsf.codecoverage,\
+@@ -275,18 +260,11 @@
+         html.editor,\
+         html.editor.lib,\
+         html.lexer,\
+-        html.parser,\
+-        html.validation,\
+-        httpserver,\
+         hudson,\
+         hudson.mercurial,\
+         hudson.subversion,\
+         ide.kit,\
+         image,\
+-        javascript.editing,\
+-        javascript.hints,\
+-        javascript.kit,\
+-        javascript.refactoring,\
+         jellytools.ide,\
+         jumpto,\
+         languages,\
+@@ -298,8 +276,6 @@
+         lib.cvsclient,\
+         lib.terminalemulator,\
+         libs.antlr3.runtime,\
+-        libs.bugtracking,\
+-        libs.bugzilla,\
+         libs.bytelist,\
+         libs.commons_codec,\
+         libs.commons_logging,\
+@@ -307,12 +283,10 @@
+         libs.freemarker,\
+         libs.ini4j,\
+         libs.jakarta_oro,\
+-        libs.jaxb,\
+         libs.jsch,\
+         libs.jvyamlb,\
+         libs.jzlib,\
+         libs.lucene,\
+-        libs.smack,\
+         libs.svnClientAdapter,\
+         libs.svnClientAdapter.javahl,\
+         libs.svnClientAdapter.svnkit,\
+@@ -321,7 +295,6 @@
+         localhistory,\
+         mercurial,\
+         o.apache.xml.resolver,\
+-        o.mozilla.rhino.patched,\
+         o.n.swing.dirchooser,\
+         o.openidex.util,\
+         options.editor,\
+@@ -344,7 +317,6 @@
+         spellchecker.apimodule,\
+         spellchecker.bindings.htmlxml,\
+         spellchecker.bindings.properties,\
+-        spellchecker.dictionary_en,\
+         spellchecker.kit,\
+         spi.debugger.ui,\
+         spi.editor.hints,\
+@@ -373,7 +345,6 @@
+         xml.axi,\
+         xml.catalog,\
+         xml.core,\
+-        xml.jaxb.api,\
+         xml.lexer,\
+         xml.multiview,\
+         xml.retriever,\
+@@ -384,8 +355,7 @@
+         xml.tools,\
+         xml.wsdl.model,\
+         xml.xam,\
+-        xml.xdm,\
+-        xsl
++        xml.xdm
+ validation.nb.cluster.ide=\
+         ide.kit
+ 
+@@ -393,7 +363,6 @@
+ nb.cluster.java.depends=\
+         nb.cluster.ide,\
+         nb.cluster.platform,\
+-        nb.cluster.websvccommon,\
+         nb.cluster.harness
+ nb.cluster.java=\
+         ant.browsetask,\
+@@ -413,23 +382,14 @@
+         form,\
+         form.j2ee,\
+         form.kit,\
+-        hibernate,\
+-        hibernatelib,\
+         hudson.ant,\
+-        hudson.maven,\
+         i18n,\
+         i18n.form,\
+         j2ee.core.utilities,\
+-        j2ee.eclipselink,\
+-        j2ee.eclipselinkmodelgen,\
+-        j2ee.jpa.refactoring,\
+-        j2ee.jpa.verification,\
+         j2ee.metadata,\
+         j2ee.metadata.model.support,\
+         j2ee.persistence,\
+-        j2ee.persistence.kit,\
+         j2ee.persistenceapi,\
+-        j2ee.toplinklib,\
+         java.api.common,\
+         java.debug,\
+         java.editor,\
+@@ -459,34 +419,13 @@
+         libs.cglib,\
+         libs.javacapi,\
+         libs.javacimpl,\
+-        libs.springframework,\
+-        maven,\
+-        maven.coverage,\
+-        maven.embedder,\
+-        maven.grammar,\
+-        maven.graph,\
+-        maven.hints,\
+-        maven.indexer,\
+-        maven.junit,\
+-        maven.kit,\
+-        maven.model,\
+-        maven.osgi,\
+-        maven.persistence,\
+-        maven.repository,\
+-        maven.search,\
+-        maven.spring,\
+         o.apache.tools.ant.module,\
+         o.jdesktop.beansbinding,\
+         projectimport.eclipse.core,\
+         projectimport.eclipse.j2se,\
+         refactoring.java,\
+         spellchecker.bindings.java,\
+-        spring.beans,\
+         swingapp,\
+-        websvc.jaxws21,\
+-        websvc.jaxws21api,\
+-        websvc.saas.codegen.java,\
+-        xml.jaxb,\
+         xml.tools.java
+ validation.nb.cluster.java=\
+         java.kit
+@@ -499,16 +438,10 @@
+         nb.cluster.harness
+ nb.cluster.apisupport=\
+         apisupport.ant,\
+-        apisupport.crudsample,\
+-        apisupport.feedreader,\
+-        apisupport.installer,\
+-        apisupport.installer.maven,\
+         apisupport.kit,\
+         apisupport.osgidemo,\
+-        apisupport.paintapp,\
+         apisupport.project,\
+-        apisupport.refactoring,\
+-        maven.apisupport
++        apisupport.refactoring
+ 
+ nb.cluster.enterprise.dir=enterprise
+ nb.cluster.enterprise.depends=\
+@@ -632,7 +565,6 @@
+         nb.cluster.harness
+ nb.cluster.nb=\
+         autoupdate.pluginimporter,\
+-        bugzilla.exceptionreporter,\
+         ide.branding,\
+         ide.branding.kit,\
+         lib.uihandler,\
+@@ -917,7 +849,6 @@
+ nb.cluster.stableuc=\
+         apisupport.apidocs,\
+         apisupport.tc.cobertura,\
+-        bugtracking.kenai,\
+         db.mysql.sakila,\
+         j2ee.sun.appsrv81,\
+         jconsole,\
+@@ -926,7 +857,6 @@
+         jmx.common,\
+         junitlib,\
+         kenai,\
+-        kenai.maven,\
+         kenai.ui,\
+         libs.jira,\
+         libs.svnjavahlwin32,\
+Index: netbeans-7.0.1+dfsg1/nbbuild/build.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/nbbuild/build.properties	2011-07-28 20:46:12.000000000 +0100
++++ netbeans-7.0.1+dfsg1/nbbuild/build.properties	2011-08-02 23:48:27.903331654 +0100
+@@ -153,7 +153,6 @@
+     lexer,\
+     api.xml,\
+     o.apache.tools.ant.module,\
+-    db,\
+     spi.quicksearch,\
+     print,\
+     extexecution
diff --git a/debian/patches/netbeans~empty-binaries-list.patch b/debian/patches/netbeans~empty-binaries-list.patch
new file mode 100644
index 0000000..08001cc
--- /dev/null
+++ b/debian/patches/netbeans~empty-binaries-list.patch
@@ -0,0 +1,728 @@
+Empty all the binaries-list files so nothing gets downloaded.
+
+Index: netbeans-7.0.1+dfsg1/apisupport.feedreader/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/apisupport.feedreader/external/binaries-list	2011-07-28 20:44:52.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-A2AC1CD690AB4C80DEFE7F9BCE14D35934C35CEC jdom-1.0.jar
+-EA66BB8EBA805BAD567DB5A6730F96AC89062601 rome-0.6.jar
+-7408D747109A701926646E859C8907D3A7C9B26E rome-fetcher-0.6.jar
+Index: netbeans-7.0.1+dfsg1/apisupport.harness/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/apisupport.harness/external/binaries-list	2011-07-28 20:44:52.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-D4EF66C1CC8A5B3C97E0CC7C210227AAEC1F1086 jsearch-2.0_05.jar
+-A806D99716C5E9441BFD8B401176FDDEFC673022 bindex-2.2.jar
+Index: netbeans-7.0.1+dfsg1/cnd.modelimpl/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/cnd.modelimpl/external/binaries-list	2011-07-28 20:45:04.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-296C195B720404C2683BA2F65E2A423DD0611B8B open-fortran-parser-0.7.1.2.zip
+-
+Index: netbeans-7.0.1+dfsg1/core.nativeaccess/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/core.nativeaccess/external/binaries-list	2011-07-28 20:45:12.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-AF109BEA46056EF1D09172A96E968ADFA8CE74F1 platform-3.2.7.jar
+Index: netbeans-7.0.1+dfsg1/css.editor/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/css.editor/external/binaries-list	2011-07-28 20:45:12.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-901D8F815922C435D985DA3814D20E34CC7622CB css21-spec.zip
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/css.visual/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/css.visual/external/binaries-list	2011-07-28 20:45:14.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-B7D59DC172005598B55699B1A75605B13C14F1FD flute-1.3.jar
+-3764096F289F38736CCC6755D97A5848FCE7D125 sac-1.3.jar
+Index: netbeans-7.0.1+dfsg1/db.drivers/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/db.drivers/external/binaries-list	2011-07-28 20:45:14.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-631249C6055BE15A1FAB26B3C28A3E5C6F3D97E0 mysql-connector-java-5.1.13-bin.jar
+-33D531C3C53055DDCBEA3D88BFA093466FFEF924 postgresql-8.3-603.jdbc3.jar
+-
+Index: netbeans-7.0.1+dfsg1/db.sql.visualeditor/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/db.sql.visualeditor/external/binaries-list	2011-07-28 20:45:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-EE416CB5D6AA88473EFE487F42DC1410360F7948 javacc-3.2.jar
+Index: netbeans-7.0.1+dfsg1/db/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/db/external/binaries-list	2011-07-28 20:45:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-F787C9B484CD7526F866C21D8925C4DACE467F8A derby-10.2.2.0.jar
+-97771BE04E7452FC197EB875D2591A7E91F274D0 derby-10.2.2.0.zip
+Index: netbeans-7.0.1+dfsg1/dlight.dtrace/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/dlight.dtrace/external/binaries-list	2011-07-28 20:45:18.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-F1AF5929CD612475CCF186F69E268F0CAAA2A90E dtracectrl-0.1.zip
+Index: netbeans-7.0.1+dfsg1/dlight.libs.h2/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/dlight.libs.h2/external/binaries-list	2011-07-28 20:45:20.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-623DE5A3A60FEA313099D7C42256B146E2BEE9B2 h2-1.0.79.jar
+Index: netbeans-7.0.1+dfsg1/extexecution.destroy/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/extexecution.destroy/external/binaries-list	2011-07-28 20:45:26.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,5 +0,0 @@
+-C9757EFB2CFBA523A7375A78FA9ECFAF0D0AC505 winp-1.14-patched.jar
+-2E07375E5CA3A452472F0E87FB33F243F7A5C08C libpam4j-1.1.jar
+-E66876EB5F33AA0E57F035F1AADD8C44FEAE7FCB processtreekiller-1.0.1.jar
+-A8762D07E76CFDE2395257A5DA47BA7C1DBD3DCE commons-io-1.4.jar
+-
+Index: netbeans-7.0.1+dfsg1/groovy.editor/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/groovy.editor/external/binaries-list	2011-07-28 20:45:32.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-559C961A6CE793FAC94C8040253EA1FBD32B668B groovy-all-1.6.4.jar
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/hibernatelib/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/hibernatelib/external/binaries-list	2011-07-28 20:45:36.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-C8A5E0D558EA7E7349F9D32B838553D5E7DD214F hibernate-3.2.5-lib.zip
+Index: netbeans-7.0.1+dfsg1/html.editor/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/html.editor/external/binaries-list	2011-07-28 20:45:36.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-23123BB29025254556B6E573023FCDF0F6715A66 html-4.01.zip
+Index: netbeans-7.0.1+dfsg1/html.parser/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/html.parser/external/binaries-list	2011-07-28 20:45:38.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-D528B44AE7593D2275927396BF930B28078C5220 htmlparser-1.2.1.jar
+-4388C34B9F085A42FBEA06C5B00FDF0A251171EC html5doc.zip
+-E796ACB5645C08FF0F9D2A6A2F76673CE1217EBB icu4j-4_0.jar
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/html.validation/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/html.validation/external/binaries-list	2011-07-28 20:45:38.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,12 +0,0 @@
+-2D859791FBF7D880591864BD4004D8442A8A3B81 commons-logging-1.1.1.jar
+-DA6E46D20241CCC81EDB3525A241114B95177FD7 commons-logging-api-1.1.1.jar
+-77DB1AFF3C0730C144D30C9935A1CD8DCD2488A9 html5-datatypes.jar
+-A2862B7795EF0E0F0716BEC84528FA3B629E479C io-xml-util.jar
+-0DCC973606CBD9737541AA5F3E76DED6E3F4D0D0 iri.jar
+-C0C5653D2200F2BD2E834B26DFDBC830D07FA0F4 jing.jar
+-71F7D2D5A3CF17CECBD15049A856BC0245C95C56 js.jar
+-F0A0D2E29ED910808C33135A3A5A51BBA6358F7B log4j-1.2.15.jar
+-A1C0ED8C43A306E3FB7676E7463204B9DA9BE290 non-schema.jar
+-7A5A7DF07297A86A944D4D0562C685585B0734EF validator.jar
+-4A7F02539072972FB8FED9C734AF40B7108B60B0 saxon9B.jar
+-FACC6D84B0B0A650B1D44FED941E9ADD9F326862 isorelax20041111.jar
+Index: netbeans-7.0.1+dfsg1/httpserver/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/httpserver/external/binaries-list	2011-07-28 20:45:38.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-CD5B5996B46CB8D96C8F0F89A7A734B3C01F3DF7 tomcat-webserver-3.2.jar
+Index: netbeans-7.0.1+dfsg1/j2ee.dd/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/j2ee.dd/external/binaries-list	2011-07-28 20:45:44.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-D2F2B34B7D0A13256D491B14590ED23CA0E49B46 javaee-api-5.jar
+Index: netbeans-7.0.1+dfsg1/j2ee.eclipselink/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/j2ee.eclipselink/external/binaries-list	2011-07-28 20:45:46.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-8C9BFFBCB34DB6E9C9C03413623F05375D44CE49 eclipselink-2.2.0.jar
+-3BCA561B1B7B284B3D3C097F92A9CD47FF485058 eclipselink-javax.persistence-2.0.jar
+Index: netbeans-7.0.1+dfsg1/j2ee.eclipselinkmodelgen/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/j2ee.eclipselinkmodelgen/external/binaries-list	2011-07-28 20:45:46.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-263D76EEB2FA35AE240DE31CFDE83C04096AE19E eclipselink-jpa-modelgen-2.2.0.jar
+Index: netbeans-7.0.1+dfsg1/j2ee.platform/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/j2ee.platform/external/binaries-list	2011-07-28 20:45:48.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-DC9A229C4AB1788D0C20D937A82FB64CE2911171 javaee6-doc-api.zip
+Index: netbeans-7.0.1+dfsg1/j2ee.toplinklib/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/j2ee.toplinklib/external/binaries-list	2011-07-28 20:45:52.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-59FAD2A4D4A1CFECED8149854EEEC3A7B9668927 glassfish-persistence-v2-build-58g.jar
+-907363E301E2279930C82BEB466BF2053C6E993B glassfish-persistence-v2ur1-build-09d.jar
+Index: netbeans-7.0.1+dfsg1/j2eeapis/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/j2eeapis/external/binaries-list	2011-07-28 20:45:52.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-EC24BF46E047E735ED802DFA8B9FCA2ED8FB11B0 jsr88javax.jar
+Index: netbeans-7.0.1+dfsg1/j2me.cdc.project.ricoh/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/j2me.cdc.project.ricoh/external/binaries-list	2011-07-28 20:45:52.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-397F4731A9F9B6EB1907E224911C77EA3AA27A8B commons-codec-1.3.jar
+-336A280D178BB957E5233189F0F32E067366C4E5 commons-httpclient-3.0.jar
+-793B8D020D81284E0B67FB635C17026121F06433 RicohAntTasks-2.0.jar
+Index: netbeans-7.0.1+dfsg1/javacard.apdu.io/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/javacard.apdu.io/external/binaries-list	2011-07-28 20:45:58.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-9C1A8BC9D3270D184F1D1BCC5F60AA81D46E1ADF apduio.jar
+Index: netbeans-7.0.1+dfsg1/javacard.ri.bundle/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/javacard.ri.bundle/external/binaries-list	2011-07-28 20:46:00.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-6243337E93F5841D4FFB404011AA076BFEB1590A javacard_ri.zip
+Index: netbeans-7.0.1+dfsg1/javacard.ri.platform/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/javacard.ri.platform/external/binaries-list	2011-07-28 20:46:00.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-33DCFAE258453BDD3D8A042F6ECF80656A82B8DD anttasks.jar
+Index: netbeans-7.0.1+dfsg1/javaee.api/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/javaee.api/external/binaries-list	2011-07-28 20:46:00.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,5 +0,0 @@
+-D6F416983EA13C334D5C599A9045414ECAF5D66D javaee-api-6.0.jar
+-EBEC44255251E6D3B8DDBAF701F732DAF0238CBF javaee-web-api-6.0.jar
+-B290091E71DEED6CE7F9EB40523D49C26399A2B4 javax.annotation.jar
+-EB77D3664EEA27D67B799ED28CB766B4D0971505 jaxb-api-osgi.jar
+-A5744971ACE1F44A0FC71CCB93DE530CB3022965 webservices-api-osgi.jar
+Index: netbeans-7.0.1+dfsg1/javahelp/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/javahelp/external/binaries-list	2011-07-28 20:46:00.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-CA70822C47A67FC3A11670270567C2D01566DAE1 jhall-2.0_05.jar
+Index: netbeans-7.0.1+dfsg1/javascript.editing/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/javascript.editing/external/binaries-list	2011-07-28 20:46:00.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,4 +0,0 @@
+-098B14300B35E1053AA9945FF2C1CDA164F43B33 js-domstubs.zip
+-5756AA27E54A3EC6C8CDAE32F49BCA7BC139EB15 jsstubs.zip
+-CD33537FD47E801E01B427997F3DE4016159B414 preindexed.zip
+-C56F4F5C42102A67F56EB8F12D0219E92E5307C2 sdocs.zip
+Index: netbeans-7.0.1+dfsg1/jemmy/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/jemmy/external/binaries-list	2011-07-28 20:46:02.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-418FC62C8A6EF5311987B01FE389B1F88EFDDCA2 jemmy-2.3.0.0.jar
+Index: netbeans-7.0.1+dfsg1/libs.antlr3.devel/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.antlr3.devel/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-1E18576780EB117E410E7A262453A99B01E55B02 antlr-3.1.3.jar
+-6FE2E3BB57DAEBD1555494818909F9664376DD6C stringtemplate-3.2.jar
+Index: netbeans-7.0.1+dfsg1/libs.antlr3.runtime/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.antlr3.runtime/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-3154E3DFD5B7466DF8F5151A95BE70584F74F76C antlr-runtime-3.1.3.jar
+-
+Index: netbeans-7.0.1+dfsg1/libs.bugtracking/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.bugtracking/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,5 +0,0 @@
+-7D3CCD3ED4DB57F2B746F5ABAF86D10F222AEB87 org.eclipse.mylyn.commons.core_3.3.1.jar
+-02C39E6C02E2386D4936245F90AC4BFA5A7BCD49 org.eclipse.mylyn.commons.net_3.3.0.jar
+-DF522A06BF4EFD99A12C545C294D940CF6A2E01D org.eclipse.mylyn.tasks.core_3.3.1.jar
+-964CD74171F427720480EFDEC40A7C7F6E58426A commons-httpclient-3.1.jar
+-0EECDAC8C86BC84B4BDFC24371BA8C785A1FC552 commons-lang-2.3.jar
+Index: netbeans-7.0.1+dfsg1/libs.bugzilla/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.bugzilla/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-94408B54D039DA036A668C6B331EF944AF2E90EC org.eclipse.mylyn.bugzilla.core_3.3.1.jar
+Index: netbeans-7.0.1+dfsg1/libs.bytelist/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.bytelist/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-886FAF4B85054DD6E50D9B3438542F432B5F9251 bytelist-0.1.jar
+Index: netbeans-7.0.1+dfsg1/libs.cglib/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.cglib/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-97D03461DC1C04FFC636DCB2579AAE7724A78EF2 cglib-2.2.jar
+Index: netbeans-7.0.1+dfsg1/libs.commons_codec/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.commons_codec/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-FD32786786E2ADB664D5ECC965DA47629DCA14BA apache-commons-codec-1.3.jar
+Index: netbeans-7.0.1+dfsg1/libs.commons_fileupload/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.commons_fileupload/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-2366159E25523D99E96D05211A2FA5399C938735 commons-fileupload-1.0.jar
+Index: netbeans-7.0.1+dfsg1/libs.commons_logging/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.commons_logging/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-BA24D5DE831911B684C92CD289ED5FF826271824 commons-logging-1.1.jar
+Index: netbeans-7.0.1+dfsg1/libs.commons_net/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.commons_net/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-ABB932ADB2C10790C1EAA4365D3AC2A1AC7CB700 commons-net-1.4.1.jar
+Index: netbeans-7.0.1+dfsg1/libs.elimpl/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.elimpl/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-2EA8E5BDC70E1B1D738140E52E4793385B2567A3 el-impl.jar
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/libs.felix/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.felix/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-08676C719D33D26DF4F3988E210A04D7F11183B7 felix-2.0.3.jar
+-BD5615C6A15497B60A0AAA9A04D4F05E2BC42D07 felix-main-2.0.2.jar
+Index: netbeans-7.0.1+dfsg1/libs.freemarker/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.freemarker/external/binaries-list	2011-07-28 20:46:06.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-4C7CF4ED0436A450EA759C2DFD7485A6929CC401 freemarker-2.3.8.jar
+Index: netbeans-7.0.1+dfsg1/libs.glassfish_logging/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.glassfish_logging/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-D813E05A06B587CD0FE36B00442EAB03C1431AA9 glassfish-logging-2.0.jar
+Index: netbeans-7.0.1+dfsg1/libs.ini4j/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.ini4j/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-8E737D82ECAC9BA6100A9BBA71E92A381B75EFDC ini4j-0.5.1.jar
+Index: netbeans-7.0.1+dfsg1/libs.jakarta_oro/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.jakarta_oro/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-5592374F834645C4AE250F4C9FBB314C9369D698 jakarta-oro-2.0.8.jar
+Index: netbeans-7.0.1+dfsg1/libs.javacup/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.javacup/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-1DE46CC85D147D9F91AF59D4A0107091C8B112D6 java-cup-11a.jar
+Index: netbeans-7.0.1+dfsg1/libs.jaxb/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.jaxb/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,4 +0,0 @@
+-2EC69BD69B66B0DABEA392DE713A11F975001760 jaxb-impl.jar
+-F02664A059617D060BEC3EBA0BC002B2102AEB84 jaxb1-impl.jar
+-64D468922B85A9626178AEDF564FFDBDE980B3EC jaxb-xjc.jar
+-27FAE927B5B9AE53A5B0ED825575DD8217CE7042 jaxb-api-doc.zip
+Index: netbeans-7.0.1+dfsg1/libs.jna/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.jna/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-4F25AA7292F70E721A9B96A6ED49365BA6E03EAB jna-3.2.7.jar
+Index: netbeans-7.0.1+dfsg1/libs.junit4/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.junit4/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-C94F54227B08100974C36170DCB53329435FE5AD junit-4.8.2.jar
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/libs.jvyamlb/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.jvyamlb/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-46B7DB09C148A16ED8D6186D05D25C693DE63CA8 jvyamlb-0.2.3.jar
+Index: netbeans-7.0.1+dfsg1/libs.jzlib/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.jzlib/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-F406B7784A0DA5C4670B038BF55A4DCD4AF30AEB jzlib-1.0.7.jar
+Index: netbeans-7.0.1+dfsg1/libs.lucene/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.lucene/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-335F7EA0E28A4A1358AA745F4BD2037E8AFE44FC lucene-core-3.0.3.jar
+Index: netbeans-7.0.1+dfsg1/libs.osgi/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.osgi/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-986195A7E31034EE73F7A896A36B24169692F142 osgi.core-4.2.jar
+-972E6455724DC6ADB1C1912F53B5E3D7DF20C5FD osgi.cmpn-4.2.jar
+Index: netbeans-7.0.1+dfsg1/libs.smack/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.smack/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-916A0FE08D840A08C950F49FB59B961E14D673B8 smack.jar
+-BA1365C7E5F3CF7F7641B354677B3F54A6EA5A15 smackx.jar
+Index: netbeans-7.0.1+dfsg1/libs.springframework/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.springframework/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-2D0D28E05BD6B6452DAAFE2B5CCB69A84EA63E5D spring-2.5.6.SEC01.jar
+-D88A41174C5F85D1B791D6A8E0F8B8A1C459D6C0 spring-framework-3.0.2.RELEASE.zip
+Index: netbeans-7.0.1+dfsg1/libs.svnClientAdapter.javahl/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.svnClientAdapter.javahl/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-0B9606F570B28FFC4FCE6C7222B88B3DCEFB1A36 svnClientAdapter-javahl-1.6.13.jar
+-0A79F5191E5F3FE372E8B88EA1B32D6D044CCA99 svnjavahl-1.6.0.jar
+Index: netbeans-7.0.1+dfsg1/libs.svnClientAdapter.svnkit/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.svnClientAdapter.svnkit/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,5 +0,0 @@
+-0AE20EC02958F193ADAB4C272ACCF6FE3196DCA0 svnClientAdapter-svnkit-1.6.13.jar
+-AB271CFC19469D9088BE306685A7AC8787373F99 svnkit-javahl.jar
+-636C6FF256A978B786D7502F43E788448E9DAB4B svnkit-1.3.4.jar
+-538D727A9A0874019FB11280F07CE3F43EE723BC sqljet-1.0.3.jar
+-68B82D7246FD90E0FC70BB9C8F10611489BF371A trilead.jar
+Index: netbeans-7.0.1+dfsg1/libs.svnClientAdapter/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.svnClientAdapter/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-A11623D2AF72A99C1509EC2A0ADA2DACBEE9A8E4 svnClientAdapter-main-1.6.13.jar
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/libs.swingx/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.swingx/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-7C6ED64C55164C5AE0394E11303CA95CB24166AF swingx-0.9.5.jar
+Index: netbeans-7.0.1+dfsg1/libs.xerces/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.xerces/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-6E60617C9D81EA1EF96913C226900BC2D1E69C37 xerces-2.8.0.jar
+Index: netbeans-7.0.1+dfsg1/maven.embedder/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/maven.embedder/external/binaries-list	2011-07-28 20:46:08.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-A2AC1CD690AB4C80DEFE7F9BCE14D35934C35CEC jdom-1.0.jar
+-653A6AD1EF786BC577FC20F56E5F2B1D30423805 maven-dependency-tree-1.2.jar
+-A511890049A6A9B8D675F4417721337580CBD2F9 apache-maven-3.0.3-bin.zip
+Index: netbeans-7.0.1+dfsg1/mobility.antext/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/mobility.antext/external/binaries-list	2011-07-28 20:46:10.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-943CD5C8802B2A3A64A010EFB86EC19BAC142E40 ant-contrib-1.0b3.jar
+Index: netbeans-7.0.1+dfsg1/mobility.deployment.webdav/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/mobility.deployment.webdav/external/binaries-list	2011-07-28 20:46:10.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,4 +0,0 @@
+-B96ED57072F0D2E6F66DD016E72B8AE9B043D143 commons-httpclient-3.0.1.jar
+-CEF99941E945D543DF0711F2C6AEF765B50F8501 jakarta-slide-ant-webdav-2.1.jar
+-D1B5BA3BFE8DCFAF08A0468F8879EF1D0E998038 jakarta-slide-webdavlib-2.1.jar
+-A2AC1CD690AB4C80DEFE7F9BCE14D35934C35CEC jdom-1.0.jar
+Index: netbeans-7.0.1+dfsg1/mobility.j2meunit/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/mobility.j2meunit/external/binaries-list	2011-07-28 20:46:10.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-2FB485DD8C5EFC7972037781BFFF0CE31316FCE6 jmunit-1.2.1-api.zip
+-BD84F1A4C0789070CC62A8D2DBA75121A57C069C jmunit4cldc10-1.2.1.jar
+-D76B8334DCBDBE93297AA5C02B17D9A856E72246 jmunit4cldc11-1.2.1.jar
+Index: netbeans-7.0.1+dfsg1/nbbuild/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/nbbuild/external/binaries-list	2011-07-28 20:46:12.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-E160D64FA4680FD5C581A0F5AB516D88FB09AD47 apitest.jar
+-
+Index: netbeans-7.0.1+dfsg1/o.apache.tools.ant.module/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/o.apache.tools.ant.module/external/binaries-list	2011-07-28 20:46:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-FF23DBB427D09AAEC3998B50D740C42B6A3FCD61 ant-libs-1.8.2.zip
+-058F5EB0A15A7F6E48895F64F4AFBF7E00760AA9 ant-misc-1.8.2.zip
+Index: netbeans-7.0.1+dfsg1/o.apache.xml.resolver/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/o.apache.xml.resolver/external/binaries-list	2011-07-28 20:46:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-B0D0FCBAC68826D2AFA3C7C89FC4D57B95A000C3 resolver-1.2.jar
+Index: netbeans-7.0.1+dfsg1/o.jdesktop.beansbinding/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/o.jdesktop.beansbinding/external/binaries-list	2011-07-28 20:46:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-F7BD95641780C2AAE8CB9BED1686441A1CE5E749 beansbinding-1.2.1-doc.zip
+-C4F88C2CFC1F3F72451CDE2AA3BB1F40879801FD beansbinding-1.2.1.jar
+Index: netbeans-7.0.1+dfsg1/o.jdesktop.layout/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/o.jdesktop.layout/external/binaries-list	2011-07-28 20:46:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-1C7FE319052EF49126CF07D0DB6953CB7007229E swing-layout-1.0.4-doc.zip
+-69D72835E165439CF7816EFDA65868FD4E0C6E2A swing-layout-1.0.4.jar
+-D2503D2217868ABAE1A5E7480A9CCA1DB3522464 swing-layout-1.0.4-src.zip
+Index: netbeans-7.0.1+dfsg1/o.mozilla.rhino.patched/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/o.mozilla.rhino.patched/external/binaries-list	2011-07-28 20:46:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-1162833E0FE87B69B99B1F7DEB3A6C386EAB6F84 rhino1_7R2rc1.zip
+Index: netbeans-7.0.1+dfsg1/o.n.mobility.lib.activesync/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/o.n.mobility.lib.activesync/external/binaries-list	2011-07-28 20:46:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-3A5C68B301F42D3E8D89976F90D4E2AE6F2984B6 nbactivesync-5.0.jar
+-84FE71831D0F320106B25776C3630001800FB35E nbactivesync.dll
+Index: netbeans-7.0.1+dfsg1/php.editor/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/php.editor/external/binaries-list	2011-07-28 20:46:26.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-40BC40A6E6DBD598900E8FAB87E460FCC601275C predefined_vars.zip
+Index: netbeans-7.0.1+dfsg1/php.phpdoc.documentation/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/php.phpdoc.documentation/external/binaries-list	2011-07-28 20:46:28.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-0702230EB3354A1687E4496D73A94F33A1E343BD phpdocdesc.zip
+Index: netbeans-7.0.1+dfsg1/php.project/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/php.project/external/binaries-list	2011-07-28 20:46:28.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-C3E8FC2F69123F598F29F930DC39F5B55A08824C phpsigfiles.zip
+-06D0F78D33106A7E5D33B414BE4CA0CE474D969A preindexed-php.zip
+Index: netbeans-7.0.1+dfsg1/servletapi/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/servletapi/external/binaries-list	2011-07-28 20:46:48.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-85F9EE8921A08E5478118005D5829C6A1637374B servlet-2.2.jar
+Index: netbeans-7.0.1+dfsg1/servletjspapi/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/servletjspapi/external/binaries-list	2011-07-28 20:46:48.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-B9FA9CDC7FA5203E1DB5C4DBAAED0133596D524F servlet3.0-jsp2.2-api.jar
+Index: netbeans-7.0.1+dfsg1/spellchecker.dictionary_en/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/spellchecker.dictionary_en/external/binaries-list	2011-07-28 20:46:48.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-F90E3DA5259DB07F36E6987EFDED647A5231DE76 ispell-enwl-3.1.20.zip
+Index: netbeans-7.0.1+dfsg1/spring.webmvc/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/spring.webmvc/external/binaries-list	2011-07-28 20:46:54.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-1A48EDCF8DCFC76882C821931EB0529DB9AF5D9B spring-webmvc-2.5.6.SEC01.jar
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/svg.perseus/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/svg.perseus/external/binaries-list	2011-07-28 20:47:02.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-2EF44D925014E2EF76416535CC0F3A7C7E9F4AE1 perseus-nb-1.0.jar
+Index: netbeans-7.0.1+dfsg1/swing.validation/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/swing.validation/external/binaries-list	2011-07-28 20:47:02.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-55CD0B272084EB80B8C91F3A0617BB602B4EF2DF ValidationAPI.jar
+Index: netbeans-7.0.1+dfsg1/swingapp/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/swingapp/external/binaries-list	2011-07-28 20:47:02.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-B456600D274B835E1E7DDB16FD843DDAB2ED3EF1 appframework-1.0.3-doc.zip
+-338045FEFF6E61DF237AAFD11B6F3FE1A3B4E60E appframework-1.0.3.jar
+-DC9F8D6F7236087924AAD28FBEC794A087DD1B3D swing-worker-1.1.jar
+Index: netbeans-7.0.1+dfsg1/web.core.syntax/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.core.syntax/external/binaries-list	2011-07-28 20:47:14.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-F6E990DF59BD1FD2058320002A853A5411A45CD4 syntaxref20.zip
+Index: netbeans-7.0.1+dfsg1/web.jsf.editor/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.jsf.editor/external/binaries-list	2011-07-28 20:47:16.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-93A58E37BA1D014375B1578F3D904736CB2D408F jsf-api-docs.zip
+Index: netbeans-7.0.1+dfsg1/web.jsf12/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.jsf12/external/binaries-list	2011-07-28 20:47:18.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-B9DB1A789C301F1D31DD6CC524DA2EBD7F89190D jsf-1.2.zip
+Index: netbeans-7.0.1+dfsg1/web.jspparser/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.jspparser/external/binaries-list	2011-07-28 20:47:18.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-7763236B189D9B910E2BDBA6822E6EB4DDDAC41B glassfish-jspparser-3.0.jar
+Index: netbeans-7.0.1+dfsg1/web.jstl11/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.jstl11/external/binaries-list	2011-07-28 20:47:18.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-3375E43C620DF4F1114959400FF9BB90D12A2FEB jstl-1.1.2.jar
+-A17E8A4D9A1F7FCC5EED606721C9ED6B7F18ACF7 standard-1.1.2.jar
+Index: netbeans-7.0.1+dfsg1/web.monitor/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.monitor/external/binaries-list	2011-07-28 20:47:18.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-2C033740B8F78C1081AF25C0173FC57317D2783A servlet-2.3.jar
+Index: netbeans-7.0.1+dfsg1/web.primefaces/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.primefaces/external/binaries-list	2011-07-28 20:47:18.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-C31A6E33D7D6E77C8123A0830D929187A9707147 primefaces-2.2.1.jar
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/web.struts/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.struts/external/binaries-list	2011-07-28 20:47:18.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-E11C2384FDEAE4F96E433C2A0339DCFC5202CC17 struts-1.3.8-javadoc.zip
+-A3F62096FB53E14CF09B006458333792890CE429 struts-1.3.8-lib.zip
+Index: netbeans-7.0.1+dfsg1/websvc.jaxws21/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/websvc.jaxws21/external/binaries-list	2011-07-28 20:47:20.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-2F43A634A42CC4FD2EF9E24B488AFFD6984D3411 jaxws-2.2.zip
+-8ECD169E9E308C258287E4F28B03B6D6F1E55F47 jaxws-api-doc.zip
+Index: netbeans-7.0.1+dfsg1/websvc.jaxws21api/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/websvc.jaxws21api/external/binaries-list	2011-07-28 20:47:20.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-23E69F0F17757673C573EBD9899727B82EF7DB7F jaxws-2.2-api.zip
+Index: netbeans-7.0.1+dfsg1/websvc.metro.lib/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/websvc.metro.lib/external/binaries-list	2011-07-28 20:47:20.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-FDECFB78184C7D19E7E20130A7D7E88C1DF0BDD1 metro-1.4-doc.zip
+-16CD40905B389B27AFD81DAFF8F163CEC810FBC6 metro-2.0.zip
+Index: netbeans-7.0.1+dfsg1/websvc.restlib/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/websvc.restlib/external/binaries-list	2011-07-28 20:47:24.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,9 +0,0 @@
+-BD6C7BD1452456F2F6B2A8CF6C4166493A24ABED jersey-1.3.zip
+-955396DB8CE0477C6BD70BA830FF84CB9B7AB47B jersey-client-1.3-javadoc.jar
+-A27843863A5EAE9DDFF1C70F7A95D3BFC2A59D99 jersey-core-1.1.5.1-javadoc.jar
+-6E3105315F3100F65D66355B04BA6B6C2B8480D3 jersey-json-1.3-javadoc.jar
+-F10ED4F2ECC7724F7C25D586DC9F25377581CCFC jersey-multipart-1.3-javadoc.jar
+-123A7BAAE06D938E5E4533ED745EEE7377E73ED8 jersey-spring-1.3-javadoc.jar
+-BAEA0B9171897175B0B3E20BDF532EF4CFD44CEE oauth-client-1.3-javadoc.jar
+-4855C8481C6951F39DC117C44CA8EE70BF2B003F oauth-signature-1.3-javadoc.jar
+-FFE3425E304F0836912D2B8ABFB5302100B39423 jsr311-api-1.1.1-javadoc.jar
+Index: netbeans-7.0.1+dfsg1/xml.jaxb.api/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/xml.jaxb.api/external/binaries-list	2011-07-28 20:47:28.000000000 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,3 +0,0 @@
+-D107B729E3CCD30E84A5E0229F900BF95DB10FC1 activation.jar
+-BCF23B1D858C6F69D67C851D497984D25345D0B1 jaxb-api.jar
+-8B7A70786148944EF061FCA58B5467D05DAE07BA jsr173_api.jar
+Index: netbeans-7.0.1+dfsg1/cnd.discovery/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/cnd.discovery/external/binaries-list	2011-08-04 21:48:10.658409190 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-5C917BCC015510DC6C7E3B511DB85B2978C0774C cnd-build-trace-1.0.zip
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/cnd.remote/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/cnd.remote/external/binaries-list	2011-08-04 21:48:10.568408997 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-84F10BEAA967E2896F0B43B0BBD08D834841F554 cnd-rfs-1.0.zip
+Index: netbeans-7.0.1+dfsg1/derby/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/derby/external/binaries-list	2011-08-04 21:48:10.538414649 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-C9A6304FAA121C97CB2458B93D30B1FD6F0F7691 derbysampledb.zip
+-
+Index: netbeans-7.0.1+dfsg1/libs.javacapi/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.javacapi/external/binaries-list	2011-08-04 21:48:10.598410325 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-ADD5DE96BF7F30DAA4EC41D70610CF72A16F58FD javac-api-nb-7.0-b07.jar
+Index: netbeans-7.0.1+dfsg1/libs.javacimpl/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.javacimpl/external/binaries-list	2011-08-04 21:48:10.498413320 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-AA6FD013C506BAC98BCE1174EACAD00383650342 javac-impl-nb-7.0-b07.jar
+Index: netbeans-7.0.1+dfsg1/libs.jsch/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/libs.jsch/external/binaries-list	2011-08-04 21:48:10.688408788 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-563D2C4728DA8351559154925B5903C259382C5B jsch-0.1.44.jar
+\ No newline at end of file
+Index: netbeans-7.0.1+dfsg1/maven.indexer/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/maven.indexer/external/binaries-list	2011-08-04 21:48:10.628409381 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1,2 +0,0 @@
+-AF599F03E590A5992EE56F363DBD8F0F32B8787E indexer-artifact-4.1.0.jar
+-CAF99EFBB25E9183609D6FBA4F63D85E7606903F indexer-core-4.1.0.jar
+Index: netbeans-7.0.1+dfsg1/web.jsf20/external/binaries-list
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.jsf20/external/binaries-list	2011-08-04 21:48:10.408409015 +0100
++++ /dev/null	1970-01-01 00:00:00.000000000 +0000
+@@ -1 +0,0 @@
+-1D74DA79DC71C52D1B7916853BDD51F346A85359 jsf-2.1.zip
diff --git a/debian/patches/netbeans~ide-launcher.patch b/debian/patches/netbeans~ide-launcher.patch
new file mode 100644
index 0000000..4465add
--- /dev/null
+++ b/debian/patches/netbeans~ide-launcher.patch
@@ -0,0 +1,69 @@
+Update the launcher to work in Debian.
+
+Index: netbeans-7.0.1+dfsg1/ide/launcher/unix/netbeans
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/ide/launcher/unix/netbeans	2011-07-28 20:45:40.000000000 +0100
++++ netbeans-7.0.1+dfsg1/ide/launcher/unix/netbeans	2011-08-02 23:42:39.694164784 +0100
+@@ -41,6 +41,17 @@
+ # Version 2 license, then the option applies only if the new code is
+ # made subject to such option by the copyright holder.
+ 
++# The Startup Notification Protocol Specification established by freedesktop.org
++# recommends to unset the DESKTOP_STARTUP_ID environment variable to avoid
++# possible reuse by some process started later by this process, e.g. when a browser
++# will be started after clicking a hyperlink in the NetBeans.
++if [ ! -z $DESKTOP_STARTUP_ID ] ; then
++    # Save a value for later using in the NB_DESKTOP_STARTUP_ID
++    NB_DESKTOP_STARTUP_ID=$DESKTOP_STARTUP_ID; export NB_DESKTOP_STARTUP_ID
++
++    unset DESKTOP_STARTUP_ID
++fi
++
+ #
+ # resolve symlinks
+ #
+@@ -57,16 +68,18 @@
+     fi
+ done
+ 
+-progdir=`dirname "$PRG"`
++#progdir=`dirname "$PRG"`
++# Patch for Debian/Ubuntu/Fedora where launcher is in /usr/bin
++progdir=/usr/share/netbeans/7.0.1/bin
+ 
+ if [ -f "$progdir"/../etc/netbeans.conf ] ; then
+     . "$progdir"/../etc/netbeans.conf
+ fi
+ 
+ # following should be done just in RPM or Solaris Launcher
+-# if [ -f /etc/netbeans.conf ] ; then
+-#     . /etc/netbeans.conf
+-# fi
++if [ -f /etc/netbeans.conf ] ; then
++    . /etc/netbeans.conf
++fi
+ 
+ 
+ # #68373: look for userdir, but do not modify "$@"
+@@ -194,7 +207,7 @@
+             --branding nb \
+             --clusters '"$netbeans_clusters"' \
+             -J-Dnetbeans.importclass=org.netbeans.upgrade.AutoUpgrade \
+-            -J-Dnetbeans.accept_license_class=org.netbeans.license.AcceptLicense \
++            --cp:p /usr/share/java/log4j-1.2.jar \
+             ${netbeans_default_options} \
+             '"$@"'
+         ;;
+Index: netbeans-7.0.1+dfsg1/ide/launcher/netbeans.conf
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/ide/launcher/netbeans.conf	2011-07-28 20:45:40.000000000 +0100
++++ netbeans-7.0.1+dfsg1/ide/launcher/netbeans.conf	2011-08-02 23:43:19.783332097 +0100
+@@ -3,7 +3,7 @@
+ 
+ # Options used by NetBeans launcher by default, can be overridden by explicit
+ # command line switches:
+-netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true"
++netbeans_default_options="-J-client -J-Xss2m -J-Xms32m -J-XX:PermSize=32m -J-Dapple.laf.useScreenMenuBar=true -J-Dapple.awt.graphics.UseQuartz=true -J-Dsun.java2d.noddraw=true -J-Dsun.java2d.pmoffscreen=false"
+ # Note that default -Xmx and -XX:MaxPermSize are selected for you automatically.
+ # You can find these values in var/log/messages.log file in your userdir.
+ # The automatically selected value can be overridden by specifying -J-Xmx or
diff --git a/debian/patches/netbeans~no-rhino.patch b/debian/patches/netbeans~no-rhino.patch
new file mode 100644
index 0000000..0cf6270
--- /dev/null
+++ b/debian/patches/netbeans~no-rhino.patch
@@ -0,0 +1,34 @@
+Build without Rhino.
+
+Index: netbeans-7.0.1+dfsg1/html.editor/nbproject/project.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/html.editor/nbproject/project.xml	2011-07-28 20:45:36.000000000 +0100
++++ netbeans-7.0.1+dfsg1/html.editor/nbproject/project.xml	2011-08-02 23:39:34.664164190 +0100
+@@ -333,9 +333,9 @@
+             <test-dependencies>
+                 <test-type>
+                     <name>unit</name>
+-                    <test-dependency>
++<!--                    <test-dependency>
+                         <code-name-base>org.mozilla.rhino.patched</code-name-base>
+-                    </test-dependency>
++                    </test-dependency>-->
+                     <test-dependency>
+                         <code-name-base>org.netbeans.api.xml</code-name-base>
+                         <compile-dependency/>
+Index: netbeans-7.0.1+dfsg1/web.jsf.editor/nbproject/project.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/web.jsf.editor/nbproject/project.xml	2011-07-28 20:47:16.000000000 +0100
++++ netbeans-7.0.1+dfsg1/web.jsf.editor/nbproject/project.xml	2011-08-02 23:39:34.664164190 +0100
+@@ -404,9 +404,9 @@
+             <test-dependencies>
+                 <test-type>
+                     <name>unit</name>
+-                    <test-dependency>
++<!--                    <test-dependency>
+                         <code-name-base>org.mozilla.rhino.patched</code-name-base>
+-                    </test-dependency>
++                    </test-dependency>-->
+                     <test-dependency>
+                         <code-name-base>org.netbeans.libs.junit4</code-name-base>
+                         <compile-dependency/>
diff --git a/debian/patches/netbeans~no-test-clean.patch b/debian/patches/netbeans~no-test-clean.patch
new file mode 100644
index 0000000..49637d5
--- /dev/null
+++ b/debian/patches/netbeans~no-test-clean.patch
@@ -0,0 +1,18 @@
+Don't require test dependencies to clean!
+
+Index: netbeans-7.0.1+dfsg1/nbbuild/templates/projectized.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/nbbuild/templates/projectized.xml	2011-08-03 22:31:13.752758220 +0100
++++ netbeans-7.0.1+dfsg1/nbbuild/templates/projectized.xml	2011-08-03 22:31:44.051925479 +0100
+@@ -296,9 +296,9 @@
+         <macrodef name="test-clean">
+             <attribute name="test.type"/>
+             <sequential>
+-                <parseprojectxml project=".">
++<!--                <parseprojectxml project=".">
+                     <testtype name="@{test.type}" folder="test.@{test.type}.folder"/>
+-                </parseprojectxml>
++                </parseprojectxml>-->
+                 <property name="test.@{test.type}.out.folder" location="${test.@{test.type}.folder}"/>
+                 <delete dir="${test.@{test.type}.out.folder}"/>
+             </sequential>
diff --git a/debian/patches/netbeans~nocopy.patch b/debian/patches/netbeans~nocopy.patch
new file mode 100644
index 0000000..eab72e9
--- /dev/null
+++ b/debian/patches/netbeans~nocopy.patch
@@ -0,0 +1,56 @@
+Don't copy some files, since we don't actually include them.
+
+Index: netbeans-7.0.1+dfsg1/css.editor/nbproject/project.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/css.editor/nbproject/project.properties	2011-07-28 20:45:12.000000000 +0100
++++ netbeans-7.0.1+dfsg1/css.editor/nbproject/project.properties	2011-08-02 23:38:53.533331296 +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.
+ 
+-release.external/css21-spec.zip=docs/css21-spec.zip
++#release.external/css21-spec.zip=docs/css21-spec.zip
+ jnlp.indirect.jars=docs/css21-spec.zip
+ 
+ javac.compilerargs=-Xlint -Xlint:-serial
+Index: netbeans-7.0.1+dfsg1/html.editor/nbproject/project.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/html.editor/nbproject/project.properties	2011-07-28 20:45:36.000000000 +0100
++++ netbeans-7.0.1+dfsg1/html.editor/nbproject/project.properties	2011-08-02 23:38:53.533331296 +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.
+ 
+-release.external/html-4.01.zip=docs/html-4.01.zip
++#release.external/html-4.01.zip=docs/html-4.01.zip
+ 
+ javac.compilerargs=-Xlint:unchecked
+ javac.source=1.6
+Index: netbeans-7.0.1+dfsg1/o.jdesktop.beansbinding/nbproject/project.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/o.jdesktop.beansbinding/nbproject/project.properties	2011-07-28 20:46:16.000000000 +0100
++++ netbeans-7.0.1+dfsg1/o.jdesktop.beansbinding/nbproject/project.properties	2011-08-02 23:39:26.623331369 +0100
+@@ -42,6 +42,6 @@
+ 
+ is.autoload=true
+ release.external/beansbinding-1.2.1.jar=modules/ext/beansbinding-1.2.1.jar
+-release.external/beansbinding-1.2.1-doc.zip=docs/beansbinding-1.2.1-doc.zip
+-jnlp.indirect.jars=docs/beansbinding-1.2.1-doc.zip
++#release.external/beansbinding-1.2.1-doc.zip=docs/beansbinding-1.2.1-doc.zip
++#jnlp.indirect.jars=docs/beansbinding-1.2.1-doc.zip
+ spec.version.base=1.11.1
+Index: netbeans-7.0.1+dfsg1/derby/nbproject/project.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/derby/nbproject/project.properties	2011-08-03 22:22:06.911925268 +0100
++++ netbeans-7.0.1+dfsg1/derby/nbproject/project.properties	2011-08-03 22:22:20.671092067 +0100
+@@ -43,6 +43,6 @@
+ javac.source=1.6
+ javac.compilerargs=-Xlint:unchecked
+ 
+-release.external/derbysampledb.zip=modules/ext/derbysampledb.zip
+-jnlp.indirect.jars=\
+-    modules/ext/derbysampledb.zip
++#release.external/derbysampledb.zip=modules/ext/derbysampledb.zip
++#jnlp.indirect.jars=\
++#    modules/ext/derbysampledb.zip
+ 
diff --git a/debian/patches/netbeans~o.a.tools.ant.patch b/debian/patches/netbeans~o.a.tools.ant.patch
new file mode 100644
index 0000000..206c658
--- /dev/null
+++ b/debian/patches/netbeans~o.a.tools.ant.patch
@@ -0,0 +1,36 @@
+We're using packaged ant, so no need to unzip.
+
+Index: netbeans-7.0+dfsg1/o.apache.tools.ant.module/external/build.xml
+===================================================================
+--- netbeans-7.0+dfsg1.orig/o.apache.tools.ant.module/external/build.xml	2011-07-04 10:21:45.664204539 +0100
++++ netbeans-7.0+dfsg1/o.apache.tools.ant.module/external/build.xml	2011-07-04 10:21:58.674204440 +0100
+@@ -45,7 +45,7 @@
+ -->
+ <project name="o.apache.tools.ant.module/external" default="unzip" basedir=".">
+     <target name="unzip">
+-        <unzip src="ant-libs-1.8.2.zip" dest="lib"/>
++<!--        <unzip src="ant-libs-1.8.2.zip" dest="lib"/>-->
+     </target>
+     <target name="clean">
+         <delete dir="lib"/>
+Index: netbeans-7.0+dfsg1/o.apache.tools.ant.module/build.xml
+===================================================================
+--- netbeans-7.0+dfsg1.orig/o.apache.tools.ant.module/build.xml	2011-07-04 10:22:14.294202648 +0100
++++ netbeans-7.0+dfsg1/o.apache.tools.ant.module/build.xml	2011-07-04 10:23:16.714203155 +0100
+@@ -79,14 +79,14 @@
+ 
+     <target name="netbeans-extra" depends="jar-bridge">
+         <mkdir dir="${cluster}/ant/lib"/>
+-        <copy todir="${cluster}/ant/lib">
++<!--        <copy todir="${cluster}/ant/lib">
+             <fileset dir="external/lib"/>
+         </copy>
+         <unzip dest="${cluster}/ant">
+             <fileset dir="external">
+                 <include name="ant-misc-*.zip"/>
+             </fileset>
+-        </unzip>
++        </unzip>-->
+     </target>
+ 
+     <target name="test-build" depends="jar-bridge,projectized-common.test-build"/>
diff --git a/debian/patches/netbeans~old-java-modules.patch b/debian/patches/netbeans~old-java-modules.patch
new file mode 100644
index 0000000..e1ac817
--- /dev/null
+++ b/debian/patches/netbeans~old-java-modules.patch
@@ -0,0 +1,6874 @@
+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><java.lang.String>()";
++
++        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<java.lang.String>";
++
++        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><java.lang.String>(java.util.Collection<? extends java.lang.String> 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 "";
+-    }
+-}
diff --git a/debian/patches/netbeans~old-java.source-module.patch b/debian/patches/netbeans~old-java.source-module.patch
new file mode 100644
index 0000000..97f1adf
--- /dev/null
+++ b/debian/patches/netbeans~old-java.source-module.patch
@@ -0,0 +1,4783 @@
+Use an older version of some java modules since the latest ones
+only build with JDK 7.
+
+Index: netbeans-7.0.1+dfsg1/java.source/apichanges.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/apichanges.xml	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/apichanges.xml	2011-08-03 23:01:41.000000000 +0100
+@@ -108,19 +108,6 @@
+     <!-- ACTUAL CHANGES BEGIN HERE: -->
+ 
+     <changes>
+-        <change id="TreePathHandle-from-ElementHandle">
+-             <api name="general"/>
+-             <summary>TreePathHandle can be created from ElementHandle</summary>
+-             <version major="0" minor="79"/>
+-             <date day="26" month="4" year="2011"/>
+-             <author login="jlahoda"/>
+-             <compatibility addition="yes" binary="compatible" deletion="no" deprecation="no" modification="no" semantic="compatible" source="compatible"/>
+-             <description>
+-                 <code>TreePathHandle</code> has a new <code>from(ElementHandle)</code> method.
+-             </description>
+-             <class package="org.netbeans.api.java.source" name="TreePathHandle"/>
+-             <issue number="197848"/>
+-        </change>
+         <change id="run-modification-task-sourceless">
+              <api name="general"/>
+              <summary>JavaSource.runModificationTask can run on source-less JavaSources</summary>
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocHelper.java	2011-08-03 23:01:41.000000000 +0100
+@@ -309,9 +309,6 @@
+                 final String pkgNameF = pkgName;
+                 final String pageNameF = pageName;
+                 final CharSequence fragment = buildFragment ? getFragment(element) : null;
+-                if (cancel == null) {
+-                    return findJavadoc(classFile, pkgName, pageNameF, fragment, allowRemoteJavadoc);
+-                }
+                 final Future<TextStream> future = RP.submit(new Callable<TextStream>() {
+                     @Override
+                     public TextStream call() throws Exception {
+@@ -320,7 +317,6 @@
+                 });
+                 do {
+                     if (cancel != null && cancel.call()) {
+-                        future.cancel(false);
+                         break;
+                     }
+                     try {
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JavadocEnv.java	2011-08-03 23:01:41.000000000 +0100
+@@ -90,8 +90,8 @@
+ 
+     public static void preRegister(final Context context, final ClasspathInfo cpInfo) {
+         context.put(docEnvKey, new Context.Factory<DocEnv>() {
+-            public DocEnv make(Context c) {
+-                return new JavadocEnv(c, cpInfo);
++            public DocEnv make() {
++                return new JavadocEnv(context, cpInfo);
+             }
+         });
+     }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/JBrowseModule.java	2011-08-03 23:01:41.000000000 +0100
+@@ -60,7 +60,16 @@
+     /** Creates a new instance of JBrowseModule */
+     public JBrowseModule() {
+     }
+-    
++
++    public @Override void restored() {
++        super.restored();        
++        //XXX:
++        //#143234: javac caches content of all jar files in a static map, which leads to memory leaks affecting the IDE
++        //when "internal" execution of javac is used
++        //the property below disables the caches
++        //java.project might be a better place (currently does not have a ModuleInstall)
++        System.setProperty("useJavaUtilZip", "true"); //NOI18N
++    }   
+     
+     public @Override void close () {
+         super.close();
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reindenter.java	2011-08-03 23:01:41.000000000 +0100
+@@ -39,7 +39,6 @@
+ package org.netbeans.modules.java.source.save;
+ 
+ import com.sun.source.tree.AnnotationTree;
+-import com.sun.source.tree.BinaryTree;
+ import com.sun.source.tree.BlockTree;
+ import com.sun.source.tree.CaseTree;
+ import com.sun.source.tree.ClassTree;
+@@ -75,7 +74,6 @@
+ import java.util.Iterator;
+ import java.util.LinkedList;
+ import java.util.List;
+-import java.util.ListIterator;
+ import java.util.Map;
+ import java.util.Set;
+ 
+@@ -135,15 +133,11 @@
+             for (Region region : regions) {
+                 HashSet<Integer> linesToAddStar = new HashSet<Integer>();
+                 LinkedList<Integer> startOffsets = getStartOffsets(region);
+-                for(ListIterator<Integer> it = startOffsets.listIterator(); it.hasNext();) {
+-                    int startOffset = it.next();
+-                    int endOffset;
+-                    if(it.hasNext()) {
+-                        endOffset = it.next();
+-                        it.previous();
+-                    } else {
+-                        endOffset = region.getEndOffset();
+-                    }
++                Iterator<Integer> it = startOffsets.iterator();
++                int startOffset = it.hasNext() ? it.next() : region.getStartOffset();
++                int endOffset = -1;
++                while (endOffset < region.getEndOffset()) {
++                    endOffset = it.hasNext() ? it.next() : region.getEndOffset();
+                     String blockCommentLine = null;
+                     int delta = 0;
+                     if (cs.addLeadingStarInComment() && ((delta = ts.move(startOffset)) > 0 && ts.moveNext() || ts.movePrevious())
+@@ -163,9 +157,10 @@
+                     if (blockCommentLine != null && !blockCommentLine.startsWith("*")) { //NOI18N
+                         linesToAddStar.add(startOffset);
+                     }
++                    startOffset = endOffset;
+                 }
+                 while (!startOffsets.isEmpty()) {
+-                    int startOffset = startOffsets.removeLast();
++                    startOffset = startOffsets.removeLast();
+                     Integer newIndent = newIndents.get(startOffset);
+                     if (linesToAddStar.contains(startOffset)) {
+                         context.modifyIndent(startOffset, 0);
+@@ -315,34 +310,24 @@
+                 }
+                 break;
+             case VARIABLE:
+-                Tree type = ((VariableTree)last).getType();
+-                if (type != null && type.getKind() != Kind.ERRONEOUS) {
+-                    ExpressionTree init = ((VariableTree)last).getInitializer();
+-                    if (init == null || init.getKind() != Kind.NEW_ARRAY
+-                            || (token = findFirstNonWhitespaceToken(startOffset, lastPos)) == null
+-                            || token.token().id() != JavaTokenId.EQ
+-                            || (token = findFirstNonWhitespaceToken(startOffset, endOffset)) == null
+-                            || token.token().id() != JavaTokenId.LBRACE) {
+-                        if (cs.alignMultilineAssignment()) 
+-                            currentIndent = getColumn(last);
+-                        else
+-                            currentIndent += cs.getContinuationIndentSize();
+-                    } else {
+-                        switch (cs.getOtherBracePlacement()) {
+-                            case NEW_LINE_INDENTED:
+-                                currentIndent += cs.getIndentSize();
+-                                break;
+-                            case NEW_LINE_HALF_INDENTED:
+-                                currentIndent += (cs.getIndentSize() / 2);
+-                                break;
+-                        }
+-                    }
+-                    break;
++                ExpressionTree init = ((VariableTree)last).getInitializer();
++                if (init == null || init.getKind() != Kind.NEW_ARRAY
++                        || (token = findFirstNonWhitespaceToken(startOffset, lastPos)) == null
++                        || token.token().id() != JavaTokenId.EQ
++                        || (token = findFirstNonWhitespaceToken(startOffset, endOffset)) == null
++                        || token.token().id() != JavaTokenId.LBRACE) {
++                    currentIndent += cs.getContinuationIndentSize();
+                 } else {
+-                    last = ((VariableTree)last).getModifiers();
+-                    if (last == null)
+-                        break;
++                    switch (cs.getOtherBracePlacement()) {
++                        case NEW_LINE_INDENTED:
++                            currentIndent += cs.getIndentSize();
++                            break;
++                        case NEW_LINE_HALF_INDENTED:
++                            currentIndent += (cs.getIndentSize() / 2);
++                            break;
++                    }
+                 }
++                break;
+             case MODIFIERS:
+                 Tree t = null;
+                 for (Tree ann : ((ModifiersTree)last).getAnnotations()) {
+@@ -356,10 +341,7 @@
+                 }
+                 break;
+             case DO_WHILE_LOOP:
+-                token = findFirstNonWhitespaceToken(startOffset, lastPos);
+-                if (token != null && !EnumSet.of(JavaTokenId.RBRACE, JavaTokenId.SEMICOLON).contains(token.token().id())) {
+-                    currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.DO), lastPos, currentIndent);
+-                }
++                currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.DO), lastPos, currentIndent);
+                 break;
+             case ENHANCED_FOR_LOOP:
+                 currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN), (int)sp.getEndPosition(cut, ((EnhancedForLoopTree)last).getExpression()), currentIndent);
+@@ -392,10 +374,7 @@
+             case IF:
+                 token = findFirstNonWhitespaceToken(startOffset, endOffset);
+                 if (token == null || token.token().id() != JavaTokenId.ELSE) {
+-                    token = findFirstNonWhitespaceToken(startOffset, lastPos);
+-                    if (token != null && !EnumSet.of(JavaTokenId.RBRACE, JavaTokenId.SEMICOLON).contains(token.token().id())) {
+-                        currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN, JavaTokenId.ELSE), (int)sp.getEndPosition(cut, ((IfTree)last).getCondition()) - 1, currentIndent);
+-                    }
++                    currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.RPAREN, JavaTokenId.ELSE), (int)sp.getEndPosition(cut, ((IfTree)last).getCondition()) - 1, currentIndent);
+                 }
+                 break;
+             case SYNCHRONIZED:
+@@ -404,17 +383,14 @@
+             case TRY:
+                 token = findFirstNonWhitespaceToken(startOffset, endOffset);
+                 if (token == null || !EnumSet.of(JavaTokenId.CATCH, JavaTokenId.FINALLY).contains(token.token().id())) {
+-                    token = findFirstNonWhitespaceToken(startOffset, lastPos);
+-                    if (token != null && token.token().id() != JavaTokenId.RBRACE) {
+-                        t = null;
+-                        for (Tree res : ((TryTree)last).getResources()) {
+-                            if (sp.getEndPosition(cut, res) > startOffset) {
+-                                break;
+-                            }
+-                            t = res;
++                    t = null;
++                    for (Tree res : ((TryTree)last).getResources()) {
++                        if (sp.getEndPosition(cut, res) > startOffset) {
++                            break;
+                         }
+-                        currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.TRY, JavaTokenId.RPAREN, JavaTokenId.FINALLY), t != null ? (int)sp.getEndPosition(cut, t) : lastPos, currentIndent);
++                        t = res;
+                     }
++                    currentIndent = getStmtIndent(startOffset, endOffset, EnumSet.of(JavaTokenId.TRY, JavaTokenId.RPAREN, JavaTokenId.FINALLY), t != null ? (int)sp.getEndPosition(cut, t) : lastPos, currentIndent);
+                 }
+                 break;
+             case CATCH:
+@@ -548,8 +524,7 @@
+                 break;
+             case NEW_ARRAY:
+                 token = findFirstNonWhitespaceToken(startOffset, endOffset);
+-                nextTokenId = token != null ? token.token().id() : null;
+-                if (nextTokenId != JavaTokenId.RBRACE) {
++                if (token == null || token.token().id() != JavaTokenId.RBRACE) {
+                     token = findFirstNonWhitespaceToken(startOffset, lastPos);
+                     prevTokenId = token != null ? token.token().id() : null;
+                     if (prevTokenId != null) {
+@@ -560,42 +535,12 @@
+                             case COMMA:
+                                 currentIndent = getMultilineIndent(((NewArrayTree)last).getInitializers(), path, token.offset(), lastLineStartOffset, currentIndent, cs.alignMultilineArrayInit(), false);
+                                 break;
+-                            case RBRACKET:
+-                                if (nextTokenId == JavaTokenId.LBRACE) {
+-                                    switch (cs.getOtherBracePlacement()) {
+-                                        case NEW_LINE_INDENTED:
+-                                            currentIndent += cs.getIndentSize();
+-                                            break;
+-                                        case NEW_LINE_HALF_INDENTED:
+-                                            currentIndent += (cs.getIndentSize() / 2);
+-                                            break;
+-                                    }
+-                                    break;
+-                                }
+                             default:
+                                 currentIndent += cs.getContinuationIndentSize();
+                         }
+                     }
+                 }
+                 break;
+-            case NEW_CLASS:
+-                token = findFirstNonWhitespaceToken(startOffset, endOffset);
+-                nextTokenId = token != null ? token.token().id() : null;
+-                token = findFirstNonWhitespaceToken(startOffset, lastPos);
+-                prevTokenId = token != null ? token.token().id() : null;
+-                if (prevTokenId == JavaTokenId.RPAREN && nextTokenId == JavaTokenId.LBRACE) {
+-                    switch (cs.getOtherBracePlacement()) {
+-                        case NEW_LINE_INDENTED:
+-                            currentIndent += cs.getIndentSize();
+-                            break;
+-                        case NEW_LINE_HALF_INDENTED:
+-                            currentIndent += (cs.getIndentSize() / 2);
+-                            break;
+-                    }
+-                } else {
+-                    currentIndent += cs.getContinuationIndentSize();
+-                }
+-                break;
+             case METHOD_INVOCATION:
+                 token = findFirstNonWhitespaceToken(startOffset, lastPos);
+                 if (token != null && token.token().id() == JavaTokenId.COMMA) {
+@@ -755,12 +700,6 @@
+         return false;
+     }
+ 
+-    private int getColumn(Tree tree) throws BadLocationException {
+-        int startOffset = (int)(sp.getStartPosition(cut, tree));
+-        int lineStartOffset = context.lineStartOffset(startOffset);
+-        return getCol(context.document().getText(lineStartOffset, startOffset - lineStartOffset));
+-    }
+-
+     private int getCurrentIndent(Tree tree) throws BadLocationException {
+         int lineStartOffset = context.lineStartOffset((int)sp.getStartPosition(cut, tree));
+         Integer newIndent = newIndents.get(lineStartOffset);
+@@ -768,76 +707,10 @@
+     }
+ 
+     private int getContinuationIndent(LinkedList<? extends Tree> path, int currentIndent) throws BadLocationException {
+-        for (Tree tree : path) {
+-            switch (tree.getKind()) {
+-                case CLASS:
+-                case INTERFACE:
+-                case ENUM:
+-                case ANNOTATION_TYPE:
+-                case VARIABLE:
+-                case METHOD:
+-                case TRY:
+-                case RETURN:
+-                case BLOCK:
+-                case FOR_LOOP:
+-                case SWITCH:
+-                case THROW:
+-                case WHILE_LOOP:
+-                case IF:
+-                case EXPRESSION_STATEMENT:
+-                case SYNCHRONIZED:
+-                case ASSERT:
+-                case CONTINUE:
+-                case LABELED_STATEMENT:
+-                case ENHANCED_FOR_LOOP:
+-                case BREAK:
+-                case EMPTY_STATEMENT:
+-                case DO_WHILE_LOOP:
+-                    return getCurrentIndent(tree) + cs.getContinuationIndentSize();
+-                case ASSIGNMENT:
+-                case MULTIPLY_ASSIGNMENT:
+-                case DIVIDE_ASSIGNMENT:
+-                case REMAINDER_ASSIGNMENT:
+-                case PLUS_ASSIGNMENT:
+-                case MINUS_ASSIGNMENT:
+-                case LEFT_SHIFT_ASSIGNMENT:
+-                case RIGHT_SHIFT_ASSIGNMENT:
+-                case UNSIGNED_RIGHT_SHIFT_ASSIGNMENT:
+-                case AND_ASSIGNMENT:
+-                case XOR_ASSIGNMENT:
+-                case OR_ASSIGNMENT:
+-                    if (cs.alignMultilineAssignment())
+-                        return getColumn(tree);
+-                    break;
+-                case AND:
+-                case CONDITIONAL_AND:
+-                case CONDITIONAL_OR:
+-                case DIVIDE:
+-                case EQUAL_TO:
+-                case GREATER_THAN:
+-                case GREATER_THAN_EQUAL:
+-                case LEFT_SHIFT:
+-                case LESS_THAN:
+-                case LESS_THAN_EQUAL:
+-                case MINUS:
+-                case MULTIPLY:
+-                case NOT_EQUAL_TO:
+-                case OR:
+-                case PLUS:
+-                case REMAINDER:
+-                case RIGHT_SHIFT:
+-                case UNSIGNED_RIGHT_SHIFT:
+-                case XOR:
+-                    if (cs.alignMultilineBinaryOp())
+-                        return getColumn(tree);
+-                    break;
+-                case CONDITIONAL_EXPRESSION:
+-                    if (cs.alignMultilineTernaryOp())
+-                        return getColumn(tree);
+-                    break;
+-            }
+-        }
+-        return currentIndent + cs.getContinuationIndentSize();
++        Tree tree = null;
++        Iterator<? extends Tree> it = path.iterator();
++        while (it.hasNext() && !((tree = it.next()) instanceof StatementTree || tree.getKind() == Kind.CLASS || tree.getKind() == Kind.METHOD));
++        return (tree != null ? getCurrentIndent(tree) : currentIndent) + cs.getContinuationIndentSize();
+     }
+ 
+     private int getStmtIndent(int startOffset, int endOffset, Set<JavaTokenId> expectedTokenIds, int expectedTokenOffset, int currentIndent) {
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java	2011-08-03 23:01:41.000000000 +0100
+@@ -223,7 +223,7 @@
+                 continue;
+             if (endOffset < start)
+                 continue;
+-            if (endOffset == start && (text == null || !(text.trim().equals("}") || templateEdit && start >= end))) //NOI18N
++            if (endOffset == start && (text == null || !(text.trim().equals("}") || templateEdit))) //NOI18N
+                 continue;
+             if (embeddingOffset >= start)
+                 continue;
+@@ -1658,7 +1658,7 @@
+         }
+ 
+         @Override
+-        public Boolean visitUnionType(UnionTypeTree node, Void p) {
++        public Boolean visitDisjunctiveType(DisjunctiveTypeTree node, Void p) {
+             List<? extends Tree> alts = node.getTypeAlternatives();
+             if (alts != null && !alts.isEmpty()) {
+                 wrapList(cs.wrapDisjunctiveCatchTypes(), cs.alignMultilineDisjunctiveCatchTypes(), false, BAR, alts);
+@@ -2235,14 +2235,12 @@
+             int alignIndent = cs.alignMultilineBinaryOp() ? col : -1;
+             scan(node.getLeftOperand(), p);
+             if (cs.wrapAfterBinaryOps()) {
+-                boolean containedNewLine = spaces(cs.spaceAroundBinaryOps() ? 1 : 0, false);
++                spaces(cs.spaceAroundBinaryOps() ? 1 : 0);
+                 if (OPERATOR.equals(tokens.token().id().primaryCategory())) {
+                     col += tokens.token().length();
+                     lastBlankLines = -1;
+                     lastBlankLinesTokenIndex = -1;
+                     tokens.moveNext();
+-                    if (containedNewLine)
+-                        newline();
+                 }
+                 wrapTree(cs.wrapBinaryOps(), alignIndent, cs.spaceAroundBinaryOps() ? 1 : 0, node.getRightOperand());
+             } else {
+@@ -2256,15 +2254,11 @@
+             int alignIndent = cs.alignMultilineTernaryOp() ? col : -1;
+             scan(node.getCondition(), p);
+             if (cs.wrapAfterTernaryOps()) {
+-                boolean containedNewLine = spaces(cs.spaceAroundTernaryOps() ? 1 : 0, false);
++                spaces(cs.spaceAroundTernaryOps() ? 1 : 0);
+                 accept(QUESTION);
+-                if (containedNewLine)
+-                    newline();
+                 wrapTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getTrueExpression());
+-                containedNewLine = spaces(cs.spaceAroundTernaryOps() ? 1 : 0, false);
++                spaces(cs.spaceAroundTernaryOps() ? 1 : 0);
+                 accept(COLON);
+-                if (containedNewLine)
+-                    newline();
+                 wrapTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getFalseExpression());
+             } else {
+                 wrapOperatorAndTree(cs.wrapTernaryOps(), alignIndent, cs.spaceAroundTernaryOps() ? 1 : 0, node.getTrueExpression());
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java	2011-08-03 23:01:41.000000000 +0100
+@@ -1103,8 +1103,6 @@
+                         parens ? new JavaTokenId[] { JavaTokenId.LPAREN, JavaTokenId.RPAREN } : null,
+                         pos,
+                         Measure.ARGUMENT,
+-                        diffContext.style.spaceBeforeSemi(),
+-                        diffContext.style.spaceAfterSemi(),
+                         false,
+                         ";" //NOI18N
+                 );
+@@ -1876,7 +1874,7 @@
+         if (!listsMatch(oldT.getVariables(), newT.getVariables())) {
+             copyTo(bounds[0], oldT.getStartPosition());
+             if (oldT.isEnum()) {
+-                int pos = diffParameterList(oldT.getVariables(), newT.getVariables(), null, oldT.getStartPosition(), Measure.ARGUMENT, diffContext.style.spaceBeforeComma(), diffContext.style.spaceAfterComma(), true, ",");  //NOI18N
++                int pos = diffParameterList(oldT.getVariables(), newT.getVariables(), null, oldT.getStartPosition(), Measure.ARGUMENT, true, ",");  //NOI18N
+                 copyTo(pos, bounds[1]);
+                 return bounds[1];
+             } else {
+@@ -2239,7 +2237,7 @@
+             int pos,
+             Comparator<JCTree> measure)
+     {
+-        return diffParameterList(oldList, newList, makeAround, pos, measure, diffContext.style.spaceBeforeComma(), diffContext.style.spaceAfterComma(), false, ",");   //NOI18N
++        return diffParameterList(oldList, newList, makeAround, pos, measure, false, ",");   //NOI18N
+     }
+     private int diffParameterList(
+             List<? extends JCTree> oldList,
+@@ -2247,8 +2245,6 @@
+             JavaTokenId[] makeAround,
+             int pos,
+             Comparator<JCTree> measure,
+-            boolean spaceBefore,
+-            boolean spaceAfter,
+             boolean isEnum,
+             String separator)
+     {
+@@ -2309,7 +2305,7 @@
+                 // insert new element
+                 case INSERT: {
+                     if (wasComma) {
+-                        if (spaceAfter) {
++                        if (diffContext.style.spaceAfterComma()) {
+                             printer.print(" ");
+                         }
+                     }
+@@ -2326,7 +2322,7 @@
+                 // just copy existing element
+                 case NOCHANGE:
+                     if (oldIndex++ == 0 && wasComma) {
+-                        if (spaceAfter) {
++                        if (diffContext.style.spaceAfterComma()) {
+                             printer.print(" ");
+                         }
+                     }
+@@ -2339,17 +2335,10 @@
+                     int start = tokenSequence.offset();
+                     tokenSequence.move(bounds[1]);
+                     moveToSrcRelevant(tokenSequence, Direction.FORWARD);
+-                    int end;
+-                    if (isEnum) {
+-                        if ((tokenSequence.token().id() == JavaTokenId.SEMICOLON || tokenSequence.token().id() == JavaTokenId.COMMA)) {
+-                            end = tokenSequence.offset();
+-                        } else {
+-                            end = bounds[1];
+-                        }
+-                    } else if (oldIndex < oldList.size()) {
++                    int end = bounds[1];
++                    if (isEnum &&
++                        (tokenSequence.token().id() == JavaTokenId.SEMICOLON || tokenSequence.token().id() == JavaTokenId.COMMA)) {
+                         end = tokenSequence.offset();
+-                    } else {
+-                        end = bounds[1];
+                     }
+                     copyTo(start, pos = end, printer);
+                     wasLeadingDelete = false;
+@@ -2358,9 +2347,6 @@
+                     break;
+             }
+             if (commaNeeded(result, item)) {
+-                if ((item.operation == Operation.INSERT || (oldIndex == oldList.size() && j + 1 < result.length && result[j + 1].operation == Operation.INSERT)) && spaceBefore) {
+-                    printer.print(" ");
+-                }
+                 printer.print(separator);
+                 wasComma = true;
+             } else {
+@@ -2535,11 +2521,6 @@
+         return pos;
+     }
+ 
+-    protected int diffUnionType(JCTypeUnion oldT, JCTypeUnion newT, int[] bounds) {
+-        int localPointer = bounds[0];
+-        return diffParameterList(oldT.alternatives, newT.alternatives, null, localPointer, Measure.MEMBER, diffContext.style.spaceAroundBinaryOps(), diffContext.style.spaceAroundBinaryOps(), false, "|");
+-    }
+-
+     private boolean commaNeeded(ResultItem[] arr, ResultItem item) {
+         if (item.operation == Operation.DELETE) {
+             return false;
+@@ -2701,7 +2682,13 @@
+                 case INSERT: {
+                     int pos = estimator.getInsertPos(i);
+                     if (pos > localPointer) {
+-                        copyTo(localPointer, localPointer = pos);
++                        tokenSequence.move(pos);
++                        moveToDifferentThan(tokenSequence, Direction.BACKWARD, EnumSet.of(JavaTokenId.WHITESPACE));
++                        tokenSequence.moveNext();
++                        pos = tokenSequence.offset();
++                        if (pos > localPointer) {
++                            copyTo(localPointer, localPointer = pos);
++                        }
+                     }
+                     int oldPos = item.element.getKind() != Kind.VARIABLE ? getOldPos(item.element) : item.element.pos;
+                     boolean found = false;
+@@ -3297,9 +3284,6 @@
+               retVal = diffModifiers((JCModifiers) oldT, (JCModifiers) newT, parent, elementBounds[0]);
+               copyTo(retVal, elementBounds[1]);
+               break;
+-          case JCTree.TYPEUNION:
+-              retVal = diffUnionType((JCTypeUnion) oldT, (JCTypeUnion) newT, elementBounds);
+-              break;
+           default:
+               // handle special cases like field groups and enum constants
+               if (oldT.getKind() == Kind.OTHER) {
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/SuperOnePassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
+@@ -164,7 +164,7 @@
+             }
+         }
+ 
+-        if (jt == null || units == null || JavaCustomIndexer.NO_ONE_PASS_COMPILE_WORKER) {
++        if (jt == null || units == null) {
+             return new ParsingOutput(false, file2FQNs, addedTypes, createdFiles, finished, modifiedTypes, aptGenerated);
+         }
+         if (context.isCancelled()) {
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/OnePassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
+@@ -166,7 +166,7 @@
+             }
+         }
+ 
+-        if (units == null || JavaCustomIndexer.NO_ONE_PASS_COMPILE_WORKER) {
++        if (units == null) {
+             return new ParsingOutput(false, file2FQNs, addedTypes, createdFiles, finished, modifiedTypes, aptGenerated);
+         }
+ 
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/JavaCustomIndexer.java	2011-08-03 23:01:41.000000000 +0100
+@@ -121,7 +121,6 @@
+  */
+ public class JavaCustomIndexer extends CustomIndexer {
+ 
+-            static final boolean NO_ONE_PASS_COMPILE_WORKER = Boolean.getBoolean(JavaCustomIndexer.class.getName() + ".no.one.pass.compile.worker");
+     private static final String SOURCE_LEVEL_ROOT = "sourceLevel"; //NOI18N
+     private static final String DIRTY_ROOT = "dirty"; //NOI18N
+     private static final String SOURCE_PATH = "sourcePath"; //NOI18N
+@@ -539,8 +538,7 @@
+         return result;
+     }
+ 
+-    static boolean addAptGenerated(final Context context, JavaParsingContext javaContext, final String sourceRelative, final Set<CompileTuple> aptGenerated) throws IOException {
+-        boolean ret = false;
++    static void addAptGenerated(final Context context, JavaParsingContext javaContext, final String sourceRelative, final Set<CompileTuple> aptGenerated) throws IOException {
+         final File aptFolder = JavaIndex.getAptFolder(context.getRootURI(), false);
+         if (aptFolder.exists()) {
+             final FileObject root = FileUtil.toFileObject(aptFolder);
+@@ -555,7 +553,7 @@
+                         if (f.exists() && FileObjects.JAVA.equals(FileObjects.getExtension(f.getName()))) {
+                             Indexable i = accessor.create(new FileObjectIndexable(root, fileName));
+                             InferableJavaFileObject ffo = FileObjects.fileFileObject(f, aptFolder, null, javaContext.encoding);
+-                            ret |= aptGenerated.add(new CompileTuple(ffo, i, false, true, true));
++                            aptGenerated.add(new CompileTuple(ffo, i, false, true, true));
+                         }
+                     }
+                 } catch (IOException ioe) {
+@@ -564,7 +562,6 @@
+                 }
+             }
+         }
+-        return ret;
+     }
+ 
+     static void setErrors(Context context, CompileTuple active, DiagnosticListenerImpl errors) {
+@@ -587,7 +584,7 @@
+         return binaryNames;
+     }
+ 
+-    private static Map<URL, Set<URL>> findDependent(final URL root, final Collection<ElementHandle<TypeElement>> classes, boolean includeFilesInError) throws IOException {
++    private static Map<URL, Set<URL>> findDependent(final URL root, final Collection<ElementHandle<TypeElement>> classes, boolean includeFilesInError) throws IOException {                
+         //get dependencies
+         Map<URL, List<URL>> deps = IndexingController.getDefault().getRootDependencies();
+         Map<URL, List<URL>> peers = IndexingController.getDefault().getRootPeers();
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/indexing/MultiPassCompileWorker.java	2011-08-03 23:01:41.000000000 +0100
+@@ -242,7 +242,9 @@
+                     continue;
+                 }
+                 jt.analyze(types);
+-                boolean aptGenerated = aptEnabled ? JavaCustomIndexer.addAptGenerated(context, javaContext, active.indexable.getRelativePath(), previous.aptGenerated) : false;
++                if (aptEnabled) {
++                    JavaCustomIndexer.addAptGenerated(context, javaContext, active.indexable.getRelativePath(), previous.aptGenerated);
++                }
+                 if (mem.isLowMemory()) {
+                     dumpSymFiles(fileManager, jt, previous.createdFiles);
+                     mem.isLowMemory();
+@@ -287,10 +289,6 @@
+                 previous.finishedFiles.add(active.indexable);
+                 active = null;
+                 state  = 0;
+-                if (aptGenerated) {
+-                    dumpSymFiles(fileManager, jt, previous.createdFiles);
+-                    jt = null;
+-                }
+             } catch (CouplingAbort ca) {
+                 //Coupling error
+                 TreeLoader.dumpCouplingAbort(ca, null);
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/pretty/VeryPretty.java	2011-08-03 23:01:41.000000000 +0100
+@@ -121,7 +121,8 @@
+     public Name enclClassName; // the enclosing class name.
+     private int indentSize;
+     private int prec; // visitor argument: the current precedence level.
+-    private boolean printingMethodParams;
++    private LinkedList<Comment> pendingComments = null;
++    private int lastReadCommentIdx = -1;
+     private DiffContext diffContext;
+     private CommentHandlerService comments;
+ 
+@@ -298,9 +299,6 @@
+     public boolean handlePossibleOldTrees(java.util.List<? extends JCTree> toPrint, boolean includeStartingComments) {
+         for (JCTree t : toPrint) {
+             if (!oldTrees.contains(t)) return false;
+-            if (t.getKind() == Kind.ARRAY_TYPE) {
+-                return false;//XXX #197584: C-like array are cannot be copied as old trees.
+-            }
+         }
+ 
+         JCTree firstTree = toPrint.get(0);
+@@ -762,11 +760,8 @@
+             print(cs.spaceBeforeMethodDeclParen() ? " (" : "(");
+             if (cs.spaceWithinMethodDeclParens() && tree.params.nonEmpty())
+                 print(' ');
+-            boolean oldPrintingMethodParams = printingMethodParams;
+-            printingMethodParams = true;
+             wrapTrees(tree.params, cs.wrapMethodParams(), cs.alignMultilineMethodParams()
+                     ? out.col : out.leftMargin + cs.getContinuationIndentSize());
+-            printingMethodParams = oldPrintingMethodParams;
+             if (cs.spaceWithinMethodDeclParens() && tree.params.nonEmpty())
+                 needSpace();
+             print(')');
+@@ -1489,7 +1484,7 @@
+     }
+ 
+     @Override
+-    public void visitTypeUnion(JCTypeUnion that) {
++    public void visitTypeDisjunction(JCTypeDisjunction that) {
+         boolean first = true;
+ 
+         for (JCExpression c : that.getTypeAlternatives()) {
+@@ -1826,16 +1821,14 @@
+         
+         VeryPretty del = new VeryPretty(diffContext, cs, new HashMap<Tree, Object>(), new HashMap<Object, int[]>(), origText, 0);
+         del.reallyPrintAnnotations = true;
+-        del.printingMethodParams = printingMethodParams;
+ 
+         del.printAnnotations(annotations);
+ 
+         String str = del.out.toString();
+-        int col = printingMethodParams ? out.leftMargin + cs.getContinuationIndentSize() : out.col;
+-        
+-        str = Reformatter.reformat(str + " class A{}", cs, cs.getRightMargin() - col);
+ 
+-        str = str.trim().replaceAll("\n", "\n" + whitespace(col));
++        str = Reformatter.reformat(str + " class A{}", cs, cs.getRightMargin() - out.col);
++
++        str = str.trim().replaceAll("\n", "\n" + whitespace(out.col));
+ 
+         adjustSpans(annotations, str);
+ 
+@@ -1850,10 +1843,7 @@
+         if (annotations.isEmpty()) return ;
+ 
+         if (printAnnotationsFormatted(annotations)) {
+-            if (!printingMethodParams)
+-                toColExactly(out.leftMargin);
+-            else
+-                out.needSpace();
++            toColExactly(out.leftMargin);
+             return ;
+         }
+         
+@@ -1876,8 +1866,7 @@
+                     break;
+                 }
+             } else {
+-                if (!printingMethodParams)
+-                    toColExactly(out.leftMargin);
++                toColExactly(out.leftMargin);
+             }
+             annotations = annotations.tail;
+         }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/PersistentClassIndex.java	2011-08-03 23:01:41.000000000 +0100
+@@ -127,12 +127,7 @@
+             return IndexManager.readAccess(new IndexManager.Action<Boolean>() {
+                 @Override
+                 public Boolean run() throws IOException, InterruptedException {
+-                    if (index instanceof Index.WithStatus) {
+-                        //Fast path
+-                        return ((Index.WithStatus)index).getStatus(false) == Index.Status.EMPTY;
+-                    } else {
+-                       return !index.exists();
+-                    }
++                    return !PersistentClassIndex.this.index.exists();
+                 }
+             }).booleanValue();
+         } catch (InterruptedException ie) {
+@@ -147,11 +142,7 @@
+     @Override
+     public boolean isValid() {
+         try {
+-            if (index instanceof Index.WithStatus) {
+-                return ((Index.WithStatus)index).getStatus(true) != Index.Status.INVALID;
+-            } else {
+-                return index.isValid(true);
+-            }
++            return index.isValid(true);
+         } catch (IOException ex) {
+             return false;
+         }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/usages/BuildArtifactMapperImpl.java	2011-08-03 23:01:41.000000000 +0100
+@@ -303,12 +303,6 @@
+             return null;
+         }
+ 
+-        File tagFile = new File(targetFolder, TAG_FILE_NAME);
+-
+-        if (!tagFile.exists()) {
+-            return null;
+-        }
+-
+         try {
+             SourceUtils.waitScanFinished();
+         } catch (InterruptedException e) {
+@@ -317,6 +311,12 @@
+             return false;
+         }
+ 
++        File tagFile = new File(targetFolder, TAG_FILE_NAME);
++
++        if (!tagFile.exists()) {
++            return null;
++        }
++
+         delete(targetFolder, false);
+         delete(tagFile, true);
+ 
+@@ -593,7 +593,7 @@
+             }
+             assert f.isAbsolute();
+         }
+-        return f;
++        return FileUtil.normalizeFile(f);
+     }
+     
+     /**
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/transform/ImmutableTreeTranslator.java	2011-08-03 23:01:41.000000000 +0100
+@@ -357,7 +357,7 @@
+     public Tree visitBlock(BlockTree tree, Object p) {
+ 	return rewriteChildren(tree);
+     }
+-    public Tree visitUnionType(UnionTypeTree tree, Object p) {
++    public Tree visitDisjunctiveType(DisjunctiveTypeTree tree, Object p) {
+         return rewriteChildren(tree);
+     }
+     public Tree visitDoWhileLoop(DoWhileLoopTree tree, Object p) {
+@@ -629,10 +629,10 @@
+ 	return tree;
+     }
+ 
+-    protected final UnionTypeTree rewriteChildren(UnionTypeTree tree) {
++    protected final DisjunctiveTypeTree rewriteChildren(DisjunctiveTypeTree tree) {
+ 	List<? extends Tree> newComponents = translate(tree.getTypeAlternatives());
+ 	if (newComponents!=tree.getTypeAlternatives()) {
+-	    UnionTypeTree n = make.UnionType(newComponents);
++	    DisjunctiveTypeTree n = make.DisjunctiveType(newComponents);
+ 	    copyCommentTo(tree,n);
+             copyPosTo(tree,n);
+ 	    tree = n;
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/SourceFileObject.java	2011-08-03 23:01:41.000000000 +0100
+@@ -44,7 +44,6 @@
+ 
+ package org.netbeans.modules.java.source.parsing;
+ 
+-import com.sun.tools.javac.api.ClientCodeWrapper.Trusted;
+ import java.io.ByteArrayInputStream;
+ import java.io.File;
+ import java.io.FileNotFoundException;
+@@ -72,6 +71,7 @@
+ import org.netbeans.lib.editor.util.swing.DocumentUtilities;
+ import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation;
+ import org.netbeans.modules.parsing.api.Source;
++import org.netbeans.modules.parsing.impl.Utilities;
+ import org.openide.cookies.EditorCookie;
+ import org.openide.filesystems.FileLock;
+ import org.openide.filesystems.FileObject;
+@@ -85,7 +85,6 @@
+  *
+  * @author Tomas Zezula
+  */
+- at Trusted
+ public class SourceFileObject implements DocumentProvider, InferableJavaFileObject {
+ 
+     final Handle handle;
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FileObjects.java	2011-08-03 23:01:41.000000000 +0100
+@@ -45,7 +45,6 @@
+ package org.netbeans.modules.java.source.parsing;
+ 
+ 
+-import com.sun.tools.javac.api.ClientCodeWrapper.Trusted;
+ import java.io.BufferedInputStream;
+ import java.io.ByteArrayInputStream;
+ import java.io.ByteArrayOutputStream;
+@@ -78,7 +77,6 @@
+ import javax.lang.model.element.Modifier;
+ import javax.lang.model.element.NestingKind;
+ import javax.tools.JavaFileObject;
+-import org.netbeans.api.annotations.common.NonNull;
+ import org.netbeans.api.annotations.common.NullAllowed;
+ import org.netbeans.api.queries.FileEncodingQuery;
+ import org.netbeans.modules.java.ClassDataLoader;
+@@ -105,21 +103,8 @@
+  */
+ public class FileObjects {
+     
+-    public static final Comparator<String> SIMPLE_NAME_STRING_COMPARATOR = new Comparator<String>(){
+-        @Override
+-        public int compare( String o1, String o2 ) {
+-            return getSimpleName( o1 ).compareTo( getSimpleName( o2 ) );
+-        }
+-    };
+-    
+-    public static final Comparator<JavaFileObject> SIMPLE_NAME_FILEOBJECT_COMPARATOR = new Comparator<JavaFileObject>(){
+-        @Override
+-        public int compare( JavaFileObject o1, JavaFileObject o2 ) {
+-            String n1 = getSimpleName( o1 );
+-            String n2 = getSimpleName( o2 );
+-            return n1.compareTo( n2 );
+-        }
+-    };
++    public static final Comparator<String> SIMPLE_NAME_STRING_COMPARATOR = new SimpleNameStringComparator();
++    public static final Comparator<JavaFileObject> SIMPLE_NAME_FILEOBJECT_COMPARATOR = new SimpleNameFileObjectComparator();
+     
+     
+     public static final String JAVA  = JavaDataLoader.JAVA_EXTENSION;
+@@ -135,9 +120,7 @@
+     public static final String RES   = "res";  //NOI18N
+ 
+     public static final String RESOURCES = "resouces." + FileObjects.RES;  //NOI18N
+-
+-    private static final String encodingName = new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding();
+-
++    
+     //todo: If more clients than btrace will need this, create a SPI.
+     private static final Set<String> javaFlavorExt = new HashSet<String>();
+     static {
+@@ -195,7 +178,17 @@
+         assert zipFile != null;
+         return new CachedZipFileObject (zipFile, folder, baseName, mtime);
+     }
+-            
++    
++    /**
++     * Creates {@link JavaFileObject} for a regular {@link File}
++     * @param file for which the {@link JavaFileObject} should be created
++     * @pram root - the classpath root owning the file
++     * @return {@link JavaFileObject}, never returns null
++     */
++    public static InferableJavaFileObject fileFileObject( final File file, final File root, final JavaFileFilterImplementation filter) {
++        return fileFileObject(file, root, filter, null);
++    }
++    
+     /**
+      * Creates {@link JavaFileObject} for a regular {@link File}
+      * @param file for which the {@link JavaFileObject} should be created
+@@ -203,22 +196,14 @@
+      * @param encoding - the file's encoding
+      * @return {@link JavaFileObject}, never returns null
+      */
+-    public static @NonNull InferableJavaFileObject fileFileObject( final @NonNull File file, final @NonNull File root,
+-            final @NullAllowed JavaFileFilterImplementation filter, final @NullAllowed Charset encoding) {
++    public static InferableJavaFileObject fileFileObject( final File file, final File root, final JavaFileFilterImplementation filter, Charset encoding) {
+         assert file != null;
+         assert root != null;
+-        final String[] pkgNamePair = getFolderAndBaseName(getRelativePath(root,file),File.separatorChar);
++        String[] pkgNamePair = getFolderAndBaseName(getRelativePath(root,file),File.separatorChar);
+         return new FileBase( file, convertFolder2Package(pkgNamePair[0], File.separatorChar), pkgNamePair[1], filter, encoding);
+     }
+-
+-    /**
+-     * Creates a FileObject for newly created file
+-     * @param root owning the file
+-     * @param path the path (separated by '/') to target folder relative to root
+-     * @param name of the file
+-     * @return {@link JavaFileObject}
+-     */
+-    public static @NonNull JavaFileObject templateFileObject (final @NonNull FileObject root, final @NonNull String path, final @NonNull String name) {
++    
++    public static JavaFileObject templateFileObject (final FileObject root, final String path, String name) {
+         assert root != null;
+         assert path != null;        
+         JavaFileFilterImplementation filter = JavaFileFilterQuery.getFilter(root);
+@@ -276,12 +261,10 @@
+                 return res;
+             }
+ 
+-            @Override
+             protected URL getURL() throws IOException {
+                 return path;
+             }
+ 
+-            @Override
+             protected String getExt() {
+                 String ext = super.getExt();
+                 if (ext == null) {
+@@ -290,7 +273,6 @@
+                 return ext;
+             }
+ 
+-            @Override
+             protected String getName(boolean includeExtension) {
+                 String name = super.getName(includeExtension);
+                 if (name == null) {
+@@ -302,7 +284,6 @@
+                 return name;
+             }
+ 
+-            @Override
+             protected String getRelativePath() {
+                 String relativePath = super.getRelativePath();
+                 if (relativePath == null) {
+@@ -331,11 +312,6 @@
+                 return false;
+             }
+ 
+-            @Override
+-            public int hashCode() {
+-                return path.hashCode();
+-            }
+-
+         };
+         return new SourceFileObject(handle, null);
+     }
+@@ -416,22 +392,12 @@
+             return new MemoryFileObject(pkgStr, nameStr, uri, lastModified, (CharBuffer)CharBuffer.allocate( length + 1 ).append( content ).append( ' ' ).flip() );
+         }        
+     }        
+-
+-    /**
+-     * Removes extension from fileName
+-     * @param fileName to remove extension from
+-     * @return the fileName without extension
+-     */
++    
+     public static String stripExtension( String fileName ) {        
+         int dot = fileName.lastIndexOf(".");
+         return (dot == -1 ? fileName : fileName.substring(0, dot));
+     }    
+-
+-    /**
+-     * Returns file extension
+-     * @param fileName to get extension from
+-     * @return the file extension or empty string when fileName has no extension
+-     */
++    
+     public static String getExtension (final String fileName) {
+         int dot = fileName.lastIndexOf('.');
+         return (dot == -1 || dot == fileName.length() -1 ) ? "" : fileName.substring(dot+1);    //NOI18N
+@@ -522,14 +488,8 @@
+             };
+         }
+     }
+-
+-    /**
+-     * Returns binary name of given file within a root
+-     * @param file to get binary name for
+-     * @param root the root owning the file
+-     * @return the binary name
+-     */
+-    public static @NonNull String getBinaryName (final @NonNull File file, final @NonNull File root) {
++                
++    public static String getBinaryName (final File file, final File root) {
+         assert file != null && root != null;
+         String fileName = FileObjects.getRelativePath (root, file);
+         int index = fileName.lastIndexOf('.');  //NOI18N
+@@ -538,90 +498,72 @@
+         }        
+         return fileName.replace(File.separatorChar,'.');   //NOI18N        
+     }
+-
+-    /**
+-     * Converts a package name into folder using '/' as separator character
+-     * @param packageName to be converted
+-     * @return the folder name
+-     */
+-    public static @NonNull String convertPackage2Folder(final @NonNull String packageName ) {
+-        return convertPackage2Folder(packageName, '/' );    //NOI18N
++    
++    public static String getSimpleName( JavaFileObject fo ) {
++        
++        String name = getName(fo,true);
++        int i = name.lastIndexOf( '$' );
++        if ( i == -1 ) {
++            return name;
++        }
++        else {
++            return name.substring( i + 1 );
++        }        
++    }
++    
++    public static String getSimpleName( String fileName ) {
++        
++        String name = getBaseName( fileName );
++        
++        int i = name.lastIndexOf( '$' );
++        if ( i == -1 ) {
++            return name;
++        }
++        else {
++            return name.substring( i + 1 );
++        }
++        
+     }
+ 
+-    /**
+-     * Converts a package name into folder using given separator character
+-     * @param packageName to be converted
+-     * @param separatorChar separator
+-     * @return the folder name
+-     */
+-    public static @NonNull String convertPackage2Folder(final @NonNull String packageName, final char separatorChar) {
+-        return packageName.replace( '.',separatorChar); //NOI18N
++    public static String convertPackage2Folder( String packageName ) {
++        return convertPackage2Folder(packageName, '/' );
+     }
+ 
+-    /**
+-     * Converts a folder into package name
+-     * @param folderName to be converted, the folder name components has to be separated by '/'
+-     * @return the package name
+-     */
+-    public static @NonNull String convertFolder2Package (@NonNull String folderName) {
+-        return convertFolder2Package (folderName, '/');    //NOI18N
++    public static String convertPackage2Folder(final String packageName, final char separatorChar) {
++        return packageName.replace( '.',separatorChar);
+     }
+ 
+-    /**
+-     * Converts a folder into package name
+-     * @param folderName to be converted
+-     * @param separatorChar separator used in folderName
+-     * @return the package name
+-     */
+-    public static @NonNull String convertFolder2Package( @NonNull String folderName, char folderSeparator ) {
+-        return folderName.replace( folderSeparator, '.' );
++    public static String convertFolder2Package (String packageName) {
++        return convertFolder2Package (packageName, '/');    //NOI18N
++    }
++    
++    public static String convertFolder2Package( String packageName, char folderSeparator ) {
++        return packageName.replace( folderSeparator, '.' );
+     }
+ 
+-    /**
+-     * Checks if the given folder is a parent of the given file
+-     * @param folder to test
+-     * @param file to test
+-     * @return true if folder is a parent of given file
+-     */
+-    public static boolean isParentOf (final @NonNull URL folder, final @NonNull URL file) {
++    public static boolean isParentOf (final URL folder, final URL file) {
+         assert folder != null && file != null;
+         return file.toExternalForm().startsWith(folder.toExternalForm());
+     }
+-
+-    /**
+-     * Resolves a relative path within a given package
+-     * @param packageName in which the relative path should be resolved
+-     * @param relativeName to resolve
+-     * @return a relative path resolved in package as path separated by '/' character
+-     */
+-    public static @NonNull String getRelativePath (final @NonNull String packageName, final @NonNull String relativeName) {
++    
++    public static String getRelativePath (final String packageName, final String relativeName) {
+         if (packageName.isEmpty()) return relativeName;
+         StringBuilder relativePath = new StringBuilder ();
+-        relativePath.append(packageName.replace('.','/'));  //NOI18N
+-        relativePath.append('/');                           //NOI18N
++        relativePath.append(packageName.replace('.','/'));
++        relativePath.append('/');
+         relativePath.append(relativeName);
+         return relativePath.toString();
+     }
+-
+-    /**
+-     * Returns a tuple {parentPath,simpleName} for given fully qualified name
+-     * @param fqn to get the parent name tuple for
+-     * @return a tuple {parentPath, simpleName}
+-     */
+-    public static @NonNull String[] getParentRelativePathAndName (@NonNull final String fqn) {
++    
++    public static String[] getParentRelativePathAndName (final String fqn) {        
+         final String[] result = getPackageAndName(fqn);
+         if (result != null) {
+             result[0] = result[0].replace('.','/');      //NOI18N
+         }
+         return result;
+     }     
+-
+-    /**
+-     * Returns a tuple {package,simpleName} for given fully qualified name
+-     * @param fqn to get the package simpleName tuple for
+-     * @return a tuple {package,simpleName}
+-     */
+-    public static @NonNull String[] getPackageAndName (final @NonNull String fqn) {
++    
++    public static String[] getPackageAndName (final String fqn) {
+         if (fqn.charAt(fqn.length()-1) == '.') {
+             return null;
+         }
+@@ -646,7 +588,7 @@
+      * @param extension
+      * @return the found kind
+      */ 
+-    public static @NonNull JavaFileObject.Kind getKind (final @NullAllowed String extension) {
++    public static JavaFileObject.Kind getKind (final @NullAllowed String extension) {
+         if (extension == null) {
+             return JavaFileObject.Kind.OTHER;
+         }
+@@ -665,12 +607,8 @@
+         }
+         return JavaFileObject.Kind.OTHER;
+     }
+-
+-    /**
+-     * Recursively deletes the folder
+-     * @param folder to be deleted
+-     */
+-    public static void deleteRecursively (final @NonNull File folder) {
++        
++    public static void deleteRecursively (final File folder) {
+         assert folder != null;        
+         if (folder.isDirectory()) {
+             File[] children = folder.listFiles();
+@@ -682,103 +620,7 @@
+         }
+         folder.delete();
+     }
+-
+-    /**
+-     * Returns a relative path of given file in given root
+-     * @param root owning the file
+-     * @param fo a file to get the relative path for
+-     * @return the relative path
+-     */
+-    public static @NonNull String getRelativePath (final @NonNull File root, final @NonNull File fo) {
+-        final String rootPath = root.getAbsolutePath();
+-        final String foPath = fo.getAbsolutePath();
+-        assert foPath.startsWith(rootPath) : String.format("getRelativePath(%s, %s)", rootPath, foPath);    //NOI18N
+-        int index = rootPath.length();
+-        if (rootPath.charAt(index - 1) != File.separatorChar) {
+-            index++;
+-        }
+-        int foIndex = foPath.length();
+-        if (foIndex <= index) {
+-            return ""; //NOI18N
+-        }
+-        return foPath.substring(index);
+-    }
+-
+-    /**
+-     * Returns a relative path of given file in given root
+-     * @param root owning the file
+-     * @param fo a file to get the relative path for
+-     * @return the relative path
+-     */
+-    public static @NonNull String getRelativePath (@NonNull final URL root, @NonNull final URL fo) throws URISyntaxException {
+-        final String path = getRelativePath(new File(root.toURI()), new File(fo.toURI()));
+-        return path.replace(File.separatorChar, '/');   //NOI18N
+-    }
+-
+-    // <editor-fold defaultstate="collapsed" desc="Private helper methods">
+-    private static CharSequence getCharContent(InputStream ins, Charset encoding, JavaFileFilterImplementation filter, long expectedLength, boolean ignoreEncodingErrors) throws IOException {
+-        char[] result;
+-        Reader in;
+-
+-        if (encoding != null) {
+-            in = new InputStreamReader (ins, encoding);
+-        } else {
+-            in = new InputStreamReader (ins);
+-        }
+-        if (filter != null) {
+-            in = filter.filterReader(in);
+-        }
+-        int red = 0;
+-        try {
+-            int len = (int) expectedLength;
+-            if (len == 0) len++; //len - red would be 0 while reading from the stream
+-            result = new char [len+1];
+-            int rv;
+-            while ((rv=in.read(result,red,len-red))>=0) {
+-                red += rv;
+-                //In case the filter enlarged the file
+-                if (red == len) {
+-                    char[] _tmp = new char[2*len];
+-                    System.arraycopy(result, 0, _tmp, 0, len);
+-                    result = _tmp;
+-                    len = result.length;
+-                }
+-            }
+-        } finally {
+-            in.close();
+-        }
+-        result[red++]='\n'; //NOI18N
+-        CharSequence buffer = CharBuffer.wrap (result, 0, red);
+-        return buffer;
+-    }
+-
+-    private static String getSimpleName(JavaFileObject fo ) {
+-        String name = getName(fo,true);
+-        int i = name.lastIndexOf( '$' );
+-        if ( i == -1 ) {
+-            return name;
+-        }
+-        else {
+-            return name.substring( i + 1 );
+-        }
+-    }
+-
+-    private static String getSimpleName( String fileName ) {
+-
+-        String name = getBaseName( fileName );
+-
+-        int i = name.lastIndexOf( '$' );
+-        if ( i == -1 ) {
+-            return name;
+-        }
+-        else {
+-            return name.substring( i + 1 );
+-        }
+-
+-    }
+-    //</editor-fold>
+-
+-    //<editor-fold defaultstate="collapsed" desc="JavaFileObject implementation">
++        
+     public static abstract class Base implements InferableJavaFileObject {
+ 
+         protected final JavaFileObject.Kind kind;
+@@ -796,22 +638,21 @@
+             this.kind = FileObjects.getKind (this.ext);
+         }
+                 
+-        @Override
+         public JavaFileObject.Kind getKind() {
+             return this.kind;
+         }
+         
+-        @Override
+         public boolean isNameCompatible (String simplename, JavaFileObject.Kind k) {
+-            return this.kind == k && nameWithoutExt.equals(simplename);
++            if (this.kind != k) {
++                return false;
++            }
++	    return nameWithoutExt.equals(simplename);
+ 	}        
+         
+-        @Override
+         public NestingKind getNestingKind() {
+             return null;
+         }
+         
+-        @Override
+         public Modifier getAccessLevel() {
+             return null;
+         }
+@@ -829,7 +670,6 @@
+             return this.nameWithoutExt;
+         }
+         
+-        @Override
+         public String getName () {
+             return this.nameWithoutExt + '.' + ext;
+         }
+@@ -842,7 +682,6 @@
+             return false;
+         }
+         
+-        @Override
+         public final String inferBinaryName () {
+             final StringBuilder sb = new StringBuilder ();
+             sb.append (this.pkgName);
+@@ -877,10 +716,8 @@
+         }
+     }
+ 
+-    @Trusted
+     public static class FileBase extends Base {
+ 
+-        private static final boolean isWindows = Utilities.isWindows();
+         protected final File f;
+         private final JavaFileFilterImplementation filter;
+         private final Charset encoding;
+@@ -934,9 +771,16 @@
+ 
+         @Override
+ 	public boolean isNameCompatible(String simplename, JavaFileObject.Kind kind) {
+-            return isWindows ?
+-                this.kind == kind && nameWithoutExt.equalsIgnoreCase(simplename) :
+-                super.isNameCompatible(simplename, kind);
++	    boolean res = super.isNameCompatible(simplename, kind);
++            if (res) {
++                return res;
++            }
++            else if (Utilities.isWindows()) {
++                return nameWithoutExt.equalsIgnoreCase(simplename);
++            }
++            else {
++                return false;
++            }
+ 	}
+ 
+         @Override
+@@ -975,8 +819,74 @@
+ 	    return f.hashCode();
+ 	}
+     }
+-        
+-    @Trusted
++
++    public static class InvalidFileException extends IOException {
++
++        public InvalidFileException () {
++            super ();
++        }
++
++        public InvalidFileException (final FileObject fo) {
++            super (NbBundle.getMessage(FileObjects.class,"FMT_InvalidFile",FileUtil.getFileDisplayName(fo)));
++        }
++    }
++
++    public static String getRelativePath (final File root, final File fo) {
++        final String rootPath = root.getAbsolutePath();
++        final String foPath = fo.getAbsolutePath();
++        assert foPath.startsWith(rootPath) : String.format("getRelativePath(%s, %s)", rootPath, foPath);
++        int index = rootPath.length();
++        if (rootPath.charAt(index - 1) != File.separatorChar) {
++            index++;
++        }
++        int foIndex = foPath.length();
++        if (foIndex <= index) {
++            return ""; //NOI18N
++        }
++        return foPath.substring(index);
++    }
++
++    public static String getRelativePath (final URL root, final URL fo) throws URISyntaxException {
++        final String path = getRelativePath(new File(root.toURI()), new File(fo.toURI()));
++        return path.replace(File.separatorChar, '/');
++    }
++
++    public static CharSequence getCharContent(InputStream ins, Charset encoding, JavaFileFilterImplementation filter, long expectedLength, boolean ignoreEncodingErrors) throws IOException {
++        char[] result;
++        Reader in;
++
++        if (encoding != null) {
++            in = new InputStreamReader (ins, encoding);
++        } else {
++            in = new InputStreamReader (ins);
++        }
++        if (filter != null) {
++            in = filter.filterReader(in);
++        }
++        int red = 0;
++        try {
++            int len = (int) expectedLength;
++            if (len == 0) len++; //len - red would be 0 while reading from the stream
++            result = new char [len+1];
++            int rv;
++            while ((rv=in.read(result,red,len-red))>=0) {
++                red += rv;
++                //In case the filter enlarged the file
++                if (red == len) {
++                    char[] _tmp = new char[2*len];
++                    System.arraycopy(result, 0, _tmp, 0, len);
++                    result = _tmp;
++                    len = result.length;
++                }
++            }
++        } finally {
++            in.close();
++        }
++        result[red++]='\n'; //NOI18N
++        CharSequence buffer = CharBuffer.wrap (result, 0, red);
++        return buffer;
++    }
++
+     private static class NewFromTemplateFileObject extends FileBase {
+ 
+         public NewFromTemplateFileObject (File f, String packageName, String baseName, JavaFileFilterImplementation filter, Charset encoding) {
+@@ -1036,7 +946,10 @@
+         }
+     }
+ 
+-    abstract static class ZipFileBase extends Base {
++    /** A subclass of FileObject representing zip entries.
++     * XXX: What happens when the archive is deleted or rebuilt?
++     */
++    public abstract static class ZipFileBase extends Base {
+         
+         protected final long mtime;
+         protected final String resName;
+@@ -1048,19 +961,17 @@
+                 this.resName = baseName;
+             }
+             else {
+-                StringBuilder rn = new StringBuilder (folderName);
+-                rn.append('/');        //NOI18N
+-                rn.append(baseName);
+-                this.resName = rn.toString();
++                StringBuilder resName = new StringBuilder (folderName);
++                resName.append('/');        //NOI18N
++                resName.append(baseName);
++                this.resName = resName.toString();
+             }
+         }
+         
+-        @Override
+         public OutputStream openOutputStream() throws IOException {
+ 	    throw new UnsupportedOperationException();
+ 	}
+ 
+-        @Override
+ 	public Reader openReader(boolean b) throws IOException {
+             if (this.getKind() == JavaFileObject.Kind.CLASS) {
+                 throw new UnsupportedOperationException();
+@@ -1070,23 +981,18 @@
+             }
+ 	}
+ 
+-        @Override
+         public Writer openWriter() throws IOException {
+ 	    throw new UnsupportedOperationException();
+ 	}
+         
+-        @Override
+         public long getLastModified() {
+ 	    return mtime;
+ 	}
+ 
+-        @Override
+ 	public boolean delete() {
+ 	    throw new UnsupportedOperationException();
+ 	}
+ 
+-        @Override
+-        @SuppressWarnings("empty-statement")
+ 	public CharBuffer getCharContent(boolean ignoreEncodingErrors) throws IOException {
+ 	    Reader r = openReader(ignoreEncodingErrors);
+             try {
+@@ -1114,7 +1020,6 @@
+             }
+ 	}
+         
+-        @Override
+         public final URI toUri () {
+             URI  zdirURI = this.getArchiveURI();
+             try {
+@@ -1136,10 +1041,14 @@
+                     }
+                     return new URI("jar:"+zdirURI.toString()+"!/"+sb.toString());    //NOI18N
+                 } catch (final UnsupportedEncodingException e2) {
+-                    throw new IllegalStateException(e2);
++                    final IllegalStateException ne = new IllegalStateException ();
++                    ne.initCause(e2);
++                    throw ne;
+                 }
+                 catch (final URISyntaxException e2) {
+-                    throw new IllegalStateException(e2);
++                    final IllegalStateException ne = new IllegalStateException ();
++                    ne.initCause(e2);
++                    throw ne;
+                 }
+             }
+         }
+@@ -1162,8 +1071,7 @@
+         protected abstract long getSize() throws IOException;
+         
+     }
+-
+-    @Trusted
++    
+     private static class ZipFileObject extends ZipFileBase {
+ 	
+ 
+@@ -1179,7 +1087,6 @@
+             
+ 	}
+ 
+-        @Override
+         public InputStream openInputStream() throws IOException {            
+             class ZipInputStream extends InputStream {
+ 
+@@ -1208,22 +1115,18 @@
+                     }
+                 }
+ 
+-                @Override
+                 public int read() throws IOException {
+                     throw new java.lang.UnsupportedOperationException("Not supported yet.");
+                 }
+ 
+-                @Override
+                 public int read(byte b[], int off, int len) throws IOException {
+                     return delegate.read(b, off, len);
+                 }
+ 
+-                @Override
+                 public int available() throws IOException {
+                     return this.delegate.available();
+                 }
+ 
+-                @Override
+                 public void close() throws IOException {
+                     try {
+                         this.delegate.close();
+@@ -1233,19 +1136,17 @@
+                 }
+ 
+ 
+-            }
++            };
+             // long time = System.currentTimeMillis();
+             ZipFile zf = new ZipFile (archiveFile);
+             // System.out.println("ZF OPEN " + archiveFile.getPath() + " took: " + (System.currentTimeMillis() - time )+ "ms." );
+             return new BufferedInputStream (new ZipInputStream (zf));
+ 	}
+         
+-        @Override
+         public URI getArchiveURI () {
+             return this.archiveFile.toURI();
+         }
+         
+-        @Override
+         protected long getSize () throws IOException {
+             ZipFile zf = new ZipFile (archiveFile);
+             try {
+@@ -1256,8 +1157,7 @@
+             }
+         }
+     }
+-
+-    @Trusted
++    
+     private static class FastZipFileObject extends ZipFileObject {
+         
+         private long offset;
+@@ -1301,8 +1201,7 @@
+             return super.getSize();
+         }
+     }
+-
+-    @Trusted
++    
+     private static class CachedZipFileObject extends ZipFileBase {
+         
+         private ZipFile zipFile;
+@@ -1313,17 +1212,14 @@
+ 	    this.zipFile = zipFile;            
+ 	}
+         
+-        @Override
+         public InputStream openInputStream() throws IOException {
+             return new BufferedInputStream (this.zipFile.getInputStream(new ZipEntry (this.resName)));
+ 	}
+         
+-        @Override
+         public URI getArchiveURI () {
+             return new File (this.zipFile.getName()).toURI();
+         }
+         
+-        @Override
+         protected long getSize() throws IOException {
+             ZipEntry ze = this.zipFile.getEntry(this.resName);
+             return ze == null ? 0L : ze.getSize();
+@@ -1331,9 +1227,8 @@
+     }
+     
+     
+-    /** Temporary FileObject for parsing input stream.
+-     */
+-    @Trusted
++    /** Temporay FileObject for parsing input stream.
++     */    
+     private static class MemoryFileObject extends Base {
+         
+         private final long lastModified;
+@@ -1353,22 +1248,19 @@
+ 
+         /**
+          * Get the character content of the file, if available.
+-         * @param ignoreEncodingErrors if true, encoding errors will be replaced by the
++         * @param ignoreEncodingErrors if true, encoding errros will be replaced by the 
+          * default translation character; otherwise they should be reported as diagnostics.
+          * @throws UnsupportedOperationException if character access is not supported
+          */
+-        @Override
+         public java.nio.CharBuffer getCharContent(boolean ignoreEncodingErrors) throws java.io.IOException {
+             return cb.duplicate();
+         }
+ 
+-        @Override
+         public boolean delete() {
+             // Do nothing
+             return false;
+         }        
+ 
+-        @Override
+         public URI toUri () {
+             if (this.uri != null) {
+                 return this.uri;
+@@ -1383,7 +1275,6 @@
+             return isVirtual;
+         }
+ 
+-        @Override
+         public long getLastModified() {
+             return this.lastModified;
+         }
+@@ -1394,7 +1285,6 @@
+          * @return an InputStream for this  object.
+          * @throws UnsupportedOperationException if the byte access is not supported
+          */
+-        @Override
+         public InputStream openInputStream() throws java.io.IOException {
+             return new ByteArrayInputStream(cb.toString().getBytes("UTF-8"));
+         }
+@@ -1405,7 +1295,6 @@
+          * @return an OutputStream for this  object.
+          * @throws UnsupportedOperationException if byte access is not supported
+          */
+-        @Override
+         public java.io.OutputStream openOutputStream() throws java.io.IOException {
+             throw new UnsupportedOperationException();
+         }
+@@ -1417,7 +1306,6 @@
+          * @throws UnsupportedOperationException if character access is not supported
+          * @throws IOException if an error occurs while opening the reader
+          */
+-        @Override
+         public java.io.Reader openReader (boolean b) throws java.io.IOException {
+             return new StringReader(this.cb.toString());
+         }
+@@ -1427,22 +1315,32 @@
+          * @throws UnsupportedOperationException if character access is not supported
+          * @throws IOException if an error occurs while opening the writer
+          */
+-        @Override
+         public java.io.Writer openWriter() throws java.io.IOException {
+             throw new UnsupportedOperationException();
+         }
+         
+-    }
+-    //</editor-fold>
+-
+-    public static class InvalidFileException extends IOException {
+-
+-        public InvalidFileException () {
+-            super ();
++    }    
++    
++    private static class SimpleNameStringComparator implements Comparator<String> {
++        
++        public int compare( String o1, String o2 ) {
++            return getSimpleName( o1 ).compareTo( getSimpleName( o2 ) );
+         }
+-
+-        public InvalidFileException (final FileObject fo) {
+-            super (NbBundle.getMessage(FileObjects.class,"FMT_InvalidFile",FileUtil.getFileDisplayName(fo)));
++                        
++    }
++    
++    private static class SimpleNameFileObjectComparator implements Comparator<JavaFileObject> {
++        
++        public int compare( JavaFileObject o1, JavaFileObject o2 ) {
++            
++            String n1 = getSimpleName( o1 );
++            String n2 = getSimpleName( o2 );
++                        
++            return n1.compareTo( n2 );
+         }
++                        
+     }
++    
++    static final String encodingName = new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding();            
++    
+ }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ProxyFileManager.java	2011-08-03 23:01:41.000000000 +0100
+@@ -44,7 +44,6 @@
+ 
+ package org.netbeans.modules.java.source.parsing;
+ 
+-import com.sun.tools.javac.api.ClientCodeWrapper.Trusted;
+ import java.io.IOException;
+ import java.io.OutputStream;
+ import java.io.OutputStreamWriter;
+@@ -58,6 +57,7 @@
+ import java.util.LinkedList;
+ import java.util.List;
+ import java.util.Set;
++import java.util.Stack;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ import javax.tools.FileObject;
+@@ -71,7 +71,6 @@
+  *
+  * @author Tomas Zezula
+  */
+- at Trusted
+ public class ProxyFileManager implements JavaFileManager {
+ 
+ 
+@@ -142,13 +141,26 @@
+         }
+         else if (location == StandardLocation.SOURCE_PATH && this.sourcePath != null) {
+             if (this.memoryFileManager != null) {
+-                return new JavaFileManager[] {
+-                    this.sourcePath,
+-                    this.memoryFileManager
+-                };
++                if (this.aptSources != null) {
++                    return new JavaFileManager[] {
++                        this.sourcePath,
++                        this.aptSources,
++                        this.memoryFileManager
++                    };
++                }
++                else {
++                    return new JavaFileManager[] {
++                        this.sourcePath,
++                        this.memoryFileManager
++                    };
++                }
+             }
+             else {
+-                return new JavaFileManager[] {this.sourcePath};
++                if (this.aptSources != null) {
++                    return new JavaFileManager[] {this.sourcePath, this.aptSources};
++                } else {
++                    return new JavaFileManager[] {this.sourcePath};
++                }
+             }
+         }
+         else if (location == StandardLocation.CLASS_OUTPUT && this.outputhPath != null) {
+@@ -429,7 +441,6 @@
+         }
+     }
+ 
+-    @Trusted
+     private static final class NullFileObject extends ForwardingInferableJavaFileObject {
+         private NullFileObject (@NonNull final InferableJavaFileObject delegate) {
+             super (delegate);
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/FolderArchive.java	2011-08-03 23:01:41.000000000 +0100
+@@ -46,26 +46,19 @@
+ 
+ import java.io.File;
+ import java.io.IOException;
+-import java.net.MalformedURLException;
+-import java.net.URISyntaxException;
+-import java.net.URL;
+ import java.nio.charset.Charset;
+ import java.util.ArrayList;
+ import java.util.Collections;
+ import java.util.List;
+ import java.util.Set;
+-import java.util.concurrent.atomic.AtomicBoolean;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ import javax.tools.JavaFileObject;
+-import org.netbeans.api.annotations.common.NonNull;
+ import org.netbeans.api.java.classpath.ClassPath;
+ import org.netbeans.api.queries.FileEncodingQuery;
+ import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation;
+-import org.netbeans.modules.java.source.indexing.JavaIndex;
+ import org.openide.filesystems.FileObject;
+ import org.openide.filesystems.FileUtil;
+-import org.openide.util.Exceptions;
+ 
+ /**
+  *
+@@ -78,9 +71,6 @@
+     
+     final File root;
+     final Charset encoding;
+-    
+-    private final AtomicBoolean sourceRootInitialized = new AtomicBoolean();
+-    private volatile URL sourceRoot;
+ 
+     /** Creates a new instance of FolderArchive */
+     public FolderArchive (final File root) {
+@@ -100,7 +90,6 @@
+         }
+     }
+     
+-    @Override
+     public Iterable<JavaFileObject> getFiles(String folderName, ClassPath.Entry entry, Set<JavaFileObject.Kind> kinds, JavaFileFilterImplementation filter) throws IOException {
+         assert folderName != null;
+         if (folderName.length()>0) {
+@@ -132,7 +121,6 @@
+         return Collections.<JavaFileObject>emptyList();
+     }
+ 
+-    @Override
+     public JavaFileObject create (String relativePath, final JavaFileFilterImplementation filter) throws UnsupportedOperationException {
+         if (File.separatorChar != '/') {    //NOI18N
+             relativePath = relativePath.replace('/', File.separatorChar);
+@@ -141,38 +129,12 @@
+         return FileObjects.fileFileObject(file, root, filter, encoding);
+     }
+ 
+-    @Override
+     public void clear () {
+     }
+ 
+     @Override
+-    public JavaFileObject getFile(final @NonNull String name) {
+-        final String path = name.replace('/', File.separatorChar);        //NOI18N
+-        File file = new File (this.root, path);
+-        if (file.exists()) {
+-            return FileObjects.fileFileObject(file,this.root,null,encoding);
+-        }
+-        try {
+-            final URL srcRoot = getBaseSourceRoot(this.root.toURI().toURL());
+-            if (srcRoot != null) {
+-                final File folder = new File(srcRoot.toURI());
+-                file = new File (folder,path);
+-                if (file.exists()) {
+-                    return FileObjects.fileFileObject(file,folder,null,encoding);
+-                }
+-            }
+-        } catch (MalformedURLException e) {
+-            Exceptions.printStackTrace(e);
+-        } catch (URISyntaxException e) {
+-            Exceptions.printStackTrace(e);
+-        }
+-        return null;
+-    }
+-
+-    private URL getBaseSourceRoot(final URL binRoot) {
+-        if (!sourceRootInitialized.getAndSet(true)) {
+-            sourceRoot = JavaIndex.getSourceRootForClassFolder(binRoot);
+-        }
+-        return sourceRoot;
++    public JavaFileObject getFile(String name) {
++        final File file = new File (this.root, name.replace('/', File.separatorChar));      //NOI18N
++        return file.exists() ? FileObjects.fileFileObject(file,this.root,null,encoding) : null ;
+     }
+ }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/CompilationInfoImpl.java	2011-08-03 23:01:41.000000000 +0100
+@@ -55,7 +55,6 @@
+ import java.util.List;
+ import java.util.Locale;
+ import java.util.Map;
+-import java.util.Map.Entry;
+ import java.util.TreeMap;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+@@ -86,7 +85,6 @@
+     private CompilationUnitTree compilationUnit;
+ 
+     private JavacTaskImpl javacTask;
+-    private DiagnosticListener<JavaFileObject> diagnosticListener;
+     private final ClasspathInfo cpInfo;
+     Pair<DocPositionRegion,MethodTree> changedMethod;
+     private final FileObject file;
+@@ -113,7 +111,6 @@
+                          final FileObject file,
+                          final FileObject root,
+                          final JavacTaskImpl javacTask,
+-                         final DiagnosticListener<JavaFileObject> diagnosticListener,
+                          final Snapshot snapshot,
+                          final boolean detached) throws IOException {
+         assert parser != null;
+@@ -126,7 +123,6 @@
+         assert file == null || snapshot != null;
+         this.jfo = file != null ? JavacParser.jfoProvider.createJavaFileObject(file, root, JavaFileFilterQuery.getFilter(file), snapshot.getText()) : null;
+         this.javacTask = javacTask;
+-        this.diagnosticListener = diagnosticListener;
+         this.isClassFile = false;
+         this.isDetached = detached;
+     }
+@@ -248,21 +244,13 @@
+         if (this.jfo == null) {
+             throw new IllegalStateException ();
+         }
+-        Collection<Collection<Diagnostic<? extends JavaFileObject>>> errors = ((DiagnosticListenerImpl)diagnosticListener).getErrors(jfo).values();
+-        List<Diagnostic<? extends JavaFileObject>> partialReparseErrors = ((DiagnosticListenerImpl)diagnosticListener).partialReparseErrors;
+-        List<Diagnostic<? extends JavaFileObject>> affectedErrors = ((DiagnosticListenerImpl)diagnosticListener).affectedErrors;
+-        int errorsSize = 0;
+-
+-        for (Collection<Diagnostic<? extends JavaFileObject>> err : errors) {
+-            errorsSize += err.size();
+-        }
+-
+-        List<Diagnostic> localErrors = new ArrayList<Diagnostic>(errorsSize +
++        Collection<Diagnostic<? extends JavaFileObject>> errors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).getErrors(jfo).values();
++        List<Diagnostic<? extends JavaFileObject>> partialReparseErrors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).partialReparseErrors;
++        List<Diagnostic<? extends JavaFileObject>> affectedErrors = ((DiagnosticListenerImpl) javacTask.getContext().get(DiagnosticListener.class)).affectedErrors;
++        List<Diagnostic> localErrors = new ArrayList<Diagnostic>(errors.size() + 
+                 (partialReparseErrors == null ? 0 : partialReparseErrors.size()) + 
+                 (affectedErrors == null ? 0 : affectedErrors.size()));
+-        for (Collection<Diagnostic<? extends JavaFileObject>> err : errors) {
+-            localErrors.addAll(err);
+-        }
++        localErrors.addAll(errors);
+         if (partialReparseErrors != null) {
+             localErrors.addAll (partialReparseErrors);
+         }
+@@ -379,20 +367,11 @@
+      */
+     public synchronized JavacTaskImpl getJavacTask() {
+         if (javacTask == null) {
+-            diagnosticListener = new DiagnosticListenerImpl(this.jfo);
+             javacTask = JavacParser.createJavacTask(this.file, this.root, this.cpInfo,
+-                    this.parser, diagnosticListener, null, isDetached);
++                    this.parser, new DiagnosticListenerImpl(this.jfo), null, isDetached);
+         }
+ 	return javacTask;
+     }
+-
+-    /**
+-     * Returns current {@link DiagnosticListener}
+-     * @return listener
+-     */
+-    DiagnosticListener<JavaFileObject> getDiagnosticListener() {
+-        return diagnosticListener;
+-    }
+     
+     /**
+      * Sets the current {@link JavaSource.Phase}
+@@ -428,7 +407,7 @@
+     // Innerclasses ------------------------------------------------------------    
+     static class DiagnosticListenerImpl implements DiagnosticListener<JavaFileObject> {
+         
+-        private final Map<JavaFileObject, TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>>> source2Errors;
++        private final Map<JavaFileObject, TreeMap<Integer,Diagnostic<? extends JavaFileObject>>> source2Errors;
+         private final JavaFileObject jfo;
+         private volatile List<Diagnostic<? extends JavaFileObject>> partialReparseErrors;
+         private volatile List<Diagnostic<? extends JavaFileObject>> affectedErrors;
+@@ -436,7 +415,7 @@
+         
+         public DiagnosticListenerImpl(final JavaFileObject jfo) {
+             this.jfo = jfo;
+-            this.source2Errors = new HashMap<JavaFileObject, TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>>>();
++            this.source2Errors = new HashMap<JavaFileObject, TreeMap<Integer, Diagnostic<? extends JavaFileObject>>>();
+         }
+         
+         @Override
+@@ -446,22 +425,15 @@
+                     partialReparseErrors.add(message);
+                 }
+             } else {
+-                TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>> errors = getErrors(message.getSource());
+-                Collection<Diagnostic<? extends JavaFileObject>> diags = errors.get((int) message.getPosition());
+-
+-                if (diags == null) {
+-                    errors.put((int) message.getPosition(), diags = new ArrayList<Diagnostic<? extends JavaFileObject>>());
+-                }
+-                
+-                diags.add(message);
++                getErrors(message.getSource()).put((int) message.getPosition(), message);
+             }
+         }
+ 
+-        private TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>> getErrors(JavaFileObject file) {
+-                TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>> errors = source2Errors.get(file);
++        private TreeMap<Integer,Diagnostic<? extends JavaFileObject>> getErrors(JavaFileObject file) {
++                TreeMap<Integer, Diagnostic<? extends JavaFileObject>> errors = source2Errors.get(file);
+ 
+                 if (errors == null) {
+-                    source2Errors.put(file, errors = new TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>>());
++                    source2Errors.put(file, errors = new TreeMap<Integer, Diagnostic<? extends JavaFileObject>>());
+                 }
+ 
+                 return errors;
+@@ -474,20 +446,18 @@
+         final void startPartialReparse (int from, int to) {
+             if (partialReparseErrors == null) {
+                 partialReparseErrors = new ArrayList<Diagnostic<? extends JavaFileObject>>();
+-                TreeMap<Integer, Collection<Diagnostic<? extends JavaFileObject>>> errors = getErrors(jfo);
++                TreeMap<Integer, Diagnostic<? extends JavaFileObject>> errors = getErrors(jfo);
+                 errors.subMap(from, to).clear();       //Remove errors in changed method durring the partial reparse
+-                Map<Integer, Collection<Diagnostic<? extends JavaFileObject>>> tail = errors.tailMap(to);
++                Map<Integer,Diagnostic<? extends JavaFileObject>> tail = errors.tailMap(to);
+                 this.affectedErrors = new ArrayList<Diagnostic<? extends JavaFileObject>>(tail.size());
+-                for (Iterator<Entry<Integer,Collection<Diagnostic<? extends JavaFileObject>>>> it = tail.entrySet().iterator(); it.hasNext();) {
+-                    Entry<Integer, Collection<Diagnostic<? extends JavaFileObject>>> e = it.next();
++                for (Iterator<Map.Entry<Integer,Diagnostic<? extends JavaFileObject>>> it = tail.entrySet().iterator(); it.hasNext();) {
++                    Map.Entry<Integer,Diagnostic<? extends JavaFileObject>> e = it.next();                    
++                    final JCDiagnostic diagnostic = (JCDiagnostic)e.getValue();
+                     it.remove();
+-                    for (Diagnostic<? extends JavaFileObject> d : e.getValue()) {
+-                        final JCDiagnostic diagnostic = (JCDiagnostic) d;
+-                        if (diagnostic == null) {
+-                            throw new IllegalStateException("#184910: diagnostic == null " + mapArraysToLists(Thread.getAllStackTraces())); //NOI18N
+-                        }
+-                        this.affectedErrors.add(new D (diagnostic));
++                    if (diagnostic == null) {
++                        throw new IllegalStateException("#184910: diagnostic == null " + mapArraysToLists(Thread.getAllStackTraces())); //NOI18N
+                     }
++                    this.affectedErrors.add(new D (diagnostic));
+                 }
+             }
+             else {
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/JavacParser.java	2011-08-03 23:01:41.000000000 +0100
+@@ -74,8 +74,6 @@
+ import java.io.OutputStream;
+ import java.io.OutputStreamWriter;
+ import java.io.PrintWriter;
+-import java.lang.ref.Reference;
+-import java.lang.ref.WeakReference;
+ import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Collection;
+@@ -87,14 +85,12 @@
+ import java.util.List;
+ import java.util.Map;
+ import java.util.concurrent.atomic.AtomicBoolean;
+-import java.util.concurrent.atomic.AtomicReference;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+ import javax.annotation.processing.Processor;
+ import javax.swing.event.ChangeEvent;
+ import  javax.swing.event.ChangeListener;
+ import javax.swing.text.Document;
+-import javax.swing.text.JTextComponent;
+ import javax.tools.Diagnostic;
+ import javax.tools.DiagnosticListener;
+ import javax.tools.JavaCompiler;
+@@ -102,7 +98,6 @@
+ import javax.tools.ToolProvider;
+ import org.netbeans.api.annotations.common.NonNull;
+ import org.netbeans.api.annotations.common.NullAllowed;
+-import org.netbeans.api.editor.EditorRegistry;
+ import org.netbeans.api.java.classpath.ClassPath;
+ import org.netbeans.api.java.lexer.JavaTokenId;
+ import org.netbeans.api.java.queries.SourceLevelQuery;
+@@ -203,11 +198,10 @@
+     //Incremental parsing support
+     private final boolean supportsReparse;
+     //Incremental parsing support
+-    private final List<Pair<DocPositionRegion,MethodTree>> positions =
+-            Collections.synchronizedList(new LinkedList<Pair<DocPositionRegion,MethodTree>>());
++    private final List<Pair<DocPositionRegion,MethodTree>> positions = Collections.synchronizedList(new LinkedList<Pair<DocPositionRegion,MethodTree>>());
+     //Incremental parsing support
+-    private final AtomicReference<Pair<DocPositionRegion,MethodTree>> changedMethod =
+-            new AtomicReference<Pair<DocPositionRegion, MethodTree>>();
++    //@GuardedBy(this)
++    private Pair<DocPositionRegion,MethodTree> changedMethod;
+     //Incremental parsing support
+     private final DocListener listener;
+     //J2ME preprocessor support
+@@ -353,23 +347,28 @@
+                 init (snapshot, task, true);
+                 boolean needsFullReparse = true;
+                 if (supportsReparse) {
+-                    final Pair<DocPositionRegion,MethodTree> _changedMethod = changedMethod.getAndSet(null);
++                    Pair<DocPositionRegion,MethodTree> _changedMethod;
++                    synchronized (this) {
++                        _changedMethod = this.changedMethod;
++                        this.changedMethod = null;
++                    }
+                     if (_changedMethod != null && ciImpl != null) {
+                         LOGGER.log(Level.FINE, "\t:trying partial reparse:\n{0}", _changedMethod.first.getText());                           //NOI18N
+                         needsFullReparse = !reparseMethod(ciImpl, snapshot, _changedMethod.second, _changedMethod.first.getText());
+                     }
+                 }
+                 if (needsFullReparse) {
+-                    positions.clear();
+-                    ciImpl = createCurrentInfo (this, file, root, snapshot, null, null);
++                    synchronized (positions) {
++                        positions.clear();
++                    }
++                    ciImpl = createCurrentInfo (this, file, root,snapshot, null);
+                     LOGGER.fine("\t:created new javac");                                    //NOI18N
+                 }
+                 break;
+             default:
+                 init (snapshot, task, false);
+                 ciImpl = createCurrentInfo(this, file, root, snapshot,
+-                    ciImpl == null ? null : ciImpl.getJavacTask(),
+-                    ciImpl == null ? null : ciImpl.getDiagnosticListener());
++                    ciImpl == null ? null : ciImpl.getJavacTask());
+         }
+         cachedSnapShot = snapshot;
+     }
+@@ -460,7 +459,7 @@
+             if (nct.getCompilationController() == null || nct.getTimeStamp() != parseId) {
+                 try {
+                     nct.setCompilationController(
+-                        JavaSourceAccessor.getINSTANCE().createCompilationController(new CompilationInfoImpl(this, file, root, null, null, cachedSnapShot, true)),
++                        JavaSourceAccessor.getINSTANCE().createCompilationController(new CompilationInfoImpl(this, file, root, null, cachedSnapShot, true)),
+                         parseId);
+                 } catch (IOException ioe) {
+                     throw new ParseException ("Javac Failure", ioe);
+@@ -617,9 +616,8 @@
+             final FileObject file,
+             final FileObject root,
+             final Snapshot snapshot,
+-            final JavacTaskImpl javac,
+-            final DiagnosticListener<JavaFileObject> diagnosticListener) throws IOException {
+-        CompilationInfoImpl info = new CompilationInfoImpl(parser, file, root, javac, diagnosticListener, snapshot, false);
++            final JavacTaskImpl javac) throws IOException {
++        CompilationInfoImpl info = new CompilationInfoImpl(parser, file, root, javac, snapshot, false);
+         if (file != null) {
+             Logger.getLogger("TIMER").log(Level.FINE, "CompilationInfo",    //NOI18N
+                     new Object[] {file, info});
+@@ -687,8 +685,6 @@
+         }
+         options.add("-XDide");   // NOI18N, javac runs inside the IDE
+         options.add("-XDsave-parameter-names");   // NOI18N, javac runs inside the IDE
+-        options.add("-XDsuppressAbortOnBadClassFile");   // NOI18N, when a class file cannot be read, produce an error type instead of failing with an exception
+-        options.add("-XDshouldStopPolicy=GENERATE");   // NOI18N, parsing should not stop in phase where an error is found
+         options.add("-g:source"); // NOI18N, Make the compiler to maintian source file info
+         options.add("-g:lines"); // NOI18N, Make the compiler to maintain line table
+         options.add("-g:vars");  // NOI18N, Make the compiler to maintain local variables table
+@@ -925,7 +921,7 @@
+                 final JavaFileObject prevLogged = l.useSource(cu.getSourceFile());
+                 JCBlock block;
+                 try {
+-                    DiagnosticListener dl = ci.getDiagnosticListener();
++                    DiagnosticListener dl = ctx.get(DiagnosticListener.class);
+                     assert dl instanceof CompilationInfoImpl.DiagnosticListenerImpl;
+                     ((CompilationInfoImpl.DiagnosticListenerImpl)dl).startPartialReparse(origStartPos, origEndPos);
+                     long start = System.currentTimeMillis();
+@@ -1068,7 +1064,6 @@
+                 th.addTokenHierarchyListener(lexListener = WeakListeners.create(TokenHierarchyListener.class, this,th));
+                 document = doc;
+             }
+-            EditorRegistry.addPropertyChangeListener(new EditorRegistryWeakListener(this));
+         }
+ 
+         @Override
+@@ -1090,13 +1085,6 @@
+                     //reset document
+                     this.document = doc;
+                 }
+-            } else if (EditorRegistry.FOCUS_GAINED_PROPERTY.equals(evt.getPropertyName())) {
+-                final Document doc = document;
+-                final JTextComponent focused = EditorRegistry.focusedComponent();
+-                final Document focusedDoc = focused == null ? null : focused.getDocument();
+-                if (doc != null && doc == focusedDoc) {
+-                    positions.clear();
+-                }
+             }
+         }
+ 
+@@ -1148,49 +1136,15 @@
+                         if (changedMethod!=null) {
+                             positions.add (changedMethod);
+                         }
+-                        JavacParser.this.changedMethod.set(changedMethod);
++                        synchronized (JavacParser.this) {
++                            JavacParser.this.changedMethod = changedMethod;
++                        }
+                     }
+                 }
+             }
+         }
+     }
+ 
+-    private static final class EditorRegistryWeakListener extends WeakReference<PropertyChangeListener> implements PropertyChangeListener, Runnable {
+-        private Reference<JTextComponent> last;
+-
+-        private EditorRegistryWeakListener(final @NonNull PropertyChangeListener delegate) {
+-            super(delegate,org.openide.util.Utilities.activeReferenceQueue());
+-        }
+-
+-        @Override
+-        public void propertyChange(PropertyChangeEvent evt) {
+-            final PropertyChangeListener delegate = get();
+-            final JTextComponent lastCandidate = EditorRegistry.focusedComponent();
+-            if (delegate != null && lastCandidate != null && lastCandidate != getLast()) {
+-                setLast(lastCandidate);
+-                delegate.propertyChange(evt);
+-            }
+-        }
+-
+-        @Override
+-        public void run() {
+-            EditorRegistry.removePropertyChangeListener(this);
+-        }
+-
+-        /**
+-         * @return the last
+-         */
+-        private JTextComponent getLast() {
+-            return last == null ? null : last.get();
+-        }
+-
+-        /**
+-         * @param last the last to set
+-         */
+-        private void setLast(JTextComponent last) {
+-            this.last = new WeakReference<JTextComponent>(last);
+-        }
+-    }
+ 
+     /**
+      * For unit tests only
+@@ -1199,7 +1153,7 @@
+      */
+     public synchronized void setChangedMethod (final Pair<DocPositionRegion,MethodTree> changedMethod) {
+         assert changedMethod != null;
+-        this.changedMethod.set(changedMethod);
++        this.changedMethod = changedMethod;
+     }
+ 
+     /**
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/parsing/ErrorHandlingJavadocEnter.java	2011-08-03 23:01:41.000000000 +0100
+@@ -63,8 +63,8 @@
+ 
+     public static void preRegister(final Context context) {
+         context.put(enterKey, new Context.Factory<Enter>() {
+-            public Enter make(Context c) {
+-                return new ErrorHandlingJavadocEnter(c);
++            public Enter make() {
++                return new ErrorHandlingJavadocEnter(context);
+             }
+         });
+     }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/TreeFactory.java	2011-08-03 23:01:41.000000000 +0100
+@@ -90,7 +90,6 @@
+     ASTService model;
+     Elements elements;
+     Types types;
+-    private final CommentHandlerService chs;
+     
+     private static final Context.Key<TreeFactory> contextKey = new Context.Key<TreeFactory>();
+ 
+@@ -110,7 +109,6 @@
+         make = com.sun.tools.javac.tree.TreeMaker.instance(context);
+         elements = JavacElements.instance(context);
+         types = JavacTypes.instance(context);
+-        chs = CommentHandlerService.instance(context);
+         make.toplevel = null;
+     }
+     
+@@ -207,7 +205,7 @@
+         return make.at(NOPOS).ClassDef((JCModifiers)modifiers,
+                              names.fromString(simpleName.toString()),
+                              typarams.toList(),
+-                             (JCExpression)extendsClause,
++                             (JCTree)extendsClause,
+                              impls.toList(),
+                              defs.toList());
+         
+@@ -296,11 +294,11 @@
+         return make.at(NOPOS).Continue(n);
+     }
+     
+-    public UnionTypeTree UnionType(List<? extends Tree> typeComponents) {
++    public DisjunctiveTypeTree DisjunctiveType(List<? extends Tree> typeComponents) {
+         ListBuffer<JCExpression> components = new ListBuffer<JCExpression>();
+         for (Tree t : typeComponents)
+             components.append((JCExpression)t);
+-        return make.at(NOPOS).TypeUnion(components.toList());
++        return make.at(NOPOS).TypeDisjunction(components.toList());
+     }
+ 
+     public DoWhileLoopTree DoWhileLoop(ExpressionTree condition, StatementTree statement) {
+@@ -1447,16 +1445,7 @@
+         REMOVE
+     }
+     
+-    public <N extends Tree> N setLabel(final N node, final CharSequence aLabel)
+-            throws IllegalArgumentException {
+-        N result = setLabelImpl(node, aLabel);
+-
+-        chs.copyComments(node, result);
+-
+-        return result;
+-    }
+-
+-    private <N extends Tree> N setLabelImpl(final N node, final CharSequence aLabel)
++    public <N extends Tree> N setLabel(final N node, final CharSequence aLabel) 
+             throws IllegalArgumentException
+     {
+         // todo (#pf): Shouldn't here be check that names are not the same?
+@@ -1607,7 +1596,7 @@
+         return make.at(NOPOS).ClassDef(make.at(NOPOS).Modifiers(modifiers, annotations),
+                              names.fromString(simpleName.toString()),
+                              typarams.toList(),
+-                             (JCExpression)extendsClause,
++                             (JCTree)extendsClause,
+                              impls.toList(),
+                              defs.toList());
+         
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/modules/java/source/builder/CommentHandlerService.java	2011-08-03 23:01:41.000000000 +0100
+@@ -53,7 +53,6 @@
+ import com.sun.tools.javac.util.Context;
+ 
+ import java.util.*;
+-import org.netbeans.modules.java.source.query.CommentSet.RelativePosition;
+ 
+ 
+ /**
+@@ -116,10 +115,12 @@
+             if (from != null) {
+                 CommentSetImpl to = map.get(toTree);
+                 if (to == null) {
+-                    map.put(toTree, to = new CommentSetImpl());
+-                }
+-                for (RelativePosition pos : RelativePosition.values()) {
+-                    to.addComments(pos, from.getComments(pos));
++                    to = (CommentSetImpl)from.clone();
++                    map.put(toTree, to);
++                } 
++                else {
++                    to.addPrecedingComments(from.getPrecedingComments());
++                    to.addTrailingComments(from.getTrailingComments());
+                 }
+             }
+         }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreePathHandle.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TreePathHandle.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreePathHandle.java	2011-08-03 23:01:41.000000000 +0100
+@@ -44,8 +44,6 @@
+                                                                                                                                                                                                                                
+ package org.netbeans.api.java.source;                                                                                                                                                                                          
+                                                                                                                                                                                                                                
+-import com.sun.source.tree.ImportTree;
+-import com.sun.source.tree.MemberSelectTree;
+ import com.sun.source.tree.Tree;                                                                                                                                                                                               
+ import com.sun.source.tree.Tree.Kind;
+ import com.sun.source.util.TreePath;                                                                                                                                                                                           
+@@ -64,9 +62,6 @@
+ import java.util.logging.Level;
+ import javax.lang.model.element.Element;                                                                                                                                                                                       
+ import javax.lang.model.element.ElementKind;
+-import javax.lang.model.element.Modifier;
+-import javax.lang.model.element.Name;
+-import javax.lang.model.element.TypeElement;
+ import javax.swing.text.Position;
+ import javax.swing.text.Position.Bias;                                                                                                                                                                                         
+ import javax.tools.JavaFileObject;
+@@ -324,20 +319,6 @@
+         }
+         throw new IllegalStateException("Cannot create PositionRef for file " + file.getPath() + ". CloneableEditorSupport not found");
+     }
+-
+-    /**Constructs a <code>TreePathHandle</code> that corresponds to the given <code>ElementHandle</code>.
+-     *
+-     * @param handle an <code>ElementHandle</code> for which the <code>TreePathHandle</code> should be constructed
+-     * @param cpInfo a classpath which is supposed to contain the element described by given the <code>ElementHandle</code>
+-     * @return a newly constructed <code>TreePathHandle</code>
+-     * @since 0.79
+-     */
+-    public static @NonNull TreePathHandle from(@NonNull ElementHandle<?> handle, @NonNull ClasspathInfo cpInfo) {
+-        Parameters.notNull("handle", handle);
+-        Parameters.notNull("cpInfo", cpInfo);
+-
+-        return new TreePathHandle(new ElementDelegate(handle, null, null, cpInfo));
+-    }
+     
+     @Override
+     public String toString() {
+@@ -536,10 +517,6 @@
+             Element el = info.getTrees().getElement(tp);
+             if (el == null) {
+                 Logger.getLogger(TreePathHandle.class.toString()).fine("info.getTrees().getElement(tp) returned null for " + tp);
+-                Element staticallyImported = getStaticallyImportedElement(tp, info);
+-                if (staticallyImported!=null) {
+-                    return staticallyImported;
+-                }
+                 if (enclElIsCorrespondingEl) {
+                     Element e = enclosingElement.resolve(info);
+                     if (e == null) {
+@@ -553,54 +530,6 @@
+                 return el;
+             }
+         }
+-        
+-        /**
+-         * special handling of static imports
+-         * see #196685
+-         * 
+-         */
+-        private Element getStaticallyImportedElement(TreePath treePath, CompilationInfo info) {
+-            if (treePath.getLeaf().getKind() != Tree.Kind.MEMBER_SELECT) 
+-                return null;
+-                
+-            MemberSelectTree memberSelectTree = (MemberSelectTree) treePath.getLeaf();
+-            TreePath tp = treePath; 
+-            while (tp!=null) {
+-                Kind treeKind = tp.getLeaf().getKind();
+-                if (treeKind == Tree.Kind.IMPORT) {
+-                    if (!((ImportTree) tp.getLeaf()).isStatic()) {
+-                        return null;
+-                    }
+-                    break;    
+-                } else if (treeKind == Tree.Kind.MEMBER_SELECT || treeKind == Tree.Kind.IDENTIFIER) {
+-                    tp = tp.getParentPath();
+-                    continue;
+-                }
+-                return null;
+-            }
+-            
+-            Name simpleName = memberSelectTree.getIdentifier();
+-            if (simpleName == null) {
+-                return null;
+-            }
+-            TreePath declPath  = new TreePath(new TreePath(treePath, memberSelectTree), memberSelectTree.getExpression());
+-            TypeElement decl = (TypeElement) info.getTrees().getElement(declPath);
+-            if (decl==null) {
+-                return null;
+-            }
+-            
+-            for (Element e : info.getElements().getAllMembers((TypeElement) decl)) {
+-                if (!e.getModifiers().contains(Modifier.STATIC)) {
+-                    continue;
+-                }
+-                if (!e.getSimpleName().equals(simpleName)) {
+-                    continue;
+-                }
+-                return e;
+-            }
+-            return null;
+-        }
+-
+ 
+         /**                                                                                                                                                                                                                        
+          * Returns the {@link Tree.Kind} of this TreePathHandle,                                                                                                                                                                   
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementHandle.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ElementHandle.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementHandle.java	2011-08-03 23:01:41.000000000 +0100
+@@ -66,7 +66,6 @@
+ import org.netbeans.modules.java.source.ElementHandleAccessor;
+ import org.netbeans.modules.java.source.usages.ClassFileUtil;
+ import org.openide.util.Parameters;
+-import org.openide.util.WeakSet;
+ 
+ /**
+  * Represents a handle for {@link Element} which can be kept and later resolved
+@@ -370,8 +369,7 @@
+         return this.kind;
+     }
+     
+-    private static final WeakSet<ElementHandle<?>> NORMALIZATION_CACHE = new WeakSet<ElementHandle<?>>();
+-
++    
+     /**
+      * Factory method for creating {@link ElementHandle}.
+      * @param element for which the {@link ElementHandle} should be created. Permitted
+@@ -384,12 +382,6 @@
+      * @throws IllegalArgumentException if the element is of an unsupported {@link ElementKind}
+      */
+     public static @NonNull <T extends Element> ElementHandle<T> create (@NonNull final T element) throws IllegalArgumentException {
+-        ElementHandle<T> eh = createImpl(element);
+-
+-        return (ElementHandle<T>) NORMALIZATION_CACHE.putIfAbsent(eh);
+-    }
+-
+-    private static @NonNull <T extends Element> ElementHandle<T> createImpl (@NonNull final T element) throws IllegalArgumentException {
+         Parameters.notNull("element", element);
+         ElementKind kind = element.getKind();
+         String[] signatures;
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/AssignComments.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/AssignComments.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/AssignComments.java	2011-08-03 23:01:41.000000000 +0100
+@@ -193,8 +193,6 @@
+     }
+ 
+     private void attachComments(Tree tree, CommentsCollection result, CommentSet.RelativePosition position) {
+-        if (!mapComments) return;
+-        
+         CommentSetImpl cs = commentService.getComments(tree);
+         for (Token<JavaTokenId> token : result) {
+             attachComment(position, cs, token);
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreeMaker.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TreeMaker.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TreeMaker.java	2011-08-03 23:01:41.000000000 +0100
+@@ -460,7 +460,7 @@
+     }
+ 
+     /**
+-     * Creates new UnionTypeTree.
++     * Creates new DisjunctiveTypeTree.
+      *
+      * @param typeComponents components from which the DisjunctiveTypeTree should be created.
+      *                       The components should either be {@link ExpressionTree} (qualified or unqualified identifier),
+@@ -468,8 +468,8 @@
+      * @return newly created DisjunctiveTypeTree
+      * @since 0.70
+      */
+-    public UnionTypeTree UnionType(List<? extends Tree> typeComponents) {
+-        return delegate.UnionType(typeComponents);
++    public DisjunctiveTypeTree DisjunctiveType(List<? extends Tree> typeComponents) {
++        return delegate.DisjunctiveType(typeComponents);
+     }
+     
+     /** Creates a new DoWhileLoopTree.
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ClasspathInfo.java	2011-08-03 23:01:41.000000000 +0100
+@@ -174,7 +174,7 @@
+             final boolean allowAptRoots = true; //todo: Set by PROCESSOR_PATH != null
+             this.cachedUserSrcClassPath = SourcePath.sources(srcCp, backgroundCompilation);
+             this.cachedAptSrcClassPath = allowAptRoots ? SourcePath.apt(srcCp, backgroundCompilation) : null;
+-            this.cachedSrcClassPath = this.cachedUserSrcClassPath;
++            this.cachedSrcClassPath =    allowAptRoots ? ClassPathSupport.createProxyClassPath(this.cachedUserSrcClassPath,this.cachedAptSrcClassPath) : this.cachedUserSrcClassPath;
+             this.outputClassPath = CacheClassPath.forSourcePath (this.cachedUserSrcClassPath);
+ 	    this.cachedSrcClassPath.addPropertyChangeListener(WeakListeners.propertyChange(this.cpListener,this.cachedSrcClassPath));
+         }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/TranslateIdentifier.java	2011-08-03 23:01:41.000000000 +0100
+@@ -240,14 +240,14 @@
+     }
+ 
+     @Override
+-    public Tree visitUnionType(UnionTypeTree node, Boolean p) {
++    public Tree visitDisjunctiveType(DisjunctiveTypeTree node, Boolean p) {
+         List<? extends Tree> typeComponents = translateTree(node.getTypeAlternatives());
+ 
+         if (make == null) return node;
+ 
+         if (typeComponents != node.getTypeAlternatives())
+         {
+-            node = make.UnionType(typeComponents);
++            node = make.DisjunctiveType(typeComponents);
+         }
+         return node;
+     }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementUtilities.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/ElementUtilities.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/ElementUtilities.java	2011-08-03 23:01:41.000000000 +0100
+@@ -555,7 +555,6 @@
+             }
+         }
+         Types types = JavacTypes.instance(ctx);
+-        com.sun.tools.javac.code.Types implTypes = com.sun.tools.javac.code.Types.instance(ctx);
+         DeclaredType implType = (DeclaredType)impl.asType();
+         for (TypeMirror t : types.directSupertypes(element.asType())) {
+             for (ExecutableElement ee : findUnimplementedMethods(impl, (TypeElement) ((DeclaredType) t).asElement())) {
+@@ -578,7 +577,8 @@
+                                     if (subType != null) {
+                                         undef.remove(existing);
+                                         MethodSymbol ms = ((MethodSymbol)existing).clone((Symbol)impl);
+-                                        Type mt = implTypes.createMethodTypeWithReturn((MethodType)ms.type, (Type)subType);
++                                        MethodType mt = (MethodType)ms.type.clone();
++                                        mt.restype = (Type)subType;
+                                         ms.type = mt;
+                                         undef.add(ms);
+                                     }
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/SourceUtils.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/SourceUtils.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/SourceUtils.java	2011-08-03 23:01:41.000000000 +0100
+@@ -82,7 +82,6 @@
+ import java.util.concurrent.Future;
+ import java.util.logging.Level;
+ import java.util.logging.Logger;
+-import javax.lang.model.util.ElementScanner6;
+ import javax.swing.SwingUtilities;
+ 
+ import org.netbeans.api.annotations.common.NonNull;
+@@ -749,32 +748,36 @@
+         try {
+             final List<ElementHandle<TypeElement>> result = new LinkedList<ElementHandle<TypeElement>>();
+             js.runUserActionTask(new Task<CompilationController>() {            
+-                @Override
+                 public void run(final CompilationController control) throws Exception {
+                     if (control.toPhase(JavaSource.Phase.ELEMENTS_RESOLVED).compareTo (JavaSource.Phase.ELEMENTS_RESOLVED)>=0) {
+-                        final List<TypeElement>  types = new ArrayList<TypeElement>();
+-                        final ElementScanner6<Void,Void> visitor = new ElementScanner6<Void, Void>() {
+-                            @Override
+-                            public Void visitType(TypeElement e, Void p) {
+-                                if (e.getEnclosingElement().getKind() == ElementKind.PACKAGE
+-                                   || e.getModifiers().contains(Modifier.STATIC)) {
+-                                    types.add(e);
+-                                    return super.visitType(e, p);
+-                                } else {
+-                                    return null;
+-                                }
+-                            }
+-                        };
+-                        visitor.scan(control.getTopLevelElements(), null);
+-                        for (TypeElement type : types) {
+-                            for (ExecutableElement exec :  ElementFilter.methodsIn(control.getElements().getAllMembers(type))) {
+-                                if (SourceUtils.isMainMethod(exec)) {
+-                                    result.add (ElementHandle.create(type));
+-                                }
+-                            }
++                        new TreePathScanner<Void,Void> () {
++                           public @Override Void visitMethod(MethodTree node, Void p) {
++                               ExecutableElement method = (ExecutableElement) control.getTrees().getElement(getCurrentPath());
++                               if (method != null && SourceUtils.isMainMethod(method) && isAccessible(method.getEnclosingElement())) {
++                                   result.add (ElementHandle.create((TypeElement)method.getEnclosingElement()));
++                               }
++                               return null;
++                           }
++                        }.scan(control.getCompilationUnit(), null);
++                    }                   
++                }
++
++                private boolean isAccessible (Element element) {
++                    ElementKind kind = element.getKind();
++                    while (kind != ElementKind.PACKAGE) {
++                        if (!kind.isClass() && !kind.isInterface()) {
++                            return false;
++                        }                    
++                        Set<Modifier> modifiers = ((TypeElement)element).getModifiers();
++                        Element parent = element.getEnclosingElement();
++                        if (parent.getKind() != ElementKind.PACKAGE && !modifiers.contains(Modifier.STATIC)) {
++                            return false;
+                         }
++                        element = parent;
++                        kind = element.getKind();
+                     }
+-                }                
++                    return true;
++                }
+ 
+             }, true);
+             return result;
+Index: netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/src/org/netbeans/api/java/source/GeneratorUtilities.java	2011-08-03 23:01:41.000000000 +0100
+@@ -95,10 +95,12 @@
+ import javax.lang.model.type.TypeMirror;
+ import javax.lang.model.type.TypeVariable;
+ import javax.lang.model.type.WildcardType;
++import javax.lang.model.util.TypeKindVisitor7;
+ import javax.lang.model.util.Types;
+ import javax.swing.text.Document;
+ 
+ import org.netbeans.api.java.lexer.JavaTokenId;
++import org.netbeans.api.java.queries.SourceLevelQuery;
+ import org.netbeans.api.lexer.TokenSequence;
+ import org.netbeans.editor.GuardedDocument;
+ import org.netbeans.modules.java.source.builder.CommentHandlerService;
+@@ -107,6 +109,7 @@
+ import org.netbeans.modules.java.source.query.CommentSet.RelativePosition;
+ import org.openide.cookies.EditorCookie;
+ import org.openide.loaders.DataObject;
++import org.openide.modules.SpecificationVersion;
+ import org.openide.util.Exceptions;
+ 
+ /**
+@@ -355,15 +358,10 @@
+         TreeMaker make = copy.getTreeMaker();
+         Set<Modifier> mods = EnumSet.of(clazz.getKind() == ElementKind.ENUM ? Modifier.PRIVATE : Modifier.PUBLIC);
+         List<VariableTree> parameters = new ArrayList<VariableTree>();
+-        LinkedList<StatementTree> statements = new LinkedList<StatementTree>();
++        List<StatementTree> statements = new ArrayList<StatementTree>();
+         ModifiersTree parameterModifiers = make.Modifiers(EnumSet.noneOf(Modifier.class));
+         List<ExpressionTree> throwsList = new LinkedList<ExpressionTree>();
+         List<TypeParameterTree> typeParams = new LinkedList<TypeParameterTree>();
+-        for (VariableElement ve : fields) {
+-            TypeMirror type = copy.getTypes().asMemberOf((DeclaredType)clazz.asType(), ve);
+-            parameters.add(make.Variable(parameterModifiers, ve.getSimpleName(), make.Type(type), null));
+-            statements.add(make.ExpressionStatement(make.Assignment(make.MemberSelect(make.Identifier("this"), ve.getSimpleName()), make.Identifier(ve.getSimpleName())))); //NOI18N
+-        }
+         if (constructor != null) {
+             ExecutableType constructorType = clazz.getSuperclass().getKind() == TypeKind.DECLARED ? (ExecutableType) copy.getTypes().asMemberOf((DeclaredType) clazz.getSuperclass(), constructor) : null;
+             if (!constructor.getParameters().isEmpty()) {
+@@ -378,7 +376,7 @@
+                     parameters.add(make.Variable(parameterModifiers, simpleName, make.Type(type), null));
+                     arguments.add(make.Identifier(simpleName));
+                 }
+-                statements.addFirst(make.ExpressionStatement(make.MethodInvocation(Collections.<ExpressionTree>emptyList(), make.Identifier("super"), arguments))); //NOI18N
++                statements.add(make.ExpressionStatement(make.MethodInvocation(Collections.<ExpressionTree>emptyList(), make.Identifier("super"), arguments))); //NOI18N
+             }
+             constructorType = constructorType != null ? constructorType : (ExecutableType) constructor.asType();
+             for (TypeMirror th : constructorType.getThrownTypes()) {
+@@ -392,8 +390,13 @@
+                 typeParams.add(make.TypeParameter(typeParameterElement.getSimpleName(), boundsList));
+             }
+         }
++        for (VariableElement ve : fields) {
++            TypeMirror type = copy.getTypes().asMemberOf((DeclaredType)clazz.asType(), ve);
++            parameters.add(make.Variable(parameterModifiers, ve.getSimpleName(), make.Type(type), null));
++            statements.add(make.ExpressionStatement(make.Assignment(make.MemberSelect(make.Identifier("this"), ve.getSimpleName()), make.Identifier(ve.getSimpleName())))); //NOI18N
++        }
+         BlockTree body = make.Block(statements, false);
+-        return make.Method(make.Modifiers(mods), "<init>", null, typeParams, parameters, throwsList, body, null, constructor!= null ? constructor.isVarArgs() : false); //NOI18N
++        return make.Method(make.Modifiers(mods), "<init>", null, typeParams, parameters, throwsList, body, null); //NOI18N
+     }
+ 
+     /**
+@@ -532,7 +535,7 @@
+ 
+     static <T extends Tree> T importComments(CompilationInfo info, T original, CompilationUnitTree cut) {
+         try {
+-            JCTree.JCCompilationUnit unit = (JCCompilationUnit) cut;
++            JCTree.JCCompilationUnit unit = (JCCompilationUnit) cut;            
+             TokenSequence<JavaTokenId> seq = ((SourceFileObject) unit.getSourceFile()).getTokenHierarchy().tokenSequence(JavaTokenId.language());
+             TreePath tp = TreePath.getPath(cut, original);
+             Tree toMap = (tp != null && original.getKind() != Kind.COMPILATION_UNIT) ? tp.getParentPath().getLeaf() : original;
+Index: netbeans-7.0.1+dfsg1/java.source/nbproject/project.properties
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/project.properties	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/nbproject/project.properties	2011-08-03 23:08:30.651929442 +0100
+@@ -46,7 +46,7 @@
+ javadoc.title=Java Source
+ javadoc.arch=${basedir}/arch.xml
+ javadoc.apichanges=${basedir}/apichanges.xml
+-spec.version.base=0.80.1
++spec.version.base=0.79.2
+ test.qa-functional.cp.extra=${refactoring.java.dir}/modules/ext/javac-api-nb-7.0-b07.jar
+ test.unit.run.cp.extra=${o.n.core.dir}/core/core.jar:\
+     ${o.n.core.dir}/lib/boot.jar:\
+@@ -132,8 +132,7 @@
+     org/netbeans/api/java/source/gen/BlockTest.class,\
+     org/netbeans/api/java/source/gen/ImportAnalysisTest.class,\
+     org/netbeans/api/java/source/gen/ImportAnalysis2Test.class,\
+-    org/netbeans/modules/java/source/save/DiffFacilityTest.class,\
+-    org/netbeans/api/java/source/gen/RewriteMultipleExpressionsTest.class
++    org/netbeans/modules/java/source/save/DiffFacilityTest.class
+ 
+ test.config.jet-main.includes=${test.config.generator.includes},\
+     org/netbeans/api/java/source/TypeUtilitiesTest.class,\
+Index: netbeans-7.0.1+dfsg1/java.source/nbproject/project.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/project.xml	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/nbproject/project.xml	2011-08-03 23:01:41.000000000 +0100
+@@ -55,7 +55,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.9.1</specification-version>
++                        <specification-version>1.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -64,7 +64,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.33.1</specification-version>
++                        <specification-version>1.28</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -73,7 +73,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.29.1</specification-version>
++                        <specification-version>1.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -89,7 +89,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>7.6.1.3</specification-version>
++                        <specification-version>7.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -107,7 +107,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>3</release-version>
+-                        <specification-version>3.2.1</specification-version>
++                        <specification-version>3.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -124,7 +124,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.12.1</specification-version>
++                        <specification-version>1.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -133,7 +133,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>2</release-version>
+-                        <specification-version>1.24.1</specification-version>
++                        <specification-version>1.11</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -142,7 +142,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>0-1</release-version>
+-                        <specification-version>1.5.1</specification-version>
++                        <specification-version>1.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -151,7 +151,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>3</release-version>
+-                        <specification-version>3.9.1.13.10</specification-version>
++                        <specification-version>3.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -160,7 +160,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.43.1.10</specification-version>
++                        <specification-version>1.11</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -169,7 +169,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.22.1</specification-version>
++                        <specification-version>1.7</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -178,7 +178,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.36.1</specification-version>
++                        <specification-version>1.18</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -187,7 +187,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.42.1</specification-version>
++                        <specification-version>1.22</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -196,7 +196,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.14.1</specification-version>
++                        <specification-version>1.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -205,7 +205,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.21.1</specification-version>
++                        <specification-version>1.8</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -213,7 +213,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>1.18.1.1</specification-version>
++                        <specification-version>1.14</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -222,7 +222,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>2</release-version>
+-                        <specification-version>1.39.1.1</specification-version>
++                        <specification-version>1.25</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -231,7 +231,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.22.1</specification-version>
++                        <specification-version>1.5</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -240,7 +240,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.25.1</specification-version>
++                        <specification-version>1.20</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -257,7 +257,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>1.5.1</specification-version>
++                        <specification-version>1.2</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -266,7 +266,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.36.1</specification-version>
++                        <specification-version>1.13</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -275,7 +275,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.51.1.8</specification-version>
++                        <specification-version>1.30</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -284,7 +284,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.23.1</specification-version>
++                        <specification-version>1.9</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -292,7 +292,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>1.16.1</specification-version>
++                        <specification-version>1.2</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -301,7 +301,7 @@
+                     <compile-dependency/>
+                     <run-dependency>
+                         <release-version>1</release-version>
+-                        <specification-version>1.15.1.1</specification-version>
++                        <specification-version>1.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -309,7 +309,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>7.31.1</specification-version>
++                        <specification-version>6.2</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -317,7 +317,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>7.20.1</specification-version>
++                        <specification-version>7.8</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -325,7 +325,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>7.47.1</specification-version>
++                        <specification-version>7.19</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -333,7 +333,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>7.21.1</specification-version>
++                        <specification-version>7.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -341,7 +341,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>7.23.1</specification-version>
++                        <specification-version>7.9</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -349,7 +349,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>7.21.1</specification-version>
++                        <specification-version>6.2</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -357,7 +357,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>6.37.1</specification-version>
++                        <specification-version>6.26</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -365,7 +365,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>8.15.1</specification-version>
++                        <specification-version>8.4</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -373,7 +373,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>8.8.1</specification-version>
++                        <specification-version>8.0</specification-version>
+                     </run-dependency>
+                 </dependency>
+                 <dependency>
+@@ -381,7 +381,7 @@
+                     <build-prerequisite/>
+                     <compile-dependency/>
+                     <run-dependency>
+-                        <specification-version>6.40.1</specification-version>
++                        <specification-version>6.2</specification-version>
+                     </run-dependency>
+                 </dependency>
+             </module-dependencies>
+@@ -424,7 +424,6 @@
+                     </test-dependency>
+                     <test-dependency>
+                         <code-name-base>org.netbeans.modules.java.editor</code-name-base>
+-                        <recursive/>
+                         <compile-dependency/>
+                     </test-dependency>
+                     <test-dependency>
+Index: netbeans-7.0.1+dfsg1/java.source/nbproject/org-netbeans-modules-java-source.sig
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/nbproject/org-netbeans-modules-java-source.sig	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/nbproject/org-netbeans-modules-java-source.sig	2011-08-03 23:01:41.000000000 +0100
+@@ -1,5 +1,5 @@
+ #Signature file v4.1
+-#Version 0.76.1
++#Version 0.60.0
+ 
+ CLSS public abstract interface com.sun.source.tree.TreeVisitor<%0 extends java.lang.Object, %1 extends java.lang.Object>
+ meth public abstract {com.sun.source.tree.TreeVisitor%0} visitAnnotation(com.sun.source.tree.AnnotationTree,{com.sun.source.tree.TreeVisitor%1})
+@@ -377,14 +377,12 @@
+ meth public boolean alignMultilineAssignment()
+ meth public boolean alignMultilineBinaryOp()
+ meth public boolean alignMultilineCallArgs()
+-meth public boolean alignMultilineDisjunctiveCatchTypes()
+ meth public boolean alignMultilineFor()
+ meth public boolean alignMultilineImplements()
+ meth public boolean alignMultilineMethodParams()
+ meth public boolean alignMultilineParenthesized()
+ meth public boolean alignMultilineTernaryOp()
+ meth public boolean alignMultilineThrows()
+-meth public boolean alignMultilineTryResources()
+ meth public boolean expandTabToSpaces()
+ meth public boolean indentCasesFromSwitch()
+ meth public boolean indentTopLevelClassMembers()
+@@ -432,7 +430,6 @@
+ meth public boolean spaceBeforeSynchronizedLeftBrace()
+ meth public boolean spaceBeforeSynchronizedParen()
+ meth public boolean spaceBeforeTryLeftBrace()
+-meth public boolean spaceBeforeTryParen()
+ meth public boolean spaceBeforeWhile()
+ meth public boolean spaceBeforeWhileLeftBrace()
+ meth public boolean spaceBeforeWhileParen()
+@@ -447,7 +444,6 @@
+ meth public boolean spaceWithinParens()
+ meth public boolean spaceWithinSwitchParens()
+ meth public boolean spaceWithinSynchronizedParens()
+-meth public boolean spaceWithinTryParens()
+ meth public boolean spaceWithinTypeCastParens()
+ meth public boolean spaceWithinWhileParens()
+ meth public boolean specialElseIf()
+@@ -497,7 +493,6 @@
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapAssignOps()
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapBinaryOps()
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapChainedMethodCalls()
+-meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapDisjunctiveCatchTypes()
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapDoWhileStatement()
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapEnumConstants()
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapExtendsImplementsKeyword()
+@@ -510,7 +505,6 @@
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapTernaryOps()
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapThrowsKeyword()
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapThrowsList()
+-meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapTryResources()
+ meth public org.netbeans.api.java.source.CodeStyle$WrapStyle wrapWhileStatement()
+ meth public static org.netbeans.api.java.source.CodeStyle getDefault(javax.swing.text.Document)
+ meth public static org.netbeans.api.java.source.CodeStyle getDefault(org.netbeans.api.project.Project)
+@@ -801,7 +795,7 @@
+ meth protected final void fileObjectsChanged()
+ meth protected final void reschedule(org.openide.filesystems.FileObject)
+ supr java.lang.Object
+-hfds ACCESSOR2,BEFORE_ADDING_REMOVING_TASKS,FILEOBJECTS_COMPUTATION,LOG,SYNCHRONOUS_EVENTS,WORKER,file2JS,file2Task,filesLock,phase,priority
++hfds ACCESSOR2,BEFORE_ADDING_REMOVING_TASKS,FILEOBJECTS_COMPUTATION,LOG,SYNCHRONOUS_EVENTS,WORKER,file2JS,file2Task,phase,priority
+ hcls Accessor2
+ 
+ CLSS public final org.netbeans.api.java.source.ModificationResult
+@@ -825,7 +819,7 @@
+ meth public void commit() throws java.io.IOException
+ supr java.lang.Object
+ hfds committed,diffs,sources,tag2Span
+-hcls CreateChange,FilteringReader,FilteringWriter
++hcls CreateChange
+ 
+ CLSS public static org.netbeans.api.java.source.ModificationResult$Difference
+  outer org.netbeans.api.java.source.ModificationResult
+@@ -874,7 +868,6 @@
+ CLSS public org.netbeans.api.java.source.SourceUtils
+ meth public static boolean checkTypesAssignable(org.netbeans.api.java.source.CompilationInfo,javax.lang.model.type.TypeMirror,javax.lang.model.type.TypeMirror)
+ meth public static boolean isMainClass(java.lang.String,org.netbeans.api.java.source.ClasspathInfo)
+-meth public static boolean isMainClass(java.lang.String,org.netbeans.api.java.source.ClasspathInfo,boolean)
+ meth public static boolean isMainMethod(javax.lang.model.element.ExecutableElement)
+ meth public static boolean isScanInProgress()
+ meth public static java.lang.String resolveImport(org.netbeans.api.java.source.CompilationInfo,com.sun.source.util.TreePath,java.lang.String) throws java.io.IOException
+@@ -893,8 +886,7 @@
+ meth public static org.openide.filesystems.FileObject getFile(org.netbeans.api.java.source.ElementHandle<? extends javax.lang.model.element.Element>,org.netbeans.api.java.source.ClasspathInfo)
+ meth public static void waitScanFinished() throws java.lang.InterruptedException
+ supr java.lang.Object
+-hfds LOG,MAX_LEN,VOWELS
+-hcls CaseInsensitiveMatch,CaseSensitiveMatch,Match
++hfds LOG,MAX_LEN,PACKAGE_SUMMARY,VOWELS
+ 
+ CLSS public abstract interface org.netbeans.api.java.source.Task<%0 extends java.lang.Object>
+ meth public abstract void run({org.netbeans.api.java.source.Task%0}) throws java.lang.Exception
+@@ -943,21 +935,15 @@
+ meth public com.sun.source.tree.ClassTree removeClassTypeParameter(com.sun.source.tree.ClassTree,int)
+ meth public com.sun.source.tree.ClassTree setExtends(com.sun.source.tree.ClassTree,com.sun.source.tree.ExpressionTree)
+ meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(com.sun.source.tree.ExpressionTree,java.util.List<? extends com.sun.source.tree.ImportTree>,java.util.List<? extends com.sun.source.tree.Tree>,javax.tools.JavaFileObject)
+-meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(java.util.List<? extends com.sun.source.tree.AnnotationTree>,com.sun.source.tree.ExpressionTree,java.util.List<? extends com.sun.source.tree.ImportTree>,java.util.List<? extends com.sun.source.tree.Tree>,javax.tools.JavaFileObject)
+-meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(java.util.List<? extends com.sun.source.tree.AnnotationTree>,org.openide.filesystems.FileObject,java.lang.String,java.util.List<? extends com.sun.source.tree.ImportTree>,java.util.List<? extends com.sun.source.tree.Tree>)
+ meth public com.sun.source.tree.CompilationUnitTree CompilationUnit(org.openide.filesystems.FileObject,java.lang.String,java.util.List<? extends com.sun.source.tree.ImportTree>,java.util.List<? extends com.sun.source.tree.Tree>)
+ meth public com.sun.source.tree.CompilationUnitTree addCompUnitImport(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.ImportTree)
+ meth public com.sun.source.tree.CompilationUnitTree addCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.Tree)
+-meth public com.sun.source.tree.CompilationUnitTree addPackageAnnotation(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.AnnotationTree)
+ meth public com.sun.source.tree.CompilationUnitTree insertCompUnitImport(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.ImportTree)
+ meth public com.sun.source.tree.CompilationUnitTree insertCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.Tree)
+-meth public com.sun.source.tree.CompilationUnitTree insertPackageAnnotation(com.sun.source.tree.CompilationUnitTree,int,com.sun.source.tree.AnnotationTree)
+ meth public com.sun.source.tree.CompilationUnitTree removeCompUnitImport(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.ImportTree)
+ meth public com.sun.source.tree.CompilationUnitTree removeCompUnitImport(com.sun.source.tree.CompilationUnitTree,int)
+ meth public com.sun.source.tree.CompilationUnitTree removeCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.Tree)
+ meth public com.sun.source.tree.CompilationUnitTree removeCompUnitTypeDecl(com.sun.source.tree.CompilationUnitTree,int)
+-meth public com.sun.source.tree.CompilationUnitTree removePackageAnnotation(com.sun.source.tree.CompilationUnitTree,com.sun.source.tree.AnnotationTree)
+-meth public com.sun.source.tree.CompilationUnitTree removePackageAnnotation(com.sun.source.tree.CompilationUnitTree,int)
+ meth public com.sun.source.tree.CompoundAssignmentTree CompoundAssignment(com.sun.source.tree.Tree$Kind,com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree)
+ meth public com.sun.source.tree.ConditionalExpressionTree ConditionalExpression(com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree,com.sun.source.tree.ExpressionTree)
+ meth public com.sun.source.tree.ContinueTree Continue(java.lang.CharSequence)
+@@ -966,9 +952,6 @@
+ meth public com.sun.source.tree.EnhancedForLoopTree EnhancedForLoop(com.sun.source.tree.VariableTree,com.sun.source.tree.ExpressionTree,com.sun.source.tree.StatementTree)
+ meth public com.sun.source.tree.ErroneousTree Erroneous(java.util.List<? extends com.sun.source.tree.Tree>)
+ meth public com.sun.source.tree.ExpressionStatementTree ExpressionStatement(com.sun.source.tree.ExpressionTree)
+-meth public com.sun.source.tree.ExpressionTree QualIdent(java.lang.String)
+- anno 0 org.netbeans.api.annotations.common.NonNull()
+- anno 1 org.netbeans.api.annotations.common.NonNull()
+ meth public com.sun.source.tree.ExpressionTree QualIdent(javax.lang.model.element.Element)
+  anno 0 org.netbeans.api.annotations.common.NonNull()
+  anno 1 org.netbeans.api.annotations.common.NonNull()
+@@ -1062,14 +1045,10 @@
+ meth public com.sun.source.tree.SwitchTree removeSwitchCase(com.sun.source.tree.SwitchTree,int)
+ meth public com.sun.source.tree.SynchronizedTree Synchronized(com.sun.source.tree.ExpressionTree,com.sun.source.tree.BlockTree)
+ meth public com.sun.source.tree.ThrowTree Throw(com.sun.source.tree.ExpressionTree)
+-meth public com.sun.source.tree.Tree Type(java.lang.String)
+- anno 0 org.netbeans.api.annotations.common.NonNull()
+- anno 1 org.netbeans.api.annotations.common.NonNull()
+ meth public com.sun.source.tree.Tree Type(javax.lang.model.type.TypeMirror)
+  anno 0 org.netbeans.api.annotations.common.NonNull()
+  anno 1 org.netbeans.api.annotations.common.NonNull()
+ meth public com.sun.source.tree.TryTree Try(com.sun.source.tree.BlockTree,java.util.List<? extends com.sun.source.tree.CatchTree>,com.sun.source.tree.BlockTree)
+-meth public com.sun.source.tree.TryTree Try(java.util.List<? extends com.sun.source.tree.Tree>,com.sun.source.tree.BlockTree,java.util.List<? extends com.sun.source.tree.CatchTree>,com.sun.source.tree.BlockTree)
+ meth public com.sun.source.tree.TryTree addTryCatch(com.sun.source.tree.TryTree,com.sun.source.tree.CatchTree)
+ meth public com.sun.source.tree.TryTree insertTryCatch(com.sun.source.tree.TryTree,int,com.sun.source.tree.CatchTree)
+ meth public com.sun.source.tree.TryTree removeTryCatch(com.sun.source.tree.TryTree,com.sun.source.tree.CatchTree)
+@@ -1108,17 +1087,12 @@
+ hcls CountingDelegate,Delegate,ElementDelegate,EmptyDelegate,TreeDelegate
+ 
+ CLSS public final org.netbeans.api.java.source.TreeUtilities
+-fld public final static java.util.Set<com.sun.source.tree.Tree$Kind> CLASS_TREE_KINDS
+ meth public boolean isAccessible(com.sun.source.tree.Scope,javax.lang.model.element.Element,javax.lang.model.type.TypeMirror)
+ meth public boolean isAnnotation(com.sun.source.tree.ClassTree)
+- anno 0 java.lang.Deprecated()
+ meth public boolean isClass(com.sun.source.tree.ClassTree)
+- anno 0 java.lang.Deprecated()
+ meth public boolean isEnum(com.sun.source.tree.ClassTree)
+- anno 0 java.lang.Deprecated()
+ meth public boolean isEnumConstant(com.sun.source.tree.VariableTree)
+ meth public boolean isInterface(com.sun.source.tree.ClassTree)
+- anno 0 java.lang.Deprecated()
+ meth public boolean isStaticContext(com.sun.source.tree.Scope)
+ meth public boolean isSynthetic(com.sun.source.util.TreePath)
+ meth public com.sun.source.tree.BlockTree parseStaticBlock(java.lang.String,com.sun.source.util.SourcePositions[])
+@@ -1129,10 +1103,6 @@
+ meth public com.sun.source.tree.Scope scopeFor(int)
+ meth public com.sun.source.tree.StatementTree getBreakContinueTarget(com.sun.source.util.TreePath)
+ meth public com.sun.source.tree.StatementTree parseStatement(java.lang.String,com.sun.source.util.SourcePositions[])
+-meth public com.sun.source.tree.Tree translate(com.sun.source.tree.Tree,java.util.Map<? extends com.sun.source.tree.Tree,? extends com.sun.source.tree.Tree>)
+- anno 0 org.netbeans.api.annotations.common.NonNull()
+- anno 1 org.netbeans.api.annotations.common.NonNull()
+- anno 2 org.netbeans.api.annotations.common.NonNull()
+ meth public com.sun.source.util.TreePath pathFor(com.sun.source.util.TreePath,int)
+ meth public com.sun.source.util.TreePath pathFor(com.sun.source.util.TreePath,int,com.sun.source.util.SourcePositions)
+ meth public com.sun.source.util.TreePath pathFor(int)
+@@ -1155,7 +1125,7 @@
+ meth public org.netbeans.api.lexer.TokenSequence<org.netbeans.api.java.lexer.JavaTokenId> tokensFor(com.sun.source.tree.Tree,com.sun.source.util.SourcePositions)
+ supr java.lang.Object
+ hfds ESCAPE_ENCODE,ESCAPE_UNENCODE,EXOTIC_ESCAPE,handler,info
+-hcls NoImports,UncaughtExceptionsVisitor,UnrelatedTypeMirrorSet
++hcls UncaughtExceptionsVisitor,UnrelatedTypeMirrorSet
+ 
+ CLSS public final org.netbeans.api.java.source.TypeMirrorHandle<%0 extends javax.lang.model.type.TypeMirror>
+ meth public javax.lang.model.type.TypeKind getKind()
+@@ -1170,25 +1140,10 @@
+ hcls PlaceholderType,Visitor
+ 
+ CLSS public final org.netbeans.api.java.source.TypeUtilities
+-innr public final static !enum TypeNameOptions
+-meth public !varargs java.lang.CharSequence getTypeName(javax.lang.model.type.TypeMirror,org.netbeans.api.java.source.TypeUtilities$TypeNameOptions[])
+- anno 0 org.netbeans.api.annotations.common.CheckReturnValue()
+- anno 0 org.netbeans.api.annotations.common.NonNull()
+- anno 1 org.netbeans.api.annotations.common.NullAllowed()
+- anno 2 org.netbeans.api.annotations.common.NonNull()
+ meth public boolean isCastable(javax.lang.model.type.TypeMirror,javax.lang.model.type.TypeMirror)
+ meth public javax.lang.model.type.TypeMirror substitute(javax.lang.model.type.TypeMirror,java.util.List<? extends javax.lang.model.type.TypeMirror>,java.util.List<? extends javax.lang.model.type.TypeMirror>)
+ supr java.lang.Object
+-hfds CAPTURED_WILDCARD,UNKNOWN,info
+-hcls TypeNameVisitor
+-
+-CLSS public final static !enum org.netbeans.api.java.source.TypeUtilities$TypeNameOptions
+- outer org.netbeans.api.java.source.TypeUtilities
+-fld public final static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions PRINT_AS_VARARG
+-fld public final static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions PRINT_FQN
+-meth public static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions valueOf(java.lang.String)
+-meth public static org.netbeans.api.java.source.TypeUtilities$TypeNameOptions[] values()
+-supr java.lang.Enum<org.netbeans.api.java.source.TypeUtilities$TypeNameOptions>
++hfds info
+ 
+ CLSS public final org.netbeans.api.java.source.TypesEvent
+ meth public java.lang.Iterable<? extends org.netbeans.api.java.source.ElementHandle<javax.lang.model.element.TypeElement>> getTypes()
+@@ -1251,7 +1206,7 @@
+  anno 1 org.netbeans.api.annotations.common.NonNull()
+  anno 2 org.netbeans.api.annotations.common.NonNull()
+ supr org.netbeans.api.java.source.CompilationController
+-hfds REWRITE_WHOLE_FILE,afterCommit,changes,externalChanges,instance,overlay,textualChanges,tree2Tag,treeMaker,userInfo
++hfds REWRITE_WHOLE_FILE,afterCommit,changes,externalChanges,instance,textualChanges,tree2Tag,treeMaker,userInfo
+ hcls Rewriter,Translator
+ 
+ CLSS public org.netbeans.api.java.source.support.CancellableTreePathScanner<%0 extends java.lang.Object, %1 extends java.lang.Object>
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/save/ReindenterTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -244,16 +244,6 @@
+                 "package t;\n at Deprecated\npublic class T {\n}\n");
+     }
+ 
+-    public void testNewLineIndentationAfterSimpleAnnotationInsideEmptyClass() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    @Deprecated|\n}\n",
+-                "package t;\npublic class T {\n    @Deprecated\n    \n}\n");
+-    }
+-
+-    public void testLineIndentationAfterSimpleAnnotationInsideEmptyClass() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    @Deprecated\n|\n}\n",
+-                "package t;\npublic class T {\n    @Deprecated\n    \n}\n");
+-    }
+-
+     public void testNewLineIndentationAfterField() throws Exception {
+         performNewLineIndentationTest("package t;\npublic class T {\n    public int i;|\n}\n",
+                 "package t;\npublic class T {\n    public int i;\n    \n}\n");
+@@ -702,26 +692,6 @@
+         }
+     }
+ 
+-    public void testNewLineIndentationBeforeWhileInDoWhile() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        }| while (check());\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        do {\n        }\n        while (check());\n    }\n}\n");
+-    }
+-
+-    public void testLineIndentationBeforeWhileInDoWhile() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        }\n| while (check());\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        do {\n        }\n        while (check());\n    }\n}\n");
+-    }
+-
+-    public void testNewLineIndentationBeforeWhileOnNewLineInDoWhile() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        }|\n        while (check());\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        do {\n        }\n        \n        while (check());\n    }\n}\n");
+-    }
+-
+-    public void testLineIndentationBeforeWhileOnNewLineInDoWhile() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        }\n|\n        while (check());\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        do {\n        }\n        \n        while (check());\n    }\n}\n");
+-    }
+-
+     public void testNewLineIndentationInsideDoWhileCond() throws Exception {
+         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        do {\n        } while (check()|);\n    }\n}\n",
+                 "package t;\npublic class T {\n    public void op() {\n        do {\n        } while (check()\n                );\n    }\n}\n");
+@@ -918,26 +888,6 @@
+                 "package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }\n        else {\n        }\n    }\n}\n");
+     }
+ 
+-    public void testNewLineIndentationBeforeElseOnNewLine() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }|\n        else {\n        }\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }\n        \n        else {\n        }\n    }\n}\n");
+-    }
+-
+-    public void testLineIndentationBeforeElseOnNewLine() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }\n|\n        else {\n        }\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        if (true) {\n        }\n        \n        else {\n        }\n    }\n}\n");
+-    }
+-
+-    public void testNewLineIndentationAfterStatementBeforeElseOnNewLine() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true)\n            System.out.println();|\n        else {\n        }\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        if (true)\n            System.out.println();\n        \n        else {\n        }\n    }\n}\n");
+-    }
+-
+-    public void testLineIndentationAfterStatementBeforeElseOnNewLine() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true)\n            System.out.println();\n|\n        else {\n        }\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        if (true)\n            System.out.println();\n        \n        else {\n        }\n    }\n}\n");
+-    }
+-
+     public void testNewLineIndentationBeforeElseStmt() throws Exception {
+         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        if (true) {\n        } else|\n    }\n}\n",
+                 "package t;\npublic class T {\n    public void op() {\n        if (true) {\n        } else\n            \n    }\n}\n");
+@@ -1104,16 +1054,6 @@
+                 "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        catch (Exception e) {\n        }\n    }\n}\n");
+     }
+ 
+-    public void testNewLineIndentationBeforeCatchOnNewLine() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        }|\n        catch (Exception e) {\n        }\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        \n        catch (Exception e) {\n        }\n    }\n}\n");
+-    }
+-
+-    public void testLineIndentationBeforeCatchOnNewLine() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        }\n|\n        catch (Exception e) {\n        }\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        \n        catch (Exception e) {\n        }\n    }\n}\n");
+-    }
+-
+     public void testNewLineIndentationBeforeCatchBlock() throws Exception {
+         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        } catch (Exception e)| {\n        }\n    }\n}\n",
+                 "package t;\npublic class T {\n    public void op() {\n        try {\n        } catch (Exception e)\n        {\n        }\n    }\n}\n");
+@@ -1156,16 +1096,6 @@
+                 "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        finally {\n        }\n    }\n}\n");
+     }
+ 
+-    public void testNewLineIndentationBeforeFinallyOnNewLine() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        }|\n        finally {\n        }\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        \n        finally {\n        }\n    }\n}\n");
+-    }
+-
+-    public void testLineIndentationBeforeFinallyOnNewLine() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        }\n|\n        finally {\n        }\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        try {\n        }\n        \n        finally {\n        }\n    }\n}\n");
+-    }
+-
+     public void testNewLineIndentationBeforeFinallyBlock() throws Exception {
+         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        try {\n        } finally| {\n        }\n    }\n}\n",
+                 "package t;\npublic class T {\n    public void op() {\n        try {\n        } finally\n        {\n        }\n    }\n}\n");
+@@ -1436,38 +1366,6 @@
+         }
+     }
+ 
+-    public void testNewLineIndentationBeforeNewArrayInit() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]| {\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n        {\n    }\n}\n");
+-    }
+-
+-    public void testLineIndentationBeforeNewArrayInit() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n|                {\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n        {\n    }\n}\n");
+-    }
+-
+-    public void testNewLineIndentationBeforeHalfIndentedNewArrayInit() throws Exception {
+-        Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class);
+-        preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name());
+-        try {
+-            performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]| {\n    }\n}\n",
+-                    "package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n          {\n    }\n}\n");
+-        } finally {
+-            preferences.remove("otherBracePlacement");
+-        }
+-    }
+-
+-    public void testLineIndentationBeforeHalfIndentedNewArrayInit() throws Exception {
+-        Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class);
+-        preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name());
+-        try {
+-            performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n|                {\n    }\n}\n",
+-                    "package t;\npublic class T {\n    public void op() {\n        int[] arr = new int[]\n          {\n    }\n}\n");
+-        } finally {
+-            preferences.remove("otherBracePlacement");
+-        }
+-    }
+-
+     public void testNewLineIndentationIndideEmptyArrayInit() throws Exception {
+         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        int[] arr = {|\n    }\n}\n",
+                 "package t;\npublic class T {\n    public void op() {\n        int[] arr = {\n            \n    }\n}\n");
+@@ -1540,38 +1438,6 @@
+         }
+     }
+ 
+-    public void testNewLineIndentationBeforeNewClassTreeBody() throws Exception {
+-        performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()| {\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n        {\n    }\n}\n");
+-    }
+-
+-    public void testLineIndentationBeforeNewClassTreeBody() throws Exception {
+-        performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n|                {\n    }\n}\n",
+-                "package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n        {\n    }\n}\n");
+-    }
+-
+-    public void testNewLineIndentationBeforeHalfIndentedNewClassTreeBody() throws Exception {
+-        Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class);
+-        preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name());
+-        try {
+-            performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()| {\n    }\n}\n",
+-                    "package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n          {\n    }\n}\n");
+-        } finally {
+-            preferences.remove("otherBracePlacement");
+-        }
+-    }
+-
+-    public void testLineIndentationBeforeHalfIndentedNewClassTreeBody() throws Exception {
+-        Preferences preferences = MimeLookup.getLookup(JavaTokenId.language().mimeType()).lookup(Preferences.class);
+-        preferences.put("otherBracePlacement", CodeStyle.BracePlacement.NEW_LINE_HALF_INDENTED.name());
+-        try {
+-            performLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n|                {\n    }\n}\n",
+-                    "package t;\npublic class T {\n    public void op() {\n        Runnable r = new Runnable()\n          {\n    }\n}\n");
+-        } finally {
+-            preferences.remove("otherBracePlacement");
+-        }
+-    }
+-
+     public void testNewLineIndentationAfterLineComment() throws Exception {
+         performNewLineIndentationTest("package t;\npublic class T {\n    public void op() {\n        System.out.println(); // Comment|\n    }\n}\n",
+                 "package t;\npublic class T {\n    public void op() {\n        System.out.println(); // Comment\n        \n    }\n}\n");
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/JavacParserTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -43,11 +43,7 @@
+ package org.netbeans.modules.java.source.parsing;
+ 
+ import java.io.File;
+-import java.util.Arrays;
+-import java.util.HashSet;
+-import java.util.Set;
+ import javax.lang.model.element.TypeElement;
+-import javax.tools.Diagnostic;
+ import org.netbeans.api.java.source.ClasspathInfo;
+ import org.netbeans.api.java.source.CompilationController;
+ import org.netbeans.api.java.source.JavaSource;
+@@ -56,7 +52,6 @@
+ import org.netbeans.api.java.source.Task;
+ import org.netbeans.api.java.source.TestUtilities;
+ import org.netbeans.junit.NbTestCase;
+-import org.netbeans.modules.java.source.tasklist.CompilerSettings;
+ import org.openide.filesystems.FileObject;
+ import org.openide.filesystems.FileUtil;
+ 
+@@ -102,31 +97,6 @@
+         }, true);
+     }
+ 
+-    public void test199332() throws Exception {
+-        CompilerSettings.getNode().putBoolean(CompilerSettings.ENABLE_LINT, true);
+-        CompilerSettings.getNode().putBoolean(CompilerSettings.ENABLE_LINT_SERIAL, true);
+-
+-        FileObject f2 = createFile("test/Test2.java", "package test; class Test2 implements Runnable, java.io.Serializable {}");
+-        JavaSource js = JavaSource.forFileObject(f2);
+-
+-        SourceUtilsTestUtil.compileRecursively(sourceRoot);
+-
+-        js.runUserActionTask(new Task<CompilationController>() {
+-            public void run(CompilationController parameter) throws Exception {
+-                assertTrue(Phase.RESOLVED.compareTo(parameter.toPhase(Phase.RESOLVED)) <= 0);
+-                assertEquals(parameter.getDiagnostics().toString(), 2, parameter.getDiagnostics().size());
+-
+-                Set<String> codes = new HashSet<String>();
+-
+-                for (Diagnostic d : parameter.getDiagnostics()) {
+-                    codes.add(d.getCode());
+-                }
+-
+-                assertEquals(new HashSet<String>(Arrays.asList("compiler.warn.missing.SVUID", "compiler.err.does.not.override.abstract")), codes);
+-            }
+-        }, true);
+-    }
+-
+     private FileObject createFile(String path, String content) throws Exception {
+         FileObject file = FileUtil.createData(sourceRoot, path);
+         TestUtilities.copyStringToFile(file, content);
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/FileObjectsTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -90,20 +90,20 @@
+     public void testRegularGetCharContent () throws Exception {
+         final File wd = this.getWorkDir();
+         final File testFile = createTestFile (wd);
+-        JavaFileObject jfo = FileObjects.fileFileObject(testFile, wd, null, null);
++        JavaFileObject jfo = FileObjects.fileFileObject(testFile, wd, null);
+         CharSequence content = jfo.getCharContent(true);
+         String expectedData = DATA+"\n";
+         assertTrue (expectedData.contentEquals(content));
+         
+         Filter f = new Filter (null);
+-        jfo = FileObjects.fileFileObject(testFile, wd, f, null);
++        jfo = FileObjects.fileFileObject(testFile, wd, f);
+         content = jfo.getCharContent(true);
+         expectedData = DATA+"\n";
+         assertTrue (expectedData.contentEquals(content));
+         assertEquals(EnumSet.of(Call.READER), f.calls);
+         
+         f = new Filter (PAD);
+-        jfo = FileObjects.fileFileObject(testFile, wd, f, null);
++        jfo = FileObjects.fileFileObject(testFile, wd, f);
+         content = jfo.getCharContent(true);
+         expectedData = PAD + DATA+"\n";
+         assertTrue (expectedData.contentEquals(content));
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/modules/java/source/parsing/GoldenArchive.java	2011-08-03 23:01:41.000000000 +0100
+@@ -50,12 +50,15 @@
+ import java.util.Collection;
+ import java.util.Collections;
+ import java.util.Comparator;
++import java.util.Iterator;
++import java.util.LinkedList;
+ import java.util.List;
+ import java.util.Set;
+ import javax.tools.JavaFileObject;
+ import org.netbeans.api.java.classpath.ClassPath;
+ import org.netbeans.modules.java.source.TestUtil;
+ import org.netbeans.modules.java.preprocessorbridge.spi.JavaFileFilterImplementation;
++import org.netbeans.modules.java.source.util.Factory;
+ 
+ /** Class which takes a folder and behaves like an archive should behave.
+  * It does not apply any optimalizations. However it is good for comparing
+@@ -124,7 +127,7 @@
+         
+         for( File f : files ) {
+             if ( !f.isDirectory() ) {
+-                entries.add( FileObjects.fileFileObject (f, rootFolder, null, null));
++                entries.add( FileObjects.fileFileObject (f, rootFolder, null));
+             }
+         }
+         
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/SourceUtilsTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -44,10 +44,8 @@
+ 
+ package org.netbeans.api.java.source;
+ 
+-import java.io.ByteArrayInputStream;
+ import java.io.File;
+ import java.io.IOException;
+-import java.io.OutputStream;
+ import java.net.URL;
+ import java.util.Arrays;
+ import java.util.Collections;
+@@ -70,12 +68,9 @@
+ import org.netbeans.junit.NbTestCase;
+ import org.netbeans.modules.java.source.ElementHandleAccessor;
+ import org.netbeans.modules.java.source.TestUtil;
+-import org.netbeans.modules.java.source.usages.ClassIndexManager;
+ import org.netbeans.modules.java.source.usages.ClasspathInfoAccessor;
+-import org.netbeans.modules.parsing.impl.indexing.CacheFolder;
+ import org.netbeans.spi.java.classpath.support.ClassPathSupport;
+ import org.netbeans.spi.java.queries.SourceForBinaryQueryImplementation;
+-import org.openide.filesystems.FileLock;
+ import org.openide.filesystems.FileObject;
+ import org.openide.filesystems.FileUtil;
+ 
+@@ -100,7 +95,41 @@
+         clearWorkDir();
+         SourceUtilsTestUtil.prepareTest(new String[0], new Object[] {SFBQImpl.getDefault()});
+     }
++
++    private void prepareTest() throws Exception {
++        File work = getWorkDir();
++        FileObject workFO = FileUtil.toFileObject(work);
++        
++        assertNotNull(workFO);
++        
++        FileObject sourceRoot = workFO.createFolder("src");
++        FileObject buildRoot  = workFO.createFolder("build");
++        FileObject cache = workFO.createFolder("cache");
++        FileObject packageRoot = sourceRoot.createFolder("sourceutils");
++        
++        SourceUtilsTestUtil.prepareTest(sourceRoot, buildRoot, cache);
++        
++        String capitalizedName = "T" + getName().substring(1);
++        
++        TestUtil.copyFiles(FileUtil.toFile(sourceRoot), "sourceutils/" + capitalizedName + ".java");
++        
++        packageRoot.refresh();
++        
++        FileObject testSource = packageRoot.getFileObject(capitalizedName + ".java");
++        
++        assertNotNull(testSource);
++
++        SourceUtilsTestUtil.compileRecursively(sourceRoot);
++        
++        js = JavaSource.forFileObject(testSource);
++        
++        assertNotNull(js);
+         
++        info = SourceUtilsTestUtil.getCompilationInfo(js, JavaSource.Phase.RESOLVED);
++        
++        assertNotNull(info);
++    }
++    
+     public void testGetEnclosingTypeElement() throws Exception {
+         //only a scatch of the test, add testcases as needed:
+         prepareTest();
+@@ -287,15 +316,69 @@
+         assertEquals (new URL[] {url1, url3, url5}, result);
+     }
+     
+-                    
++    
++    private void assertEquals (URL[] expected, Set<URL> result) {
++        assertEquals (expected.length,result.size());
++        for (URL eurl : expected) {
++            assertTrue (result.remove(eurl));
++        }
++        assertTrue(result.isEmpty());
++    }
++    
++    private <E extends Element> E findElementBySimpleName(String simpleName, List<E> elements) {
++        for (E e : elements) {
++            if (simpleName.contentEquals(e.getSimpleName()))
++                return e;
++        }
++        
++        fail("Not found element with simple name: " + simpleName);
++        
++        throw new Error("Should never be here!");
++    }
++    
++    public void testGetFQNsForSimpleName() throws Exception {
++// The method was removed,
++// tzezula: I am going to create an replacement using lucene        
++//        prepareTest();
++//        
++//        List<TypeElement> fqnTEs;
++//        List<String> fqns;
++//        
++//        fqnTEs = SourceUtils.getFQNsForSimpleNamePrefix(info, "List", true);
++//        fqns = new ArrayList<String>();
++//        
++//        for (TypeElement te : fqnTEs) {
++//            fqns.add(te.getQualifiedName().toString());
++//        }
++//        
++//        assertTrue(fqns.remove("java.util.List"));
++//        assertTrue(fqns.remove("java.awt.List"));
++//        
++//        //JDK16 specific:
++//        fqns.remove("com.sun.xml.bind.v2.schemagen.xmlschema.List");
++//        
++//        assertEquals(fqns.toString(), 0, fqns.size());
++//
++//        fqnTEs = SourceUtils.getFQNsForSimpleNamePrefix(info, "File", true);
++//        fqns = new ArrayList<String>();
++//        
++//        for (TypeElement te : fqnTEs) {
++//            fqns.add(te.getQualifiedName().toString());
++//        }
++//        
++//        assertTrue(fqns.remove("java.io.File"));
++//        
++//        assertEquals(fqns.toString(), 0, fqns.size());
++        
++        //XXX: onlyExact
++    }
++    
++    
+     public void testGetFile () throws Exception {
+         File workDir = getWorkDir();
+         FileObject workFo = FileUtil.toFileObject(workDir);
+         assertNotNull (workFo);
+         FileObject src = workFo.createFolder("src");
+-        FileObject userDir = workFo.createFolder("ud");
+-        CacheFolder.setCacheFolder(userDir);
+-        ClassIndexManager.getDefault().createUsagesQuery(src.getURL(), true);
+         FileObject srcInDefPkg = src.createData("Foo","java");
+         assertNotNull(srcInDefPkg);
+         FileObject sourceFile = src.createFolder("org").createFolder("me").createData("Test", "java");
+@@ -326,156 +409,6 @@
+         result = SourceUtils.getFile(handle,cpInfo);
+         assertNotNull(result);
+     }
+-
+-    public void testGetMainClasses() throws Exception {
+-        final File wd = getWorkDir();
+-        final FileObject src = FileUtil.createFolder(new File (wd,"src"));
+-        final FileObject userDir = FileUtil.createFolder(new File (wd,"ud"));
+-        CacheFolder.setCacheFolder(userDir);
+-        final FileObject emptyClass = createFile(src, "C1.java","class C1 {}");
+-        assertEquals(0, SourceUtils.getMainClasses(emptyClass).size());
+-        final FileObject classWithMethod = createFile(src, "C2.java","class C2 { public static void test (String... args){} }");
+-        assertEquals(0, SourceUtils.getMainClasses(classWithMethod).size());
+-        final FileObject classWithMethod2 = createFile(src, "C3.java","class C3 { static void main (String... args){} }");
+-        assertEquals(0, SourceUtils.getMainClasses(classWithMethod2).size());
+-        final FileObject classWithMethod3 = createFile(src, "C4.java","class C4 { public void main (String... args){} }");
+-        assertEquals(0, SourceUtils.getMainClasses(classWithMethod3).size());
+-        final FileObject classWithMethod4 = createFile(src, "C5.java","class C5 { public static void main (StringBuilder... args){} }");
+-        assertEquals(0, SourceUtils.getMainClasses(classWithMethod4).size());
+-        final FileObject simpleMain = createFile(src, "M1.java","class M1 { public static void main (String... args){} }");
+-        assertMain(new String[] {"M1"}, SourceUtils.getMainClasses(simpleMain));
+-        final FileObject simpleMain2 = createFile(src, "M2.java","public class M2 { public static void main (String... args){} }");
+-        assertMain(new String[] {"M2"}, SourceUtils.getMainClasses(simpleMain2));
+-        final FileObject innerMain = createFile(src, "M3.java","class M3 { public static class Inner { public static void main (String... args){} } }");
+-        assertMain(new String[] {"M3.Inner"}, SourceUtils.getMainClasses(innerMain));
+-        final FileObject innerMain2 = createFile(src, "M4.java","class M4 { protected static class Inner { public static void main (String... args){} } }");
+-        assertMain(new String[] {"M4.Inner"}, SourceUtils.getMainClasses(innerMain2));
+-        final FileObject innerMain3 = createFile(src, "M5.java","class M5 { static class Inner { public static void main (String... args){} } }");
+-        assertMain(new String[] {"M5.Inner"}, SourceUtils.getMainClasses(innerMain3));
+-        final FileObject innerMain4 = createFile(src, "M6.java","class M6 { private static class Inner { public static void main (String... args){} } }");
+-        assertMain(new String[] {"M6.Inner"}, SourceUtils.getMainClasses(innerMain4));
+-        final FileObject innerMain5 = createFile(src, "M7.java","class M7 { class Inner { public static void main (String... args){} } }");
+-        assertEquals(0, SourceUtils.getMainClasses(innerMain5).size());
+-        final FileObject innerMain6 = createFile(src, "M8.java","class M8 { class Inner { static class InnerInner {public static void main (String... args){} } } }");
+-        assertEquals(0, SourceUtils.getMainClasses(innerMain6).size());
+-        final FileObject innerMain7 = createFile(src, "M9.java","class M9 { static class Inner { static class InnerInner {public static void main (String... args){} } } }");
+-        assertMain(new String[] {"M9.Inner.InnerInner"}, SourceUtils.getMainClasses(innerMain7));
+-        final FileObject twoTop = createFile(src, "T1.java","class T1 { public static void main (String... args){}} class T1X {public static void main (String... args){}}");
+-        assertMain(new String[] {"T1","T1X"}, SourceUtils.getMainClasses(twoTop));
+-        final FileObject twoTop2 = createFile(src, "T2.java","class T2 { public static void main (String... args){} static class Inner {public static void main (String... args){}}} class T2X {public static void main (String... args){} static class Inner {public static void main (String... args){}}}");
+-        assertMain(new String[] {"T2","T2X", "T2.Inner", "T2X.Inner"}, SourceUtils.getMainClasses(twoTop2));
+-        final FileObject inhMain = createFile(src, "D1.java","class D1 { public static void main (String... args){}} class D1X extends D1 {}");
+-        assertMain(new String[] {"D1","D1X"}, SourceUtils.getMainClasses(inhMain));
+-    }
+-    
+-    public void testGenerateReadableParameterName() throws Exception {
+-        System.out.println("testGenerateReadableParameterName");
+-        Match m = new Match("java.lang.Object", "o");
+-        m.match("java.lang.Runnable", "r")
+-        .match("java.awt.event.ActionListener,java.awt.event.ActionListener","al,al1")
+-        .match("java.io.InputStream", "in")
+-        .match("java.io.OutputStream","out")
+-        .match("java.io.ByteArrayOutputStream","stream")
+-        .match("missingthing.Foodbar", "fdbr")
+-        .match("somepackage.FillUpNoKnownMessageEverywhere", "funkme")
+-        .match("java.lang.Class","type")
+-        .match("java.lang.Class<T>", "type")
+-        .match("org.openide.util.Lookup","lkp")
+-        .match("sun.awt.KeyboardFocusManagerPeerImpl", "kfmpi")
+-        .match("com.foo.BigInterface", "bi")
+-        .match("java.util.concurrent.Callable<Runnable>", "clbl")
+-        .match("int[]", "ints")
+-        .match("short", "s")
+-        .match("java.lang.Integer...", "intgrs")
+-        .match("java.awt.Component[]", "cmpnts")
+-        .match("int,java.lang.Runnable", "i,r")
+-        .match("java.lang.Runnable[]", "rs")
+-        .match("com.foo.Classwithanannoyinglylongname", "c")
+-        .match("com.foo.Classwithanannoyinglylongname,foo.bar.Classwithanotherannoyinglylongname", "c,c1")
+-        .match("com.foo.Classwithanannoyinglylongname,foo.bar.ClasswithLongnameButshortAcronym", "c,clba")
+-        .match("com.foo.ClassWithAnAnnoyinglyLongNameThatGoesOnForever", "c");
+-        m.assertMatch();
+-    }
+-
+-    //<editor-fold defaultstate="collapsed" desc="Helper methods & Mock services">
+-    
+-    private void prepareTest() throws Exception {
+-        File work = getWorkDir();
+-        FileObject workFO = FileUtil.toFileObject(work);
+-        
+-        assertNotNull(workFO);
+-        
+-        FileObject sourceRoot = workFO.createFolder("src");
+-        FileObject buildRoot  = workFO.createFolder("build");
+-        FileObject cache = workFO.createFolder("cache");
+-        FileObject packageRoot = sourceRoot.createFolder("sourceutils");
+-        
+-        SourceUtilsTestUtil.prepareTest(sourceRoot, buildRoot, cache);
+-        
+-        String capitalizedName = "T" + getName().substring(1);
+-        
+-        TestUtil.copyFiles(FileUtil.toFile(sourceRoot), "sourceutils/" + capitalizedName + ".java");
+-        
+-        packageRoot.refresh();
+-        
+-        FileObject testSource = packageRoot.getFileObject(capitalizedName + ".java");
+-        
+-        assertNotNull(testSource);
+-
+-        SourceUtilsTestUtil.compileRecursively(sourceRoot);
+-        
+-        js = JavaSource.forFileObject(testSource);
+-        
+-        assertNotNull(js);
+-        
+-        info = SourceUtilsTestUtil.getCompilationInfo(js, JavaSource.Phase.RESOLVED);
+-        
+-        assertNotNull(info);
+-    }
+-
+-    private void assertEquals (URL[] expected, Set<URL> result) {
+-        assertEquals (expected.length,result.size());
+-        for (URL eurl : expected) {
+-            assertTrue (result.remove(eurl));
+-        }
+-        assertTrue(result.isEmpty());
+-    }
+-
+-    private <E extends Element> E findElementBySimpleName(String simpleName, List<E> elements) {
+-        for (E e : elements) {
+-            if (simpleName.contentEquals(e.getSimpleName()))
+-                return e;
+-        }
+-
+-        fail("Not found element with simple name: " + simpleName);
+-
+-        throw new Error("Should never be here!");
+-    }
+-
+-    private void assertMain(final String[] expected, final Iterable<? extends ElementHandle<TypeElement>> result) {
+-        final Set<String> es = new HashSet<String>(Arrays.asList(expected));
+-        for (ElementHandle<TypeElement> r : result) {
+-            assertTrue(es.remove(r.getQualifiedName()));
+-        }
+-        assertTrue(es.isEmpty());
+-    }
+-
+-
+-    private static FileObject createFile (final FileObject folder, final String name, final String content) throws IOException {
+-        final FileObject fo = FileUtil.createData(folder, name);
+-        final FileLock lock = fo.lock();
+-        try {
+-            final OutputStream out = fo.getOutputStream(lock);
+-            try {
+-                FileUtil.copy(new ByteArrayInputStream(content.getBytes()), out);
+-            } finally {
+-                out.close();
+-            }
+-        } finally {
+-            lock.releaseLock();
+-        }
+-        return fo;
+-    }
+     
+     
+     private static class SFBQImpl implements SourceForBinaryQueryImplementation {
+@@ -518,7 +451,36 @@
+             return instance;
+         }
+     }
+-    
++
++    public void testGenerateReadableParameterName() throws Exception {
++        System.out.println("testGenerateReadableParameterName");
++        Match m = new Match("java.lang.Object", "o");
++        m.match("java.lang.Runnable", "r")
++        .match("java.awt.event.ActionListener,java.awt.event.ActionListener","al,al1")
++        .match("java.io.InputStream", "in")
++        .match("java.io.OutputStream","out")
++        .match("java.io.ByteArrayOutputStream","stream")
++        .match("missingthing.Foodbar", "fdbr")
++        .match("somepackage.FillUpNoKnownMessageEverywhere", "funkme")
++        .match("java.lang.Class","type")
++        .match("java.lang.Class<T>", "type")
++        .match("org.openide.util.Lookup","lkp")
++        .match("sun.awt.KeyboardFocusManagerPeerImpl", "kfmpi")
++        .match("com.foo.BigInterface", "bi")
++        .match("java.util.concurrent.Callable<Runnable>", "clbl")
++        .match("int[]", "ints")
++        .match("short", "s")
++        .match("java.lang.Integer...", "intgrs")
++        .match("java.awt.Component[]", "cmpnts")
++        .match("int,java.lang.Runnable", "i,r")
++        .match("java.lang.Runnable[]", "rs")
++        .match("com.foo.Classwithanannoyinglylongname", "c")
++        .match("com.foo.Classwithanannoyinglylongname,foo.bar.Classwithanotherannoyinglylongname", "c,c1")
++        .match("com.foo.Classwithanannoyinglylongname,foo.bar.ClasswithLongnameButshortAcronym", "c,clba")
++        .match("com.foo.ClassWithAnAnnoyinglyLongNameThatGoesOnForever", "c");
++        m.assertMatch();
++    }
++
+     private static final class Match {
+         private String[] fqns;
+         private String[] names;
+@@ -551,5 +513,99 @@
+             return next;
+         }
+     }
+-    //</editor-fold>
++    
++//    //tests for SourceUtils.filterSupportedMIMETypes:
++//
++//    @SuppressWarnings("deprecation")
++//    public void testFilter() throws Exception {
++//        SourceUtilsTestUtil.setLookup(new Object[] {new JavaSourceProviderImpl(), new ResolverImpl()}, SourceUtilsTest.class.getClassLoader());
++//        boolean registered = false;
++//        
++//        for (JavaSourceProvider p : Lookup.getDefault().lookupAll(JavaSourceProvider.class)) {
++//            if (p instanceof JavaSourceProvider) {
++//                registered = true;
++//                break;
++//            }
++//        }
++//        
++//        assertTrue(registered);
++//        
++//        FileObject work = FileUtil.toFileObject(getWorkDir());
++//        
++//        FileObject file1 = FileUtil.createData(work, "test.ext1");
++//        FileObject file2 = FileUtil.createData(work, "test.ext2");
++//        FileObject file3 = FileUtil.createData(work, "test.ext3");
++//        FileObject file4 = FileUtil.createData(work, "test.ext4");
++//        FileObject file5 = FileUtil.createData(work, "test.txt");
++//        FileObject file6 = FileUtil.createData(work, "test.ant");
++//
++//        assertEquals("text/x-java", FileUtil.getMIMEType(file1));
++//        assertEquals("text/jsp", FileUtil.getMIMEType(file2));
++//        assertEquals("text/plain", FileUtil.getMIMEType(file3));
++//        assertEquals("text/test+x-java", FileUtil.getMIMEType(file4));
++//        assertEquals("text/test+x-ant+xml", FileUtil.getMIMEType(file6));
++//        
++//        List<FileObject> files = Arrays.asList(file1, file2, file3, file4, file5, file6);
++//        
++//        assertEquals(Arrays.asList(file1, file2, file3, file4, file6), SourceUtils.filterSupportedMIMETypes(files, F1.class));
++//        assertEquals(Arrays.asList(file1, file4), SourceUtils.filterSupportedMIMETypes(files, F2.class));
++//        assertEquals(Arrays.asList(file4), SourceUtils.filterSupportedMIMETypes(files, F3.class));
++//        assertEquals(Arrays.asList(file1, file4), SourceUtils.filterSupportedMIMETypes(files, F4.class));
++//        assertEquals(Arrays.asList(file1, file2, file4), SourceUtils.filterSupportedMIMETypes(files, F5.class));
++//    }
++//    
++//    public static class JavaSourceProviderImpl implements JavaSourceProvider {
++//        public PositionTranslatingJavaFileFilterImplementation forFileObject(FileObject fo) {
++//            if ("txt".equals(fo.getExt()))
++//                return null;
++//            
++//            return new PositionTranslatingJavaFileFilterImplementation() {
++//                public int getOriginalPosition(int javaSourcePosition) {
++//                    return javaSourcePosition;
++//                }
++//                public int getJavaSourcePosition(int originalPosition) {
++//                    return originalPosition;
++//                }
++//                public Reader filterReader(Reader r) {
++//                    return r;
++//                }
++//                public CharSequence filterCharSequence(CharSequence charSequence) {
++//                    return charSequence;
++//                }
++//                public Writer filterWriter(Writer w) {
++//                    return w;
++//                }
++//                public void addChangeListener(ChangeListener listener) {}
++//                public void removeChangeListener(ChangeListener listener) {}
++//            };
++//        }
++//    }
++//    
++//    public static class ResolverImpl extends MIMEResolver {
++//        public String findMIMEType(FileObject fo) {
++//            String ext = fo.getExt();
++//            
++//            if ("ext1".contains(ext)) return "text/x-java";
++//            if ("ext2".contains(ext)) return "text/jsp";
++//            if ("ext3".contains(ext)) return "text/plain";
++//            if ("ext4".contains(ext)) return "text/test+x-java";
++//            if ("ant".contains(ext)) return "text/test+x-ant+xml";
++//            
++//            return null;
++//        }
++//    }
++//    
++//    @SupportedMimeTypes("*")
++//    private static class F1 {}
++//    
++//    @SupportedMimeTypes("text/x-java")
++//    private static class F2 {}
++//    
++//    @SupportedMimeTypes("text/test+x-java")
++//    private static class F3 {}
++//    
++//    private static class F4 {}
++//    
++//    @SupportedMimeTypes({"text/x-java", "text/jsp"})
++//    private static class F5 {}
+ }
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/TreePathHandleTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -45,14 +45,12 @@
+ package org.netbeans.api.java.source;
+ 
+ import com.sun.source.tree.ClassTree;
+-import com.sun.source.tree.MethodTree;
+ import com.sun.source.tree.Tree.Kind;
+ import com.sun.source.tree.VariableTree;
+ import com.sun.source.util.TreePath;
+ import java.io.File;
+ import java.io.OutputStream;
+ import java.security.Permission;
+-import javax.lang.model.element.Element;
+ import javax.lang.model.element.TypeElement;
+ import org.netbeans.api.java.source.JavaSource.Phase;
+ import org.netbeans.junit.NbTestCase;
+@@ -338,32 +336,6 @@
+         assertTrue(tp.getLeaf() == resolved.getLeaf());
+     }
+ 
+-    public void testFromElementHandle() throws Exception {
+-        FileObject file = FileUtil.createData(sourceRoot, "test/test.java");
+-        String code = "package test;\n" +
+-                      "public class Test {\n" +
+-                      "    public static void test() {\n" +
+-                      "    }\n" +
+-                      "}";
+-
+-        writeIntoFile(file,code);
+-
+-        JavaSource js = JavaSource.forFileObject(file);
+-        CompilationInfo info = SourceUtilsTestUtil.getCompilationInfo(js, Phase.RESOLVED);
+-
+-        ClassTree clazz = (ClassTree) info.getCompilationUnit().getTypeDecls().get(0);
+-        MethodTree method = (MethodTree) clazz.getMembers().get(1);
+-        TreePath tp = TreePath.getPath(info.getCompilationUnit(), method);
+-        Element el = info.getTrees().getElement(tp);
+-        ElementHandle<?> elHandle = ElementHandle.create(el);
+-        TreePathHandle handle   = TreePathHandle.from(elHandle, info.getClasspathInfo());
+-        TreePath       resolved = handle.resolve(info);
+-
+-        assertNotNull(resolved);
+-
+-        assertTrue(tp.getLeaf() == resolved.getLeaf());
+-    }
+-
+     private static final class SecMan extends SecurityManager {
+ 
+         @Override
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/GeneratorUtilitiesTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -331,10 +331,6 @@
+         performTest("package test;\npublic class Test extends XX {\nprivate int test;\n}\nclass XX {\npublic XX(boolean b){\n}\n}\n", new ConstructorTask(30), new ConstructorValidator());
+     }
+ 
+-    public void testConstructor197192() throws Exception {
+-        performTest("package test;\npublic class Test extends XX {\nprivate int test;\n}\nclass XX {\npublic XX(String... args){\n}\n}\n", new ConstructorTask(30), new ConstructorValidator());
+-    }
+-
+     public void testConstructor100341() throws Exception {
+         performTest("package test;\npublic class Test extends java.util.ArrayList<String> {\n}\n", new ALConstructorTask(30), null);
+     }
+@@ -818,8 +814,6 @@
+             ExecutableElement ctor = ctors.get(0);
+ 
+             assertEquals(supCtor == null ? 1 : 2, ctor.getParameters().size());
+-            if (supCtor != null)
+-                assertEquals(supCtor.isVarArgs(), ctor.isVarArgs());
+         }
+ 
+     }
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/CommentCollectorTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -509,34 +509,6 @@
+         src.runModificationTask(task);
+ 
+     }
+-
+-    public void test197057() throws Exception {
+-        File testFile = new File(work, "Test.java");
+-        final String origin =
+-                       "package test;\n" +
+-                       "public class Test {\n public void aa() {\n//aa\n } public void bb() {\n//bb\n } }\n";
+-        TestUtilities.copyStringToFile(testFile, origin);
+-        JavaSource src = getJavaSource(testFile);
+-
+-        Task<WorkingCopy> task = new Task<WorkingCopy>() {
+-            public void run(final WorkingCopy workingCopy) throws Exception {
+-                workingCopy.toPhase(JavaSource.Phase.PARSED);
+-                ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0);
+-                MethodTree a = (MethodTree) clazz.getMembers().get(0);
+-                MethodTree b = (MethodTree) clazz.getMembers().get(1);
+-
+-                a = GeneratorUtilities.get(workingCopy).importComments(a, workingCopy.getCompilationUnit());
+-                b = GeneratorUtilities.get(workingCopy).importComments(b, workingCopy.getCompilationUnit());
+-
+-                final CommentHandlerService service = CommentHandlerService.instance(workingCopy.impl.getJavacTask().getContext());
+-
+-                verify(a.getBody(), CommentSet.RelativePosition.INNER, service, "", "//aa");
+-                verify(b.getBody(), CommentSet.RelativePosition.INNER, service, "", "//bb");
+-            }
+-        };
+-        src.runModificationTask(task);
+-
+-    }
+     
+     void verify(Tree tree, CommentSet.RelativePosition position, CommentHandler service, String... comments) {
+         assertNotNull("Comments handler service not null", service);
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/JavaSourceTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -88,7 +88,6 @@
+ import java.util.List;
+ import java.util.Set;
+ import java.util.concurrent.TimeUnit;
+-import java.util.concurrent.TimeoutException;
+ import java.util.concurrent.atomic.AtomicReference;
+ import java.util.logging.Handler;
+ import javax.swing.text.BadLocationException;
+@@ -1209,12 +1208,7 @@
+         rutStart.await();
+         res = js.runWhenScanFinished(new T(latch), true);
+         assertEquals(1,latch.getCount());
+-        try {
+-            res.get(1,TimeUnit.SECONDS);
+-            assertTrue(false);
+-        } catch (TimeoutException te) {
+-            //Pass
+-        }
++        res.get(1,TimeUnit.SECONDS);
+         assertFalse(res.isDone());
+         assertFalse (res.isCancelled());
+         rutLatch.countDown();
+@@ -1231,23 +1225,13 @@
+         rutStart.await();
+         res = js.runWhenScanFinished(new T(latch), true);
+         assertEquals(1,latch.getCount());
+-        try {
+-            res.get(1,TimeUnit.SECONDS);
+-            assertTrue(false);
+-        } catch (TimeoutException te) {
+-            //Pass
+-        }
++        res.get(1,TimeUnit.SECONDS);
+         assertFalse(res.isDone());
+         assertFalse (res.isCancelled());
+         assertTrue (res.cancel(false));
+         rutLatch.countDown();
+         assertFalse(latch.await(3, TimeUnit.SECONDS));
+-        try {
+-            res.get(1,TimeUnit.SECONDS);
+-            assertTrue(false);
+-        } catch (TimeoutException te) {
+-            //Pass
+-        }
++        res.get(1,TimeUnit.SECONDS);
+         assertFalse(res.isDone());
+         assertTrue (res.isCancelled());
+     }
+@@ -2186,7 +2170,7 @@
+ 
+     }
+ 
+-    private static class TestIndex implements Index.WithStatus {
++    private static class TestIndex implements Index {
+         //Activate the TestIndex.await after scan is done
+         //during the scan the prebuildArgs may call the index
+         //and cause deadlock
+@@ -2197,17 +2181,12 @@
+         }
+ 
+         @Override
+-        public Status getStatus(boolean tryOpen) throws IOException {
+-            return Status.VALID;
+-        }
+-
+-        @Override
+-        public boolean exists() {
++        public boolean isValid(boolean tryOpen) throws IOException {
+             return true;
+         }
+ 
+         @Override
+-        public boolean isValid(boolean tryOpen) throws IOException {
++        public boolean exists() {
+             return true;
+         }
+ 
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultiCatchTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -44,14 +44,11 @@
+ package org.netbeans.api.java.source.gen;
+ 
+ import com.sun.source.tree.*;
+-import com.sun.source.util.TreeScanner;
+ import java.io.File;
+ import java.io.IOException;
+-import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.EnumSet;
+-import java.util.List;
+ import javax.lang.model.element.Modifier;
+ import org.netbeans.api.java.source.Task;
+ import org.netbeans.api.java.source.JavaSource;
+@@ -114,7 +111,7 @@
+                 TryTree tt = make.Try(make.Block(Collections.<StatementTree>emptyList(), false),
+                                       Collections.singletonList(make.Catch(make.Variable(make.Modifiers(EnumSet.of(Modifier.FINAL)),
+                                                                                          "ex",
+-                                                                                         make.UnionType(Arrays.asList(make.Identifier("java.net.MalformedURLException"),
++                                                                                         make.DisjunctiveType(Arrays.asList(make.Identifier("java.net.MalformedURLException"),
+                                                                                                                             make.Identifier("java.io.IOException"))
+                                                                                                           ),
+                                                                                          null),
+@@ -129,202 +126,6 @@
+         System.err.println(res);
+         assertEquals(golden, res);
+     }
+-
+-    public void testRenameInMultiCatch() throws Exception {
+-        testFile = new File(getWorkDir(), "Test.java");
+-        TestUtilities.copyStringToFile(testFile,
+-            "package hierbas.del.litoral;\n" +
+-            "import java.io.*;\n" +
+-            "import java.net.*;\n" +
+-            "public class Test {\n" +
+-            "    public void taragui() {\n" +
+-            "        try {\n" +
+-            "        } catch (MalformedURLException | FileNotFoundException ex) {\n" +
+-            "        }\n" +
+-            "    }\n" +
+-            "}\n"
+-            );
+-        String golden =
+-            "package hierbas.del.litoral;\n" +
+-            "import java.io.*;\n" +
+-            "import java.net.*;\n" +
+-            "public class Test {\n" +
+-            "    public void taragui() {\n" +
+-            "        try {\n" +
+-            "        } catch (MalformedURLException | IOException ex) {\n" +
+-            "        }\n" +
+-            "    }\n" +
+-            "}\n";
+-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
+-        Task task = new Task<WorkingCopy>() {
+-
+-            public void run(final WorkingCopy workingCopy) throws IOException {
+-                workingCopy.toPhase(Phase.RESOLVED);
+-                final TreeMaker make = workingCopy.getTreeMaker();
+-
+-                new TreeScanner<Void, Void>() {
+-                    @Override public Void visitIdentifier(IdentifierTree node, Void p) {
+-                        if (node.getName().contentEquals("FileNotFoundException")) {
+-                            workingCopy.rewrite(node, make.Identifier("IOException"));
+-                        }
+-                        return super.visitIdentifier(node, p);
+-                    }
+-                }.scan(workingCopy.getCompilationUnit(), null);
+-            }
+-
+-        };
+-        testSource.runModificationTask(task).commit();
+-        String res = TestUtilities.copyFileToString(testFile);
+-        System.err.println(res);
+-        assertEquals(golden, res);
+-    }
+-
+-    public void testAddLastToMultiCatch() throws Exception {
+-        testFile = new File(getWorkDir(), "Test.java");
+-        TestUtilities.copyStringToFile(testFile,
+-            "package hierbas.del.litoral;\n" +
+-            "import java.io.*;\n" +
+-            "import java.net.*;\n" +
+-            "public class Test {\n" +
+-            "    public void taragui() {\n" +
+-            "        try {\n" +
+-            "        } catch (MalformedURLException | FileNotFoundException ex) {\n" +
+-            "        }\n" +
+-            "    }\n" +
+-            "}\n"
+-            );
+-        String golden =
+-            "package hierbas.del.litoral;\n" +
+-            "import java.io.*;\n" +
+-            "import java.net.*;\n" +
+-            "public class Test {\n" +
+-            "    public void taragui() {\n" +
+-            "        try {\n" +
+-            "        } catch (MalformedURLException | FileNotFoundException | IOException ex) {\n" +
+-            "        }\n" +
+-            "    }\n" +
+-            "}\n";
+-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
+-        Task task = new Task<WorkingCopy>() {
+-
+-            public void run(final WorkingCopy workingCopy) throws IOException {
+-                workingCopy.toPhase(Phase.RESOLVED);
+-                final TreeMaker make = workingCopy.getTreeMaker();
+-
+-                new TreeScanner<Void, Void>() {
+-                    @Override public Void visitUnionType(UnionTypeTree node, Void p) {
+-                        List<Tree> alternatives = new ArrayList<Tree>(node.getTypeAlternatives());
+-                        alternatives.add(make.Identifier("IOException"));
+-                        workingCopy.rewrite(node, make.UnionType(alternatives));
+-                        return null;
+-                    }
+-                }.scan(workingCopy.getCompilationUnit(), null);
+-            }
+-
+-        };
+-        testSource.runModificationTask(task).commit();
+-        String res = TestUtilities.copyFileToString(testFile);
+-        System.err.println(res);
+-        assertEquals(golden, res);
+-    }
+-
+-    public void testAddFirstToMultiCatch() throws Exception {
+-        testFile = new File(getWorkDir(), "Test.java");
+-        TestUtilities.copyStringToFile(testFile,
+-            "package hierbas.del.litoral;\n" +
+-            "import java.io.*;\n" +
+-            "import java.net.*;\n" +
+-            "public class Test {\n" +
+-            "    public void taragui() {\n" +
+-            "        try {\n" +
+-            "        } catch (MalformedURLException | FileNotFoundException ex) {\n" +
+-            "        }\n" +
+-            "    }\n" +
+-            "}\n"
+-            );
+-        String golden =
+-            "package hierbas.del.litoral;\n" +
+-            "import java.io.*;\n" +
+-            "import java.net.*;\n" +
+-            "public class Test {\n" +
+-            "    public void taragui() {\n" +
+-            "        try {\n" +
+-            "        } catch (IOException | MalformedURLException | FileNotFoundException ex) {\n" +
+-            "        }\n" +
+-            "    }\n" +
+-            "}\n";
+-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
+-        Task task = new Task<WorkingCopy>() {
+-
+-            public void run(final WorkingCopy workingCopy) throws IOException {
+-                workingCopy.toPhase(Phase.RESOLVED);
+-                final TreeMaker make = workingCopy.getTreeMaker();
+-
+-                new TreeScanner<Void, Void>() {
+-                    @Override public Void visitUnionType(UnionTypeTree node, Void p) {
+-                        List<Tree> alternatives = new ArrayList<Tree>(node.getTypeAlternatives());
+-                        alternatives.add(0, make.Identifier("IOException"));
+-                        workingCopy.rewrite(node, make.UnionType(alternatives));
+-                        return null;
+-                    }
+-                }.scan(workingCopy.getCompilationUnit(), null);
+-            }
+-
+-        };
+-        testSource.runModificationTask(task).commit();
+-        String res = TestUtilities.copyFileToString(testFile);
+-        System.err.println(res);
+-        assertEquals(golden, res);
+-    }
+-
+-    public void testAddMiddleToMultiCatch() throws Exception {
+-        testFile = new File(getWorkDir(), "Test.java");
+-        TestUtilities.copyStringToFile(testFile,
+-            "package hierbas.del.litoral;\n" +
+-            "import java.io.*;\n" +
+-            "import java.net.*;\n" +
+-            "public class Test {\n" +
+-            "    public void taragui() {\n" +
+-            "        try {\n" +
+-            "        } catch (MalformedURLException | FileNotFoundException ex) {\n" +
+-            "        }\n" +
+-            "    }\n" +
+-            "}\n"
+-            );
+-        String golden =
+-            "package hierbas.del.litoral;\n" +
+-            "import java.io.*;\n" +
+-            "import java.net.*;\n" +
+-            "public class Test {\n" +
+-            "    public void taragui() {\n" +
+-            "        try {\n" +
+-            "        } catch (MalformedURLException | IOException | FileNotFoundException ex) {\n" +
+-            "        }\n" +
+-            "    }\n" +
+-            "}\n";
+-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
+-        Task task = new Task<WorkingCopy>() {
+-
+-            public void run(final WorkingCopy workingCopy) throws IOException {
+-                workingCopy.toPhase(Phase.RESOLVED);
+-                final TreeMaker make = workingCopy.getTreeMaker();
+-
+-                new TreeScanner<Void, Void>() {
+-                    @Override public Void visitUnionType(UnionTypeTree node, Void p) {
+-                        List<Tree> alternatives = new ArrayList<Tree>(node.getTypeAlternatives());
+-                        alternatives.add(1, make.Identifier("IOException"));
+-                        workingCopy.rewrite(node, make.UnionType(alternatives));
+-                        return null;
+-                    }
+-                }.scan(workingCopy.getCompilationUnit(), null);
+-            }
+-
+-        };
+-        testSource.runModificationTask(task).commit();
+-        String res = TestUtilities.copyFileToString(testFile);
+-        System.err.println(res);
+-        assertEquals(golden, res);
+-    }
+     
+     String getGoldenPckg() {
+         return "";
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/AnnotationTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -904,42 +904,6 @@
+         assertEquals(golden, res);
+     }
+ 
+-    public void testParameterAnnotations() throws Exception {
+-        testFile = new File(getWorkDir(), "Test.java");
+-        String code = "package hierbas.del.litoral;\n" +
+-                      "\n" +
+-                      "public class Test {\n\n" +
+-                      "    public Test() {\n" +
+-                      "    }\n\n" +
+-                      "    public void test() {\n" +
+-                      "    }\n" +
+-                      "}\n";
+-
+-        code = Reformatter.reformat(code, CodeStyle.getDefault(FileUtil.toFileObject(testFile)));
+-        TestUtilities.copyStringToFile(testFile, code);
+-
+-        JavaSource src = getJavaSource(testFile);
+-        Task task = new Task<WorkingCopy>() {
+-
+-            public void run(final WorkingCopy workingCopy) throws IOException {
+-                workingCopy.toPhase(Phase.RESOLVED);
+-
+-                NewClassTree nct = (NewClassTree) workingCopy.getTreeUtilities().parseExpression("new Object() { public int a(@Test1(a=1) @Test2(b=2) int i, @Test1 @Test2 int j) { return 0; }", new SourcePositions[1]);
+-                ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0);
+-                workingCopy.rewrite(clazz, workingCopy.getTreeMaker().addClassMember(clazz, nct.getClassBody().getMembers().get(0)));
+-            }
+-
+-        };
+-        src.runModificationTask(task).commit();
+-        String res = TestUtilities.copyFileToString(testFile);
+-        String formattedRes = Reformatter.reformat(res, CodeStyle.getDefault(FileUtil.toFileObject(testFile)));
+-        System.err.println(res);
+-        res = res.replaceAll("\n[ ]*\n", "\n");
+-        System.err.println(formattedRes);
+-        formattedRes = formattedRes.replaceAll("\n[ ]*\n", "\n"); //XXX: workaround for a bug in reformatter
+-        assertEquals(formattedRes, res);
+-    }
+-
+     private void setValues(Preferences p, Map<String, String> values) {
+         for (Entry<String, String> e : values.entrySet()) {
+             if (e.getValue() != null) {
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/RefactoringRegressionsTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -43,10 +43,6 @@
+  */
+ package org.netbeans.api.java.source.gen;
+ 
+-import com.sun.source.util.TreePath;
+-import org.openide.cookies.EditorCookie;
+-import org.openide.filesystems.FileUtil;
+-import org.openide.loaders.DataObject;
+ import java.io.File;
+ import java.io.IOException;
+ import java.util.Collections;
+@@ -63,7 +59,7 @@
+ 
+ /**
+  *
+- * @author Pavel Flaska, Jan Becicka
++ * @author Pavel Flaska
+  */
+ public class RefactoringRegressionsTest extends GeneratorTestMDRCompat {
+ 
+@@ -736,110 +732,6 @@
+         assertEquals(golden, res);
+     }
+ 
+-    public void test197057() throws Exception {
+-        System.err.println("test197057");
+-
+-
+-        testFile = new File(getWorkDir(), "Test.java");
+-        TestUtilities.copyStringToFile(testFile,
+-            "package personal;\n" +
+-            "\n" +
+-            "public class Test {\n" +
+-            "    private void a() {\n" +
+-            "       //a\n" +
+-            "    }\n" +
+-            "    private void b() {\n" +
+-            "       //b\n" +
+-            "    }\n" +
+-            "}\n" +
+-            "class A {\n" +
+-            "}\n");
+-
+-
+-
+-         String golden =
+-            "package personal;\n" +
+-            "\n" +
+-            "public class Test {\n" +
+-            "    private void a() {\n" +
+-            "       //a\n" +
+-            "    }\n" +
+-            "    private void b() {\n" +
+-            "       //b\n" +
+-            "    }\n" +
+-            "}\n" +
+-            "class A {\n\n" +
+-            "    private void a() {\n" +
+-            "        //a\n" +
+-            "    }\n\n" +
+-            "    private void b() {\n" +
+-            "        //b\n" +
+-            "    }\n" +
+-            "}\n";
+-
+-
+-
+-        JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile));
+-        Task task = new Task<WorkingCopy>() {
+-
+-            public void run(WorkingCopy workingCopy) throws java.io.IOException {
+-                workingCopy.toPhase(Phase.RESOLVED);
+-                TreeMaker make = workingCopy.getTreeMaker();
+-                ClassTree clazz = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(0);
+-                ClassTree dest = (ClassTree) workingCopy.getCompilationUnit().getTypeDecls().get(1);
+-                ClassTree newDest;
+-
+-                MethodTree a = (MethodTree) clazz.getMembers().get(1);
+-                MethodTree b = (MethodTree) clazz.getMembers().get(2);
+-
+-                GeneratorUtilities genUtils = GeneratorUtilities.get(workingCopy);
+-                TreePath mpath = workingCopy.getTrees().getPath(workingCopy.getCompilationUnit(), a);
+-                Tree newMethodTree = genUtils.importComments(mpath.getLeaf(), mpath.getCompilationUnit());
+-                newMethodTree = genUtils.importFQNs(newMethodTree);
+-
+-                MethodTree oldOne = (MethodTree) newMethodTree;
+-                MethodTree newm = make.Method(
+-                        oldOne.getModifiers(),
+-                        oldOne.getName(),
+-                        oldOne.getReturnType(),
+-                        oldOne.getTypeParameters(),
+-                        oldOne.getParameters(),
+-                        oldOne.getThrows(),
+-                        oldOne.getBody(),
+-                        (ExpressionTree) oldOne.getDefaultValue());
+-                //RetoucheUtils.copyJavadoc(methodElm, m, workingCopy);
+-                newDest = genUtils.insertClassMember(dest, newm);
+-
+-                mpath = workingCopy.getTrees().getPath(workingCopy.getCompilationUnit(), b);
+-                newMethodTree = genUtils.importComments(mpath.getLeaf(), mpath.getCompilationUnit());
+-                newMethodTree = genUtils.importFQNs(newMethodTree);
+-
+-                oldOne = (MethodTree) newMethodTree;
+-                newm = make.Method(
+-                        oldOne.getModifiers(),
+-                        oldOne.getName(),
+-                        oldOne.getReturnType(),
+-                        oldOne.getTypeParameters(),
+-                        oldOne.getParameters(),
+-                        oldOne.getThrows(),
+-                        oldOne.getBody(),
+-                        (ExpressionTree) oldOne.getDefaultValue());
+-                //RetoucheUtils.copyJavadoc(methodElm, m, workingCopy);
+-                newDest = genUtils.insertClassMember(newDest, newm);
+-
+-                workingCopy.rewrite(dest, newDest);
+-            }
+-        };
+-        testSource.runModificationTask(task).commit();
+-        DataObject d = DataObject.find(FileUtil.toFileObject(testFile));
+-        EditorCookie ec = d.getLookup().lookup(EditorCookie.class);
+-        ec.saveDocument();
+-
+-        String res = TestUtilities.copyFileToString(testFile);
+-        System.err.println(res);
+-        assertEquals(golden, res);
+-    }
+-    
+     String getGoldenPckg() {
+         return "";
+     }
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/CommentsTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -1485,6 +1485,7 @@
+                 ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0);
+                 GeneratorUtilities.get(workingCopy).importComments(clazz, cut);
+                 ClassTree newClazz = make.setLabel(clazz, clazz.getSimpleName());
++                GeneratorUtilities.get(workingCopy).copyComments(clazz, newClazz, true);
+                 make.removeComment(newClazz, 0, true);
+                 workingCopy.rewrite(clazz, newClazz);
+             }
+Index: netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java	2011-08-03 23:01:41.000000000 +0100
++++ netbeans-7.0.1+dfsg1/java.source/test/unit/src/org/netbeans/api/java/source/gen/MoveTreeTest.java	2011-08-03 23:01:41.000000000 +0100
+@@ -604,46 +604,6 @@
+         Utils.setCodePreferences(origValues);
+     }
+ 
+-    public void testCLikeArray() throws Exception {
+-        testFile = new File(getWorkDir(), "Test.java");
+-        TestUtilities.copyStringToFile(testFile,
+-            "package hierbas.del.litoral;\n\n" +
+-            "public class Test {\n" +
+-            "    public int taragui() {\n" +
+-            "        int ii[] = null;" +
+-            "    }\n" +
+-            "}\n"
+-            );
+-        String golden =
+-            "package hierbas.del.litoral;\n\n" +
+-            "public class Test {\n" +
+-            "    public int taragui(int[] a) {\n" +
+-            "        int ii[] = null;" +
+-            "    }\n" +
+-            "}\n";
+-
+-        JavaSource src = getJavaSource(testFile);
+-        Task<WorkingCopy> task = new Task<WorkingCopy>() {
+-
+-            public void run(WorkingCopy workingCopy) throws IOException {
+-                workingCopy.toPhase(Phase.RESOLVED);
+-                CompilationUnitTree cut = workingCopy.getCompilationUnit();
+-                ClassTree clazz = (ClassTree) cut.getTypeDecls().get(0);
+-                MethodTree method = (MethodTree) clazz.getMembers().get(1);
+-                VariableTree var = (VariableTree) method.getBody().getStatements().get(0);
+-                TreeMaker make = workingCopy.getTreeMaker();
+-                VariableTree param = workingCopy.getTreeMaker().Variable(make.Modifiers(EnumSet.noneOf(Modifier.class)), "a", var.getType(), null);
+-
+-                workingCopy.rewrite(method, make.addMethodParameter(method, param));
+-            }
+-
+-        };
+-        src.runModificationTask(task).commit();
+-        String res = TestUtilities.copyFileToString(testFile);
+-        System.err.println(res);
+-        assertEquals(golden, res);
+-    }
+-
+     String getGoldenPckg() {
+         return "";
+     }
diff --git a/debian/patches/netbeans~small-ide.patch b/debian/patches/netbeans~small-ide.patch
new file mode 100644
index 0000000..59bab4f
--- /dev/null
+++ b/debian/patches/netbeans~small-ide.patch
@@ -0,0 +1,179 @@
+Don't include all modules in the build.
+
+Index: netbeans-7.0.1+dfsg1/java.kit/nbproject/project.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/java.kit/nbproject/project.xml	2011-08-02 23:52:03.033331621 +0100
++++ netbeans-7.0.1+dfsg1/java.kit/nbproject/project.xml	2011-08-02 23:52:42.223337975 +0100
+@@ -204,7 +204,7 @@
+                         <specification-version>1.13.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.websvc.jaxws21</code-name-base>
+                     <run-dependency>
+                         <release-version>1</release-version>
+@@ -223,7 +223,7 @@
+                         <release-version>1</release-version>
+                         <specification-version>1.13.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.xml.tools.java</code-name-base>
+                     <run-dependency>
+Index: netbeans-7.0.1+dfsg1/apisupport.kit/nbproject/project.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/apisupport.kit/nbproject/project.xml	2011-07-28 20:44:52.000000000 +0100
++++ netbeans-7.0.1+dfsg1/apisupport.kit/nbproject/project.xml	2011-08-02 23:54:10.473330573 +0100
+@@ -11,7 +11,7 @@
+                         <specification-version>2.43.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.apisupport.crudsample</code-name-base>
+                     <run-dependency>
+                         <specification-version>1.6.1</specification-version>
+@@ -23,31 +23,31 @@
+                         <release-version>1</release-version>
+                         <specification-version>1.17.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.apisupport.harness</code-name-base>
+                     <run-dependency>
+                         <specification-version>1.26.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.apisupport.installer</code-name-base>
+                     <run-dependency>
+                         <specification-version>1.6.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.apisupport.osgidemo</code-name-base>
+                     <run-dependency>
+                         <specification-version>1.6.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.apisupport.paintapp</code-name-base>
+                     <run-dependency>
+                         <specification-version>1.14.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.apisupport.project</code-name-base>
+                     <run-dependency>
+Index: netbeans-7.0.1+dfsg1/editor.kit/nbproject/project.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/editor.kit/nbproject/project.xml	2011-08-02 23:54:24.404164300 +0100
++++ netbeans-7.0.1+dfsg1/editor.kit/nbproject/project.xml	2011-08-02 23:56:08.223331516 +0100
+@@ -5,13 +5,13 @@
+         <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
+             <code-name-base>org.netbeans.modules.editor.kit</code-name-base>
+             <module-dependencies>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.css.visual</code-name-base>
+                     <run-dependency>
+                         <release-version>1</release-version>
+                         <specification-version>2.17.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.editor.actions</code-name-base>
+                     <run-dependency>
+@@ -33,7 +33,7 @@
+                         <specification-version>1.36.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.html.parser</code-name-base>
+                     <run-dependency>
+                         <release-version>1</release-version>
+@@ -46,7 +46,7 @@
+                         <release-version>1</release-version>
+                         <specification-version>1.6.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.image</code-name-base>
+                     <run-dependency>
+@@ -54,13 +54,13 @@
+                         <specification-version>1.31.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.javascript.kit</code-name-base>
+                     <run-dependency>
+                         <release-version>1</release-version>
+                         <specification-version>0.115.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.languages.diff</code-name-base>
+                     <run-dependency>
+@@ -126,13 +126,13 @@
+                         <specification-version>1.26.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.xsl</code-name-base>
+                     <run-dependency>
+                         <release-version>1</release-version>
+                         <specification-version>1.26.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+             </module-dependencies>
+             <public-packages/>
+         </data>
+Index: netbeans-7.0.1+dfsg1/ide.kit/nbproject/project.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/ide.kit/nbproject/project.xml	2011-08-02 23:56:22.374164685 +0100
++++ netbeans-7.0.1+dfsg1/ide.kit/nbproject/project.xml	2011-08-02 23:57:00.373332636 +0100
+@@ -25,12 +25,12 @@
+                         <specification-version>1.15.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.dlight.terminal</code-name-base>
+                     <run-dependency>
+                         <specification-version>1.6.1.1</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.editor.bookmarks</code-name-base>
+                     <run-dependency>
+@@ -135,13 +135,13 @@
+                         <specification-version>1.23.1</specification-version>
+                     </run-dependency>
+                 </dependency>
+-                <dependency>
++<!--                <dependency>
+                     <code-name-base>org.netbeans.modules.httpserver</code-name-base>
+                     <run-dependency>
+                         <release-version>2</release-version>
+                         <specification-version>2.19.1.42</specification-version>
+                     </run-dependency>
+-                </dependency>
++                </dependency>-->
+                 <dependency>
+                     <code-name-base>org.netbeans.modules.jumpto</code-name-base>
+                     <run-dependency>
diff --git a/debian/patches/netbeans~svnclient.patch b/debian/patches/netbeans~svnclient.patch
new file mode 100644
index 0000000..934b163
--- /dev/null
+++ b/debian/patches/netbeans~svnclient.patch
@@ -0,0 +1,87 @@
+Use the packaged SVN client libraries.
+
+Index: netbeans-7.0+dfsg1/libs.svnClientAdapter/nbproject/project.xml
+===================================================================
+--- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter/nbproject/project.xml	2011-06-29 20:36:57.542215632 +0100
++++ netbeans-7.0+dfsg1/libs.svnClientAdapter/nbproject/project.xml	2011-06-29 20:37:22.709715583 +0100
+@@ -81,6 +81,8 @@
+                 <package>org.netbeans.libs.svnclientadapter</package>
+                 <package>org.tigris.subversion.svnclientadapter</package>
+                 <package>org.tigris.subversion.svnclientadapter.utils</package>
++                <package>org.tigris.subversion.svnclientadapter.javahl</package>
++                <package>org.tigris.subversion.svnclientadapter.svnkit</package>
+             </friend-packages>
+             <class-path-extension>
+                 <runtime-relative-path>ext/svnClientAdapter-main-1.6.13.jar</runtime-relative-path>
+Index: netbeans-7.0+dfsg1/libs.svnClientAdapter.javahl/nbproject/project.xml
+===================================================================
+--- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter.javahl/nbproject/project.xml	2011-06-29 20:36:57.512215360 +0100
++++ netbeans-7.0+dfsg1/libs.svnClientAdapter.javahl/nbproject/project.xml	2011-06-29 20:36:59.420548683 +0100
+@@ -95,8 +95,8 @@
+             </test-dependencies>
+             <public-packages/>
+             <class-path-extension>
+-                <runtime-relative-path>ext/svnClientAdapter-javahl-1.6.13.jar</runtime-relative-path>
+-                <binary-origin>external/svnClientAdapter-javahl-1.6.13.jar</binary-origin>
++                <runtime-relative-path>ext/svnClientAdapter-main-1.6.13.jar</runtime-relative-path>
++<!--                <binary-origin>external/svnClientAdapter-javahl-1.6.13.jar</binary-origin>-->
+             </class-path-extension>
+             <class-path-extension>
+                 <runtime-relative-path>ext/svnjavahl-1.6.0.jar</runtime-relative-path>
+Index: netbeans-7.0+dfsg1/libs.svnClientAdapter.javahl/nbproject/project.properties
+===================================================================
+--- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter.javahl/nbproject/project.properties	2011-06-29 20:36:57.482215322 +0100
++++ netbeans-7.0+dfsg1/libs.svnClientAdapter.javahl/nbproject/project.properties	2011-06-29 20:36:59.430548565 +0100
+@@ -43,7 +43,7 @@
+ 
+ is.eager=true
+ javac.source=1.6
+-release.external/svnClientAdapter-javahl-1.6.13.jar=modules/ext/svnClientAdapter-javahl-1.6.13.jar
++#release.external/svnClientAdapter-javahl-1.6.13.jar=modules/ext/svnClientAdapter-javahl-1.6.13.jar
+ release.external/svnjavahl-1.6.0.jar=modules/ext/svnjavahl-1.6.0.jar
+ 
+ # Hidden class found: org.tigris.subversion.svnclientadapter.commandline.CommandLine$CmdArguments in method protected byte[] org.tigris.subversion.svnclientadapter.commandline.SvnCommandLine.execBytes(org.tigris.subversion.svnclientadapter.commandline.CommandLine$CmdArguments,boolean) throws java.lang.Exception in class org.tigris.subversion.svnclientadapter.commandline.SvnCommandLine
+Index: netbeans-7.0+dfsg1/libs.svnClientAdapter.svnkit/nbproject/project.xml
+===================================================================
+--- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter.svnkit/nbproject/project.xml	2011-06-29 20:40:32.111381291 +0100
++++ netbeans-7.0+dfsg1/libs.svnClientAdapter.svnkit/nbproject/project.xml	2011-06-29 20:44:53.912215278 +0100
+@@ -95,18 +95,18 @@
+                 </test-type>
+             </test-dependencies>            
+             <public-packages/>
+-            <class-path-extension>
++<!--            <class-path-extension>
+                 <runtime-relative-path>ext/svnClientAdapter-svnkit-1.6.13.jar</runtime-relative-path>
+                 <binary-origin>external/svnClientAdapter-svnkit-1.6.13.jar</binary-origin>
+-            </class-path-extension>
++            </class-path-extension>-->
+             <class-path-extension>
+                 <runtime-relative-path>ext/svnkit-1.3.4.jar</runtime-relative-path>
+                 <binary-origin>external/svnkit-1.3.4.jar</binary-origin>
+             </class-path-extension>
+-            <class-path-extension>
++<!--            <class-path-extension>
+                 <runtime-relative-path>ext/sqljet-1.0.3.jar</runtime-relative-path>
+                 <binary-origin>external/sqljet-1.0.3.jar</binary-origin>
+-            </class-path-extension>
++            </class-path-extension>-->
+             <class-path-extension>
+                 <runtime-relative-path>ext/svnkit-javahl.jar</runtime-relative-path>
+                 <binary-origin>external/svnkit-javahl.jar</binary-origin>
+Index: netbeans-7.0+dfsg1/libs.svnClientAdapter.svnkit/nbproject/project.properties
+===================================================================
+--- netbeans-7.0+dfsg1.orig/libs.svnClientAdapter.svnkit/nbproject/project.properties	2011-06-29 20:41:04.219715631 +0100
++++ netbeans-7.0+dfsg1/libs.svnClientAdapter.svnkit/nbproject/project.properties	2011-06-29 20:45:11.059716185 +0100
+@@ -43,10 +43,10 @@
+ 
+ is.eager=true
+ javac.source=1.6
+-release.external/svnClientAdapter-svnkit-1.6.13.jar=modules/ext/svnClientAdapter-svnkit-1.6.13.jar
++#release.external/svnClientAdapter-svnkit-1.6.13.jar=modules/ext/svnClientAdapter-svnkit-1.6.13.jar
+ release.external/svnkit-javahl.jar=modules/ext/svnkit-javahl.jar
+ release.external/svnkit-1.3.4.jar=modules/ext/svnkit-1.3.4.jar
+-release.external/sqljet-1.0.3.jar=modules/ext/sqljet-1.0.3.jar
++#release.external/sqljet-1.0.3.jar=modules/ext/sqljet-1.0.3.jar
+ release.external/trilead.jar=modules/ext/trilead.jar
+ 
+ sigtest.gen.fail.on.error=false
diff --git a/debian/patches/netbeans~updatecenters.patch b/debian/patches/netbeans~updatecenters.patch
new file mode 100644
index 0000000..ee0a518
--- /dev/null
+++ b/debian/patches/netbeans~updatecenters.patch
@@ -0,0 +1,33 @@
+Disable the update centers.
+
+Index: netbeans-7.0.1+dfsg1/updatecenters/src/org/netbeans/modules/updatecenters/resources/mf-layer.xml
+===================================================================
+--- netbeans-7.0.1+dfsg1.orig/updatecenters/src/org/netbeans/modules/updatecenters/resources/mf-layer.xml	2011-07-28 20:47:06.000000000 +0100
++++ netbeans-7.0.1+dfsg1/updatecenters/src/org/netbeans/modules/updatecenters/resources/mf-layer.xml	2011-08-02 23:44:50.923331325 +0100
+@@ -55,7 +55,7 @@
+ 		<attr name="iconBase" stringvalue="org/netbeans/modules/updatecenters/resources/updateAction.gif"/>
+ 		<attr name="url" bundlevalue="org.netbeans.modules.updatecenters.resources.Bundle#URL_Distribution"/>
+ 		<attr name="category" stringvalue="STANDARD"/>
+-		<attr name="enabled" boolvalue="true"/>
++		<attr name="enabled" boolvalue="false"/>
+ 		<attr name="instanceOf" stringvalue="org.netbeans.spi.autoupdate.UpdateProvider"/>
+ 		<attr name="instanceCreate" methodvalue="org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogFactory.createUpdateProvider"/>
+ 	</file>
+@@ -64,7 +64,7 @@
+ 		<attr name="iconBase" stringvalue="org/netbeans/modules/updatecenters/resources/updateAction.gif"/>
+ 		<attr name="url" bundlevalue="org.netbeans.modules.updatecenters.resources.Bundle#URL_Certified"/>
+ 		<attr name="category" stringvalue="STANDARD"/>
+-		<attr name="enabled" boolvalue="true"/>
++		<attr name="enabled" boolvalue="false"/>
+ 		<attr name="instanceOf" stringvalue="org.netbeans.spi.autoupdate.UpdateProvider"/>
+ 		<attr name="instanceCreate" methodvalue="org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogFactory.createUpdateProvider"/>
+ 	</file>
+@@ -73,7 +73,7 @@
+ 		<attr name="iconBase" stringvalue="org/netbeans/modules/updatecenters/resources/updateAction.gif"/>
+ 		<attr name="url" bundlevalue="org.netbeans.modules.updatecenters.resources.Bundle#URL_PluginPortal"/>
+ 		<attr name="category" stringvalue="COMMUNITY"/>
+-		<attr name="enabled" boolvalue="true"/>
++		<attr name="enabled" boolvalue="false"/>
+ 		<attr name="instanceOf" stringvalue="org.netbeans.spi.autoupdate.UpdateProvider"/>
+ 		<attr name="instanceCreate" methodvalue="org.netbeans.modules.autoupdate.updateprovider.AutoupdateCatalogFactory.createUpdateProvider"/>
+ 	</file>
diff --git a/debian/patches/series b/debian/patches/series
index 5c4e325..4f9ce90 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,15 +1,19 @@
-netbeans-6.9~00-updatecenters.patch
-netbeans-6.9~10-o.apache.tools.ant.module.patch
-netbeans-6.9~30-build-xml.patch
-netbeans-6.9~40-ide-launcher.patch
-netbeans-6.9~41-log4j-classpath.patch
-netbeans-6.9~50-build-copy.patch
-netbeans-6.9~60-nosvnkit.patch
-netbeans-6.9~70-small-ide-cluster.patch
-netbeans-6.9~71-cluster-properties.patch
-netbeans-6.9~80-config.patch
-netbeans-6.9~90-junit-migration.patch
-netbeans-6.9~ini4j-0.5.2-SNAPSHOT.patch
-netbeans-6.9~original-svnclientadapter.patch
-netbeans-6.9~servlet-api-2.5.patch
-netbeans-6.9~autogenerated-changes.patch
+netbeans~empty-binaries-list.patch
+netbeans-platform~launcher.patch
+netbeans-platform~nojnabinaries.patch
+netbeans-platform~windowslauncher.patch
+netbeans-platform~include-extras.patch
+netbeans-platform~nbi.patch
+netbeans-platform~properties.patch
+netbeans~nocopy.patch
+netbeans~no-rhino.patch
+netbeans~svnclient.patch
+netbeans~o.a.tools.ant.patch
+netbeans~no-test-clean.patch
+netbeans~ide-launcher.patch
+netbeans~updatecenters.patch
+netbeans~build.patch
+netbeans~cluster-properties.patch
+netbeans~small-ide.patch
+netbeans~old-java.source-module.patch
+netbeans~old-java-modules.patch
diff --git a/debian/pom/openide-modules.xml b/debian/pom/openide-modules.xml
new file mode 100644
index 0000000..40c598d
--- /dev/null
+++ b/debian/pom/openide-modules.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 
+	 xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.netbeans.api</groupId>
+  <artifactId>org-openide-modules</artifactId>
+  <version>7.0</version>
+  <dependencies>
+    <dependency>
+      <groupId>org.netbeans.api</groupId>
+      <artifactId>org-openide-util</artifactId>
+      <version>7.0</version>
+    </dependency>
+    <dependency>
+      <groupId>org.netbeans.api</groupId>
+      <artifactId>org-openide-util-lookup</artifactId>
+      <version>7.0</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/debian/pom/openide-util-lookup.xml b/debian/pom/openide-util-lookup.xml
new file mode 100644
index 0000000..2c5db14
--- /dev/null
+++ b/debian/pom/openide-util-lookup.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 
+	 xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.netbeans.api</groupId>
+  <artifactId>org-openide-util-lookup</artifactId>
+  <version>7.0</version>
+</project>
diff --git a/debian/pom/openide-util.xml b/debian/pom/openide-util.xml
new file mode 100644
index 0000000..ab842c2
--- /dev/null
+++ b/debian/pom/openide-util.xml
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" 
+	 xmlns="http://maven.apache.org/POM/4.0.0" 
+	 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.netbeans.api</groupId>
+  <artifactId>org-openide-util</artifactId>
+  <version>7.0</version>
+  <dependencies>
+    <dependency>
+      <groupId>org.netbeans.api</groupId>
+      <artifactId>org-openide-util-lookup</artifactId>
+      <version>7.0</version>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/debian/rules b/debian/rules
index 5808be2..9fbbb9e 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,37 +3,41 @@
 export JAVA_HOME=/usr/lib/jvm/default-java
 
 #package names
-pkg-nb                         := netbeans
+pkg-platform			:= platform13
+pkg-lib-platform		:= libnb-$(pkg-platform)
+libnb-platform-java		:= $(pkg-lib-platform)-java
+libnb-platform-java-doc 	:= $(pkg-lib-platform)-java-doc
+libnb-platform-devel-java	:= libnb-platform-devel-java
 
+# TODO - update to latest versions
+pkg-nb                         := netbeans
 base-apisupport                := apisupport2
 base-ide                       := ide13
 base-java                      := java4
-base-nb                        := nb6.9
-base-platform                  := platform12
+base-nb                        := nb
+base-platform                  := platform13
 
 pkg-apisupport                 := libnb-$(base-apisupport)-java
 pkg-ide                        := libnb-$(base-ide)-java
 pkg-java                       := libnb-$(base-java)-java
 
+
 NBDIR          := /usr/share/netbeans
-JAVADIR        := /usr/share/java
-
-JHALL_JAR      := jhall.jar
-JSEARCH_JAR    := jsearch.jar
-JH_JAR         := jh.jar
-SWINGL_JAR     := swing-layout.jar
-JAVAC_API_JAR  := javac-api.jar
-JAVAC_IMPL_JAR := javac-impl.jar
-
-NB_SWINGL_JAR  := swing-layout-1.0.4.jar
-NB_JSEARCH_JAR := jsearch-2.0_05.jar
-NB_JH_JAR      := jh-2.0_05.jar
-NB_JAVAC_API_JAR  := javac-api-nb-7.0-b07.jar
-NB_JAVAC_IMPL_JAR := javac-impl-nb-7.0-b07.jar
-NB_JSR223_JAR  := jsr223-api.jar
+export JAVADIR := /usr/share/java
+
+JH_JAR          := jhall.jar
+JSEARCH_JAR     := jsearch.jar
+NB_JH_JAR       := jhall-2.0_05.jar
+NB_JSEARCH_JAR  := jsearch-2.0_05.jar
+
+JAVADOC_INSTALL_DIR	:= usr/share/doc/$(libnb-platform-java-doc)/api
+JAVADOC_WEBSITE		:= http://bits.netbeans.org/7.0/javadoc
 
 NB_INSTALL_DIR := usr/share/netbeans
 
+EXT_JAR_LINK_DIR	:= $(NB_INSTALL_DIR)/$(pkg-platform)/modules/ext/
+LIB_DIR			:= $(NB_INSTALL_DIR)/$(pkg-platform)/lib/
+
 INSTALL        := dh_install -p
 LINK           := dh_link -p
 
@@ -41,7 +45,7 @@ NB_PLATFORM_BUILD_DIR := $(shell pwd)/nbbuild/netbeans/platform
 
 DEB_UPSTREAM_VERSION = $(shell dpkg-parsechangelog | \
 			       grep -e '^Version' | \
-                               perl -pi -e 's/^Version:\s+(.*)-\d+$$/$$1/')
+                               perl -pi -e 's/^Version:\s+(.*)\+dfsg\d+-\d+$$/$$1/')
 
 # Defined function to be used to create symlinks
 define symlink
@@ -52,80 +56,96 @@ endef
 %:
 	dh $@ --with javahelper
 
+#link:
+#	$(shell awk 'NF==4 {printf("echo ln -sf %s %s/%s;\n",$$1,$$2,$$4)}' debian/linked-jars)
+#	$(shell awk 'NF==4 {printf("echo ln -sf %s nbbuild/netbeans/%s/%s;\n",$$1,$$3,$$4)}' debian/linked-jars)
+
 override_dh_auto_build:
-	mkdir -p nbbuild/netbeans
-	ln -sf $(NBDIR)/$(base-platform) nbbuild/netbeans/platform
-	ln -sf $(NBDIR)/harness   nbbuild/netbeans/harness
 	mkdir -p nbbuild/external/xhtml1-dtds
-	ln -sf /usr/share/xml/xhtml/schema/dtd/1.0/xhtml* nbbuild/external/xhtml1-dtds/
+	ln -sf /usr/share/xml/xhtml/schema/dtd/1.0/xhtml* nbbuild/external/xhtml1-dtds
 	ln -sf /usr/share/xml/entities/xhtml/xhtml* nbbuild/external/xhtml1-dtds
-	$(call symlink, $(JAVADIR)/$(JSEARCH_JAR), apisupport.harness/external/$(NB_JSEARCH_JAR))
-	$(call symlink, $(JAVADIR)/$(JH_JAR), javahelp/external/$(NB_JH_JAR))
-	$(call symlink, $(JAVADIR)/$(SWINGL_JAR), o.jdesktop.layout/external/$(NB_SWINGL_JAR))
-	$(call symlink, $(JAVADIR)/$(JAVAC_API_JAR), libs.javacapi/external/$(NB_JAVAC_API_JAR))
-	$(call symlink, $(JAVADIR)/$(JAVAC_IMPL_JAR), libs.javacimpl/external/$(NB_JAVAC_IMPL_JAR))
-
-	$(call symlink, /usr/share/ant/lib, o.apache.tools.ant.module/external/lib)
-
-	mkdir -p nbbuild/netbeans/ide/modules/ext
-	ln -sf $(JAVADIR)/jsch.jar                      nbbuild/netbeans/ide/modules/ext/jsch-0.1.41.jar
-	ln -sf $(JAVADIR)/xml-commons-resolver-1.1.jar  nbbuild/netbeans/ide/modules/ext/resolver-1.2.jar
-	ln -sf $(JAVADIR)/ini4j.jar                     nbbuild/netbeans/ide/modules/ext/ini4j-0.5.2-SNAPSHOT.jar
-	ln -sf $(JAVADIR)/freemarker.jar                nbbuild/netbeans/ide/modules/ext/freemarker-2.3.8.jar
-	ln -sf $(JAVADIR)/svnClientAdapter.jar          nbbuild/netbeans/ide/modules/ext/svnClientAdapter-1.6.0.jar
-	ln -sf $(JAVADIR)/xercesImpl.jar                nbbuild/netbeans/ide/modules/ext/xerces-2.8.0.jar
-	ln -sf $(JAVADIR)/lucene-core.jar               nbbuild/netbeans/ide/modules/ext/lucene-core-2.4.1.jar
-	ln -sf $(JAVADIR)/commons-logging.jar           nbbuild/netbeans/ide/modules/ext/commons-logging-1.1.jar
-	ln -sf $(JAVADIR)/svn-javahl.jar                nbbuild/netbeans/ide/modules/ext/svnjavahl-1.6.0.jar
-	ln -sf $(JAVADIR)/commons-net.jar               nbbuild/netbeans/ide/modules/ext/commons-net-1.4.1.jar
-	ln -sf $(JAVADIR)/oro.jar                       nbbuild/netbeans/ide/modules/ext/jakarta-oro-2.0.8.jar
-	ln -sf $(JAVADIR)/jvyamlb.jar                   nbbuild/netbeans/ide/modules/ext/jvyamlb-0.2.3.jar
-	ln -sf $(JAVADIR)/jruby.jar                     nbbuild/netbeans/ide/modules/ext/bytelist-0.1.jar
-	ln -sf $(JAVADIR)/swingx.jar                    nbbuild/netbeans/ide/modules/ext/swingx-0.9.5.jar
-	ln -sf $(JAVADIR)/jzlib.jar                     nbbuild/netbeans/ide/modules/ext/jzlib-1.0.7.jar
-	ln -sf $(JAVADIR)/servlet-api-2.5.jar           nbbuild/netbeans/ide/modules/ext/servlet-api-2.5.jar
-
-	mkdir -p nbbuild/netbeans/java/modules/ext
-	ln -sf $(JAVADIR)/javac-api.jar                 nbbuild/netbeans/java/modules/ext/javac-api-nb-7.0-b07.jar
-	ln -sf $(JAVADIR)/javac-impl.jar                nbbuild/netbeans/java/modules/ext/javac-impl-nb-7.0-b07.jar
-	ln -sf $(JAVA_HOME)/jre/lib/rt.jar              nbbuild/netbeans/java/modules/ext/swing-worker-1.1.jar
-	ln -sf $(JAVADIR)/bsaf.jar                      nbbuild/netbeans/java/modules/ext/appframework-1.0.3.jar
-	ln -sf $(JAVADIR)/beansbinding.jar              nbbuild/netbeans/java/modules/ext/beansbinding-1.2.1.jar
-	ln -sf $(JAVADIR)/junit4.jar                    nbbuild/netbeans/java/modules/ext/junit-3.8.2.jar
-
-	cp LICENSE.txt ide.branding/release-toplevel/
-	
-	# Ensure certain directories exist in source tree
-	mkdir -p o.jdesktop.beansbinding/external
-	mkdir -p swingapp/external
-
-	ant \
+	# link the required jars
+	$(shell awk 'NF==4 {printf("ln -sf %s %s/%s;\n",$$1,$$2,$$4)}' debian/linked-jars)
+	######## Remove services and org/eclipse/* from equinox osgi.jar#####################
+	mkdir debian/jar_tmp;  cd debian/jar_tmp; \
+	jar -xf $(JAVADIR)/org.eclipse.osgi.jar; \
+	rm -rf META-INF/services org/eclipse; \
+	jar -cf ../../libs.osgi/external/osgi.core-4.2.jar ./*;
+	rm -rf debian/jar_tmp
+#TODO	$(call symlink, /usr/share/ant/lib, o.apache.tools.ant.module/external/lib)
+	################################################################
+	# Build the Windows launcher
+	cd o.n.bootstrap/launcher/windows && make .build-impl nbexec.exe
+	cd apisupport.harness/windows-launcher-src && make
+	################################################################
+	# Build the ide. DISPLAY must be unset to avoid build failures.
+	unset DISPLAY; ant \
 	-Dpermit.jdk6.builds=true \
 	-Dbuild.compiler.deprecation=false \
 	-Dbuild.compiler.debug=false \
-	-Dverify.checkout=false \
-	-Dnb.cluster.platform-is-built=true \
-	-Dnb.cluster.harness-is-built=true \
-	-Do.n.core.dir=$(NB_PLATFORM_BUILD_DIR) \
-	-Dcore.dir=$(NB_PLATFORM_BUILD_DIR) \
-	-Dcore.startup.dir=$(NB_PLATFORM_BUILD_DIR) \
-	-Dopenide.awt.dir=$(NB_PLATFORM_BUILD_DIR) \
-	-Dlibs.beans-binding.classpath=$(JAVADIR)/beansbinding.jar \
-	-Dlibs.swing-layout.classpath=$(JAVADIR)/$(SWINGL_JAR) \
 	-Dext.binaries.downloaded=true \
-	-Ddo-not-rebuild-clusters=true \
+	-Dverify.checkout=false \
 	-Dcluster.config=basic \
-	-d \
 	-f nbbuild/build.xml build-nozip
+	################################################################
+	# Build javadoc package
+	ant \
+	-Dbuild.compiler.deprecation=false \
+	-Dbuild.compiler.debug=false \
+	-Dverify.checkout=false \
+	-Dallmodules= \
+	-Dcluster.config=platform \
+	-Dconfig.javadoc.cluster=$(pkg-base) \
+	-Djavadoc.docs.org-netbeans-api-java=$(JAVADOC_WEBSITE)/org-netbeans-api-java/ \
+	-Djavadoc.docs.org-netbeans-modules-project-ant=$(JAVADOC_WEBSITE)/org-netbeans-modules-project-ant/ \
+	-Djavadoc.docs.org-netbeans-modules-projectapi=$(JAVADOC_WEBSITE)/org-netbeans-modules-projectapi/ \
+	-f nbbuild/build.xml build-javadoc
+
 
-	cd l10n && ant -v -f build.xml -Ddist.dir=../nbbuild/netbeans -Dnbms.dir="" -Dnbms.dist.dir="" build
 
 override_dh_auto_install:
+	# recreate links
+	$(shell awk 'NF==4 {printf("ln -sf %s nbbuild/netbeans/%s/%s;\n",$$1,$$3,$$4)}' debian/linked-jars)
+	# Install libraries
+	mh_installjar -plibnb-org-openide-util-java -l debian/pom/openide-util.xml \
+		nbbuild/netbeans/platform/lib/org-openide-util.jar
+	mh_installpom -plibnb-org-openide-util-java debian/pom/openide-util.xml
+	mh_installjar -plibnb-org-openide-util-lookup-java -l debian/pom/openide-util-lookup.xml \
+		nbbuild/netbeans/platform/lib/org-openide-util-lookup.jar
+	mh_installpom -plibnb-org-openide-util-lookup-java debian/pom/openide-util-lookup.xml
+	mh_installjar -plibnb-org-openide-modules-java -l debian/pom/openide-modules.xml \
+		nbbuild/netbeans/platform/lib/org-openide-modules.jar
+	mh_installpom -plibnb-org-openide-modules-java debian/pom/openide-modules.xml
+	#
+	# Install Platform
+	echo > nbbuild/netbeans/platform/.noautoupdate
+	echo > nbbuild/netbeans/platform/.lastModified
+	$(INSTALL)$(libnb-platform-java)   nbbuild/netbeans/platform/* $(NB_INSTALL_DIR)/$(pkg-platform)
+	$(INSTALL)$(libnb-platform-java)   nbbuild/netbeans/platform/.noautoupdate $(NB_INSTALL_DIR)/$(pkg-platform)
+	$(INSTALL)$(libnb-platform-java)   nbbuild/netbeans/platform/.lastModified $(NB_INSTALL_DIR)/$(pkg-platform)
+	$(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-util.jar        $(LIB_DIR)/org-openide-util.jar
+	$(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-util-lookup.jar $(LIB_DIR)/org-openide-util-lookup.jar
+	$(LINK)$(libnb-platform-java) $(JAVADIR)/org-openide-modules.jar     $(LIB_DIR)/org-openide-modules.jar
+	#
+	# Install devel package
+	rm -f nbbuild/netbeans/harness/antlib/$(NB_JSEARCH_JAR)
+	echo > nbbuild/netbeans/harness/.noautoupdate
+	echo > nbbuild/netbeans/harness/.lastModified
+	$(INSTALL)$(libnb-platform-devel-java)   nbbuild/netbeans/harness/* $(NB_INSTALL_DIR)/harness
+	$(INSTALL)$(libnb-platform-devel-java)   nbbuild/netbeans/harness/.noautoupdate $(NB_INSTALL_DIR)/harness
+	$(INSTALL)$(libnb-platform-devel-java)   nbbuild/netbeans/harness/.lastModified $(NB_INSTALL_DIR)/harness
+	# Install javadoc
+	rm -f nbbuild/build/javadoc/*.zip
+	$(INSTALL)$(libnb-platform-java-doc) nbbuild/build/javadoc/* $(JAVADOC_INSTALL_DIR)
+	#
+	#Fixing permissions
+	chmod 0755 debian/$(libnb-platform-devel-java)/$(NB_INSTALL_DIR)/harness/launchers/app.sh
+	#
 	# Install IDE package files
 	echo > nbbuild/netbeans/ide/.noautoupdate
 	echo > nbbuild/netbeans/ide/.lastModified
-	#all files are removed from lib because they are in dll formats
-	rm -rf nbbuild/netbeans/$(base-ide)/modules/lib
+#	#all files are removed from lib because they are in dll formats
+#	rm -rf nbbuild/netbeans/$(base-ide)/modules/lib
 	$(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/*               $(NB_INSTALL_DIR)/$(base-ide)
 	$(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/.noautoupdate   $(NB_INSTALL_DIR)/$(base-ide)
 	$(INSTALL)$(pkg-ide) nbbuild/netbeans/ide/.lastModified   $(NB_INSTALL_DIR)/$(base-ide)
@@ -133,89 +153,95 @@ override_dh_auto_install:
 	# Install Java package files
 	echo > nbbuild/netbeans/java/.noautoupdate
 	echo > nbbuild/netbeans/java/.lastModified
-	#all doc files are removed because they are in zip and jar formats
-	rm -rf nbbuild/netbeans/java/docs
+#	#all doc files are removed because they are in zip and jar formats
+#	rm -rf nbbuild/netbeans/java/docs
 	$(INSTALL)$(pkg-java) nbbuild/netbeans/java/*             $(NB_INSTALL_DIR)/$(base-java)
 	$(INSTALL)$(pkg-java) nbbuild/netbeans/java/.noautoupdate $(NB_INSTALL_DIR)/$(base-java)
 	$(INSTALL)$(pkg-java) nbbuild/netbeans/java/.lastModified $(NB_INSTALL_DIR)/$(base-java)
-	$(LINK)$(pkg-java)    usr/share/ant/bin 					$(NB_INSTALL_DIR)/$(base-java)/ant/bin
-	$(LINK)$(pkg-java)    usr/share/ant/etc 					$(NB_INSTALL_DIR)/$(base-java)/ant/etc
-	$(LINK)$(pkg-java)    usr/share/ant/lib 					$(NB_INSTALL_DIR)/$(base-java)/ant/lib
-
+	# Link in Ant libraries and binaries
+	-rmdir debian/libnb-java4-java/$(NB_INSTALL_DIR)/$(base-java)/ant/lib
+	$(LINK)$(pkg-java)    usr/share/ant/bin 	$(NB_INSTALL_DIR)/$(base-java)/ant/bin
+	$(LINK)$(pkg-java)    usr/share/ant/etc 	$(NB_INSTALL_DIR)/$(base-java)/ant/etc
+	$(LINK)$(pkg-java)    usr/share/ant/lib 	$(NB_INSTALL_DIR)/$(base-java)/ant/lib
+#
 	# Install API support package files
 	echo > nbbuild/netbeans/apisupport/.noautoupdate
 	echo > nbbuild/netbeans/apisupport/.lastModified
 	$(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/*              $(NB_INSTALL_DIR)/$(base-apisupport)
 	$(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/.noautoupdate  $(NB_INSTALL_DIR)/$(base-apisupport)
 	$(INSTALL)$(pkg-apisupport) nbbuild/netbeans/apisupport/.lastModified  $(NB_INSTALL_DIR)/$(base-apisupport)
-
-	# Install Netbeans package files
+#	# Install Netbeans package files
 	echo > nbbuild/netbeans/nb/.noautoupdate
-	$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/*                 $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
-	$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/.lastModified     $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
-	$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/.noautoupdate     $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
-	$(INSTALL)$(pkg-nb) nbbuild/netbeans/bin/*                        $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/bin
+	$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/*               $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
+	$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/.lastModified   $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
+	$(INSTALL)$(pkg-nb) nbbuild/netbeans/nb/.noautoupdate   $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb
+	$(INSTALL)$(pkg-nb) nbbuild/netbeans/bin/*              $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/bin
 	$(INSTALL)$(pkg-nb) nbbuild/netbeans/CREDITS.html                 usr/share/$(pkg-nb)
 	$(INSTALL)$(pkg-nb) nbbuild/netbeans/README.html                  usr/share/$(pkg-nb)
 	$(INSTALL)$(pkg-nb) nbbuild/netbeans/netbeans.css                 usr/share/$(pkg-nb)
-	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/$(base-platform)                    	$(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/platform
-	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/harness                      		$(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/harness
-	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/$(base-apisupport)           		$(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/apisupport
-	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/$(base-ide)                  		$(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/ide
-	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/$(base-java)                 		$(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/java
+	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/$(base-platform) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/platform
+	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/harness          $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/harness
+	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/$(base-apisupport) $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/apisupport
+	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/$(base-ide)        $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/ide
+	$(LINK)$(pkg-nb)    $(NB_INSTALL_DIR)/$(base-java)       $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/java
 
 	# Create file marker to avoid displaying license dialog at first IDE start
 	echo > debian/license_accepted
 	$(INSTALL)$(pkg-nb) debian/license_accepted $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb/var
-
 	# Install file productid used by autoupdate to report installation type
 	$(INSTALL)$(pkg-nb) debian/productid 	  $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/nb/config
-
+#
 	# Install netbeans.conf
 	$(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.conf etc
-	$(LINK)$(pkg-nb) etc/netbeans.conf 			  $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc/netbeans.conf
-
+	$(LINK)$(pkg-nb) etc/netbeans.conf 	$(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc/netbeans.conf
+#
 	# Install netbeans.clusters
 	$(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.clusters etc
-	$(LINK)$(pkg-nb) etc/netbeans.clusters 		  $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc/netbeans.clusters
-
-	# Save original version of netbeans.conf as postinst patches it
-	#cp nbbuild/netbeans/etc/netbeans.conf 	  nbbuild/netbeans/etc/netbeans.conf.orig
-	#$(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.conf.orig $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc
-
+	$(LINK)$(pkg-nb) etc/netbeans.clusters 	$(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc/netbeans.clusters
+#
+#	# Save original version of netbeans.conf as postinst patches it
+#	#cp nbbuild/netbeans/etc/netbeans.conf 	  nbbuild/netbeans/etc/netbeans.conf.orig
+#	#$(INSTALL)$(pkg-nb) nbbuild/netbeans/etc/netbeans.conf.orig $(NB_INSTALL_DIR)/$(DEB_UPSTREAM_VERSION)/etc
+#
 	# Install launcher
 	$(INSTALL)$(pkg-nb) nbbuild/netbeans/bin/netbeans usr/bin
-
 	# Install desktop file
 	$(INSTALL)$(pkg-nb) debian/netbeans.desktop usr/share/applications
 
+
 override_dh_auto_clean:
-	-rm -f stamp-build-$(pkg-nb)
-	-rm -f nbbuild/netbeans/platform
-	-rm -f nbbuild/netbeans/harness
-	-rm -f o.apache.tools.ant.module/external/lib
-	$(call symlink, $(JAVADIR)/$(JHALL_JAR), javahelp/external/$(NB_JH_JAR))
+	-rm -f *.cdbs-config_list
+	-rm -f stamp-build-$(libnb-platform-java)
+	-rm -f stamp-build-$(libnb-platform-devel-java)
+	-rm -f stamp-build-$(libnb-platform-java-doc)
+	$(call symlink, $(JAVADIR)/$(JH_JAR), javahelp/external/$(NB_JH_JAR))
+	$(call symlink, $(JAVADIR)/$(JSEARCH_JAR), apisupport.harness/external/$(NB_JSEARCH_JAR))
 	ant -Dpermit.jdk6.builds=true -f nbbuild/build.xml clean
-	-rm -f apisupport.harness/external/$(NB_JSEARCH_JAR)
-	-rm -f javahelp/external/$(NB_JH_JAR)
-	-rm -f o.jdesktop.layout/external/$(NB_SWINGL_JAR)
-	-rm -f libs.javacapi/external/$(NB_JAVAC_API_JAR)
-	-rm -f libs.javacimpl/external/$(NB_JAVAC_IMPL_JAR)
+	cd o.n.bootstrap/launcher/windows && make clean
+	cd apisupport.harness/windows-launcher-src && make clean
+	mh_clean
+# remove all the symlinks to jar files we created
+	find . -name "*.jar" -type l -execdir rm -f \{\} \;
+	-rm -f libs.osgi/external/osgi.core-4.2.jar
+	-rm -rf nbbuild/external/xhtml1-dtds
+	-rm -f  nbbuild/nbproject/private/scan-cache-standard.ser
+#	-rm -f  nbbuild/nbantext.jar
+	-rm -rf debian/jar_tmp
 	-rm -f debian/license_accepted
-	# this file is not deleted by ant clean though it should so delete it here
-	-rm -f schema2beans/anttask/s2banttask.jar
+	# these files are not deleted by ant clean though it should so delete here
 	-rm -f swingapp/src/org/netbeans/modules/swingapp/resources/CRUDShellApp.zip
 	-rm -f swingapp/src/org/netbeans/modules/swingapp/resources/BasicShellApp.zip
-	-rm -f nbbuild/nbproject/private/scan-cache-standard.ser
-	-rm -f nbbuild/nbproject/private/scan-cache-full.ser
-	-rm -f gsf.api/anttask/gsfanttask.jar
-	-rm -f ide.branding/release-toplevel/LICENSE.txt
-	-rm -f nbbuild/external/xhtml1-dtds/*
-	-rm -rf l10n/build
-	-rm -f l10n/l10nantext.jar
-	-rm -f nbbuild/nbantext.jar
-	-rm -rf o.jdesktop.beansbinding/external
-	-rm -rf swingapp/external
+# TODO - shouldn't have to do this
+#	-rm -rf */build
+#
+#	-rm -f stamp-build-$(pkg-nb)
+#	-rm -f nbbuild/netbeans/platform
+#	-rm -f nbbuild/netbeans/harness
+#	-rm -f o.apache.tools.ant.module/external/lib
 
 override_jh_depends:
-	# Skipping jh_depends run. See bug #610817.
+	# Skipping jh_depends run - since we use symlinks to /usr/share/java then 
+	# jh_depends gets it wrong.
+
+get-orig-source:
+	uscan --download-version $(subst +dfsg\d*,,$(DEB_UPSTREAM_VERSION)) --force-download
diff --git a/debian/watch b/debian/watch
index 93e7a3c..b637a15 100644
--- a/debian/watch
+++ b/debian/watch
@@ -1,2 +1,3 @@
 version=3
-http://netbeans.org/projects/installer/downloads/download/netbeans-6.9/netbeans-([\d\.]+)-\d+-base-src-linux\.tar\.%20gz debian uupdate
+opts=dversionmangle=s/\+dfsg\d*$//,downloadurlmangle=s/$/final\/zip/ \
+http://dlc.sun.com.edgesuite.net/netbeans/ ([0-9.]*)/ debian debian/orig-tar.sh


hooks/post-receive
-- 
netbeans packaging



More information about the pkg-java-commits mailing list