diff -u netbeans-6.5/debian/rules netbeans-6.5/debian/rules --- netbeans-6.5/debian/rules +++ netbeans-6.5/debian/rules @@ -58,7 +58,7 @@ ln -sf $(JAVADIR)/svnClientAdapter.jar $(DEB_SRCDIR)/nbbuild/netbeans/$(base-ide)/modules/ext/svnClientAdapter-1.4.0.jar ln -sf $(JAVADIR)/xercesImpl.jar $(DEB_SRCDIR)/nbbuild/netbeans/$(base-ide)/modules/ext/xerces-2.8.0.jar ln -sf $(JAVADIR)/lucene-core.jar $(DEB_SRCDIR)/nbbuild/netbeans/$(base-ide)/modules/ext/lucene-core-2.3.2.jar - ln -sf $(JAVADIR)/commons-logging.jar $(DEB_SRCDIR)/nbbuild/netbeans/$(base-ide)/modules/ext/commons-logging-1.0.4.jar + ln -sf $(JAVADIR)/commons-logging.jar $(DEB_SRCDIR)/nbbuild/netbeans/$(base-ide)/modules/ext/commons-logging-1.1.jar ln -sf $(JAVADIR)/svn-javahl.jar $(DEB_SRCDIR)/nbbuild/netbeans/$(base-ide)/modules/ext/svnjavahl-1.5.0.jar ln -sf $(JAVADIR)/commons-net.jar $(DEB_SRCDIR)/nbbuild/netbeans/$(base-ide)/modules/ext/commons-net-1.4.1.jar ln -sf $(JAVADIR)/oro.jar $(DEB_SRCDIR)/nbbuild/netbeans/$(base-ide)/modules/ext/jakarta-oro-2.0.8.jar diff -u netbeans-6.5/debian/changelog netbeans-6.5/debian/changelog --- netbeans-6.5/debian/changelog +++ netbeans-6.5/debian/changelog @@ -1,3 +1,13 @@ +netbeans (6.5-0ubuntu2) jaunty; urgency=low + + * Added patches for NetBeans IDE 6.5 (LP: #345562) + (contain bug fixes from NetBeans 6.5.1) + * 40-ide-launcher.patch is updated (LP: #307103) + * debian/rules file is corrected: commons-logging jar's version + is changed from 1.0.4 to 1.1. + + -- Yulia Novozhilova Tue, 31 Mar 2009 18:34:02 +0400 + netbeans (6.5-0ubuntu1) jaunty; urgency=low * New upstream release. (LP: #251173) diff -u netbeans-6.5/debian/patches/40-ide-launcher.patch netbeans-6.5/debian/patches/40-ide-launcher.patch --- netbeans-6.5/debian/patches/40-ide-launcher.patch +++ netbeans-6.5/debian/patches/40-ide-launcher.patch @@ -1,11 +1,31 @@ -diff -Nur -x '*.orig' -x '*~' netbeans-6.5/ide/launcher/unix/netbeans netbeans-6.5.new/ide/launcher/unix/netbeans ---- netbeans-6.5/ide/launcher/unix/netbeans 2008-11-10 00:13:12.000000000 +0300 -+++ netbeans-6.5.new/ide/launcher/unix/netbeans 2009-01-10 19:41:06.000000000 +0300 -@@ -54,16 +54,16 @@ +diff -Nur netbeans-ide-launcher/ide/launcher/unix/netbeans netbeans-ide-launcher.new/ide/launcher/unix/netbeans +--- netbeans-ide-launcher/ide/launcher/unix/netbeans 2008-06-30 17:47:50.000000000 +0400 ++++ netbeans-ide-launcher.new/ide/launcher/unix/netbeans 2008-10-22 15:58:13.000000000 +0400 +@@ -38,6 +38,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 + # +@@ -54,16 +65,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.5/bin if [ -f "$progdir"/../etc/netbeans.conf ] ; then @@ -19,6 +39,14 @@ -+ 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 "$@" +@@ -199,7 +212,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} \ + '"$@"' + ;; \ No newline at end of file only in patch2: unchanged: --- netbeans-6.5.orig/debian/patches/91-6.5.1-patches-1.patch +++ netbeans-6.5/debian/patches/91-6.5.1-patches-1.patch @@ -0,0 +1,4494 @@ +diff -r 76d51071af8a -r af9499d919b8 ant.freeform/manifest.mf +--- a/ant.freeform/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/ant.freeform/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,6 +1,6 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.ant.freeform/1 +-OpenIDE-Module-Specification-Version: 1.18.1 ++OpenIDE-Module-Specification-Version: 1.18.2 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ant/freeform/Bundle.properties + OpenIDE-Module-Layer: org/netbeans/modules/ant/freeform/resources/layer.xml + AutoUpdate-Show-In-Client: false +diff -r 76d51071af8a -r af9499d919b8 ant.freeform/nbproject/project.xml +--- a/ant.freeform/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/ant.freeform/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -134,7 +134,9 @@ + org.openide.loaders + + +- ++ ++ 7.2.2 ++ + + + org.openide.nodes +diff -r 76d51071af8a -r af9499d919b8 ant.freeform/src/org/netbeans/modules/ant/freeform/ui/FolderNodeFactory.java +--- a/ant.freeform/src/org/netbeans/modules/ant/freeform/ui/FolderNodeFactory.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/ant.freeform/src/org/netbeans/modules/ant/freeform/ui/FolderNodeFactory.java Tue Mar 10 13:53:55 2009 +0300 +@@ -75,6 +75,7 @@ + import org.openide.filesystems.FileObject; + import org.openide.filesystems.FileUtil; + import org.openide.loaders.ChangeableDataFilter; ++import org.openide.loaders.DataFilter; + import org.openide.loaders.DataFolder; + import org.openide.loaders.DataObject; + import org.openide.loaders.DataObjectNotFoundException; +@@ -88,7 +89,6 @@ + import org.openide.util.ImageUtilities; + import org.openide.util.Lookup; + import org.openide.util.RequestProcessor; +-import org.openide.util.Utilities; + import org.openide.util.actions.SystemAction; + import org.openide.util.lookup.Lookups; + import org.w3c.dom.Element; +@@ -260,20 +260,19 @@ + } + + +- static final class VisibilityQueryDataFilter implements ChangeListener, ChangeableDataFilter { ++ private static final class GroupDataFilter implements ChangeListener, ChangeableDataFilter, DataFilter.FileBased { + + private final ChangeSupport cs = new ChangeSupport(this); + private final FileObject root; + private final PathMatcher matcher; + +- public VisibilityQueryDataFilter(FileObject root, String includes, String excludes) { ++ public GroupDataFilter(FileObject root, String includes, String excludes) { + this.root = root; + matcher = new PathMatcher(includes, excludes, FileUtil.toFile(root)); + VisibilityQuery.getDefault().addChangeListener( this ); + } + +- public boolean acceptDataObject(DataObject obj) { +- FileObject fo = obj.getPrimaryFile(); ++ public boolean acceptFileObject(FileObject fo) { + String path = FileUtil.getRelativePath(root, fo); + assert path != null : fo + " not in " + root; //NOI18N + if (fo.isFolder()) { +@@ -296,6 +295,10 @@ + public void removeChangeListener( ChangeListener listener ) { + cs.removeChangeListener(listener); + } ++ ++ public boolean acceptDataObject(DataObject d) { ++ return acceptFileObject(d.getPrimaryFile()); ++ } + + } + +@@ -312,7 +315,7 @@ + } + + public ViewItemNode(DataFolder folder, String includes, String excludes, String name, String displayName) { +- super(folder.getNodeDelegate(), folder.createNodeChildren(new VisibilityQueryDataFilter(folder.getPrimaryFile(), includes, excludes))); ++ super(folder.getNodeDelegate(), folder.createNodeChildren(new GroupDataFilter(folder.getPrimaryFile(), includes, excludes))); + this.name = name; + this.displayName = displayName; + } +diff -r 76d51071af8a -r af9499d919b8 ant.kit/manifest.mf +--- a/ant.kit/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/ant.kit/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,5 +2,5 @@ + OpenIDE-Module: org.netbeans.modules.ant.kit + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ant/kit/Bundle.properties + OpenIDE-Module-Requires: BuildActions +-OpenIDE-Module-Specification-Version: 1.2.1 ++OpenIDE-Module-Specification-Version: 1.2.3 + +diff -r 76d51071af8a -r af9499d919b8 ant.kit/nbproject/project.xml +--- a/ant.kit/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/ant.kit/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -9,7 +9,7 @@ + org.apache.tools.ant.module + + 3 +- 3.27 ++ 3.32.2 + + + +@@ -29,7 +29,7 @@ + org.netbeans.modules.ant.freeform + + 1 +- 1.15 ++ 1.18.2 + + + +diff -r 76d51071af8a -r af9499d919b8 ant.kit/src/org/netbeans/modules/ant/kit/Bundle.properties +--- a/ant.kit/src/org/netbeans/modules/ant/kit/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/ant.kit/src/org/netbeans/modules/ant/kit/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,8 @@ + OpenIDE-Module-Display-Category=Java + OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
\ ++
\ + Provides basic integration for the Apache Ant build tool in the IDE. \ + Includes support for editing Ant scripts and running targets. \ + Provides infrastructure for free-form Ant-based projects, and some special tasks used by Ant-based Java projects of several kinds. +diff -r 76d51071af8a -r af9499d919b8 api.java.classpath/manifest.mf +--- a/api.java.classpath/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/api.java.classpath/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.api.java.classpath/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/api/java/classpath/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.18.1 ++OpenIDE-Module-Specification-Version: 1.18.2 + +diff -r 76d51071af8a -r af9499d919b8 api.java.classpath/src/org/netbeans/api/java/classpath/ClassPath.java +--- a/api.java.classpath/src/org/netbeans/api/java/classpath/ClassPath.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/api.java.classpath/src/org/netbeans/api/java/classpath/ClassPath.java Tue Mar 10 13:53:55 2009 +0300 +@@ -57,6 +57,7 @@ + import java.util.Arrays; + import java.util.Collection; + import java.util.Collections; ++import java.util.HashMap; + import java.util.HashSet; + import java.util.List; + import java.util.Map; +@@ -292,23 +293,27 @@ + current = this.invalidEntries; + } + List resources = impl.getResources(); ++ final List snapshot = new ArrayList(); ++ for (PathResourceImplementation pr : resources) { ++ snapshot.add(new Object[] {pr, pr.getRoots()}); ++ } + List result; + synchronized (this) { + if (this.invalidEntries == current) { + if (this.entriesCache == null) { +- this.entriesCache = createEntries (resources); ++ this.entriesCache = createEntries (snapshot); + } + result = this.entriesCache; + } + else { +- result = createEntries (resources); ++ result = createEntries (snapshot); + } + } + assert result != null; + return result; + } + +- private List createEntries (final List resources) { ++ private List createEntries (final List resources) { + //The ClassPathImplementation.getResources () should never return + // null but it was not explicitly stated in the javadoc + if (resources == null) { +@@ -316,10 +321,12 @@ + } + else { + List cache = new ArrayList (); +- for (PathResourceImplementation pr : resources) { ++ for (Object[] pair : resources) { ++ PathResourceImplementation pr = (PathResourceImplementation) pair[0]; ++ URL[] roots = (URL[]) pair[1]; + pr.removePropertyChangeListener(weakPListener); + pr.addPropertyChangeListener(weakPListener = WeakListeners.propertyChange(pListener, pr)); +- for (URL root : pr.getRoots()) { ++ for (URL root : roots) { + cache.add(new Entry(root, + pr instanceof FilteringPathResourceImplementation ? (FilteringPathResourceImplementation) pr : null)); + } +diff -r 76d51071af8a -r af9499d919b8 autoupdate.services/manifest.mf +--- a/autoupdate.services/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/autoupdate.services/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,6 +1,6 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.autoupdate.services + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/autoupdate/services/resources/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.5.1 ++OpenIDE-Module-Specification-Version: 1.5.2 + AutoUpdate-Show-In-Client: false + AutoUpdate-Essential-Module: true +diff -r 76d51071af8a -r af9499d919b8 autoupdate.services/src/org/netbeans/modules/autoupdate/services/InstallSupportImpl.java +--- a/autoupdate.services/src/org/netbeans/modules/autoupdate/services/InstallSupportImpl.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/autoupdate.services/src/org/netbeans/modules/autoupdate/services/InstallSupportImpl.java Tue Mar 10 13:53:55 2009 +0300 +@@ -312,6 +312,7 @@ + boolean needsRestart = false; + JarEntry updaterJarEntry = null; + JarFile updaterJarFile = null; ++ File updaterTargetCluster = null; + File targetCluster = null; + for (ModuleUpdateElementImpl moduleImpl : affectedModuleImpls) { + synchronized(this) { +@@ -348,6 +349,7 @@ + err.log (Level.FINE, ModuleUpdater.AUTOUPDATE_UPDATER_JAR_PATH + " is being installed from " + moduleImpl.getCodeName ()); + updaterJarEntry = entry; + updaterJarFile = jf; ++ updaterTargetCluster = targetCluster; + needsRestart = true; + break; + } +@@ -366,7 +368,7 @@ + // store source of installed files + Utilities.writeAdditionalInformation (getElement2Clusters ()); + if (updaterJarFile != null) { +- Utilities.writeUpdateOfUpdaterJar (updaterJarEntry, updaterJarFile, targetCluster); ++ Utilities.writeUpdateOfUpdaterJar (updaterJarEntry, updaterJarFile, updaterTargetCluster); + } + + if (! needsRestart) { +diff -r 76d51071af8a -r af9499d919b8 autoupdate.services/src/org/netbeans/modules/autoupdate/services/Utilities.java +--- a/autoupdate.services/src/org/netbeans/modules/autoupdate/services/Utilities.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/autoupdate.services/src/org/netbeans/modules/autoupdate/services/Utilities.java Tue Mar 10 13:53:55 2009 +0300 +@@ -83,6 +83,7 @@ + import org.netbeans.api.autoupdate.UpdateUnit; + import org.netbeans.core.startup.Main; + import org.netbeans.core.startup.TopLogging; ++import org.netbeans.modules.autoupdate.updateprovider.DummyModuleInfo; + import org.netbeans.spi.autoupdate.KeyStoreProvider; + import org.netbeans.spi.autoupdate.UpdateItem; + import org.netbeans.updater.ModuleDeactivator; +@@ -657,27 +658,36 @@ + matched = DependencyChecker.checkDependencyModule (dep, ((ModuleUpdateElementImpl) reqElImpl).getModuleInfo ()); + } + if (! matched) { +- UpdateElement reqEl = u.getAvailableUpdates ().isEmpty () ? null : u.getAvailableUpdates ().get (0); +- if (reqEl == null) { +- for (ModuleInfo m : availableInfos) { +- if (DependencyChecker.checkDependencyModule (dep, m)) { +- matched = true; +- break; ++ // first chance ++ for (ModuleInfo m : availableInfos) { ++ if (DependencyChecker.checkDependencyModule (dep, m)) { ++ matched = true; ++ break; ++ } ++ } ++ if (! matched) { ++ UpdateElement reqEl = u.getAvailableUpdates ().isEmpty () ? null : u.getAvailableUpdates ().get (0); ++ if (reqEl == null) { ++ for (ModuleInfo m : availableInfos) { ++ if (DependencyChecker.checkDependencyModule (dep, m)) { ++ matched = true; ++ break; ++ } + } +- } +- if (! matched) { +- brokenDependencies.add (dep); +- } +- } else { +- UpdateElementImpl reqElImpl = Trampoline.API.impl (reqEl); +- ModuleUpdateElementImpl reqModuleImpl = (ModuleUpdateElementImpl) reqElImpl; +- ModuleInfo info = reqModuleImpl.getModuleInfo (); +- if (DependencyChecker.checkDependencyModule (dep, info)) { +- if (! availableInfos.contains (info)) { +- requested = reqEl; ++ if (! matched) { ++ brokenDependencies.add (dep); + } + } else { +- brokenDependencies.add (dep); ++ UpdateElementImpl reqElImpl = Trampoline.API.impl (reqEl); ++ ModuleUpdateElementImpl reqModuleImpl = (ModuleUpdateElementImpl) reqElImpl; ++ ModuleInfo info = reqModuleImpl.getModuleInfo (); ++ if (DependencyChecker.checkDependencyModule (dep, info)) { ++ if (! availableInfos.contains (info)) { ++ requested = reqEl; ++ } ++ } else { ++ brokenDependencies.add (dep); ++ } + } + } + } +@@ -686,6 +696,11 @@ + case Dependency.TYPE_REQUIRES : + case Dependency.TYPE_NEEDS : + case Dependency.TYPE_RECOMMENDS : ++ if (DummyModuleInfo.TOKEN_MODULE_FORMAT1.equals (dep.getName ()) || ++ DummyModuleInfo.TOKEN_MODULE_FORMAT2.equals (dep.getName ())) { ++ // these tokens you can ignore here ++ break; ++ } + UpdateUnit p = DependencyAggregator.getRequested (dep); + boolean passed = false; + if (p == null) { +diff -r 76d51071af8a -r af9499d919b8 autoupdate.services/src/org/netbeans/modules/autoupdate/services/resources/Bundle.properties +--- a/autoupdate.services/src/org/netbeans/modules/autoupdate/services/resources/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/autoupdate.services/src/org/netbeans/modules/autoupdate/services/resources/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,8 @@ + OpenIDE-Module-Display-Category=Infrastructure + OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
\ ++
\ + The AutoUpdate feature provides several services: download and install available updates of installed modules, search and install new modules from subscribed Update Centers, view and manage the modules. + OpenIDE-Module-Name=Auto Update Services + OpenIDE-Module-Short-Description=Support for searching for module updates on Update Center and for downloading and installing modules +diff -r 76d51071af8a -r af9499d919b8 autoupdate.services/src/org/netbeans/modules/autoupdate/updateprovider/AutoupdateCatalogCache.java +--- a/autoupdate.services/src/org/netbeans/modules/autoupdate/updateprovider/AutoupdateCatalogCache.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/autoupdate.services/src/org/netbeans/modules/autoupdate/updateprovider/AutoupdateCatalogCache.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + /* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * +- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. ++ * 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 +@@ -24,7 +24,7 @@ + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original +- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun ++ * 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 +@@ -151,8 +151,12 @@ + NetworkAccess.NetworkListener nwl = new NetworkAccess.NetworkListener () { + + public void streamOpened (InputStream stream) { +- err.log (Level.FINE, "Successfully read URI " + sourceUrl); +- doCopy (sourceUrl, stream, cache, temp); ++ err.log (Level.FINE, "Successfully started reading URI " + sourceUrl); ++ try { ++ doCopy (sourceUrl, stream, cache, temp); ++ } catch (IOException ex) { ++ storeException (ex); ++ } + } + + public void accessCanceled () { +@@ -197,7 +201,7 @@ + return storedException; + } + +- private void doCopy (URL sourceUrl, InputStream is, File cache, File temp) { ++ private void doCopy (URL sourceUrl, InputStream is, File cache, File temp) throws IOException { + + OutputStream os = null; + int read = 0; +@@ -206,28 +210,32 @@ + os = new BufferedOutputStream(new FileOutputStream (temp)); + while ((read = is.read ()) != -1) { + os.write (read); +- } ++ } ++ is.close (); ++ os.flush (); ++ os.close (); ++ synchronized (this) { ++ if (cache.exists () && ! cache.delete ()) { ++ err.log (Level.INFO, "Cannot delete cache " + cache); ++ try { ++ Thread.sleep(200); ++ } catch (InterruptedException ie) { ++ assert false : ie; ++ } ++ cache.delete(); ++ } ++ } ++ if (! temp.renameTo (cache)) { ++ err.log (Level.INFO, "Cannot rename temp " + temp + " to cache " + cache); ++ } + } catch (IOException ioe) { + err.log (Level.INFO, "Writing content of URL " + sourceUrl + " failed.", ioe); ++ throw ioe; + } finally { + try { + if (is != null) is.close (); + if (os != null) os.flush (); + if (os != null) os.close (); +- synchronized (this) { +- if (cache.exists () && ! cache.delete ()) { +- err.log (Level.INFO, "Cannot delete cache " + cache); +- try { +- Thread.sleep(200); +- } catch (InterruptedException ie) { +- assert false : ie; +- } +- cache.delete(); +- } +- if (! temp.renameTo (cache)) { +- err.log (Level.INFO, "Cannot rename temp " + temp + " to cache " + cache); +- } +- } + } catch (IOException ioe) { + err.log (Level.INFO, "Closing streams failed.", ioe); + } +diff -r 76d51071af8a -r af9499d919b8 core.kit/manifest.mf +--- a/core.kit/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.kit/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.core.kit + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/core/kit/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.2.1 ++OpenIDE-Module-Specification-Version: 1.2.4 + AutoUpdate-Essential-Module: true +diff -r 76d51071af8a -r af9499d919b8 core.kit/nbproject/project.xml +--- a/core.kit/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.kit/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -9,7 +9,7 @@ + org.netbeans.core + + 2 +- 3.6 ++ 3.10.4 + +
+ +@@ -23,7 +23,7 @@ + org.netbeans.core.windows + + 2 +- 2.10 ++ 2.12.3 + + + +@@ -42,21 +42,21 @@ + org.netbeans.modules.favorites + + 1 +- 1.12 ++ 1.14.3 + + + + org.netbeans.modules.masterfs + + 2 +- 1.11 ++ 2.15.2 + + + + org.netbeans.modules.options.api + + 1 +- 1.5 ++ 1.10.2 + + + +@@ -77,6 +77,36 @@ + 1.6 +
+ ++ ++ org.openide.explorer ++ ++ ++ ++ 6.16.3 ++ ++ ++ ++ org.openide.loaders ++ ++ ++ ++ 7.2.3 ++ ++ ++ ++ org.openide.nodes ++ ++ ++ ++ 7.7.3 ++ ++ ++ ++ org.openide.text ++ ++ 6.21.2 ++ ++ + + + +diff -r 76d51071af8a -r af9499d919b8 core.kit/src/org/netbeans/modules/core/kit/Bundle.properties +--- a/core.kit/src/org/netbeans/modules/core/kit/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.kit/src/org/netbeans/modules/core/kit/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -2,5 +2,8 @@ + OpenIDE-Module-Name=Platform + OpenIDE-Module-Short-Description=NetBeans Platform + OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
\ ++
\ + The NetBeans Platform is a generic framework for Swing applications. It provides the services common to almost all large desktop applications: window management, menus, settings and storage, update management, file access, etc.

\ + See more information at platform.netbeans.org. +diff -r 76d51071af8a -r af9499d919b8 core.nativeaccess/manifest.mf +--- a/core.nativeaccess/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.nativeaccess/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + Manifest-Version: 1.0 + AutoUpdate-Show-In-Client: false + OpenIDE-Module: org.netbeans.core.nativeaccess/1 +-OpenIDE-Module-Specification-Version: 1.1.1 ++OpenIDE-Module-Specification-Version: 1.1.2 + OpenIDE-Module-Localizing-Bundle: org/netbeans/core/nativeaccess/Bundle.properties + OpenIDE-Module-Provides: org.netbeans.core.windows.nativeaccess.NativeWindowSystem + +diff -r 76d51071af8a -r af9499d919b8 core.nativeaccess/nbproject/project.xml +--- a/core.nativeaccess/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.nativeaccess/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -20,7 +20,7 @@ + + + 1 +- 1.0 ++ 1.1.2 + + + +diff -r 76d51071af8a -r af9499d919b8 core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java +--- a/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.nativeaccess/src/org/netbeans/core/nativeaccess/NativeWindowSystemImpl.java Tue Mar 10 13:53:55 2009 +0300 +@@ -46,7 +46,6 @@ + import javax.swing.Icon; + import org.netbeans.core.windows.nativeaccess.NativeWindowSystem; + import org.netbeans.core.nativeaccess.transparency.WindowUtils; +-import org.openide.util.Utilities; + + + /** +@@ -61,11 +60,7 @@ + public boolean isWindowAlphaSupported() { + boolean res = false; + try { +- String osArch = System.getProperty("os.arch"); +- // jna currently doesn't work on 64 bit java on Win, this check should +- // be deleted when https://jna.dev.java.net/issues/show_bug.cgi?id=59 is implemented +- boolean isWin64 = Utilities.isWindows() && osArch != null && osArch.indexOf("amd64") != -1; +- res = WindowUtils.isWindowAlphaSupported() && !isWin64; ++ res = WindowUtils.isWindowAlphaSupported(); + } catch( ThreadDeath td ) { + throw td; + } catch (UnsatisfiedLinkError e) { +diff -r 76d51071af8a -r af9499d919b8 core.windows/nbproject/project.properties +--- a/core.windows/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.windows/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,7 +39,7 @@ + + javac.compilerargs=-Xlint:unchecked + javac.source=1.5 +-spec.version.base=2.12.1 ++spec.version.base=2.12.3 + + + test.config.commit.includes=**/Validate*Test.class +diff -r 76d51071af8a -r af9499d919b8 core.windows/src/org/netbeans/core/windows/Central.java +--- a/core.windows/src/org/netbeans/core/windows/Central.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.windows/src/org/netbeans/core/windows/Central.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1998,7 +1998,8 @@ + for( ModeImpl m : getModes() ) { + if( m.getKind() == Constants.MODE_KIND_EDITOR + && !"editor".equals(m.getName()) //NOI18N +- && !m.getOpenedTopComponentsIDs().isEmpty() ) ++ && !m.getOpenedTopComponentsIDs().isEmpty() ++ && !m.isPermanent() ) + return m; + } + return null; +diff -r 76d51071af8a -r af9499d919b8 core.windows/src/org/netbeans/core/windows/view/ui/Bundle.properties +--- a/core.windows/src/org/netbeans/core/windows/view/ui/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.windows/src/org/netbeans/core/windows/view/ui/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -46,8 +46,8 @@ + # {0} build number + # {1} project name + # {2} name of main project +-CTL_MainWindow_Title=NetBeans Platform 6.5 +-CTL_MainWindow_Title_No_Project=NetBeans Platform 6.5 ++CTL_MainWindow_Title=NetBeans Platform 6.5.1 ++CTL_MainWindow_Title_No_Project=NetBeans Platform 6.5.1 + + # DocumentsDlg + LBL_Documents=&Documents: +diff -r 76d51071af8a -r af9499d919b8 core.windows/src/org/netbeans/core/windows/view/ui/KeyboardPopupSwitcher.java +--- a/core.windows/src/org/netbeans/core/windows/view/ui/KeyboardPopupSwitcher.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.windows/src/org/netbeans/core/windows/view/ui/KeyboardPopupSwitcher.java Tue Mar 10 13:53:55 2009 +0300 +@@ -60,6 +60,7 @@ + import org.netbeans.swing.popupswitcher.SwitcherTableItem; + import org.openide.awt.StatusDisplayer; + import org.openide.util.Utilities; ++import org.openide.windows.Mode; + import org.openide.windows.WindowManager; + + /** +@@ -137,6 +138,13 @@ + return false; + } + ++ if( Boolean.getBoolean("netbeans.winsys.ctrltab.editoronly") ) { //NOI18N ++ Mode activeMode = wmi.getActiveMode(); ++ if( !wmi.isEditorMode(activeMode) ) ++ return false; ++ } ++ ++ + boolean isCtrlTab = kev.getKeyCode() == KeyEvent.VK_TAB && + kev.getModifiers() == InputEvent.CTRL_MASK; + boolean isCtrlShiftTab = kev.getKeyCode() == KeyEvent.VK_TAB && +diff -r 76d51071af8a -r af9499d919b8 core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java +--- a/core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/core.windows/src/org/netbeans/core/windows/view/ui/MainWindow.java Tue Mar 10 13:53:55 2009 +0300 +@@ -459,20 +459,6 @@ + } + } + +- /** +- * don't allow smaller bounds than the one constructed from preffered sizes, making sure everything is visible when +- * in SDI. #40063 +- */ +- public void setBounds(Rectangle rect) { +- Rectangle bounds = rect; +- if (bounds != null) { +- if (bounds.height < getPreferredSize().height) { +- bounds = new Rectangle(bounds.x, bounds.y, bounds.width, getPreferredSize().height); +- } +- } +- super.setBounds(bounds); +- } +- + /** Prepares main window, has to be called after {@link initializeComponents()}. */ + public void prepareWindow() { + initializeBounds(); +diff -r 76d51071af8a -r af9499d919b8 db.core/manifest.mf +--- a/db.core/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.core/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,6 +1,6 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.db.core +-OpenIDE-Module-Specification-Version: 1.7.1 ++OpenIDE-Module-Specification-Version: 1.7.3 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/core/Bundle.properties + OpenIDE-Module-Layer: org/netbeans/modules/db/core/resources/layer.xml + OpenIDE-Module-Requires: org.openide.windows.IOProvider +diff -r 76d51071af8a -r af9499d919b8 db.core/src/org/netbeans/modules/db/sql/execute/ui/SQLHistoryPanel.form +--- a/db.core/src/org/netbeans/modules/db/sql/execute/ui/SQLHistoryPanel.form Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.core/src/org/netbeans/modules/db/sql/execute/ui/SQLHistoryPanel.form Tue Mar 10 13:53:55 2009 +0300 +@@ -65,7 +65,7 @@ + + + +- ++ + + + +diff -r 76d51071af8a -r af9499d919b8 db.core/src/org/netbeans/modules/db/sql/execute/ui/SQLHistoryPanel.java +--- a/db.core/src/org/netbeans/modules/db/sql/execute/ui/SQLHistoryPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.core/src/org/netbeans/modules/db/sql/execute/ui/SQLHistoryPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -83,6 +83,7 @@ + import javax.swing.text.BadLocationException; + import javax.swing.text.Caret; + import javax.swing.text.Document; ++import org.netbeans.api.editor.EditorRegistry; + import org.netbeans.modules.db.sql.history.SQLHistory; + import org.netbeans.modules.db.sql.history.SQLHistoryException; + import org.netbeans.modules.db.sql.history.SQLHistoryModel; +@@ -326,7 +327,7 @@ + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(insertSQLButton) + .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() +- .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 168, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) ++ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 168, Short.MAX_VALUE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(sqlLimitTextField, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) +@@ -359,20 +360,26 @@ + + + private void insertSQL() { +- int rowSelected = sqlHistoryTable.getSelectedRow(); + try { + // Make sure to insert the entire SQL, not just what appears in the Table + List sqlHistoryList = view.getCurrentSQLHistoryList(); + int i = 0; + String sqlToInsert = ""; // NOI18N ++ InsertSQLUtility insertUtility = new InsertSQLUtility(); + for (SQLHistory sqlHistory : sqlHistoryList) { +- if (rowSelected == i) { ++ if (sqlHistoryTable.isRowSelected(i)) { + sqlToInsert = sqlHistory.getSql().trim(); ++ JEditorPane pane = (JEditorPane)EditorRegistry.lastFocusedComponent(); ++ String mime = pane.getContentType(); ++ if (mime.equals("text/x-sql")) { // NOI18N ++ editorPane = pane; ++ } ++ insertUtility.insert(sqlToInsert, editorPane); + } + // increment for the next row + i++; + } +- new InsertSQLUtility().insert(sqlToInsert, editorPane); ++ + } catch (BadLocationException ex) { + Exceptions.printStackTrace(ex); + } +@@ -446,9 +453,11 @@ + } + + private void handleSQLHistoryException() { +- inputWarningLabel.setText(NbBundle.getMessage(SQLHistoryPanel.class, "LBL_ErrorParsingSQLHistory")); + LOGGER.log(Level.WARNING, NbBundle.getMessage(SQLHistoryPanel.class, "LBL_ErrorParsingSQLHistory")); +- SQLHistoryPersistenceManager.getInstance().removeHistoryFile(historyRoot); ++ List sqlHistoryList = SQLHistoryPersistenceManager.getInstance().retrieve(); ++ view.setCurrentSQLHistoryList(sqlHistoryList); ++ ((HistoryTableModel) sqlHistoryTable.getModel()).refreshTable(null, sqlHistoryList); ++ view.updateConnectionUrl(); + } + + // Variables declaration - do not modify//GEN-BEGIN:variables +@@ -481,7 +490,9 @@ + this.sqlHistoryList = model.getSQLHistoryList(); + this.currentSQLHistoryList = model.getSQLHistoryList(); + } catch (SQLHistoryException ex) { +- // ignore for now since this exception will be caught later ++ LOGGER.log(Level.WARNING, NbBundle.getMessage(SQLHistoryPanel.class, "LBL_ErrorParsingSQLHistory"), ex); ++ sqlHistoryList = SQLHistoryPersistenceManager.getInstance().retrieve(); ++ setCurrentSQLHistoryList(sqlHistoryList); + } + } + +diff -r 76d51071af8a -r af9499d919b8 db.core/src/org/netbeans/modules/db/sql/history/SQLHistoryPersistenceManager.java +--- a/db.core/src/org/netbeans/modules/db/sql/history/SQLHistoryPersistenceManager.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.core/src/org/netbeans/modules/db/sql/history/SQLHistoryPersistenceManager.java Tue Mar 10 13:53:55 2009 +0300 +@@ -49,8 +49,10 @@ + import java.text.DateFormat; + import java.text.ParseException; + import java.util.ArrayList; ++import java.util.Calendar; + import java.util.Date; + import java.util.List; ++import java.util.Locale; + import org.openide.util.Exceptions; + import org.xml.sax.Attributes; + import java.util.logging.Level; +@@ -95,7 +97,7 @@ + private static Document document; + private List sqlHistoryList; + private int numElemsToRemove = 0; +- ++ + private SQLHistoryPersistenceManager() { + } + +@@ -105,7 +107,7 @@ + } + return _instance; + } +- ++ + public void removeHistoryFile(FileObject historyRoot) { + try { + FileObject folder = DataFolder.findFolder(historyRoot).getPrimaryFile(); +@@ -128,7 +130,7 @@ + throw new SQLHistoryException(); + } + } +- ++ + public List retrieve(String historyFilePath, FileObject historyFileObject) throws ClassNotFoundException, SQLHistoryException { + Handler handler = null; + try { +@@ -136,8 +138,9 @@ + DataFolder df = DataFolder.findFolder(historyFileObject); + AtomicFileAction reader = new AtomicFileAction(df, handler, READ, null); + df.getPrimaryFile().getFileSystem().runAtomicAction(reader); +- ++ + } catch (IOException ex) { ++ sqlHistoryList = handler.getXmlSqlHistoryList(); + throw new SQLHistoryException(); + } + if (handler != null) { +@@ -146,15 +149,19 @@ + return new ArrayList(); + } + } +- ++ ++ public List retrieve() { ++ return sqlHistoryList; ++ } ++ + public void setNumElemsToRemove(int elemsToRemove) { + numElemsToRemove = elemsToRemove; + } +- ++ + public int getNumElemsToRemove() { + return numElemsToRemove; + } +- ++ + public List updateSQLSaved(int limit, FileObject historyFileObject) throws SQLHistoryException { + String historyFilePath = null; + List updatedSQLHistoryList = null; +@@ -163,7 +170,7 @@ + if (historyFileObject == null) { + return new ArrayList(); + } +- updatedSQLHistoryList = retrieve(historyFilePath, historyFileObject); ++ updatedSQLHistoryList = retrieve(historyFilePath, historyFileObject); + // Remove elements from list based on the number of statements to save that is set in the SQL History dialog + if (limit < updatedSQLHistoryList.size()) { + numElemsToRemove = updatedSQLHistoryList.size() - limit; +@@ -175,7 +182,7 @@ + df.getPrimaryFile().getFileSystem().runAtomicAction(modifier); + } + } +- updatedSQLHistoryList = retrieve(historyFilePath, historyFileObject); ++ updatedSQLHistoryList = retrieve(historyFilePath, historyFileObject); + } catch (ClassNotFoundException ex) { + throw new SQLHistoryException(); + } catch (IOException ex) { +@@ -183,7 +190,7 @@ + } + return updatedSQLHistoryList; + } +- ++ + private static final class AtomicFileAction implements FileSystem.AtomicAction { + List sqlHistoryList; + DataFolder parent; +@@ -191,14 +198,14 @@ + FileObject data; + Handler handler; + int actionType; +- ++ + AtomicFileAction(DataFolder parent, Handler handler, int actionType, List sqlHistoryList) { + this.parent = parent; + this.handler = handler; + this.sqlHistoryList = sqlHistoryList; + this.actionType = actionType; + } +- ++ + public void run() throws IOException { + FileLock lck = null; + OutputStream ostm = null; +@@ -246,10 +253,10 @@ + xmlWriter = new XmlWriter(data, sqlHistoryList, writer); + xmlWriter.write(xmlWriter.createElements(document), ""); // NOI18N + break; +- case MODIFY: ++ case MODIFY: + factory = DocumentBuilderFactory.newInstance(); +- builder = factory.newDocumentBuilder(); +- if (folder.getChildren().length > 0) { ++ builder = factory.newDocumentBuilder(); ++ if (folder.getChildren().length > 0) { + data = FileUtil.toFileObject(FileUtil.normalizeFile(new File(fn))); + InputStream inputStream = data.getInputStream(); + document = builder.parse(inputStream); +@@ -284,7 +291,7 @@ + if (lck != null) { + lck.releaseLock(); + } +- } ++ } + } + } + +@@ -312,7 +319,7 @@ + nameNode = document.createElement("sql"); // NOI18N + nameNode.appendChild(document.createTextNode(sqlHistory.getSql())); + nameNode.setAttribute("url", sqlHistory.getUrl()); // NOI18N +- nameNode.setAttribute("date", DateFormat.getInstance().format(sqlHistory.getDate())); // NOI18N ++ nameNode.setAttribute("date", new Long(sqlHistory.getDate().getTime()).toString()); // NOI18N + newNode.appendChild(nameNode); + } + document.adoptNode(newNode); +@@ -322,13 +329,13 @@ + nameNode = document.createElement("sql"); // NOI18N + nameNode.appendChild(document.createTextNode(sqlHistory.getSql())); + nameNode.setAttribute("url", sqlHistory.getUrl()); // NOI18N +- nameNode.setAttribute("date", DateFormat.getInstance().format(sqlHistory.getDate())); // NOI18N ++ nameNode.setAttribute("date", new Long(sqlHistory.getDate().getTime()).toString()); // NOI18N + newNode.insertBefore(nameNode, newNode.getFirstChild()); + } + } + return newNode; + } +- ++ + /** + * + * remove XML elements when the number of statements to save is reduced in the SQL History dialog +@@ -350,13 +357,13 @@ + // Remove elements from the DOM + for (int i = 0; i < elemsToRemove; i++) { + if (nodes.item(0) != null) { +- history.removeChild(nodes.item(nodes.getLength()-1)); ++ history.removeChild(nodes.item(nodes.getLength() - 1)); + } + } + } + return history; + } +- ++ + private void write() { + pw.println(""); + } +@@ -410,7 +417,7 @@ + } + + } +- ++ + private String fixup(String s) { + StringBuffer sb = new StringBuffer(); + int len = s.length(); +@@ -440,7 +447,7 @@ + return sb.toString(); + } + } +- ++ + /** + * SAX handler for reading the XML file. + */ +@@ -454,7 +461,7 @@ + private static StringBuilder sql; + private static Date date; + boolean matchingUrl = false; +- private List xmlSqlHistoryList = new ArrayList(); ++ private List xmlSqlHistoryList = new ArrayList(); + static boolean isSql = false; + private int limit = 10000; + +@@ -463,21 +470,30 @@ + } + + @Override +- public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { ++ public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException { + if (ELEMENT_SQL.equals(qName)) { + isSql = true; +- +- try { +- url = attrs.getValue(ATTR_URL_PROPERTY_VALUE); +- date = DateFormat.getInstance().parse(attrs.getValue(ATTR_DATE_PROPERTY_VALUE)); +- } catch (ParseException ex) { +- throw new SAXException(); ++ url = attrs.getValue(ATTR_URL_PROPERTY_VALUE); ++ // #152486 SQL History: if running NB in multiple locales the history file cannot be parsed ++ if (attrs.getValue(ATTR_DATE_PROPERTY_VALUE).indexOf("/") != -1) { // NOI18N ++ try { ++ DateFormat df = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT); ++ date = df.parse(attrs.getValue(ATTR_DATE_PROPERTY_VALUE)); ++ } catch (ParseException ex) { ++ // # 152486; Date stored is not parsable, so reset the date to the current timestamp ++ Calendar calendar = Calendar.getInstance(); ++ date = calendar.getTime(); ++ } ++ } else { ++ Calendar calendar = Calendar.getInstance(); ++ calendar.setTimeInMillis(new Long(attrs.getValue(ATTR_DATE_PROPERTY_VALUE)).longValue()); ++ date = calendar.getTime(); + } + } else { + isSql = false; + } + } +- ++ + @Override + public void endElement(String uri, String localName, String qName) { + if (ELEMENT_SQL.equals(qName)) { +@@ -494,7 +510,7 @@ + date = null; + sql = null; + } +- ++ + private void addHistory(String url, String sql, Date date) { + String sqlSetting = NbPreferences.forModule(SQLHistoryPersistenceManager.class).get("SQL_STATEMENTS_SAVED_FOR_HISTORY", ""); + if (!sqlSetting.equals("")) { // NOI18N +@@ -508,7 +524,7 @@ + xmlSqlHistoryList.remove(xmlSqlHistoryList.size() - 1); + } + } +- ++ + @Override + public void characters(char buf[], int offset, int length) { + if (isSql) { +@@ -521,7 +537,7 @@ + } + } + } +- ++ + public void setXmlSqlHistoryList(List sqlHistoryList) { + xmlSqlHistoryList = sqlHistoryList; + } +diff -r 76d51071af8a -r af9499d919b8 db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java +--- a/db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.core/src/org/netbeans/modules/db/sql/loader/SQLCloneableEditor.java Tue Mar 10 13:53:55 2009 +0300 +@@ -603,17 +603,15 @@ + Object[] options = new Object[]{ + DialogDescriptor.CLOSED_OPTION + }; +- final DialogDescriptor desc = new DialogDescriptor(panel, NbBundle.getMessage(SQLCloneableEditor.class, "LBL_SQL_HISTORY_TITLE"), true, options, ++ final DialogDescriptor desc = new DialogDescriptor(panel, NbBundle.getMessage(SQLCloneableEditor.class, "LBL_SQL_HISTORY_TITLE"), false, options, + DialogDescriptor.CLOSED_OPTION, DialogDescriptor.DEFAULT_ALIGN, new HelpCtx("sql_history"), null); // NOI18N + dlg = DialogDisplayer.getDefault().createDialog(desc); + dlg.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SQLCloneableEditor.class, "ACSD_DLG")); + panel.setSize(panel.getPreferredSize()); + dlg.pack(); ++ dlg.setAlwaysOnTop(true); + dlg.setVisible(true); + } finally { +- if (dlg != null) { +- dlg.dispose(); +- } + getComponent().setCursor(null); + } + } +diff -r 76d51071af8a -r af9499d919b8 db.dataview/manifest.mf +--- a/db.dataview/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.dataview/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.db.dataview + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/dataview/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.0.1 ++OpenIDE-Module-Specification-Version: 1.0.3 + AutoUpdate-Show-In-Client: false +diff -r 76d51071af8a -r af9499d919b8 db.dataview/src/org/netbeans/modules/db/dataview/meta/DBForeignKey.java +--- a/db.dataview/src/org/netbeans/modules/db/dataview/meta/DBForeignKey.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.dataview/src/org/netbeans/modules/db/dataview/meta/DBForeignKey.java Tue Mar 10 13:53:55 2009 +0300 +@@ -85,11 +85,12 @@ + + Map fkColumns = new HashMap(); + while (rs.next()) { +- DBForeignKey fk = (DBForeignKey) fkColumns.get(rs.getString(RS_FK_NAME)); ++ String fk_name = rs.getString(RS_FK_NAME); ++ DBForeignKey fk = (DBForeignKey) fkColumns.get(fk_name); + if (fk != null) { + fk.addColumnNames(rs); + } else { +- fk = new DBForeignKey(rs); ++ fk = new DBForeignKey(rs, fk_name); + fk.setParentObject(table); + fkColumns.put(fk.getName(), fk); + } +@@ -97,10 +98,10 @@ + return fkColumns; + } + +- private DBForeignKey(ResultSet rs) throws SQLException { ++ private DBForeignKey(ResultSet rs, String fkName) throws SQLException { + assert rs != null; + +- fkName = rs.getString(RS_FK_NAME); ++ this.fkName = fkName; + pkName = rs.getString(RS_PK_NAME); + + pkTable = rs.getString(RS_PKTABLE_NAME); +diff -r 76d51071af8a -r af9499d919b8 db.dataview/src/org/netbeans/modules/db/dataview/meta/DBMetaDataFactory.java +--- a/db.dataview/src/org/netbeans/modules/db/dataview/meta/DBMetaDataFactory.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.dataview/src/org/netbeans/modules/db/dataview/meta/DBMetaDataFactory.java Tue Mar 10 13:53:55 2009 +0300 +@@ -188,7 +188,11 @@ + // get table column information + ResultSetMetaData rsMeta = rs.getMetaData(); + for (int i = 1; i <= rsMeta.getColumnCount(); i++) { ++ // #153219 - workaround + String tableName = rsMeta.getTableName(i); ++ if (tableName == null) { ++ tableName = noTableName; ++ } + String schemaName = rsMeta.getSchemaName(i); + String catalogName = rsMeta.getCatalogName(i); + String key = catalogName + schemaName + tableName; +diff -r 76d51071af8a -r af9499d919b8 db.dataview/src/org/netbeans/modules/db/dataview/output/Bundle.properties +--- a/db.dataview/src/org/netbeans/modules/db/dataview/output/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.dataview/src/org/netbeans/modules/db/dataview/output/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -146,7 +146,7 @@ + InsertRecordDialog.AccessibleContext.accessibleDescription=This is the dialog which helps user input records into database + InsertRecordDialog.jEditorPane1.AccessibleContext.accessibleDescription=text/sql + InsertRecordDialog.previewBtn.text=Show SQL +-InsertRecordDialog.jTextArea1.text=Enter values for the following columns that were found in the table.Time and date values must match the ISO date and time format. Press CTRL+0 to toggle setting NULL value for a given column. ++InsertRecordDialog.jTextArea1.text=Enter values for the following columns that were found in the table. Time and date values must match the ISO date and time format. Press CTRL+0 to toggle setting NULL value and CTRL+1 to toggle setting DEFAULT value for a given column. + InsertRecordDialog.title=Insert Record + InsertRecordDialog.jEditorPane1.toolTipText=Generated SQL for INSERT + InsertRecordDialog.jEditorPane1.contentType=text/sql +diff -r 76d51071af8a -r af9499d919b8 db.dataview/src/org/netbeans/modules/db/dataview/output/DataViewTableUI.java +--- a/db.dataview/src/org/netbeans/modules/db/dataview/output/DataViewTableUI.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.dataview/src/org/netbeans/modules/db/dataview/output/DataViewTableUI.java Tue Mar 10 13:53:55 2009 +0300 +@@ -63,8 +63,10 @@ + import java.util.List; + import java.util.logging.Level; + import java.util.logging.Logger; ++import javax.swing.AbstractCellEditor; + import javax.swing.DefaultCellEditor; + import javax.swing.JButton; ++import javax.swing.JCheckBox; + import javax.swing.JComponent; + import javax.swing.JLabel; + import javax.swing.JMenuItem; +@@ -75,6 +77,7 @@ + import javax.swing.JTable; + import javax.swing.JTextArea; + import javax.swing.JTextField; ++import javax.swing.event.CellEditorListener; + import javax.swing.event.ListSelectionEvent; + import javax.swing.event.ListSelectionListener; + import javax.swing.table.DefaultTableCellRenderer; +@@ -122,6 +125,7 @@ + setDefaultEditor(Object.class, new ResultSetTableCellEditor(new JTextField())); + setDefaultEditor(Number.class, new NumberEditor(new JTextField())); + setDefaultEditor(String.class, new StringTableCellEditor(new JTextField())); ++ setDefaultEditor(Boolean.class, new BooleanTableCellEditor(new JCheckBox())); + + TableSelectionListener listener = new TableSelectionListener(this); + this.getSelectionModel().addListSelectionListener(listener); +@@ -564,6 +568,38 @@ + setToolTipText(getText()); + } + } ++ ++ private static class BooleanCellRenderer extends DefaultTableCellRenderer.UIResource { ++ ++ public BooleanCellRenderer() { ++ super(); ++ cb.setHorizontalAlignment(0); ++ } ++ ++ public BooleanCellRenderer(Color color, Color color1) { ++ this(); ++ background = color; ++ foreground = color1; ++ } ++ ++ @Override ++ public Component getTableCellRendererComponent(JTable jtable, Object obj, boolean flag, boolean flag1, int i, int j) { ++ if (flag) { ++ cb.setBackground(jtable.getSelectionBackground()); ++ cb.setForeground(jtable.getSelectionForeground()); ++ } else { ++ cb.setBackground(background != null ? background : jtable.getBackground()); ++ cb.setForeground(foreground != null ? foreground : jtable.getForeground()); ++ } ++ ++ cb.setSelected(((Boolean) obj).booleanValue()); ++ return cb; ++ } ++ private static JCheckBox cb = new JCheckBox(); ++ private Color background; ++ private Color foreground; ++ } ++ + + private static class GeneratedResultSetCellRenderer extends ResultSetCellRenderer { + +@@ -589,6 +625,7 @@ + final TableCellRenderer DATE_RENDERER = new DateRenderer(); + final TableCellRenderer DATETIME_RENDERER = new DateTimeRenderer(); + final TableCellRenderer STRING_RENDERER = new StringRenderer(); ++ final TableCellRenderer BOOLEAN_RENDERER = new BooleanCellRenderer(); + + @Override + public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { +@@ -604,6 +641,8 @@ + return DATE_RENDERER.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + } else if (value instanceof Time) { + return TIME_RENDERER.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); ++ } else if (value instanceof Boolean) { ++ return BOOLEAN_RENDERER.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + } else { + Component c = super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); + if (c instanceof JComponent) { +@@ -834,4 +873,66 @@ + } + } + } ++ ++ public class BooleanTableCellEditor extends AbstractCellEditor ++ implements ActionListener, TableCellEditor { ++ ++ private int row, column; ++ private boolean editable = true; ++ private JTable table; ++ private JCheckBox cb; ++ ++ public BooleanTableCellEditor(JCheckBox cb) { ++ this.cb = cb; ++ cb.setHorizontalAlignment(0); ++ } ++ ++ @Override ++ public void addCellEditorListener(CellEditorListener celleditorlistener) { ++ super.addCellEditorListener(celleditorlistener); ++ cb.addActionListener(this); ++ } ++ ++ @Override ++ public void removeCellEditorListener(CellEditorListener celleditorlistener) { ++ super.removeCellEditorListener(celleditorlistener); ++ cb.removeActionListener(this); ++ } ++ ++ public Object getCellEditorValue() { ++ return new Boolean(cb.isSelected()); ++ } ++ ++ @Override ++ public boolean isCellEditable(EventObject eventobject) { ++ return true; ++ } ++ ++ public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { ++ cb.setSelected(((Boolean) value).booleanValue()); ++ ++ DBColumn dbCol = tablePanel.getDataViewDBTable().getColumn(column); ++ if (dbCol.isGenerated()) { ++ editable = false; ++ } else if (!tablePanel.isEditable()) { ++ editable = false; ++ } else { ++ editable = dbCol.isEditable(); ++ } ++ cb.setEnabled(editable); ++ ++ this.table = table; ++ this.row = row; ++ this.column = column; ++ ++ return cb; ++ } ++ ++ public void actionPerformed(ActionEvent actionevent) { ++ table.setValueAt(getCellEditorValue(), row, column); ++ setRowSelectionInterval(row, row); ++ } ++ ++ } ++ + } +diff -r 76d51071af8a -r af9499d919b8 db.dataview/src/org/netbeans/modules/db/dataview/output/InsertRecordDialog.java +--- a/db.dataview/src/org/netbeans/modules/db/dataview/output/InsertRecordDialog.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.dataview/src/org/netbeans/modules/db/dataview/output/InsertRecordDialog.java Tue Mar 10 13:53:55 2009 +0300 +@@ -89,6 +89,14 @@ + + jSplitPane1.setBottomComponent(null); + ++ KeyStroke enter = KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false); ++ Action enterAction = new AbstractAction() { ++ ++ public void actionPerformed(ActionEvent e) { ++ executeBtnActionPerformed(null); ++ } ++ }; ++ + KeyStroke escape = KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0, false); + Action escapeAction = new AbstractAction() { + +@@ -97,7 +105,9 @@ + } + }; + getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(escape, "ESCAPE"); // NOI18N ++ getRootPane().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(enter, "ENTER"); // NOI18N + getRootPane().getActionMap().put("ESCAPE", escapeAction); // NOI18N ++ getRootPane().getActionMap().put("ENTER", enterAction); // NOI18N + } + + /** This method is called from within the constructor to +@@ -258,59 +268,59 @@ + pack(); + }// //GEN-END:initComponents + +-private void cancelBtnActionPerformed(java.awt.event.ActionEvent evt) { +- dispose(); +-} ++ private void cancelBtnActionPerformed(java.awt.event.ActionEvent evt) { ++ dispose(); ++ } + +-private void executeBtnActionPerformed(java.awt.event.ActionEvent evt) { +- String[] insertSQL = null; +- try { +- Object[] insertedRow = getInsertValues(); ++ private void executeBtnActionPerformed(java.awt.event.ActionEvent evt) { ++ String[] insertSQL = null; ++ try { ++ Object[] insertedRow = getInsertValues(); + +- SQLStatementGenerator stmtBldr = dataView.getSQLStatementGenerator(); +- insertSQL = stmtBldr.generateInsertStatement(insertedRow); +- SQLExecutionHelper execHelper = dataView.getSQLExecutionHelper(); +- execHelper.executeInsertRow(insertSQL, insertedRow); +- } catch (DBException ex) { +- if (jSplitPane1.getBottomComponent() == null) { ++ SQLStatementGenerator stmtBldr = dataView.getSQLStatementGenerator(); ++ insertSQL = stmtBldr.generateInsertStatement(insertedRow); ++ SQLExecutionHelper execHelper = dataView.getSQLExecutionHelper(); ++ execHelper.executeInsertRow(insertSQL, insertedRow); ++ } catch (DBException ex) { ++ if (jSplitPane1.getBottomComponent() == null) { ++ jSplitPane1.setDividerLocation(250); ++ jSplitPane1.setBottomComponent(jScrollPane2); ++ previewBtn.setText(NbBundle.getMessage(InsertRecordDialog.class, "LBL_hide_sql")); ++ } ++ jEditorPane1.setForeground(Color.red); ++ jEditorPane1.setContentType("text/plain"); // NOI18N ++ jEditorPane1.setText(ex.getMessage()); ++ ++ return; ++ } ++ dispose(); ++ } ++ ++ private void clearBtnActionPerformed(java.awt.event.ActionEvent evt) { ++ int rows = dataView.getDataViewDBTable().getColumnCount(); ++ for (int i = 0; i < rows; i++) { ++ if (dataView.getDataViewDBTable().getColumn(i).isGenerated()) { ++ colValueTextField[i].setText(""); // NOI18N ++ colValueTextField[i].setEditable(false); ++ } else { ++ colValueTextField[i].setText(""); // NOI18N ++ colValueTextField[i].setEditable(true); ++ } ++ } ++ refreshSQL(); ++ } ++ ++ private void previewBtnActionPerformed(java.awt.event.ActionEvent evt) { ++ if (evt.getActionCommand().equalsIgnoreCase(NbBundle.getMessage(InsertRecordDialog.class, "LBL_show_sql"))) { + jSplitPane1.setDividerLocation(250); + jSplitPane1.setBottomComponent(jScrollPane2); +- previewBtn.setText(NbBundle.getMessage(InsertRecordDialog.class,"LBL_hide_sql")); +- } +- jEditorPane1.setForeground(Color.red); +- jEditorPane1.setContentType("text/plain"); // NOI18N +- jEditorPane1.setText(ex.getMessage()); +- +- return; +- } +- dispose(); +-} +- +-private void clearBtnActionPerformed(java.awt.event.ActionEvent evt) { +- int rows = dataView.getDataViewDBTable().getColumnCount(); +- for (int i = 0; i < rows; i++) { +- if (dataView.getDataViewDBTable().getColumn(i).isGenerated()) { +- colValueTextField[i].setText(""); // NOI18N +- colValueTextField[i].setEditable(false); ++ refreshSQL(); ++ previewBtn.setText(NbBundle.getMessage(InsertRecordDialog.class, "LBL_hide_sql")); + } else { +- colValueTextField[i].setText(""); // NOI18N +- colValueTextField[i].setEditable(true); ++ jSplitPane1.setBottomComponent(null); ++ previewBtn.setText(NbBundle.getMessage(InsertRecordDialog.class, "LBL_show_sql")); + } + } +- refreshSQL(); +-} +- +-private void previewBtnActionPerformed(java.awt.event.ActionEvent evt) { +- if (evt.getActionCommand().equalsIgnoreCase(NbBundle.getMessage(InsertRecordDialog.class,"LBL_show_sql"))) { +- jSplitPane1.setDividerLocation(250); +- jSplitPane1.setBottomComponent(jScrollPane2); +- refreshSQL(); +- previewBtn.setText(NbBundle.getMessage(InsertRecordDialog.class,"LBL_hide_sql")); +- } else { +- jSplitPane1.setBottomComponent(null); +- previewBtn.setText(NbBundle.getMessage(InsertRecordDialog.class,"LBL_show_sql")); +- } +-} + + private void refreshSQL() { + try { +@@ -333,14 +343,14 @@ + Connection conn = DBConnectionFactory.getInstance().getConnection(dataView.getDatabaseConnection()); + Map typeInfo = Collections.emptyMap(); + try { +- if(conn != null) { ++ if (conn != null) { + DBMetaDataFactory dbMeta = new DBMetaDataFactory(conn); + typeInfo = dbMeta.buildDBSpecificDatatypeMap(); +- } ++ } + } catch (SQLException ex) { + // ignore + } +- ++ + int rows = dataView.getDataViewDBTable().getColumnCount(); + JLabel[] colNameLabel = new JLabel[rows]; + JLabel[] colDataType = new JLabel[rows]; +@@ -360,7 +370,7 @@ + colNameLabel[i].setFont(colNameLabel[i].getFont()); // NOI18N + colNameLabel[i].getAccessibleContext().setAccessibleName(colNameLabel[i].getName()); + colNameLabel[i].getAccessibleContext().setAccessibleDescription(colNameLabel[i].getName()); +- ++ + gridBagConstraints.gridx = gridx; + gridBagConstraints.gridy = gridy; + gridBagConstraints.insets = new java.awt.Insets(0, 0, bottom, right); +@@ -400,7 +410,7 @@ + + colDataType[i].setText(typeName); + colDataType[i].setDisplayedMnemonicIndex(-1); +- ++ + colNameLabel[i].setLabelFor(colValueTextField[i]); + colDataType[i].setLabelFor(colValueTextField[i]); + +diff -r 76d51071af8a -r af9499d919b8 db.dataview/src/org/netbeans/modules/db/dataview/output/SQLExecutionHelper.java +--- a/db.dataview/src/org/netbeans/modules/db/dataview/output/SQLExecutionHelper.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.dataview/src/org/netbeans/modules/db/dataview/output/SQLExecutionHelper.java Tue Mar 10 13:53:55 2009 +0300 +@@ -197,12 +197,13 @@ + + void executeDeleteRow(final DataViewTableUI rsTable) { + String title = NbBundle.getMessage(SQLExecutionHelper.class, "LBL_sql_delete"); ++ final int[] rows = rsTable.getSelectedRows(); + SQLStatementExecutor executor = new SQLStatementExecutor(dataView, title, "") { + + @Override + public void execute() throws SQLException, DBException { + dataView.setEditable(false); +- int[] rows = rsTable.getSelectedRows(); ++ + for (int j = 0; j < rows.length && !error; j++) { + if (Thread.currentThread().isInterrupted()) { + break; +@@ -247,7 +248,7 @@ + + @Override + protected void executeOnSucess() { +- dataView.decrementRowSize(rsTable.getSelectedRows().length); ++ dataView.decrementRowSize(rows.length); + SQLExecutionHelper.this.executeQuery(); + } + }; +@@ -360,7 +361,7 @@ + stmt = conn.createStatement(); + + DBTable dbTable = dataView.getDataViewDBTable().geTable(0); +- String truncateSql = "TRUNCATE TABLE" + dbTable.getFullyQualifiedName(); // NOI18N ++ String truncateSql = "TRUNCATE TABLE " + dbTable.getFullyQualifiedName(); // NOI18N + + try { + executeSQLStatement(stmt, truncateSql); +diff -r 76d51071af8a -r af9499d919b8 db.dataview/src/org/netbeans/modules/db/dataview/output/SQLStatementExecutor.java +--- a/db.dataview/src/org/netbeans/modules/db/dataview/output/SQLStatementExecutor.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.dataview/src/org/netbeans/modules/db/dataview/output/SQLStatementExecutor.java Tue Mar 10 13:53:55 2009 +0300 +@@ -49,7 +49,6 @@ + import org.openide.DialogDisplayer; + import org.openide.NotifyDescriptor; + import org.openide.util.Cancellable; +-import org.openide.util.Exceptions; + import org.openide.util.NbBundle; + import org.openide.util.RequestProcessor; + +@@ -152,7 +151,7 @@ + errorMsg = cmdName + NbBundle.getMessage(SQLStatementExecutor.class,"MSG_failed") + errorMsg; + dataView.setErrorStatusText(new DBException(errorMsg, ex)); + +- NotifyDescriptor nd = new NotifyDescriptor.Exception(ex); ++ NotifyDescriptor nd = new NotifyDescriptor.Exception(new DBException(errorMsg, ex)); + DialogDisplayer.getDefault().notify(nd); + } + } +diff -r 76d51071af8a -r af9499d919b8 db.kit/manifest.mf +--- a/db.kit/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.kit/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.db.kit + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/kit/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.3.1 ++OpenIDE-Module-Specification-Version: 1.3.4 + +diff -r 76d51071af8a -r af9499d919b8 db.kit/nbproject/project.xml +--- a/db.kit/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.kit/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -9,19 +9,19 @@ + org.netbeans.modules.db + + 1 +- 1.24 ++ 1.30.3 + + + + org.netbeans.modules.db.core + +- 1.4 ++ 1.7.3 + + + + org.netbeans.modules.db.dataview + +- 1.0 ++ 1.0.3 + + + +@@ -40,7 +40,7 @@ + + org.netbeans.modules.db.mysql + +- 0.1 ++ 0.1.3 + + + +diff -r 76d51071af8a -r af9499d919b8 db.kit/src/org/netbeans/modules/db/kit/Bundle.properties +--- a/db.kit/src/org/netbeans/modules/db/kit/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.kit/src/org/netbeans/modules/db/kit/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,8 @@ + OpenIDE-Module-Display-Category=Base IDE + OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
\ ++
\ + Provides a visual and text SQL editor and a browser of database connections, tables and their data. + OpenIDE-Module-Name=Database + OpenIDE-Module-Short-Description=Database browser, visual and text SQL editor. +diff -r 76d51071af8a -r af9499d919b8 db.mysql/manifest.mf +--- a/db.mysql/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -4,5 +4,5 @@ + OpenIDE-Module-Implementation-Version: 2 + OpenIDE-Module-Layer: org/netbeans/modules/db/mysql/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/db/mysql/Bundle.properties +-OpenIDE-Module-Specification-Version: 0.1.1 ++OpenIDE-Module-Specification-Version: 0.1.3 + +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/impl/BaseSampleProvider.java +--- a/db.mysql/src/org/netbeans/modules/db/mysql/impl/BaseSampleProvider.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/impl/BaseSampleProvider.java Tue Mar 10 13:53:55 2009 +0300 +@@ -43,6 +43,9 @@ + import java.io.File; + import java.io.IOException; + import java.io.InputStreamReader; ++import java.sql.Connection; ++import java.sql.ResultSet; ++import java.sql.SQLException; + import java.util.ArrayList; + import java.util.List; + import java.util.logging.Logger; +@@ -96,6 +99,10 @@ + throw new DatabaseException(getMessage("MSG_SampleNotSupported", sampleName)); + } + ++ if (! checkInnodbSupport(dbconn.getJDBCConnection())) { ++ throw new DatabaseException(getMessage("MSG_NoSampleWithoutInnoDB")); // NOI8N ++ } ++ + String sql = getSqlText(sampleName); + + SQLExecutor.execute(dbconn, sql); +@@ -104,6 +111,22 @@ + public boolean supportsSample(String name) { + return SAMPLES.contains(name); + } ++ private boolean checkInnodbSupport(Connection conn) throws DatabaseException { ++ try { ++ ResultSet rs = conn.createStatement().executeQuery("SHOW STORAGE ENGINES"); // NOI18N ++ ++ while (rs.next()) { ++ if ("INNODB".equals(rs.getString(1).toUpperCase()) && ++ ("YES".equals(rs.getString(2).toUpperCase()) || "DEFAULT".equals(rs.getString(2).toUpperCase()))) { // NOI18N ++ return true; ++ } ++ } ++ ++ return false; ++ } catch (SQLException sqle) { ++ throw new DatabaseException(sqle); ++ } ++ } + + public List getSampleNames() { + return SAMPLES; +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/impl/Bundle.properties +--- a/db.mysql/src/org/netbeans/modules/db/mysql/impl/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/impl/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -54,10 +54,11 @@ + MSG_ReconnectingToMySQL=Reconnecting to the MySQL server + MSG_WaitingForServerToStart=Waiting for MySQL Server to start + MSG_WaitingForServerToStop=Waiting for MySQL Server to stop +-MSG_CantStartServerIsAlreadyRunning=Unable to start the MySQL server because it appears to be already running at host {0}, port {0}. Please try connecting to the server. It is also possible another process is listening on that port. ++MSG_CantStartServerIsAlreadyRunning=Unable to start the MySQL server because it appears to be already running at host {0}, port {1}. Please try connecting to the server. It is also possible another process is listening on that port. + MSG_CheckStart=The settings for starting MySQL have changed. Do you want to start the server now? + MSG_UnableToStopServer=Encountered an error while trying to stop the MySQL server + MSG_UnableToStartServer=Encountered an error while trying to start the MySQL server ++MSG_NoSampleWithoutInnoDB=The sample requires the InnoDB storage engine, and this engine is not enabled on the server. Please enable InnoDB and try again. + StartManager.CancelButton=Cancel + StartManager.CancelButtonA11yDesc=Cancel start of MySQL server + StartManager.KeepWaitingButton=Keep Waiting +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/impl/ConnectionProcessor.java +--- a/db.mysql/src/org/netbeans/modules/db/mysql/impl/ConnectionProcessor.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/impl/ConnectionProcessor.java Tue Mar 10 13:53:55 2009 +0300 +@@ -45,6 +45,8 @@ + import java.util.logging.Level; + import java.util.logging.Logger; + import org.netbeans.api.db.explorer.DatabaseException; ++import org.netbeans.api.db.sql.support.SQLIdentifiers; ++import org.netbeans.api.db.sql.support.SQLIdentifiers.Quoter; + import org.openide.util.NbBundle; + + /** +@@ -56,41 +58,66 @@ + public class ConnectionProcessor implements Runnable { + private static final Logger LOGGER = Logger.getLogger(ConnectionProcessor.class.getName()); + final BlockingQueue inqueue; +- ++ ++ // INVARIANT: if connection is null or not connected, quoter is null ++ // if connection is connected, quoter is set based on DBMD for the connection ++ // synchronized on this + private Connection conn; ++ // synchronized on this ++ private Quoter quoter; ++ + private Thread taskThread; + +- void setConnection(Connection conn) { ++ synchronized void setConnection(Connection conn) throws DatabaseException { + this.conn = conn; + } + +- Connection getConnection() { +- return this.conn; ++ synchronized private void setQuoter() throws DatabaseException { ++ try { ++ if (conn != null && !conn.isClosed()) { ++ this.quoter = SQLIdentifiers.createQuoter(conn.getMetaData()); ++ } else { ++ this.quoter = null; ++ } ++ } catch (SQLException sqle) { ++ throw new DatabaseException(sqle); ++ } ++ + } + +- void validateConnection() throws DatabaseException { ++ synchronized Connection getConnection() { ++ return conn; ++ } ++ ++ synchronized Quoter getQuoter() { ++ return quoter; ++ } ++ ++ synchronized void validateConnection() throws DatabaseException { + try { + // A connection only needs to be validated if it already exists. + // We're trying to see if something went wrong to an existing connection... + if (conn == null) { + return; + } +- ++ + if (conn.isClosed()) { + conn = null; + throw new DatabaseException(NbBundle.getMessage(ConnectionProcessor.class, "MSG_ConnectionLost")); + } + + // Send a command to the server, if it fails we know the connection is invalid. +- conn.getMetaData().getTables(null, null, " ", new String[] { "TABLE" }).close(); ++ conn.getMetaData().getTables(null, null, " ", new String[]{"TABLE"}).close(); ++ quoter = SQLIdentifiers.createQuoter(conn.getMetaData()); + } catch (SQLException e) { + conn = null; ++ quoter = null; + LOGGER.log(Level.FINE, null, e); + throw new DatabaseException(NbBundle.getMessage(ConnectionProcessor.class, "MSG_ConnectionLost"), e); + } + } +- +- boolean isConnected() { ++ ++ synchronized boolean isConnected() { + return conn != null; + } + +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/impl/MySQLDatabaseServer.java +--- a/db.mysql/src/org/netbeans/modules/db/mysql/impl/MySQLDatabaseServer.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/impl/MySQLDatabaseServer.java Tue Mar 10 13:53:55 2009 +0300 +@@ -71,6 +71,7 @@ + import org.netbeans.api.db.explorer.ConnectionManager; + import org.netbeans.api.db.explorer.DatabaseConnection; + import org.netbeans.api.db.explorer.DatabaseException; ++import org.netbeans.api.db.sql.support.SQLIdentifiers.Quoter; + import org.netbeans.api.progress.ProgressHandle; + import org.netbeans.api.progress.ProgressHandleFactory; + import org.netbeans.modules.db.mysql.Database; +@@ -84,7 +85,6 @@ + import org.openide.util.ImageUtilities; + import org.openide.util.NbBundle; + import org.openide.util.RequestProcessor; +-import org.openide.util.RequestProcessor.Task; + import org.openide.util.Utilities; + + /** +@@ -621,7 +621,9 @@ + public void execute() throws Exception { + try { + Connection conn = connProcessor.getConnection(); +- conn.prepareStatement(CREATE_DATABASE_SQL + dbname).executeUpdate(); ++ Quoter quoter = connProcessor.getQuoter(); ++ String quotedName = quoter.quoteIfNeeded(dbname); ++ conn.prepareStatement(CREATE_DATABASE_SQL + quotedName).executeUpdate(); + } finally { + refreshDatabaseList(); + } +@@ -635,13 +637,21 @@ + public void execute() throws Exception { + try { + Connection conn = connProcessor.getConnection(); +- conn.prepareStatement(DROP_DATABASE_SQL + dbname).executeUpdate(); ++ Quoter quoter = connProcessor.getQuoter(); ++ String quotedName = quoter.quoteIfNeeded(dbname); ++ conn.prepareStatement(DROP_DATABASE_SQL + quotedName).executeUpdate(); + + if (deleteConnections) { ++ String hostname = getHost(); ++ ++ String ipaddr = Utils.getHostIpAddress(hostname); + DatabaseConnection[] dbconns = ConnectionManager.getDefault().getConnections(); + for (DatabaseConnection dbconn : dbconns) { + if (dbconn.getDriverClass().equals(MySQLOptions.getDriverClass()) && +- dbconn.getDatabaseURL().contains("/" + dbname)) { ++ dbconn.getDatabaseURL().contains("/" + dbname) && ++ (dbconn.getDatabaseURL().contains(getHost()) || ++ dbconn.getDatabaseURL().contains(ipaddr)) && ++ dbconn.getDatabaseURL().contains(getPort())) { + ConnectionManager.getDefault().removeConnection(dbconn); + } + } +@@ -713,9 +723,10 @@ + public void grantFullDatabaseRights(final String dbname, final DatabaseUser grantUser) { + new DatabaseCommand(true) { + @Override +- public void execute() throws Exception { ++ public void execute() throws Exception { ++ String quotedName = connProcessor.getQuoter().quoteIfNeeded(dbname); + PreparedStatement ps = connProcessor.getConnection(). +- prepareStatement(GRANT_ALL_SQL_1 + dbname + GRANT_ALL_SQL_2); ++ prepareStatement(GRANT_ALL_SQL_1 + quotedName + GRANT_ALL_SQL_2); + ps.setString(1, grantUser.getUser()); + ps.setString(2, grantUser.getHost()); + ps.executeUpdate(); +@@ -745,8 +756,7 @@ + public void execute() throws Exception { + ServerState state = checkRunning(1000); + if (state == ServerState.CONNECTED) { +- throw new DatabaseException(NbBundle.getMessage(MySQLDatabaseServer.class, +- "MSG_CantStartServerIsAlreadyRunning", getHost(), getPort())); ++ return; + } + + try { +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/ui/BasePropertiesPanel.form +--- a/db.mysql/src/org/netbeans/modules/db/mysql/ui/BasePropertiesPanel.form Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/ui/BasePropertiesPanel.form Tue Mar 10 13:53:55 2009 +0300 +@@ -22,41 +22,29 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ + +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ++ ++ ++ ++ + +- +- +- +- +- +- +- +- +- +- +- + + + + + ++ ++ ++ ++ + + + +@@ -72,8 +60,8 @@ + + + ++ + +- + + + +@@ -82,8 +70,8 @@ + + + ++ + +- + + + +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/ui/BasePropertiesPanel.java +--- a/db.mysql/src/org/netbeans/modules/db/mysql/ui/BasePropertiesPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/ui/BasePropertiesPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -7,7 +7,7 @@ + package org.netbeans.modules.db.mysql.ui; + + import java.awt.Color; +-import java.util.ResourceBundle; ++import javax.swing.SwingUtilities; + import javax.swing.UIManager; + import javax.swing.event.DocumentListener; + import org.netbeans.modules.db.mysql.DatabaseServer; +@@ -206,31 +206,24 @@ + .add(layout.createSequentialGroup() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() ++ .addContainerGap() ++ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false) ++ .add(labelHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ++ .add(labelPort, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ++ .add(labelPassword, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ++ .add(labelUser, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)) ++ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) +- .add(layout.createSequentialGroup() +- .addContainerGap() +- .add(labelHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 181, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) +- .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) +- .add(layout.createSequentialGroup() +- .addContainerGap() +- .add(labelPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 181, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) +- .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() +- .addContainerGap() +- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) +- .add(org.jdesktop.layout.GroupLayout.LEADING, labelPassword, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) +- .add(org.jdesktop.layout.GroupLayout.LEADING, labelUser, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE))))) +- .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) +- .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING) +- .add(txtHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE) +- .add(org.jdesktop.layout.GroupLayout.LEADING, txtPassword, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE) +- .add(org.jdesktop.layout.GroupLayout.LEADING, txtPort, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE) +- .add(org.jdesktop.layout.GroupLayout.LEADING, txtUser, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 291, Short.MAX_VALUE))) ++ .add(txtPort, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE) ++ .add(txtPassword, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE) ++ .add(txtUser, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE) ++ .add(txtHost, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 294, Short.MAX_VALUE))) ++ .add(layout.createSequentialGroup() ++ .addContainerGap() ++ .add(messageLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE)) + .add(layout.createSequentialGroup() + .add(50, 50, 50) +- .add(chkSavePassword)) +- .add(layout.createSequentialGroup() +- .addContainerGap() +- .add(messageLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 482, Short.MAX_VALUE))) ++ .add(chkSavePassword, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 452, Short.MAX_VALUE))) + .addContainerGap()) + ); + layout.setVerticalGroup( +@@ -242,16 +235,16 @@ + .add(txtHost, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) +- .add(labelPort) +- .add(txtPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ++ .add(txtPort, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) ++ .add(labelPort)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(labelUser) + .add(txtUser, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) +- .add(labelPassword) +- .add(txtPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) ++ .add(txtPassword, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) ++ .add(labelPassword)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(chkSavePassword) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/ui/Bundle.properties +--- a/db.mysql/src/org/netbeans/modules/db/mysql/ui/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/ui/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -45,6 +45,7 @@ + CreateNewDatabasePanel.MSG_DeleteFailed=Unable to delete database {0} + CreateNewDatabasePanel.MSG_DeleteCreatedDatabase=An error occurred after creating the database. Would you like to delete the database? + CreateNewDatabasePanel.STR_DeleteCreatedDatabaseTitle=Confirm Delete Newly Created Database ++CreateDatbasePanel.MSG_NoGrantUserSelected=You have selected to grant access to a user but no user name has been selected. Please select a user and try again. + CreateNewDatabasePanel.messageLabel.AccessibleContext.accessibleName= + CreateNewDatabasePanel.chkGrantAccess.AccessibleContext.accessibleDescription=Grant full access to a database user for this new database + CreateNewDatabasePanel.comboDatabaseName.AccessibleContext.accessibleDescription=Select or enter a name for this new database +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/ui/CreateDatabasePanel.java +--- a/db.mysql/src/org/netbeans/modules/db/mysql/ui/CreateDatabasePanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/ui/CreateDatabasePanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -72,6 +72,10 @@ + "CreateNewDatabasePanel.MSG_SpecifyDatabase"); + } + ++ if (this.isGrantAccess() && Utils.isEmpty((String)comboUsers.getSelectedItem())) { ++ error = NbBundle.getMessage(CreateDatabasePanel.class, "CreateDatbasePanel.MSG_NoGrantUserSelected"); ++ } ++ + if (error != null) { + messageLabel.setText(error); + okButton.setEnabled(false); +@@ -130,6 +134,9 @@ + task = RequestProcessor.getDefault().create(new Runnable() { + public void run() { + createDatabase(); ++ if (isGrantAccess()) { ++ grantAccess(); ++ } + } + }); + +@@ -172,6 +179,13 @@ + return dbconn; + } + ++ private void grantAccess() { ++ String dbname = getDatabaseName(); ++ DatabaseUser user = (DatabaseUser)comboUsers.getSelectedItem(); ++ assert(user != null); ++ server.grantFullDatabaseRights(dbname, user); ++ } ++ + /** + * Create a database based on settings of the dialog. Set the member + * variable dbconn to the resulting Database Connection. +diff -r 76d51071af8a -r af9499d919b8 db.mysql/src/org/netbeans/modules/db/mysql/util/Utils.java +--- a/db.mysql/src/org/netbeans/modules/db/mysql/util/Utils.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/src/org/netbeans/modules/db/mysql/util/Utils.java Tue Mar 10 13:53:55 2009 +0300 +@@ -40,8 +40,10 @@ + package org.netbeans.modules.db.mysql.util; + + import java.io.File; ++import java.net.InetAddress; + import java.net.MalformedURLException; + import java.net.URL; ++import java.net.UnknownHostException; + import java.util.ResourceBundle; + import java.util.logging.Level; + import java.util.logging.Logger; +@@ -58,6 +60,11 @@ + */ + public class Utils { + private static Logger LOGGER = Logger.getLogger(Utils.class.getName()); ++ ++ public static String getHostIpAddress(String hostname) throws UnknownHostException { ++ InetAddress inetaddr = InetAddress.getByName(hostname); ++ return inetaddr.getHostAddress(); ++ } + + public static RuntimeException launderThrowable(Throwable t) { + assert (t != null); +diff -r 76d51071af8a -r af9499d919b8 db.mysql/test/unit/src/org/netbeans/modules/db/mysql/impl/MySQLDatabaseServerTest.java +--- a/db.mysql/test/unit/src/org/netbeans/modules/db/mysql/impl/MySQLDatabaseServerTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db.mysql/test/unit/src/org/netbeans/modules/db/mysql/impl/MySQLDatabaseServerTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -44,6 +44,7 @@ + import java.text.MessageFormat; + import java.util.Arrays; + import java.util.ResourceBundle; ++import org.netbeans.api.db.explorer.DatabaseException; + import org.netbeans.api.db.explorer.JDBCDriverManager; + import org.netbeans.modules.db.mysql.DatabaseServer; + import org.netbeans.modules.db.mysql.test.TestBase; +diff -r 76d51071af8a -r af9499d919b8 db/javahelp/org/netbeans/modules/db/docs/mysql.html +--- a/db/javahelp/org/netbeans/modules/db/docs/mysql.html Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/javahelp/org/netbeans/modules/db/docs/mysql.html Tue Mar 10 13:53:55 2009 +0300 +@@ -52,10 +52,10 @@ + + + +-

Using MySQL with the NetBeans IDE

+-

See Also

+-

The NetBeans IDE comes with MySQL database support. In the Services window, a MySQL node appears under the Databases node when the IDE detects a running MySQL server on the local machine at the default port. The node is also registered automatically under the following conditions:

+-
    ++

    Using MySQL with the IDE

    ++

    See Also

    ++

    The IDE comes with MySQL database support. In the Services window, a MySQL node appears under the Databases node when the IDE detects a running MySQL server on the local machine at the default port. The node is also registered automatically under the following conditions:

    ++
      +
    • If the IDE detects a recognized installation of MySQL. This is currently MAMP on Macintosh and XAMPP on Windows.
    • +
    • If a MySQL connection is registered, the IDE auto-registers the MySQL node using the properties defined on the connection.
    • +
    • If the user creates a new connection to MySQL, the IDE auto-registers the MySQL node at that time.
    • +@@ -64,13 +64,15 @@ + + +
        +-
      • Create Database. Brings up a dialog for creating a database, including sample databases.
      • ++
      • Create Database. Brings up a dialog for creating a database, including sample databases. ++
        • ++Note: When using MySQL 5.0 with Windows, some foreign characters may not be used when creating a database.
      • +
      • Start. Starts the database server. If the user chooses this action and no start or stop command is set, then they are prompted to set the command.
      • +
      • Stop. Stops the database server. If the user chooses this action and no start or stop command is set, then they are prompted to set the command.
      • +
      • Connect. Connects the IDE to the MySQL database server.
      • +
      • Disconnect. Disconnects the IDE ffrom the MySQL database server.
      • + +-
      • Delete. Removes the MySQL node. It also marks the node as removed, so that next time the user starts up NetBeans the IDE will not auto-register the node again. The user will need to manually register the node using Databases > Register MySQL Server.
      • ++
      • Delete. Removes the MySQL node. It also marks the node as removed, so that next time the user starts up the IDE will not auto-register the node again. The user will need to manually register the node using Databases > Register MySQL Server.
      • +
      • Refresh. Refreshes the list of databases based on what's currently on the server.
      • +
      • Run Administration Tool. Brings up the administration tool that is registered with the runtime. The provider either invokes the admin tool as a separate system process, or if it is a web-based tool, brings up the provided URL in the default browser. If the administer command has not been set, then when the user picks the action, they are prompted to set the path to the command.
      • +
      • Properties. Brings up a dialog that allows the user to configure important settings for the server. There are two tabs, one for basic settings and one for setting command paths to administrative commands (start, stop, administer)
      • +@@ -91,6 +93,7 @@ + are not logged. +
      • Disable Debug. This terminates the debugging function.
      • +
      ++ + +
      +
      +diff -r 76d51071af8a -r af9499d919b8 db/libsrc/org/netbeans/lib/ddl/resources/dbspec.plist +--- a/db/libsrc/org/netbeans/lib/ddl/resources/dbspec.plist Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/libsrc/org/netbeans/lib/ddl/resources/dbspec.plist Tue Mar 10 13:53:55 2009 +0300 +@@ -904,7 +904,7 @@ + }; + + RemoveColumnCommand = { +- Supported = false; ++ Supported = true; + }; + + }; +diff -r 76d51071af8a -r af9499d919b8 db/nbproject/project.properties +--- a/db/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -42,7 +42,7 @@ + javadoc.arch=${basedir}/arch.xml + javadoc.apichanges=${basedir}/apichanges.xml + +-spec.version.base=1.30.1 ++spec.version.base=1.30.3 + + extra.module.files=modules/ext/ddl.jar + +diff -r 76d51071af8a -r af9499d919b8 db/src/org/netbeans/modules/db/explorer/actions/AddIndexAction.java +--- a/db/src/org/netbeans/modules/db/explorer/actions/AddIndexAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/src/org/netbeans/modules/db/explorer/actions/AddIndexAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -42,22 +42,23 @@ + package org.netbeans.modules.db.explorer.actions; + + import java.sql.*; +-import java.text.MessageFormat; + import java.util.*; +-import org.netbeans.modules.db.explorer.DbUtilities; + +-import org.openide.*; ++import java.util.logging.Level; ++import java.util.logging.Logger; ++import org.netbeans.api.db.explorer.DatabaseException; + import org.openide.nodes.*; + +-import org.netbeans.lib.ddl.*; + import org.netbeans.lib.ddl.impl.*; +-import org.netbeans.lib.ddl.adaptors.*; + import org.netbeans.modules.db.explorer.*; + import org.netbeans.modules.db.explorer.dlg.*; + import org.netbeans.modules.db.explorer.nodes.*; + import org.netbeans.modules.db.explorer.infos.*; ++import org.openide.util.RequestProcessor; + + public class AddIndexAction extends DatabaseAction { ++ private static final Logger LOGGER = Logger.getLogger(AddIndexAction.class .getName()); ++ + public void performAction (Node[] activatedNodes) { + Node node; + if (activatedNodes != null && activatedNodes.length>0) +@@ -67,7 +68,7 @@ + + try { + DatabaseNodeInfo info = (DatabaseNodeInfo)node.getCookie(DatabaseNodeInfo.class); +- IndexListNodeInfo nfo = (IndexListNodeInfo)info.getParent(nodename); ++ final IndexListNodeInfo nfo = (IndexListNodeInfo)info.getParent(nodename); + + String tablename = (String)nfo.get(DatabaseNode.TABLE); + String columnname = (String)nfo.get(DatabaseNode.COLUMN); +@@ -93,12 +94,24 @@ + throw new Exception(bundle().getString("EXC_NoUsableColumnInPlace")); // NOI18N + + // Create and execute command +- AddIndexDialog dlg = new AddIndexDialog(cols, spec, info); ++ final AddIndexDialog dlg = new AddIndexDialog(cols, spec, info); + dlg.setIndexName(tablename + "_idx"); // NOI18N + if (dlg.run()) { +- nfo.addIndex(dlg.getIndexName()); ++ RequestProcessor.getDefault().post(new Runnable() { ++ public void run() { ++ try { ++ nfo.addIndex(dlg.getIndexName()); ++ nfo.refreshChildren(); ++ } catch (DatabaseException dbe) { ++ LOGGER.log(Level.INFO, dbe.getMessage(), dbe); ++ DbUtilities.reportError(bundle().getString("ERR_UnableToAddIndex"), dbe.getMessage()); // NOI18N ++ } ++ ++ } ++ }); + } + } catch(Exception exc) { ++ LOGGER.log(Level.INFO, exc.getMessage(), exc); + DbUtilities.reportError(bundle().getString("ERR_UnableToAddIndex"), exc.getMessage()); // NOI18N + } + } +diff -r 76d51071af8a -r af9499d919b8 db/src/org/netbeans/modules/db/explorer/dlg/LabeledTextFieldDialog.form +--- a/db/src/org/netbeans/modules/db/explorer/dlg/LabeledTextFieldDialog.form Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/src/org/netbeans/modules/db/explorer/dlg/LabeledTextFieldDialog.form Tue Mar 10 13:53:55 2009 +0300 +@@ -22,7 +22,7 @@ + + + +- ++ + + + +@@ -54,21 +54,29 @@ + + + +- ++ + + + + + + +- ++ + + ++ ++ ++ ++ ++ ++ ++ ++ + + + + +- ++ + + + +@@ -88,13 +96,21 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ + + + + + + +- ++ + + + +diff -r 76d51071af8a -r af9499d919b8 db/src/org/netbeans/modules/db/explorer/dlg/LabeledTextFieldDialog.java +--- a/db/src/org/netbeans/modules/db/explorer/dlg/LabeledTextFieldDialog.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/src/org/netbeans/modules/db/explorer/dlg/LabeledTextFieldDialog.java Tue Mar 10 13:53:55 2009 +0300 +@@ -60,8 +60,8 @@ + /** Creates new form LabeledTextFieldDialog */ + public LabeledTextFieldDialog(String notes) + { +- String title = bundle.getString("RecreateTableRenameTable"); +- String lab = bundle.getString("RecreateTableNewName"); ++ String title = bundle.getString("RecreateTableRenameTable"); // NOI18N ++ String lab = bundle.getString("RecreateTableNewName"); // NOI18N + original_notes = notes; + + initComponents(); +@@ -71,7 +71,7 @@ + Mnemonics.setLocalizedText(titleLabel, lab); + titleLabel.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_RecreateTableNewNameA11yDesc")); // NOI18N + +- Mnemonics.setLocalizedText(descLabel, bundle.getString("RecreateTableRenameNotes")); ++ Mnemonics.setLocalizedText(descLabel, bundle.getString("RecreateTableRenameNotes")); // NOI18N + descLabel.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_RecreateTableRenameNotesA11yDesc")); // NOI18N + Mnemonics.setLocalizedText(editButton, bundle.getString("EditCommand")); // NOI18N + editButton.setToolTipText(bundle.getString("ACS_EditCommandA11yDesc")); // NOI18N +@@ -86,7 +86,7 @@ + } + }; + +- getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_RecreateTableDialogA11yDesc")); ++ getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_RecreateTableDialogA11yDesc")); // NOI18N + + DialogDescriptor descriptor = new DialogDescriptor(this, title, true, listener); + dialog = DialogDisplayer.getDefault().createDialog(descriptor); +@@ -134,7 +134,7 @@ + isEditMode = !isEditMode; + + if (isEditMode) { // NOI18N +- Mnemonics.setLocalizedText(editButton, bundle.getString("ReloadCommand")); ++ Mnemonics.setLocalizedText(editButton, bundle.getString("ReloadCommand")); // NOI18N + editButton.setToolTipText(bundle.getString("ACS_ReloadCommandA11yDesc")); // NOI18N + notesArea.setEditable( true ); + notesArea.setEnabled(true); +@@ -144,12 +144,12 @@ + textField.setBackground(titleLabel.getBackground()); // grey + } else { + // reload script from file +- Mnemonics.setLocalizedText(editButton, bundle.getString("EditCommand")); ++ Mnemonics.setLocalizedText(editButton, bundle.getString("EditCommand")); // NOI18N + editButton.setToolTipText(bundle.getString("ACS_EditCommandA11yDesc")); // NOI18N + notesArea.setText(original_notes); + notesArea.setEditable( false ); + notesArea.setEnabled(false); +- notesArea.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground")); ++ notesArea.setDisabledTextColor(javax.swing.UIManager.getColor("Label.foreground")); // NOI18N + textField.setEditable( true ); + textField.setBackground(notesArea.getBackground()); // grey + notesArea.setBackground(titleLabel.getBackground()); // white +@@ -162,7 +162,7 @@ + * WARNING: Do NOT modify this code. The content of this method is + * always regenerated by the Form Editor. + */ +- // ++ // //GEN-BEGIN:initComponents + private void initComponents() { + + titleLabel = new javax.swing.JLabel(); +@@ -172,6 +172,12 @@ + notesArea = new javax.swing.JTextArea(); + editButton = new javax.swing.JButton(); + ++ titleLabel.setText(bundle.getString("LabeledTextFieldDialog.titleLabel.text")); // NOI18N ++ ++ textField.setText(bundle.getString("LabeledTextFieldDialog.textField.text")); // NOI18N ++ ++ descLabel.setText(bundle.getString("LabeledTextFieldDialog.descLabel.text")); // NOI18N ++ + notesArea.setColumns(20); + notesArea.setEditable(false); + notesArea.setLineWrap(true); +@@ -179,7 +185,10 @@ + notesArea.setWrapStyleWord(true); + notesArea.setEnabled(false); + notesAreaScrollPane.setViewportView(notesArea); ++ notesArea.getAccessibleContext().setAccessibleName(bundle.getString("ACS_RecreateTableTableScriptTextAreaA11yName")); // NOI18N ++ notesArea.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_RecreateTableTableScriptTextAreaA11yDesc")); // NOI18N + ++ editButton.setText(bundle.getString("LabeledTextFieldDialog.editButton.text")); // NOI18N + editButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(java.awt.event.ActionEvent evt) { + editButtonActionPerformed(evt); +@@ -197,7 +206,7 @@ + .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createSequentialGroup() + .add(titleLabel) + .add(18, 18, 18) +- .add(textField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 437, Short.MAX_VALUE)) ++ .add(textField, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 485, Short.MAX_VALUE)) + .add(org.jdesktop.layout.GroupLayout.LEADING, descLabel) + .add(org.jdesktop.layout.GroupLayout.LEADING, editButton)) + .addContainerGap()) +@@ -217,7 +226,10 @@ + .add(editButton) + .addContainerGap()) + ); +- }// ++ ++ textField.getAccessibleContext().setAccessibleName(bundle.getString("ACS_RecreateTableNewNameTextFieldA11yName")); // NOI18N ++ textField.getAccessibleContext().setAccessibleDescription(bundle.getString("ACS_RecreateTableNewNameTextFieldA11yDesc")); // NOI18N ++ }// //GEN-END:initComponents + + private void editButtonActionPerformed(java.awt.event.ActionEvent evt) { + updateState(); +@@ -231,13 +243,13 @@ + private String original_notes; + private ResourceBundle bundle = NbBundle.getBundle("org.netbeans.modules.db.resources.Bundle"); //NOI18N + +- // Variables declaration - do not modify ++ // Variables declaration - do not modify//GEN-BEGIN:variables + private javax.swing.JLabel descLabel; + private javax.swing.JButton editButton; + private javax.swing.JTextArea notesArea; + private javax.swing.JScrollPane notesAreaScrollPane; + private javax.swing.JTextField textField; + private javax.swing.JLabel titleLabel; +- // End of variables declaration ++ // End of variables declaration//GEN-END:variables + + } +diff -r 76d51071af8a -r af9499d919b8 db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java +--- a/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/src/org/netbeans/modules/db/explorer/dlg/NewConnectionPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -884,6 +884,7 @@ + public void run() { + progressHandle = ProgressHandleFactory.createHandle(getMessage("ConnectionProgress_Connecting")); + progressHandle.start(); ++ enableInput(false); + } + }); + } +@@ -911,11 +912,28 @@ + public void run() { + if (progressHandle != null) { + progressHandle.finish(); ++ enableInput(true); + } + } + }); + } + ++ private void enableInput(boolean enable) { ++ fieldInputCheckBox.setEnabled(enable); ++ directInputCheckBox.setEnabled(enable); ++ templateComboBox.setEnabled(enable); ++ userField.setEnabled(enable); ++ passwordField.setEnabled(enable); ++ passwordCheckBox.setEnabled(enable); ++ showUrlCheckBox.setEnabled(enable); ++ urlField.setEnabled(enable); ++ directUrlField.setEnabled(enable); ++ ++ for (Entry entry : urlFields.entrySet()) { ++ entry.getValue().getField().setEnabled(enable); ++ } ++ } ++ + private void resetProgress() { + if (progressHandle != null) { + progressHandle.setDisplayName(""); // NOI18N +diff -r 76d51071af8a -r af9499d919b8 db/src/org/netbeans/modules/db/explorer/infos/Bundle.properties +--- a/db/src/org/netbeans/modules/db/explorer/infos/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/src/org/netbeans/modules/db/explorer/infos/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -34,4 +34,5 @@ + # Contributor(s): + # + # Portions Copyrighted 2008 Sun Microsystems, Inc. +-MSG_ConnectionLost=Connection to the database was lost. Do you want to try to reconnect? +\ No newline at end of file ++MSG_ConnectionLost=Connection to the database was lost. Do you want to try to reconnect? ++LBL_JavaDB_DeleteNotSupported=Java DB version {0} does not support column deletion. +\ No newline at end of file +diff -r 76d51071af8a -r af9499d919b8 db/src/org/netbeans/modules/db/explorer/infos/ColumnNodeInfo.java +--- a/db/src/org/netbeans/modules/db/explorer/infos/ColumnNodeInfo.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/src/org/netbeans/modules/db/explorer/infos/ColumnNodeInfo.java Tue Mar 10 13:53:55 2009 +0300 +@@ -43,9 +43,13 @@ + + import java.io.IOException; + import java.sql.ResultSet; ++import java.sql.SQLException; + import java.util.HashMap; + import java.util.Map; + import java.text.MessageFormat; ++import java.util.Vector; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import org.netbeans.modules.db.explorer.DbUtilities; + + import org.netbeans.lib.ddl.impl.AbstractCommand; +@@ -57,10 +61,37 @@ + import org.netbeans.lib.ddl.impl.TableColumn; + + import org.netbeans.api.db.explorer.DatabaseException; ++import org.netbeans.modules.db.explorer.nodes.ColumnNode; + import org.netbeans.modules.db.explorer.nodes.DatabaseNode; + + public class ColumnNodeInfo extends DatabaseNodeInfo { + static final long serialVersionUID =-1470704512178901918L; ++ private static final Logger LOGGER = Logger.getLogger(ColumnNode.class.getName()); ++ private static final double JAVADB_MINOR_VERSION_SUPPORTED = 3; // Java DB minor version that supports column deletion ++ private static final String DELETE_ACTION_CLASS = "DeleteAction"; // NOI18N ++ ++ ++ @Override ++ public Vector getActions() { ++ // #149904 [65cat] Cannot remove database table column from action ++ Vector actions = super.getActions(); ++ Vector revisedActions = new Vector(); ++ Specification spec = (Specification) getSpecification(); ++ // If Java DB doesn't support column deletion, exclude the Delete action ++ for (int i = 0; i < actions.size(); i++) { ++ if (spec.getProperties().get("DatabaseProductName").equals("Apache Derby") && !isSupported(spec)) { // NOI18N ++ if (actions.get(i) != null) { ++ String simpleClassName = actions.get(i).getClass().getSimpleName(); ++ if (!simpleClassName.equals(DELETE_ACTION_CLASS)) { ++ revisedActions.add(actions.get(i)); ++ } ++ } ++ } else { ++ revisedActions.add(actions.get(i)); ++ } ++ } ++ return revisedActions; ++ } + + public boolean canAdd(Map propmap, String propname) { + if (propname.equals("decdigits")) { //NOI18N +@@ -287,5 +318,26 @@ + return this.getColumnPosition() - + ((ColumnNodeInfo)o2).getColumnPosition(); + } +- ++ ++ private boolean isSupported(Specification spec) { ++ try { ++ int majorVersion = spec.getMetaData().getDatabaseMajorVersion(); ++ if (majorVersion < 10) { ++ return false; ++ } ++ String productVersion = spec.getMetaData().getDatabaseProductVersion(); ++ int dotLoc = productVersion.indexOf("."); // NOI18N ++ if (dotLoc != -1) { // check if no "dot" in the release - if future Java DB versions do not support dot releases ++ int minorVersion = Integer.parseInt(productVersion.substring(dotLoc + 1, dotLoc + 2)); ++ if (minorVersion < JAVADB_MINOR_VERSION_SUPPORTED) { ++ return false; ++ } ++ } ++ } catch (SQLException ex) { ++ LOGGER.log(Level.INFO, "ColumnNodeInfo.isSupported() threw SQLException", ex); ++ } catch (NumberFormatException nfe) { ++ LOGGER.log(Level.INFO, "ColumnNodeInfo.isSupported() threw NumberFormatException retrieving the version", nfe); ++ } ++ return true; ++ } + } +diff -r 76d51071af8a -r af9499d919b8 db/src/org/netbeans/modules/db/explorer/infos/DatabaseNodeInfo.java +--- a/db/src/org/netbeans/modules/db/explorer/infos/DatabaseNodeInfo.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/src/org/netbeans/modules/db/explorer/infos/DatabaseNodeInfo.java Tue Mar 10 13:53:55 2009 +0300 +@@ -50,7 +50,9 @@ + import java.util.*; + + import java.util.concurrent.ConcurrentHashMap; ++import java.util.logging.Level; + import java.util.logging.Logger; ++import javax.swing.SwingUtilities; + import javax.swing.event.ChangeListener; + import org.netbeans.api.db.explorer.ConnectionManager; + import org.openide.nodes.Node; +@@ -59,7 +61,6 @@ + + import org.netbeans.lib.ddl.DatabaseSpecification; + import org.netbeans.lib.ddl.DatabaseSpecificationFactory; +-import org.netbeans.lib.ddl.DBConnection; + import org.netbeans.lib.ddl.impl.DriverSpecification; + import org.netbeans.lib.ddl.util.PListReader; + import org.netbeans.api.db.explorer.DatabaseException; +@@ -70,9 +71,12 @@ + import org.netbeans.modules.db.explorer.actions.DatabaseAction; + import org.netbeans.modules.db.explorer.nodes.DatabaseNode; + import org.netbeans.modules.db.util.UIUtils; ++import org.openide.DialogDisplayer; ++import org.openide.NotifyDescriptor; + import org.openide.util.ChangeSupport; + import org.openide.util.Mutex; + import org.openide.util.Mutex.Action; ++import org.openide.util.RequestProcessor; + + public class DatabaseNodeInfo extends ConcurrentHashMap + implements Node.Cookie, Comparable { +@@ -355,11 +359,30 @@ + } + + public void refreshChildren() throws DatabaseException { ++ // Refresh involves going to the database, which shouldn't go on the ++ // dispatch thread. ++ if (SwingUtilities.isEventDispatchThread()) { ++ RequestProcessor.getDefault().post(new Runnable() { ++ public void run() { ++ try { ++ refreshChildrenSync(); ++ } catch (Exception e) { ++ LOGGER.log(Level.INFO, e.getMessage(), e); ++ DialogDisplayer.getDefault().notifyLater(new NotifyDescriptor.Exception(e)); ++ } ++ } ++ }); ++ } else { ++ refreshChildrenSync(); ++ } ++ } ++ ++ private void refreshChildrenSync() throws DatabaseException { + // create list (infos) + Vector children = loadChildren(new Vector()); + + put(DatabaseNodeInfo.CHILDREN, children); +- ++ + notifyChange(); + } + +diff -r 76d51071af8a -r af9499d919b8 db/src/org/netbeans/modules/db/util/DataComboBoxSupport.java +--- a/db/src/org/netbeans/modules/db/util/DataComboBoxSupport.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/src/org/netbeans/modules/db/util/DataComboBoxSupport.java Tue Mar 10 13:53:55 2009 +0300 +@@ -41,21 +41,15 @@ + + package org.netbeans.modules.db.util; + +-import java.awt.Color; + import java.awt.Component; +-import java.awt.Dimension; + import java.awt.event.ActionEvent; + import java.awt.event.ActionListener; +-import java.awt.event.InputEvent; +-import java.awt.event.KeyAdapter; +-import java.awt.event.KeyEvent; + import javax.swing.AbstractListModel; + import javax.swing.ComboBoxModel; + import javax.swing.DefaultListCellRenderer; + import javax.swing.JComboBox; + import javax.swing.JLabel; + import javax.swing.JList; +-import javax.swing.JSeparator; + import javax.swing.SwingUtilities; + import javax.swing.event.ListDataEvent; + import javax.swing.event.ListDataListener; +@@ -64,7 +58,7 @@ + + /** + * This is an utility class for filling combo boxes with some data (usually +- * some items). The combo box has a separator item and a "Add item" item allowing ++ * some items). The combo box has a "New item" item allowing + * the user to invoke the adding of new items to the combo box. The client of + * this class should provide a {@link DataComboBoxModel} and call + * the {@link #connect} method. +@@ -72,35 +66,15 @@ + * @author Andrei Badea + */ + public final class DataComboBoxSupport { +- + private final DataComboBoxModel dataModel; + private final boolean allowAdding; + + private Object previousItem = null; + private Object previousNonSpecialItem = null; +- private int previousIndex = -1; + + private boolean performingNewItemAction = false; + + /** +- * Serves as the separator item. +- */ +- private static final class Separator extends JSeparator { +- +- Separator() { +- setForeground(Color.BLACK); +- } +- +- public Dimension getPreferredSize() { +- Dimension size = super.getPreferredSize(); +- return new Dimension(size.width, 1); +- } +- } +- +- /** Not private because used in tests. */ +- static final Separator SEPARATOR_ITEM = new Separator(); +- +- /** + * Serves as the new item. Not private because used in tests. + */ + final Object NEW_ITEM = new Object() { +@@ -113,13 +87,12 @@ + DataComboBoxSupport(JComboBox comboBox, DataComboBoxModel dataModel, boolean allowAdding) { + this.dataModel = dataModel; + this.allowAdding = allowAdding; +- ++ + comboBox.setEditable(false); + + comboBox.setModel(new ItemComboBoxModel()); + + comboBox.setRenderer(new ItemListCellRenderer()); +- comboBox.addKeyListener(new ItemKeyListener()); + comboBox.addActionListener(new ItemActionListener()); + comboBox.addPopupMenuListener(new ItemPopupMenuListener()); + } +@@ -139,7 +112,7 @@ + } + + private boolean isSpecialItem(Object item) { +- return item == SEPARATOR_ITEM || item == NEW_ITEM; ++ return item == NEW_ITEM; + } + + private void setPreviousNonSpecialItem(JComboBox comboBox) { +@@ -169,11 +142,9 @@ + } + } + +- // there are the delegate items, SEPARATOR_ITEM, NEW_ITEM ++ // there are the delegate items and NEW_ITEM + if (index >= 0 && index < getDelegate().getSize()) { + return getDelegate().getElementAt(index); +- } else if (index == getSize() - 2) { +- return SEPARATOR_ITEM; + } else if (index == getSize() - 1) { + return NEW_ITEM; + } else { +@@ -187,9 +158,8 @@ + + public int getSize() { + // 1 = NEW_ITEM +- // 2 = SEPARATOR, NEW_ITEM + if (allowAdding) { +- return getDelegate().getSize() == 0 ? 1 : getDelegate().getSize() + 2; ++ return getDelegate().getSize() == 0 ? 1 : getDelegate().getSize() + 1; + } else { + return getDelegate().getSize(); + } +@@ -197,7 +167,6 @@ + + public void setSelectedItem(Object anItem) { + previousItem = getDelegate().getSelectedItem(); +- previousIndex = getItemIndex(previousItem); + + if (!isSpecialItem(previousItem)) { + previousNonSpecialItem = previousItem; +@@ -254,8 +223,6 @@ + String displayName = dataModel.getItemDisplayName(value); + label.setText(dataModel.getItemDisplayName(value)); + label.setToolTipText(dataModel.getItemTooltipText(value)); +- } else if (value == SEPARATOR_ITEM) { +- return SEPARATOR_ITEM; + } else if (value != null) { + label.setText(value.toString()); + label.setToolTipText(null); +@@ -265,73 +232,32 @@ + } + } + +- private final class ItemKeyListener extends KeyAdapter { +- +- public void keyPressed(KeyEvent e) { +- JComboBox comboBox = (JComboBox)e.getSource(); +- +- int keyCode = e.getKeyCode(); +- if (KeyEvent.VK_ENTER == keyCode) { +- Object selectedItem = comboBox.getSelectedItem(); +- if (selectedItem == NEW_ITEM) { +- performingNewItemAction = true; +- try { +- comboBox.setPopupVisible(false); +- e.consume(); +- dataModel.newItemActionPerformed(); +- } finally { +- performingNewItemAction = false; +- } +- +- setPreviousNonSpecialItem(comboBox); +- } +- } +- } +- } +- + private final class ItemActionListener implements ActionListener { + + public void actionPerformed(ActionEvent e) { + final JComboBox comboBox = (JComboBox)e.getSource(); + + Object selectedItem = comboBox.getSelectedItem(); +- if (selectedItem == SEPARATOR_ITEM) { +- int newIndex = -1; +- if (previousIndex != -1) { +- // skipping the separator when moving up/down with the arrow keys +- int selectedIndex = comboBox.getSelectedIndex(); +- if (selectedIndex > previousIndex) { +- // moving down +- newIndex = selectedIndex + 1; +- } else { +- // moving up +- newIndex= selectedIndex - 1; ++ if (selectedItem == NEW_ITEM) { ++ performingNewItemAction = true; ++ try { ++ comboBox.setPopupVisible(false); ++ dataModel.newItemActionPerformed(); ++ } finally { ++ performingNewItemAction = false; ++ } ++ ++ setPreviousNonSpecialItem(comboBox); ++ // we (or maybe the client) have just selected an item inside an actionPerformed event, ++ // which will not send another actionPerformed event for the new item. ++ // We need to make sure all listeners get an event for the new item, ++ // thus... ++ final Object newSelectedItem = comboBox.getSelectedItem(); ++ SwingUtilities.invokeLater(new Runnable() { ++ public void run() { ++ comboBox.setSelectedItem(newSelectedItem); + } +- } +- comboBox.setSelectedIndex(newIndex); +- } else if ((e.getModifiers() & InputEvent.BUTTON1_MASK) != 0) { +- // handling mouse click, see KeyEvent.getKeyModifiersText(e.getModifiers()) +- if (selectedItem == NEW_ITEM) { +- performingNewItemAction = true; +- try { +- comboBox.setPopupVisible(false); +- dataModel.newItemActionPerformed(); +- } finally { +- performingNewItemAction = false; +- } +- +- setPreviousNonSpecialItem(comboBox); +- // we (or maybe the client) have just selected an item inside an actionPerformed event, +- // which will not send another actionPerformed event for the new item. +- // We need to make sure all listeners get an event for the new item, +- // thus... +- final Object newSelectedItem = comboBox.getSelectedItem(); +- SwingUtilities.invokeLater(new Runnable() { +- public void run() { +- comboBox.setSelectedItem(newSelectedItem); +- } +- }); +- } ++ }); + } + } + } +diff -r 76d51071af8a -r af9499d919b8 db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java +--- a/db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/test/unit/src/org/netbeans/api/db/explorer/support/DatabaseExplorerUIsTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -85,7 +85,7 @@ + initConnections(); + JComboBox combo = connect(); + +- assertTrue("Wrong number of items in the combobox", combo.getItemCount() == 4); ++ assertTrue("Wrong number of items in the combobox", combo.getItemCount() == 3); + + assertSame(dbconn2, combo.getItemAt(0)); + assertSame(dbconn1, combo.getItemAt(1)); +diff -r 76d51071af8a -r af9499d919b8 db/test/unit/src/org/netbeans/modules/db/util/DataComboBoxSupportTest.java +--- a/db/test/unit/src/org/netbeans/modules/db/util/DataComboBoxSupportTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/test/unit/src/org/netbeans/modules/db/util/DataComboBoxSupportTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -80,8 +80,7 @@ + + assertEquals("foo", comboBox.getItemAt(0)); + assertEquals("bar", comboBox.getItemAt(1)); +- assertSame(support.SEPARATOR_ITEM, comboBox.getItemAt(2)); +- assertEquals("Add", comboBox.getItemAt(3).toString()); ++ assertEquals("Add", comboBox.getItemAt(2).toString()); + assertEquals("The old selected item was removed, nothing should be selected now", -1, comboBox.getSelectedIndex()); + + comboBox.setSelectedIndex(1); // bar +@@ -89,8 +88,7 @@ + listModel.setItems(items); + + assertEquals("bar", comboBox.getItemAt(0)); +- assertSame(support.SEPARATOR_ITEM, comboBox.getItemAt(1)); +- assertEquals("Add", comboBox.getItemAt(2).toString()); ++ assertEquals("Add", comboBox.getItemAt(1).toString()); + assertEquals("Bar should still be selected", 0, comboBox.getSelectedIndex()); + + items.add("new"); +@@ -98,8 +96,7 @@ + + assertEquals("bar", comboBox.getItemAt(0)); + assertEquals("new", comboBox.getItemAt(1)); +- assertSame(support.SEPARATOR_ITEM, comboBox.getItemAt(2)); +- assertEquals("Add", comboBox.getItemAt(3).toString()); ++ assertEquals("Add", comboBox.getItemAt(2).toString()); + assertEquals("new", comboBox.getSelectedItem()); + assertEquals("New should be selected", 1, comboBox.getSelectedIndex()); + } +diff -r 76d51071af8a -r af9499d919b8 db/test/unit/src/org/netbeans/modules/db/util/DatabaseExplorerInternalUIsTest.java +--- a/db/test/unit/src/org/netbeans/modules/db/util/DatabaseExplorerInternalUIsTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/db/test/unit/src/org/netbeans/modules/db/util/DatabaseExplorerInternalUIsTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -93,7 +93,7 @@ + JComboBox combo = new JComboBox(); + DatabaseExplorerInternalUIs.connect(combo, JDBCDriverManager.getDefault()); + +- assertEquals(4, combo.getItemCount()); ++ assertEquals(3, combo.getItemCount()); + JdbcUrl url = (JdbcUrl)combo.getItemAt(0); + assertDriversEqual(driver2, url.getDriver()); + assertEquals(driver2.getClassName(), url.getClassName()); +@@ -123,7 +123,7 @@ + JComboBox combo = new JComboBox(); + DatabaseExplorerInternalUIs.connect(combo, JDBCDriverManager.getDefault()); + +- assertEquals(4, combo.getItemCount()); ++ assertEquals(3, combo.getItemCount()); + + JdbcUrl url = (JdbcUrl)combo.getItemAt(0); + assertDriversEqual(driver1, url.getDriver()); +diff -r 76d51071af8a -r af9499d919b8 dbschema/nbproject/project.properties +--- a/dbschema/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/dbschema/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,7 +39,7 @@ + + javac.compilerargs=-Xlint -Xlint:-serial + javac.source=1.5 +-spec.version.base=1.12.1 ++spec.version.base=1.12.2 + + javahelp.base=org/netbeans/modules/dbschema/docs + javahelp.hs=HelpSet.hs +diff -r 76d51071af8a -r af9499d919b8 dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaConnectionPanel.java +--- a/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaConnectionPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaConnectionPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + /* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * +- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. ++ * Copyright 1997-2009 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 +@@ -24,7 +24,7 @@ + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original +- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun ++ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL +@@ -169,7 +169,7 @@ + + private final ResourceBundle bundle = NbBundle.getBundle("org.netbeans.modules.dbschema.jdbcimpl.resources.Bundle"); //NOI18N + +- public boolean isValid() { ++ public boolean isInputValid() { + return existingConnComboBox.getSelectedItem() instanceof DatabaseConnection; + } + +diff -r 76d51071af8a -r af9499d919b8 dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaConnectionWizardPanel.java +--- a/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaConnectionWizardPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaConnectionWizardPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + /* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * +- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. ++ * Copyright 1997-2009 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 +@@ -24,7 +24,7 @@ + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original +- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun ++ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL +@@ -68,7 +68,7 @@ + } + + public boolean isValid () { +- return getPanelUI().isValid(); ++ return getPanelUI().isInputValid(); + } + + } +diff -r 76d51071af8a -r af9499d919b8 dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesPanel.java +--- a/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + /* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * +- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. ++ * Copyright 1997-2009 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 +@@ -24,7 +24,7 @@ + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original +- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun ++ * Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun + * Microsystems, Inc. All Rights Reserved. + * + * If you wish your version of this file to be governed by only the CDDL +@@ -687,7 +687,7 @@ + jButtonRemoveAll.setEnabled(((SortedListModel) jListSelectedTables.getModel()).isEmpty() ? false : true); + } + +- public boolean isValid() { ++ public boolean isInputValid() { + if (jListSelectedTables.getModel().getSize() > 0) + return true; + else +diff -r 76d51071af8a -r af9499d919b8 dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesWizardPanel.java +--- a/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesWizardPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/dbschema/src/org/netbeans/modules/dbschema/jdbcimpl/wizard/DBSchemaTablesWizardPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -68,7 +68,7 @@ + } + + public boolean isValid () { +- return getPanelUI().isValid(); ++ return getPanelUI().isInputValid(); + } + + } +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/manifest.mf +--- a/debugger.jpda.ui/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,7 +2,7 @@ + OpenIDE-Module: org.netbeans.modules.debugger.jpda.ui/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/ui/Bundle.properties + OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/resources/mf-layer.xml +-OpenIDE-Module-Specification-Version: 1.8.2 ++OpenIDE-Module-Specification-Version: 1.8.3 + OpenIDE-Module-Requires: org.netbeans.api.debugger.jpda.JPDADebuggerEngineImpl, + org.netbeans.spi.debugger.ui + OpenIDE-Module-Provides: org.netbeans.modules.debugger.jpda.ui +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/nbproject/project.xml +--- a/debugger.jpda.ui/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -115,6 +115,7 @@ + + + 1 ++ 2.14.2 + + + +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/Bundle.properties +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -42,7 +42,11 @@ + OpenIDE-Module-Name=Java Debugger + OpenIDE-Module-Display-Category=Java + OpenIDE-Module-Short-Description=JPDA Debugger. +-OpenIDE-Module-Long-Description=Contains UI for Java Debugger implementation. ++OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ ++ Contains UI for Java Debugger implementation. + + # File names on system filesystem + # Each key is resource path to a primary file +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/ConnectPanel.java +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/ConnectPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/ConnectPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -57,6 +57,7 @@ + import java.awt.event.ActionListener; + import java.awt.event.FocusAdapter; + import java.awt.event.FocusEvent; ++import java.beans.PropertyChangeListener; + import java.io.IOException; + import java.text.MessageFormat; + import java.util.ArrayList; +@@ -106,8 +107,7 @@ + * + * @author Jan Jancura + */ +-public class ConnectPanel extends JPanel implements +-Controller, ActionListener { ++public class ConnectPanel extends JPanel implements ActionListener { + + private static final Logger USG_LOGGER = Logger.getLogger("org.netbeans.ui.metrics.debugger"); // NOI18N + +@@ -117,6 +117,7 @@ + private JComboBox cbConnectors; + /** List of JTextFields containing all parameters of curentConnector. */ + private JTextField[] tfParams; ++ private Controller controller; + + + public ConnectPanel () { +@@ -176,6 +177,11 @@ + } + + cbConnectors.setSelectedIndex (defaultIndex); ++ controller = new ConnectController(); ++ } ++ ++ public Controller getController() { ++ return controller; + } + + /** +@@ -310,93 +316,6 @@ + return; + } + +- public boolean cancel () { +- return true; +- } +- +- public boolean ok () { +- int index = cbConnectors.getSelectedIndex (); +- final Connector connector = (Connector) connectors.get (index); +- final Map args = getEditedArgs (tfParams, connector); +- if (args == null) return true; // CANCEL +- saveArgs (args, connector); +- log(connector, args); +- +- // Take the start off the AWT EQ: +- final RequestProcessor.Task[] startTaskPtr = new RequestProcessor.Task[1]; +- startTaskPtr[0] = RequestProcessor.getDefault().create(new Runnable() { +- public void run() { +- final Thread theCurrentThread = Thread.currentThread(); +- ProgressHandle progress = ProgressHandleFactory.createHandle( +- NbBundle.getMessage(ConnectPanel.class, "CTL_connectProgress"), +- new Cancellable() { +- public boolean cancel() { +- theCurrentThread.interrupt(); +- return startTaskPtr[0].isFinished(); +- } +- }); +- try { +- //System.out.println("Before progress.start()"); +- progress.start(); +- //System.out.println("After progress.start()"); +- DebuggerEngine[] es = null; +- if (connector instanceof AttachingConnector) +- es = DebuggerManager.getDebuggerManager ().startDebugging ( +- DebuggerInfo.create ( +- AttachingDICookie.ID, +- new Object [] { +- AttachingDICookie.create ( +- (AttachingConnector) connector, +- args +- ) +- } +- ) +- ); +- else +- if (connector instanceof ListeningConnector) +- es = DebuggerManager.getDebuggerManager ().startDebugging ( +- DebuggerInfo.create ( +- ListeningDICookie.ID, +- new Object [] { +- ListeningDICookie.create ( +- (ListeningConnector) connector, +- args +- ) +- } +- ) +- ); +- if (es != null) { +- for (int i = 0; i < es.length; i++) { +- JPDADebugger d = es[i].lookupFirst(null, JPDADebugger.class); +- if (d == null) continue; +- try { +- // workaround for #64227 +- if (d.getState() != d.STATE_RUNNING) +- d.waitRunning (); +- } catch (DebuggerStartException dsex) { +- //ErrorManager.getDefault().notify(ErrorManager.USER, dsex); +- // Not necessary to notify - message written to debugger console. +- } +- } +- } +- } finally { +- //System.out.println("Before progress.finish()"); +- progress.finish(); +- //System.out.println("After progress.finish()"); +- } +- } +- }); +- Runnable action = new Runnable() { +- +- public void run() { +- startTaskPtr[0].schedule(0); +- } +- }; +- ScanDialog.runWhenScanFinished(action, NbBundle.getMessage (ConnectPanel.class, "CTL_Connect")); //NOI18N +- //System.out.println("Before return from ConnectPanel.ok()"); +- return true; +- } +- + private static void log(Connector c, Map args) { + LogRecord record = new LogRecord(Level.INFO, "USG_DEBUG_ATTACH_JPDA"); + record.setResourceBundle(NbBundle.getBundle(ConnectPanel.class)); +@@ -419,17 +338,6 @@ + USG_LOGGER.log(record); + } + +- /** +- * Return true whether value of this customizer +- * is valid (and OK button can be enabled). +- * +- * @return true whether value of this customizer +- * is valid +- */ +- public boolean isValid () { +- return true; +- } +- + + // private helper methods .................................................. + +@@ -602,6 +510,113 @@ + return null; + } + } ++ ++ private class ConnectController implements Controller { ++ ++ public boolean cancel () { ++ return true; ++ } ++ ++ public boolean ok () { ++ int index = cbConnectors.getSelectedIndex (); ++ final Connector connector = (Connector) connectors.get (index); ++ final Map args = getEditedArgs (tfParams, connector); ++ if (args == null) return true; // CANCEL ++ saveArgs (args, connector); ++ log(connector, args); ++ ++ // Take the start off the AWT EQ: ++ final RequestProcessor.Task[] startTaskPtr = new RequestProcessor.Task[1]; ++ startTaskPtr[0] = new RequestProcessor("JPDA Debugger Starting").create(new Runnable() { ++ public void run() { ++ final Thread theCurrentThread = Thread.currentThread(); ++ ProgressHandle progress = ProgressHandleFactory.createHandle( ++ NbBundle.getMessage(ConnectPanel.class, "CTL_connectProgress"), ++ new Cancellable() { ++ public boolean cancel() { ++ theCurrentThread.interrupt(); ++ return startTaskPtr[0].isFinished(); ++ } ++ }); ++ try { ++ //System.out.println("Before progress.start()"); ++ progress.start(); ++ //System.out.println("After progress.start()"); ++ DebuggerEngine[] es = null; ++ if (connector instanceof AttachingConnector) ++ es = DebuggerManager.getDebuggerManager ().startDebugging ( ++ DebuggerInfo.create ( ++ AttachingDICookie.ID, ++ new Object [] { ++ AttachingDICookie.create ( ++ (AttachingConnector) connector, ++ args ++ ) ++ } ++ ) ++ ); ++ else ++ if (connector instanceof ListeningConnector) ++ es = DebuggerManager.getDebuggerManager ().startDebugging ( ++ DebuggerInfo.create ( ++ ListeningDICookie.ID, ++ new Object [] { ++ ListeningDICookie.create ( ++ (ListeningConnector) connector, ++ args ++ ) ++ } ++ ) ++ ); ++ if (es != null) { ++ for (int i = 0; i < es.length; i++) { ++ JPDADebugger d = es[i].lookupFirst(null, JPDADebugger.class); ++ if (d == null) continue; ++ try { ++ // workaround for #64227 ++ if (d.getState() != d.STATE_RUNNING) ++ d.waitRunning (); ++ } catch (DebuggerStartException dsex) { ++ //ErrorManager.getDefault().notify(ErrorManager.USER, dsex); ++ // Not necessary to notify - message written to debugger console. ++ } ++ } ++ } ++ } finally { ++ //System.out.println("Before progress.finish()"); ++ progress.finish(); ++ //System.out.println("After progress.finish()"); ++ } ++ } ++ }); ++ Runnable action = new Runnable() { ++ ++ public void run() { ++ startTaskPtr[0].schedule(0); ++ } ++ }; ++ ScanDialog.runWhenScanFinished(action, NbBundle.getMessage (ConnectPanel.class, "CTL_Connect")); //NOI18N ++ //System.out.println("Before return from ConnectPanel.ok()"); ++ return true; ++ } ++ ++ /** ++ * Return true whether value of this customizer ++ * is valid (and OK button can be enabled). ++ * ++ * @return true whether value of this customizer ++ * is valid ++ */ ++ public boolean isValid () { ++ return true; ++ } ++ ++ public void addPropertyChangeListener(PropertyChangeListener l) { ++ } ++ ++ public void removePropertyChangeListener(PropertyChangeListener l) { ++ } ++ } + + } + +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/JPDAAttachType.java +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/JPDAAttachType.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/JPDAAttachType.java Tue Mar 10 13:53:55 2009 +0300 +@@ -41,8 +41,11 @@ + + package org.netbeans.modules.debugger.jpda.ui; + ++import java.lang.ref.Reference; ++import java.lang.ref.WeakReference; + import javax.swing.JComponent; + import org.netbeans.spi.debugger.ui.AttachType; ++import org.netbeans.spi.debugger.ui.Controller; + import org.openide.util.NbBundle; + + +@@ -52,11 +55,27 @@ + */ + public class JPDAAttachType extends AttachType { + ++ private Reference customizerRef = new WeakReference(null); ++ ++ @Override + public String getTypeDisplayName () { + return NbBundle.getMessage (JPDAAttachType.class, "CTL_Connector_name"); + } + + public JComponent getCustomizer () { +- return new ConnectPanel (); ++ ConnectPanel panel = new ConnectPanel (); ++ customizerRef = new WeakReference(panel); ++ return panel; + } ++ ++ @Override ++ public Controller getController() { ++ ConnectPanel panel = customizerRef.get(); ++ if (panel != null) { ++ return panel.getController(); ++ } else { ++ return null; ++ } ++ } ++ + } +\ No newline at end of file +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ClassBreakpointPanel.java +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ClassBreakpointPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ClassBreakpointPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -290,17 +290,6 @@ + return true; + } + +- /** +- * Return true whether value of this customizer +- * is valid (and OK button can be enabled). +- * +- * @return true whether value of this customizer +- * is valid +- */ +- public boolean isValid () { +- return true; +- } +- + private String valiadateMsg () { + if (tfClassName.getText().trim ().length() == 0) { + return NbBundle.getMessage(ClassBreakpointPanel.class, "MSG_No_Class_Name_Spec"); +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ExceptionBreakpointPanel.java +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ExceptionBreakpointPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ExceptionBreakpointPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -293,17 +293,6 @@ + return true; + } + +- /** +- * Return true whether value of this customizer +- * is valid (and OK button can be enabled). +- * +- * @return true whether value of this customizer +- * is valid +- */ +- public boolean isValid () { +- return true; +- } +- + private String valiadateMsg () { + if (tfExceptionClassName.getText().trim ().length() == 0) { + return NbBundle.getMessage(ExceptionBreakpointPanel.class, "MSG_No_Exception_Class_Name_Spec"); +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/FieldBreakpointPanel.form +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/FieldBreakpointPanel.form Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/FieldBreakpointPanel.form Tue Mar 10 13:53:55 2009 +0300 +@@ -8,6 +8,7 @@ + + + ++ + + + +@@ -39,9 +40,6 @@ + + + +- +- +- + + + +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/FieldBreakpointPanel.java +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/FieldBreakpointPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/FieldBreakpointPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -319,17 +319,6 @@ + return true; + } + +- /** +- * Return true whether value of this customizer +- * is valid (and OK button can be enabled). +- * +- * @return true whether value of this customizer +- * is valid +- */ +- public boolean isValid () { +- return true; +- } +- + private String valiadateMsg () { + if (tfClassName.getText().trim ().length() == 0 || tfFieldName.getText().trim ().length() == 0) { + return NbBundle.getMessage(FieldBreakpointPanel.class, "MSG_No_Class_or_Field_Name_Spec"); +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/LineBreakpointPanel.java +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/LineBreakpointPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/LineBreakpointPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -305,17 +305,6 @@ + return true; + } + +- /** +- * Return true whether value of this customizer +- * is valid (and OK button can be enabled). +- * +- * @return true whether value of this customizer +- * is valid +- */ +- public boolean isValid () { +- return true; +- } +- + private String valiadateMsg () { + int line; + try { +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/MethodBreakpointPanel.java +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/MethodBreakpointPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/MethodBreakpointPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -506,17 +506,6 @@ + return true; + } + +- /** +- * Return true whether value of this customizer +- * is valid (and OK button can be enabled). +- * +- * @return true whether value of this customizer +- * is valid +- */ +- public boolean isValid () { +- return true; +- } +- + private String valiadateMsg () { + if (tfClassName.getText().trim ().length() == 0 || (tfMethodName.getText().trim ().length() == 0 && !cbAllMethods.isSelected())) { + return NbBundle.getMessage(MethodBreakpointPanel.class, "MSG_No_Class_or_Method_Name_Spec"); +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ThreadBreakpointPanel.java +--- a/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ThreadBreakpointPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda.ui/src/org/netbeans/modules/debugger/jpda/ui/breakpoints/ThreadBreakpointPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -247,17 +247,6 @@ + return true; + } + +- /** +- * Return true whether value of this customizer +- * is valid (and OK button can be enabled). +- * +- * @return true whether value of this customizer +- * is valid +- */ +- public boolean isValid () { +- return true; +- } +- + private String valiadateMsg () { + return null; + } +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda/manifest.mf +--- a/debugger.jpda/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,6 +2,6 @@ + OpenIDE-Module: org.netbeans.modules.debugger.jpda/2 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/jpda/Bundle.properties + OpenIDE-Module-Layer: org/netbeans/modules/debugger/jpda/resources/mf-layer.xml +-OpenIDE-Module-Specification-Version: 1.22.1 ++OpenIDE-Module-Specification-Version: 1.22.2 + OpenIDE-Module-Provides: org.netbeans.api.debugger.jpda.JPDADebuggerEngineImpl + OpenIDE-Module-Requires: org.netbeans.spi.debugger.jpda.EditorContext, org.netbeans.spi.debugger.jpda.SourcePathProvider +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/RunIntoMethodActionProvider.java +--- a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/RunIntoMethodActionProvider.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/actions/RunIntoMethodActionProvider.java Tue Mar 10 13:53:55 2009 +0300 +@@ -312,6 +312,7 @@ + debugger.getOperator().register(brReq, tracingExecutor); + brReq.addThreadFilter(t.getThreadReference()); + brReq.setSuspendPolicy(debugger.getSuspend()); ++ brReq.addCountFilter(1); + brReq.enable(); + if (setBoundaryStep) { + boundaryStepPtr[0] = setBoundaryStepRequest(debugger, t, brReq); +diff -r 76d51071af8a -r af9499d919b8 debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/WatchesModel.java +--- a/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/WatchesModel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/debugger.jpda/src/org/netbeans/modules/debugger/jpda/models/WatchesModel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -530,7 +530,8 @@ + public void propertyChange (PropertyChangeEvent evt) { + String propName = evt.getPropertyName(); + // We already have watchAdded & watchRemoved. Ignore PROP_WATCHES: +- if (DebuggerManager.PROP_WATCHES.equals(propName)) return ; ++ // We care only about the debugger state change and watch expression change here... ++ if (!(JPDADebugger.PROP_STATE.equals(propName) || Watch.PROP_EXPRESSION.equals(propName))) return ; + final WatchesModel m = getModel (); + if (m == null) return; + if (m.debugger.getState () == JPDADebugger.STATE_DISCONNECTED) { +diff -r 76d51071af8a -r af9499d919b8 editor.completion/manifest.mf +--- a/editor.completion/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/editor.completion/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,7 +2,7 @@ + OpenIDE-Module: org.netbeans.modules.editor.completion/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/editor/completion/Bundle.properties + OpenIDE-Module-Install: org/netbeans/modules/editor/completion/CompletionModule.class +-OpenIDE-Module-Specification-Version: 1.13.1 ++OpenIDE-Module-Specification-Version: 1.13.2 + OpenIDE-Module-Layer: org/netbeans/modules/editor/completion/resources/layer.xml + OpenIDE-Module-Implementation-Version: 1 + AutoUpdate-Show-In-Client: false +diff -r 76d51071af8a -r af9499d919b8 editor.completion/nbproject/project.xml +--- a/editor.completion/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/editor.completion/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -61,7 +61,7 @@ + + + 1 +- 1.27 ++ 1.29.2 + +
      + +diff -r 76d51071af8a -r af9499d919b8 editor.completion/src/org/netbeans/modules/editor/completion/CompletionLayoutPopup.java +--- a/editor.completion/src/org/netbeans/modules/editor/completion/CompletionLayoutPopup.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/editor.completion/src/org/netbeans/modules/editor/completion/CompletionLayoutPopup.java Tue Mar 10 13:53:55 2009 +0300 +@@ -372,42 +372,44 @@ + * @param unionBounds bounds occupied by all popups + */ + void showAlongOrNextOccupiedBounds(Rectangle occupiedBounds, Rectangle unionBounds) { +- Rectangle screen = ScreenBoundsProvider.getScreenBounds(getEditorComponent()); +- Dimension prefSize = getPreferredSize(); +- Rectangle bounds = new Rectangle(); +- boolean aboveCaret; ++ if (occupiedBounds != null) { ++ Rectangle screen = ScreenBoundsProvider.getScreenBounds(getEditorComponent()); ++ Dimension prefSize = getPreferredSize(); ++ Rectangle bounds = new Rectangle(); ++ boolean aboveCaret; + +- if (isEnoughSpace(occupiedBounds, preferDisplayAboveCaret)) { +- aboveCaret = preferDisplayAboveCaret; +- } else +- aboveCaret = false; ++ if (isEnoughSpace(occupiedBounds, preferDisplayAboveCaret)) { ++ aboveCaret = preferDisplayAboveCaret; ++ } else ++ aboveCaret = false; + +- boolean left = false; +- boolean right = false; ++ boolean left = false; ++ boolean right = false; + +- // Right of CC +- if (occupiedBounds.x + occupiedBounds.width + prefSize.width < screen.width && +- occupiedBounds.y + prefSize.height < screen.height) { +- bounds.x = occupiedBounds.x + occupiedBounds.width + CompletionLayout.POPUP_VERTICAL_GAP; +- right = true; +- } ++ // Right of CC ++ if (occupiedBounds.x + occupiedBounds.width + prefSize.width < screen.width && ++ occupiedBounds.y + prefSize.height < screen.height) { ++ bounds.x = occupiedBounds.x + occupiedBounds.width + CompletionLayout.POPUP_VERTICAL_GAP; ++ right = true; ++ } + +- // Left of CC +- if (!right && occupiedBounds.x - prefSize.width > 0 && occupiedBounds.y + prefSize.height < screen.height) { +- bounds.x = occupiedBounds.x - prefSize.width - CompletionLayout.POPUP_VERTICAL_GAP; +- left = true; +- } ++ // Left of CC ++ if (!right && occupiedBounds.x - prefSize.width > 0 && occupiedBounds.y + prefSize.height < screen.height) { ++ bounds.x = occupiedBounds.x - prefSize.width - CompletionLayout.POPUP_VERTICAL_GAP; ++ left = true; ++ } + +- if (right || left) { +- bounds.width = prefSize.width; +- bounds.height = Math.min(prefSize.height, screen.height); +- if (aboveCaret) { +- bounds.y = occupiedBounds.y + occupiedBounds.height - prefSize.height; +- } else { +- bounds.y = occupiedBounds.y; ++ if (right || left) { ++ bounds.width = prefSize.width; ++ bounds.height = Math.min(prefSize.height, screen.height); ++ if (aboveCaret) { ++ bounds.y = occupiedBounds.y + occupiedBounds.height - prefSize.height; ++ } else { ++ bounds.y = occupiedBounds.y; ++ } ++ show(bounds, aboveCaret); ++ return; + } +- show(bounds, aboveCaret); +- return; + } + + // Fallback to Above/Below +diff -r 76d51071af8a -r af9499d919b8 editor.lib/nbproject/project.properties +--- a/editor.lib/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/editor.lib/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,7 +39,7 @@ + + javac.compilerargs=-Xlint:unchecked + javac.source=1.5 +-spec.version.base=1.29.1 ++spec.version.base=1.29.2 + is.autoload=true + + javadoc.arch=${basedir}/arch.xml +diff -r 76d51071af8a -r af9499d919b8 editor.lib/src/org/netbeans/editor/GuardedDocument.java +--- a/editor.lib/src/org/netbeans/editor/GuardedDocument.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/editor.lib/src/org/netbeans/editor/GuardedDocument.java Tue Mar 10 13:53:55 2009 +0300 +@@ -46,6 +46,8 @@ + import java.util.Enumeration; + import java.awt.Color; + import java.awt.Font; ++import java.util.logging.Level; ++import java.util.logging.Logger; + import javax.swing.text.BadLocationException; + import javax.swing.text.StyledDocument; + import javax.swing.text.Style; +@@ -81,6 +83,9 @@ + private static final boolean debugAtomic = Boolean.getBoolean("netbeans.debug.editor.atomic"); // NOI18N + private static final boolean debugAtomicStack = Boolean.getBoolean("netbeans.debug.editor.atomic.stack"); // NOI18N + ++ // -J-Dorg.netbeans.editor.GuardedDocument.level=FINEST ++ private static final Logger LOG = Logger.getLogger(GuardedDocument.class.getName()); ++ + // Add the attributes to sets + static { + guardedSet.addAttribute(GUARDED_ATTRIBUTE, Boolean.TRUE); +@@ -211,22 +216,31 @@ + } + } + +- if (text.length() > 0 +- && (rel & MarkBlock.OVERLAP) != 0 ++ boolean guarded = (rel & MarkBlock.OVERLAP) != 0 + && rel != MarkBlock.INSIDE_END // guarded blocks have insertAfter endMark +- && !(text.charAt(text.length() - 1) == '\n' +- && rel == MarkBlock.INSIDE_BEGIN) +- ) { ++ && !(text.charAt(text.length() - 1) == '\n' && rel == MarkBlock.INSIDE_BEGIN); ++ if (guarded) { + if (!breakGuarded || atomicAsUser) { +- throw new GuardedException( +- MessageFormat.format( +- NbBundle.getBundle(BaseKit.class).getString(FMT_GUARDED_INSERT_LOCALE), +- new Object [] { +- new Integer(offset) +- } +- ), +- offset +- ); ++ CharSequence docText = org.netbeans.lib.editor.util.swing.DocumentUtilities.getText(this); ++ // Allow mod when inserting "inside" line and right at the begining of the guarded block ++ boolean insertAtLineBegin = (offset == 0 || docText.charAt(offset - 1) == '\n'); ++ guarded = (rel != MarkBlock.INSIDE_BEGIN) || insertAtLineBegin; ++ if (guarded) { ++ if (LOG.isLoggable(Level.FINE)) { ++ LOG.fine("GuardedDocument.preInsertCheck(): offset:" + Utilities.debugPosition(this, offset) + ++ ", relation: " + rel + "; guardedBlockChain:\n" + guardedBlockChain + "\n"); ++ } ++ ++ throw new GuardedException( ++ MessageFormat.format( ++ NbBundle.getBundle(BaseKit.class).getString(FMT_GUARDED_INSERT_LOCALE), ++ new Object [] { ++ new Integer(offset) ++ } ++ ), ++ offset ++ ); ++ } + } + } + } +@@ -248,11 +262,27 @@ + } + } + +- if ((rel & MarkBlock.OVERLAP) != 0 +- || (rel == MarkBlock.CONTINUE_BEGIN +- && !(offset == 0 || getChars(offset - 1, 1)[0] == '\n')) +- ) { ++ // Check if removed block overlaps any guarded block(s) ++ // Also check that if an area right before GB gets removed (including ending newline) ++ // that the area does not start in the middle of the line (GB would then start in the middle of line ++ // after the removal). ++ // For GBs that already start in the middle of a line this does not apply ++ boolean guarded = ((rel & MarkBlock.OVERLAP) != 0); ++ if (!guarded && (rel == MarkBlock.CONTINUE_BEGIN)) { // GB starts right after removed area ++ CharSequence docText = org.netbeans.lib.editor.util.swing.DocumentUtilities.getText(this); ++ int gbStartOffset = offset + len; ++ // To allow removal either GB starts in a middle of line ++ // or (if starts at line begining) check that a character in front of first removed char is newline ++ boolean gbStartsAtLineBegin = (gbStartOffset == 0 || docText.charAt(gbStartOffset - 1) == '\n'); ++ guarded = gbStartsAtLineBegin && (offset != 0 && docText.charAt(offset - 1) != '\n'); ++ } ++ if (guarded) { + if (!breakGuarded || atomicAsUser) { ++ if (LOG.isLoggable(Level.FINE)) { ++ LOG.fine("GuardedDocument.preRemoveCheck(): offset:" + Utilities.debugPosition(this, offset) + ++ ", relation: " + rel + "; guardedBlockChain:\n" + guardedBlockChain + "\n"); ++ } ++ + // test whether the previous char before removed text is '\n' + throw new GuardedException( + MessageFormat.format( +diff -r 76d51071af8a -r af9499d919b8 favorites/manifest.mf +--- a/favorites/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/favorites/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.favorites/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/favorites/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.14.1 ++OpenIDE-Module-Specification-Version: 1.14.3 + OpenIDE-Module-Layer: org/netbeans/modules/favorites/resources/layer.xml + AutoUpdate-Show-In-Client: false + AutoUpdate-Essential-Module: true +diff -r 76d51071af8a -r af9499d919b8 favorites/nbproject/project.xml +--- a/favorites/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/favorites/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -100,7 +100,7 @@ + + + +- 4.12 ++ 7.2.2 + + + +diff -r 76d51071af8a -r af9499d919b8 favorites/src/org/netbeans/modules/favorites/Favorites.java +--- a/favorites/src/org/netbeans/modules/favorites/Favorites.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/favorites/src/org/netbeans/modules/favorites/Favorites.java Tue Mar 10 13:53:55 2009 +0300 +@@ -61,16 +61,18 @@ + import org.openide.filesystems.FileStateInvalidException; + import org.openide.filesystems.FileUtil; + import org.openide.filesystems.Repository; ++import org.openide.loaders.ChangeableDataFilter; ++import org.openide.loaders.DataFilter; + import org.openide.loaders.DataFolder; + import org.openide.loaders.DataObject; + import org.openide.loaders.DataShadow; + import org.openide.nodes.FilterNode; + import org.openide.nodes.Index; + import org.openide.nodes.Node; ++import org.openide.util.ChangeSupport; + import org.openide.util.Exceptions; + import org.openide.util.ImageUtilities; + import org.openide.util.NbBundle; +-import org.openide.util.Utilities; + import org.openide.util.datatransfer.PasteType; + + /** +@@ -287,43 +289,71 @@ + } + } + +- private static class Chldrn extends FilterNode.Children +- implements ChangeListener, Runnable { ++ ++ ++ static class VisQ ++ implements DataFilter.FileBased, ChangeableDataFilter, ChangeListener { ++ public static final VisQ DEFAULT = new VisQ(); ++ + private ChangeListener weak; +- private boolean hideHidden; +- /** Creates new Chldrn. */ +- public Chldrn (Node node, boolean hideHidden) { +- super (node); +- this.hideHidden = hideHidden; +- ++ private ChangeSupport support = new ChangeSupport(this); ++ ++ VisQ() { + weak = org.openide.util.WeakListeners.change(this, VisibilityQuery.getDefault()); + VisibilityQuery.getDefault().addChangeListener(weak); + } + ++ public boolean acceptFileObject(FileObject fo) { ++ return VisibilityQuery.getDefault().isVisible(fo); ++ } ++ ++ public boolean acceptDataObject(DataObject obj) { ++ return acceptFileObject(obj.getPrimaryFile()); ++ } ++ ++ public void addChangeListener(ChangeListener listener) { ++ support.addChangeListener(listener); ++ } ++ ++ public void removeChangeListener(ChangeListener listener) { ++ support.removeChangeListener(listener); ++ } ++ ++ public void stateChanged(ChangeEvent e) { ++ support.fireChange(); ++ } ++ } // end of VisQ ++ ++ private static class Chldrn extends FilterNode.Children { ++ private boolean hideHidden; ++ /** Creates new Chldrn. */ ++ public Chldrn(Node node, boolean hideHidden) { ++ super (node); ++ this.hideHidden = hideHidden; ++ } ++ + @Override + protected Node[] createNodes(Node node) { ++ org.openide.nodes.Children ch = Children.LEAF; ++ DataObject obj = node.getLookup().lookup(DataObject.class); + if (hideHidden) { +- DataObject obj = node.getCookie(DataObject.class); + if (obj != null && !VisibilityQuery.getDefault().isVisible(obj.getPrimaryFile())) { + return null; + } + } ++ ++ DataFolder folder = node.getLookup().lookup(DataFolder.class); ++ if (folder != null) { ++ ch = new Chldrn(new FilterNode(node, folder.createNodeChildren(new VisQ())), true); ++ } else { ++ if (node.isLeaf()) { ++ ch = org.openide.nodes.Children.LEAF; ++ } else { ++ ch = new Chldrn(node, true); ++ } ++ } + +- return new Node[] { new ProjectFilterNode ( +- node, +- (node.isLeaf ()) ? org.openide.nodes.Children.LEAF : new Chldrn (node, true) +- )}; +- } +- +- public void stateChanged(ChangeEvent e) { +- MUTEX.postWriteRequest(this); +- } +- +- public void run() { +- Node[] arr = original.getChildren().getNodes(); +- for (int i = 0; i < arr.length; i++) { +- refreshKey(arr[i]); +- } ++ return new Node[] { new ProjectFilterNode (node, ch) }; + } + } // end of Chldrn + +diff -r 76d51071af8a -r af9499d919b8 favorites/src/org/netbeans/modules/favorites/templates/TemplatesPanel.java +--- a/favorites/src/org/netbeans/modules/favorites/templates/TemplatesPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/favorites/src/org/netbeans/modules/favorites/templates/TemplatesPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -91,11 +91,14 @@ + * @author Jiri Rechtacek + */ + public class TemplatesPanel extends TopComponent implements ExplorerManager.Provider { +- private ExplorerManager manager; +- private TemplateTreeView view; ++ private static ExplorerManager manager; ++ private static TemplateTreeView view; + + static private FileObject templatesRoot; + ++ private static final String TEMPLATE_DISPLAY_NAME_ATTRIBUTE = "displayName"; ++ private static final String TEMPLATE_LOCALIZING_BUNDLE_ATTRIBUTE = "SystemFileSystem.localizingBundle"; ++ + /** Creates new form TemplatesPanel */ + public TemplatesPanel () { + +@@ -470,7 +473,7 @@ + SystemAction.get (DeleteAction.class), + SystemAction.get (RenameAction.class), + }; +- ++ + public TemplateNode (Node n) { + this (n, new DataFolderFilterChildren (n), new InstanceContent ()); + } +@@ -515,17 +518,22 @@ + } + + @Override ++ public String getName () { ++ return super.getDisplayName (); ++ } ++ ++ @Override + public void setName(String name) { +- // #140308 - get attributtes before rename and set them for renamed FileObject + FileObject fo = this.getLookup().lookup(FileObject.class); +- final HashMap attributes = getAttributes(fo); +- super.setName(name); + try { +- setAttributes (fo, attributes); ++ fo.setAttribute (TEMPLATE_DISPLAY_NAME_ATTRIBUTE, name); ++ fo.setAttribute (TEMPLATE_LOCALIZING_BUNDLE_ATTRIBUTE, null); + } catch (IOException ex) { + Logger.getLogger(TemplatesPanel.class.getName()).log(Level.WARNING, null, ex); + } ++ setDisplayName (name); + } ++ + } + + private static class DataFolderFilterChildren extends FilterNode.Children { +@@ -634,10 +642,33 @@ + static DataObject createDuplicateFromNode (Node n) { + DataObject source = getDOFromNode (n); + try { ++ Node parent = n.getParentNode (); + DataObject target = source.copy(source.getFolder()); + FileObject srcFo = source.getPrimaryFile(); + FileObject targetFo = target.getPrimaryFile(); +- setAttributes(targetFo, getAttributes(srcFo)); ++ setTemplateAttributes(targetFo, getAttributes(srcFo)); ++ if (parent != null) { ++ Node duplicateNode = null; ++ for (Node k : parent.getChildren ().getNodes (true)) { ++ if (k.getName ().startsWith (targetFo.getName ())) { ++ duplicateNode = k; ++ break; ++ } ++ } ++ if (duplicateNode != null) { ++ final Node finalNode = duplicateNode; ++ SwingUtilities.invokeLater (new Runnable () { ++ public void run () { ++ try { ++ manager.setSelectedNodes (new Node [] { finalNode }); ++ view.invokeInplaceEditing (); ++ } catch (PropertyVetoException ex) { ++ Logger.getLogger (TemplatesPanel.class.getName ()).log (Level.INFO, ex.getLocalizedMessage (), ex); ++ } ++ } ++ }); ++ } ++ } + return target; + } catch (IOException ioe) { + Logger.getLogger(TemplatesPanel.class.getName()).log(Level.WARNING, null, ioe); +@@ -663,8 +694,12 @@ + } + + /** Sets attributes for given FileObject. */ +- private static void setAttributes(FileObject fo, HashMap attributes) throws IOException { ++ private static void setTemplateAttributes(FileObject fo, HashMap attributes) throws IOException { + for (Entry entry : attributes.entrySet()) { ++ // skip localizing bundle for custom templates ++ if (TEMPLATE_LOCALIZING_BUNDLE_ATTRIBUTE.equals (entry.getKey ())) { ++ continue; ++ } + fo.setAttribute(entry.getKey(), entry.getValue()); + } + } +diff -r 76d51071af8a -r af9499d919b8 favorites/test/unit/src/org/netbeans/modules/favorites/VisibilityQueryWorksTest.java +--- a/favorites/test/unit/src/org/netbeans/modules/favorites/VisibilityQueryWorksTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/favorites/test/unit/src/org/netbeans/modules/favorites/VisibilityQueryWorksTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -85,6 +85,7 @@ + /** If execution fails we wrap the exception with + * new log message. + */ ++ @Override + protected void runTest () throws Throwable { + try { + super.runTest (); +@@ -96,6 +97,7 @@ + } + + ++ @Override + protected void setUp () throws Exception { + clearWorkDir(); + +@@ -193,7 +195,10 @@ + VQI vqi = (VQI) Lookup.getDefault().lookup(VQI.class); + vqi.showAll = true; + vqi.fire(); +- ++ ++ // initialize the children ++ Node some = f.getChildren().findChild(null); ++ assertNotNull("Some node needs to be found", some); + arr = f.getChildren().getNodes(true); + assertNodeForDataObject("hidden object is now there", hiddenDO, true, arr); + assertEquals("One child at all", 1, arr.length); +diff -r 76d51071af8a -r af9499d919b8 form.kit/manifest.mf +--- a/form.kit/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/form.kit/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.form.kit + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/form/kit/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.2.1 ++OpenIDE-Module-Specification-Version: 1.2.2 + +diff -r 76d51071af8a -r af9499d919b8 form.kit/nbproject/project.xml +--- a/form.kit/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/form.kit/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -41,7 +41,7 @@ + + org.netbeans.modules.swingapp + +- 1.1 ++ 1.3.2 + + + +diff -r 76d51071af8a -r af9499d919b8 form.kit/src/org/netbeans/modules/form/kit/Bundle.properties +--- a/form.kit/src/org/netbeans/modules/form/kit/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/form.kit/src/org/netbeans/modules/form/kit/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -1,4 +1,8 @@ + OpenIDE-Module-Display-Category=Java + OpenIDE-Module-Name=GUI Builder + OpenIDE-Module-Short-Description=Enables you to visually design Java desktop (AWT and Swing) applications. +-OpenIDE-Module-Long-Description=The GUI Builder enables you to visually design Java desktop (AWT and Swing) applications. It includes special support for GroupLayout, the Swing Application Framework (JSR 296), and the Beans Binding specification (JSR 295). ++OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ ++The GUI Builder enables you to visually design Java desktop (AWT and Swing) applications. It includes special support for GroupLayout, the Swing Application Framework (JSR 296), and the Beans Binding specification (JSR 295). +diff -r 76d51071af8a -r af9499d919b8 glassfish.common/manifest.mf +--- a/glassfish.common/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/glassfish.common/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + Manifest-Version: 1.0 +-OpenIDE-Module: org.netbeans.modules.glassfish.common ++OpenIDE-Module: org.netbeans.modules.glassfish.common/0 + OpenIDE-Module-Install: org/netbeans/modules/glassfish/common/Installer.class + OpenIDE-Module-Layer: org/netbeans/modules/glassfish/common/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/glassfish/common/Bundle.properties +-OpenIDE-Module-Specification-Version: 0.51.1 ++OpenIDE-Module-Specification-Version: 1.0.2 + +diff -r 76d51071af8a -r af9499d919b8 glassfish.common/nbproject/project.xml +--- a/glassfish.common/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/glassfish.common/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -37,8 +37,8 @@ + + + +- 0-1 +- 1.0 ++ 0 ++ 1.2 + +
      + +diff -r 76d51071af8a -r af9499d919b8 glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java +--- a/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/glassfish.common/src/org/netbeans/modules/glassfish/spi/ServerUtilities.java Tue Mar 10 13:53:55 2009 +0300 +@@ -58,6 +58,7 @@ + import org.netbeans.spi.server.ServerInstanceImplementation; + import org.netbeans.spi.server.ServerInstanceProvider; + import org.openide.WizardDescriptor.InstantiatingIterator; ++import org.openide.filesystems.FileObject; + import org.openide.filesystems.FileUtil; + import org.openide.util.Lookup; + +@@ -254,13 +255,14 @@ + * modules directory. + * + * @param jarList the list "so far" +- * @param parent the directory to look into ++ * @param parent the directory to look into. Should not be null. + * @param depth depth of the server + * @param escape pass true if backslashes in jar names should be escaped + * @return the complete list of jars that match the selection criteria + */ +- public static List filterByManifest(List jarList, File parent, int depth, boolean escape) { +- if(parent.exists()) { ++ public static List filterByManifest(List jarList, FileObject parent, int depth, boolean escape) { ++ // be kind to clients that pass in null ++ if(null != parent) { + int parentLength = parent.getPath().length(); + /* modules/web/jsf-impl.jar was not seen (or added with wrong relative name). + * need to calculate size relative to the modules/ dir and not the subdirs +@@ -269,20 +271,21 @@ + * with this test, we now also return "web/jsf-impl.jar" which is correct + */ + if (depth==1){ +- parentLength = parent.getParentFile().getPath().length(); ++ parentLength = parent.getParent().getPath().length(); + } +- for(File candidate: parent.listFiles()) { +- if(candidate.isDirectory()) { ++ ++ for(FileObject candidate: parent.getChildren()) { ++ if(candidate.isFolder()) { + if(depth < 1) { + filterByManifest(jarList, candidate, depth+1, escape); + } + continue; +- } else if(!candidate.getName().endsWith(".jar")) { ++ } else if(!candidate.getNameExt().endsWith(".jar")) { + continue; + } + JarFile jarFile = null; + try { +- jarFile = new JarFile(candidate, false); ++ jarFile = new JarFile(FileUtil.toFile(candidate), false); + Manifest manifest = jarFile.getManifest(); + if(manifest != null) { + Attributes attrs = manifest.getMainAttributes(); +@@ -290,7 +293,7 @@ + String bundleName = attrs.getValue("Bundle-SymbolicName"); + //String bundleName = attrs.getValue("Extension-Name"); + if(bundleName != null && bundleName.contains("javax")) { +- String val = candidate.getPath().substring(parentLength+1); ++ String val = candidate.getPath().substring(parentLength); + if(escape) { + val = val.replace("\\", "\\\\"); + } +@@ -300,14 +303,14 @@ + } + } catch (IOException ex) { + Logger.getLogger(ServerUtilities.class.getName()).log(Level.INFO, +- candidate.getAbsolutePath(), ex); ++ candidate.getPath(), ex); + } finally { + if (null != jarFile) { + try { + jarFile.close(); + } catch (IOException ex) { + Logger.getLogger(ServerUtilities.class.getName()).log(Level.INFO, +- candidate.getAbsolutePath(), ex); ++ candidate.getPath(), ex); + } + jarFile = null; + } +@@ -315,8 +318,8 @@ + + } + } else { +- Logger.getLogger(ServerUtilities.class.getName()).log(Level.FINER, +- parent.getAbsolutePath() + " does not exist"); ++ Logger.getLogger(ServerUtilities.class.getName()).log(Level.FINER, ++ "Null FileObject passed in as the parent parameter. Returning the original list"); + } + return jarList; + } +diff -r 76d51071af8a -r af9499d919b8 hibernate/manifest.mf +--- a/hibernate/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/hibernate/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -3,4 +3,4 @@ + OpenIDE-Module-Implementation-Version: 1 + OpenIDE-Module-Layer: org/netbeans/modules/hibernate/resources/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/hibernate/resources/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.0.1 ++OpenIDE-Module-Specification-Version: 1.0.3 +diff -r 76d51071af8a -r af9499d919b8 hibernate/nbproject/project.xml +--- a/hibernate/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/hibernate/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -132,7 +132,7 @@ + + + 1 +- 1.0 ++ 1.12.2 + + + +diff -r 76d51071af8a -r af9499d919b8 hibernate/src/org/netbeans/modules/hibernate/hqleditor/HQLEditorController.java +--- a/hibernate/src/org/netbeans/modules/hibernate/hqleditor/HQLEditorController.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/hibernate/src/org/netbeans/modules/hibernate/hqleditor/HQLEditorController.java Tue Mar 10 13:53:55 2009 +0300 +@@ -42,9 +42,11 @@ + import java.net.URL; + import java.util.ArrayList; + import java.util.Arrays; ++import java.util.HashSet; + import java.util.Iterator; + import java.util.List; + import java.util.Map; ++import java.util.Set; + import java.util.StringTokenizer; + import java.util.logging.Level; + import java.util.logging.Logger; +@@ -146,7 +148,7 @@ + } + + public SessionFactory getHibernateSessionFactoryForThisContext(FileObject configFileObject, +- List mappingFOList, ++ Set mappingFOList, + List annotatedClassList, + ClassLoader customClassLoader) throws Exception { + +@@ -252,7 +254,7 @@ + } + + // Process Mappings +- List matchedMappingFOList = new ArrayList(); ++ Set matchedMappingFOList = new HashSet(); + List mappingFOList = new ArrayList(); + Map> mappingPOJOMap = env.getAllPOJONamesFromConfiguration(configFileObject); + +@@ -551,7 +553,7 @@ + } + } + +- private List getRelatedMappings(FileObject mappingFO, List relatedMappings, Map> mappingPOJOMap) { ++ private Set getRelatedMappings(FileObject mappingFO, Set relatedMappings, Map> mappingPOJOMap) { + try { + org.dom4j.io.SAXReader xmlReader = new org.dom4j.io.SAXReader(); + org.dom4j.Document document = xmlReader.read(FileUtil.toFile(mappingFO)); +@@ -559,21 +561,21 @@ + while (classElementIterator.hasNext()) { + org.dom4j.Element classElement = (org.dom4j.Element) classElementIterator.next(); + logger.info("Processing many-to-one"); +- processMappingRelationships(classElement.elementIterator("many-to-one"), relatedMappings, mappingPOJOMap); ++ processMappingRelationships(classElement.elementIterator("many-to-one"), relatedMappings, mappingPOJOMap); + logger.info("Processing one-to-one"); +- processMappingRelationships(classElement.elementIterator("one-to-one"), relatedMappings, mappingPOJOMap); ++ processMappingRelationships(classElement.elementIterator("one-to-one"), relatedMappings, mappingPOJOMap); + logger.info("Processing set"); +- processMappingRelationships(classElement.elementIterator("set"), relatedMappings, mappingPOJOMap); ++ processMappingRelationships(classElement.elementIterator("set"), relatedMappings, mappingPOJOMap); + logger.info("Processing idbag"); +- processMappingRelationships(classElement.elementIterator("idbag"), relatedMappings, mappingPOJOMap); ++ processMappingRelationships(classElement.elementIterator("idbag"), relatedMappings, mappingPOJOMap); + logger.info("Processing map"); +- processMappingRelationships(classElement.elementIterator("map"), relatedMappings, mappingPOJOMap); ++ processMappingRelationships(classElement.elementIterator("map"), relatedMappings, mappingPOJOMap); + logger.info("Processing bag"); +- processMappingRelationships(classElement.elementIterator("bag"), relatedMappings, mappingPOJOMap); ++ processMappingRelationships(classElement.elementIterator("bag"), relatedMappings, mappingPOJOMap); + logger.info("Processing list"); +- processMappingRelationships(classElement.elementIterator("list"), relatedMappings, mappingPOJOMap); ++ processMappingRelationships(classElement.elementIterator("list"), relatedMappings, mappingPOJOMap); + logger.info("Processing array"); +- processMappingRelationships(classElement.elementIterator("array"), relatedMappings, mappingPOJOMap); ++ processMappingRelationships(classElement.elementIterator("array"), relatedMappings, mappingPOJOMap); + + } + } catch (Exception e) { +@@ -583,28 +585,28 @@ + return relatedMappings; + } + +- private List processMappingRelationships(Iterator relationshipIterator, List relatedMappings, Map> mappingPOJOMap) { ++ private Set processMappingRelationships(Iterator relationshipIterator, Set relatedMappings, Map> mappingPOJOMap) { + while (relationshipIterator.hasNext()) { + org.dom4j.Element relationshipElement = (org.dom4j.Element) relationshipIterator.next(); + String pojoName = relationshipElement.attributeValue("class"); +- if(pojoName == null) { ++ if (pojoName == null) { + // Check for Collection based relationship types. + org.dom4j.Element connectionTypeElement = relationshipElement.element("one-to-many"); +- if(connectionTypeElement == null) { ++ if (connectionTypeElement == null) { + connectionTypeElement = relationshipElement.element("composite-element"); + } +- if(connectionTypeElement == null) { ++ if (connectionTypeElement == null) { + connectionTypeElement = relationshipElement.element("one-to-many"); + } +- if(connectionTypeElement == null) { ++ if (connectionTypeElement == null) { + connectionTypeElement = relationshipElement.element("many-to-many"); + } +- if(connectionTypeElement != null) { ++ if (connectionTypeElement != null) { + pojoName = connectionTypeElement.attributeValue("class"); +- } ++ } + } + FileObject relatedMappingFO = findRelatedMappingFO(pojoName, mappingPOJOMap); +- if (relatedMappingFO != null && (! relatedMappings.contains(relatedMappingFO))) { ++ if (relatedMappingFO != null && (!relatedMappings.contains(relatedMappingFO))) { + relatedMappings.add(relatedMappingFO); + getRelatedMappings(relatedMappingFO, relatedMappings, mappingPOJOMap); + } +@@ -648,7 +650,7 @@ + private Class processMatchingClass(String className, ClassLoader customClassLoader, Project project) { + FileObject clazzFO = HibernateUtil.findJavaFileObjectInProject(className, project); + FileObject buildFolderFO = HibernateUtil.getBuildFO(project); +- if(buildFolderFO == null) { ++ if (buildFolderFO == null) { + return null; // Unable to find the build folder. + } + return checkAndCompile(className, clazzFO, buildFolderFO, customClassLoader, project); +@@ -705,7 +707,7 @@ + logger.info("b = " + b); + if (b == false) { // Compilation errors. + FileObject classfileFO = buildFolderFO.getFileObject(className + ".class"); +- if(classfileFO != null && classfileFO.isValid()) { ++ if (classfileFO != null && classfileFO.isValid()) { + classfileFO.delete(); + } + return clazz; +diff -r 76d51071af8a -r af9499d919b8 hibernate/src/org/netbeans/modules/hibernate/loaders/cfg/multiview/MappingPanel.java +--- a/hibernate/src/org/netbeans/modules/hibernate/loaders/cfg/multiview/MappingPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/hibernate/src/org/netbeans/modules/hibernate/loaders/cfg/multiview/MappingPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -70,7 +70,7 @@ + this.classTextField.setText( className ); + } + +- public boolean isValid() { ++ public boolean isDataValid() { + // At least one field should be filled to make it valid + if( getResourceName().length() != 0 + || getJarName().length() != 0 +diff -r 76d51071af8a -r af9499d919b8 hibernate/src/org/netbeans/modules/hibernate/loaders/cfg/multiview/MappingsTablePanel.java +--- a/hibernate/src/org/netbeans/modules/hibernate/loaders/cfg/multiview/MappingsTablePanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/hibernate/src/org/netbeans/modules/hibernate/loaders/cfg/multiview/MappingsTablePanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -118,7 +118,7 @@ + + if (add) { + // enambe/disable OK button +- dialog.setValid(dialogPanel.isValid()); ++ dialog.setValid(dialogPanel.isDataValid()); + } + + javax.swing.event.DocumentListener docListener = new EditDialog.DocListener(dialog); +diff -r 76d51071af8a -r af9499d919b8 hibernate/src/org/netbeans/modules/hibernate/resources/Bundle.properties +--- a/hibernate/src/org/netbeans/modules/hibernate/resources/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/hibernate/src/org/netbeans/modules/hibernate/resources/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -38,6 +38,9 @@ + # made subject to such option by the copyright holder. + OpenIDE-Module-Display-Category=Java + OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ + This module provides Hibernate support in NetBeans + OpenIDE-Module-Name=Hibernate Support + OpenIDE-Module-Short-Description=Hibernate Support +diff -r 76d51071af8a -r af9499d919b8 ide.branding.kit/manifest.mf +--- a/ide.branding.kit/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/ide.branding.kit/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.ide.branding.kit + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/branding/kit/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.2.1 ++OpenIDE-Module-Specification-Version: 1.2.4 + +diff -r 76d51071af8a -r af9499d919b8 ide.branding.kit/nbproject/project.xml +--- a/ide.branding.kit/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/ide.branding.kit/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -21,13 +21,13 @@ + + org.netbeans.modules.registration + +- 1.0 ++ 1.1.2 + + + + org.netbeans.modules.uihandler.exceptionreporter + +- 1.0 ++ 1.2.3 + + + +@@ -37,6 +37,12 @@ + 1.12 + + ++ ++ org.netbeans.modules.reglib ++ ++ 1.2.4 ++ ++ + + + +diff -r 76d51071af8a -r af9499d919b8 ide.branding.kit/src/org/netbeans/modules/ide/branding/kit/Bundle.properties +--- a/ide.branding.kit/src/org/netbeans/modules/ide/branding/kit/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/ide.branding.kit/src/org/netbeans/modules/ide/branding/kit/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,9 @@ + OpenIDE-Module-Display-Category=Base IDE + OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ ++\ + Content and branding for the specific release of NetBeans, including welcome screen, branding, definition of update centers, exception reporter, etc. + OpenIDE-Module-Name=NetBeans 6.5 + OpenIDE-Module-Short-Description=NetBeans IDE content and branding. +diff -r 76d51071af8a -r af9499d919b8 ide.kit/manifest.mf +--- a/ide.kit/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/ide.kit/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.ide.kit + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/ide/kit/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.5.1 ++OpenIDE-Module-Specification-Version: 1.5.4 + +diff -r 76d51071af8a -r af9499d919b8 ide.kit/nbproject/project.xml +--- a/ide.kit/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/ide.kit/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -6,6 +6,15 @@ + org.netbeans.modules.ide.kit + + ++ org.netbeans.api.java.classpath ++ ++ ++ ++ 1 ++ 1.18.2 ++ ++ ++ + org.netbeans.core.ide + + 1 +@@ -50,7 +59,7 @@ + org.netbeans.modules.editor.completion + + 1 +- 1.9 ++ 1.13.2 + + + +@@ -134,7 +143,7 @@ + org.netbeans.modules.jumpto + + 1 +- 1.2 ++ 1.7.2 + + + +@@ -152,16 +161,25 @@ + + + ++ org.netbeans.modules.project.ant ++ ++ ++ ++ 1 ++ 1.26.3 ++ ++ ++ + org.netbeans.modules.project.libraries + + 1 +- 1.14 ++ 1.19.2 + + + + org.netbeans.modules.projectui + +- 1.12 ++ 1.15.3 + + + +diff -r 76d51071af8a -r af9499d919b8 ide.kit/src/org/netbeans/modules/ide/kit/Bundle.properties +--- a/ide.kit/src/org/netbeans/modules/ide/kit/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/ide.kit/src/org/netbeans/modules/ide/kit/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,8 @@ + OpenIDE-Module-Display-Category=Base IDE + OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ + The IDE Platform consists of the modules in the Base IDE that do not naturally belong to any of its visible plugins, but are installed together with the plugins that require them. \ + The modules (NBMs) in IDE Platform are: Directory Chooser, External HTML Browser, External Libraries, General Online Help, General Options Dialog Panels, Generic Languages Framework, HTTP Server, IDE Defaults, Project UI, Refactoring API, Tag Based Editors Library, Timers API, and User Utilities. + OpenIDE-Module-Name=IDE Platform only in patch2: unchanged: --- netbeans-6.5.orig/debian/patches/94-6.5.1-patches-4.patch +++ netbeans-6.5/debian/patches/94-6.5.1-patches-4.patch @@ -0,0 +1,103 @@ +diff -Nur -x '*.orig' -x '*~' netbeans-6.5/java.kit/nbproject/project.xml netbeans-6.5.new/java.kit/nbproject/project.xml +--- netbeans-6.5/java.kit/nbproject/project.xml 2009-03-30 19:35:36.000000000 +0400 ++++ netbeans-6.5.new/java.kit/nbproject/project.xml 2009-03-30 19:43:06.000000000 +0400 +@@ -35,6 +35,13 @@ + +
      + ++ org.netbeans.modules.debugger.jpda ++ ++ 2 ++ 1.22.2 ++ ++ ++ + org.netbeans.modules.i18n + + 1 +@@ -65,7 +72,7 @@ + org.netbeans.modules.java.editor + + 1 +- 2.8 ++ 2.13.2 + + + +@@ -114,7 +121,7 @@ + org.netbeans.modules.java.j2seproject + + 1 +- 1.12 ++ 1.21.2 + + + +@@ -135,13 +142,13 @@ + org.netbeans.modules.java.project + + 1 +- 1.12 ++ 1.22.2 + + + + org.netbeans.modules.java.source + +- 0.21 ++ 0.40.4 + + + +@@ -154,14 +161,14 @@ + org.netbeans.modules.java.sourceui + + 1 +- 1.2 ++ 1.6.2 + + + + org.netbeans.modules.javadoc + + 1 +- 1.20 ++ 1.24.2 + + + +@@ -181,7 +188,7 @@ + org.netbeans.modules.refactoring.java + + 1 +- 1.1 ++ 1.4.2 + + + ++ ++ org.netbeans.libs.javacimpl ++ ++ 1 ++ 0.9.2 ++ ++ +
      + + +diff -Nur -x '*.orig' -x '*~' netbeans-6.5/libs.javacimpl/nbproject/project.properties netbeans-6.5.new/libs.javacimpl/nbproject/project.properties +--- netbeans-6.5/libs.javacimpl/nbproject/project.properties 2009-03-30 19:35:36.000000000 +0400 ++++ netbeans-6.5.new/libs.javacimpl/nbproject/project.properties 2009-03-30 19:44:59.000000000 +0400 +@@ -40,7 +40,7 @@ + javac.source=1.5 + nbm.homepage=http://jackpot.netbeans.org/ + nbm.module.author=Petr Hrebejk, Sun Microsystems, Inc. +-spec.version.base=0.9.1 ++spec.version.base=0.9.2 + javadoc.arch=${basedir}/arch.xml + + only in patch2: unchanged: --- netbeans-6.5.orig/debian/patches/92-6.5.1-patches-2.patch +++ netbeans-6.5/debian/patches/92-6.5.1-patches-2.patch @@ -0,0 +1,2512 @@ +diff -r 76d51071af8a -r af9499d919b8 java.editor/nbproject/project.properties +--- a/java.editor/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.editor/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,7 +39,7 @@ + + javadoc.title=Java Editor + +-spec.version.base=2.13.1 ++spec.version.base=2.13.2 + test.qa-functional.cp.extra=${editor.dir}/modules/org-netbeans-modules-editor-fold.jar + javac.source=1.5 + build.compiler.source=1.5 +diff -r 76d51071af8a -r af9499d919b8 java.editor/src/org/netbeans/modules/editor/java/AbstractCamelCasePosition.java +--- a/java.editor/src/org/netbeans/modules/editor/java/AbstractCamelCasePosition.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.editor/src/org/netbeans/modules/editor/java/AbstractCamelCasePosition.java Tue Mar 10 13:53:55 2009 +0300 +@@ -90,7 +90,7 @@ + } else { + final BaseDocument bdoc = org.netbeans.editor.Utilities.getDocument(target); + if (bdoc != null) { +- bdoc.runAtomic (new Runnable () { ++ bdoc.runAtomicAsUser(new Runnable () { + public void run () { + DocumentUtilities.setTypingModification(bdoc, true); + try { +diff -r 76d51071af8a -r af9499d919b8 java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java +--- a/java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.editor/src/org/netbeans/modules/editor/java/BraceCompletion.java Tue Mar 10 13:53:55 2009 +0300 +@@ -474,7 +474,7 @@ + // It can be revised in the future. + bracketBalance = 1; + } +- finished = true; ++ finished = javaTS.offset() < caretOffset; + } + } + break; +@@ -592,8 +592,16 @@ + if (caretOffset <= 0) { + return false; + } +- char previousChar = doc.getChars(caretOffset - 1, 1)[0]; +- return previousChar == '\\'; ++ ++ if (caretOffset == 1) { ++ char previousChar = doc.getChars(caretOffset - 1, 1)[0]; ++ ++ return previousChar == '\\'; ++ } ++ ++ char[] previousChars = doc.getChars(caretOffset - 2, 2); ++ ++ return previousChars[0] != '\\' && previousChars[1] == '\\'; + } + + /** +diff -r 76d51071af8a -r af9499d919b8 java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java +--- a/java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.editor/test/unit/src/org/netbeans/modules/editor/java/JavaBraceCompletionUnitTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -79,7 +79,7 @@ + } + + // ------- Tests for completion of right parenthesis ')' ------------- +- ++ + public void testTypeSemicolonInForLoop() { // #146139 + Context ctx = new Context(new JavaKit(), + "for (int i = 0|)" +@@ -125,7 +125,7 @@ + ctx.typeChar('('); + ctx.assertDocumentTextEquals("m(|)"); + } +- ++ + public void testTypeSecondRightParen() { + Context ctx = new Context(new JavaKit(), + "m()|)" +@@ -135,7 +135,7 @@ + "m())|" + ); + } +- ++ + public void testTypeRightParenSwingInvokeLaterRunnable() { + Context ctx = new Context(new JavaKit(), + "SwingUtilities.invokeLater(new Runnable()|))" +@@ -169,7 +169,7 @@ + "})" + ); + } +- ++ + public void testTypeRightParenIfMethodCall() { + Context ctx = new Context(new JavaKit(), + "if (a()|) + 5 > 6) {\n" + +@@ -195,7 +195,7 @@ + + + // ------- Tests for completion of right brace '}' ------------- +- ++ + public void testTypeAddRightBraceIfLeftBrace() { + Context ctx = new Context(new JavaKit(), + "if (true) {|" +@@ -219,7 +219,7 @@ + "}" + ); + } +- ++ + public void testTypeAddRightBraceIfLeftBraceLineComment() { + Context ctx = new Context(new JavaKit(), + "if (true) { // line-comment|" +@@ -292,9 +292,9 @@ + " System.out.println(\"\");\n" + + "}\n"); + } +- +- +- // ------- Tests for completion of quote (") ------------- ++ ++ ++ // ------- Tests for completion of quote (") ------------- + public void testTypeSimpleQuoteInEmptyDoc () throws Exception { + Context ctx = new Context(new JavaKit(), + "|" +@@ -324,7 +324,7 @@ + " \"|\"" + ); + } +- ++ + public void testTypeSimpleQuoteInWhiteSpaceArea () throws Exception { + Context ctx = new Context(new JavaKit(), + " | " +@@ -334,7 +334,7 @@ + " \"|\" " + ); + } +- ++ + public void testTypeQuoteAtEOL () throws Exception { + Context ctx = new Context(new JavaKit(), + " |\n" +@@ -344,7 +344,7 @@ + " \"|\"\n" + ); + } +- ++ + public void testTypeQuoteWithUnterminatedStringLiteral () throws Exception { + Context ctx = new Context(new JavaKit(), + " \"unterminated string| \n" +@@ -354,7 +354,7 @@ + " \"unterminated string\"| \n" + ); + } +- ++ + public void testTypeQuoteAtEOLWithUnterminatedStringLiteral () throws Exception { + Context ctx = new Context(new JavaKit(), + " \"unterminated string | \n" +@@ -394,7 +394,7 @@ + " System.out.println(\"|some text) " + ); + } +- ++ + public void testTypeQuoteInsideNonEmptyParenthesesBeforeClosingParentheses () throws Exception { + Context ctx = new Context(new JavaKit(), + " System.out.println(i+|) " +@@ -404,7 +404,7 @@ + " System.out.println(i+\"|\") " + ); + } +- ++ + public void testTypeQuoteInsideNonEmptyParenthesesBeforeClosingParenthesesAndUnterminatedStringLiteral () throws Exception { + Context ctx = new Context(new JavaKit(), + " System.out.println(\"unterminated string literal |); " +@@ -474,7 +474,7 @@ + "\\\"|" + ); + } +- ++ + public void testTypeQuoteEaten() throws Exception { + Context ctx = new Context(new JavaKit(), + "|" +@@ -484,8 +484,8 @@ + ctx.assertDocumentTextEquals( + "\"\"|" + ); +- } +- ++ } ++ + public void testTypeQuoteOnFirstQuote () throws Exception { + Context ctx = new Context(new JavaKit(), + " |\"asdf\"" +@@ -504,8 +504,8 @@ + ctx.assertDocumentTextEquals( + "/** \"|\n */" + ); +- } +- ++ } ++ + public void testTypeQuoteAtTheEndOfLineCommentLine() throws Exception { + Context ctx = new Context(new JavaKit(), + "// test line comment |\n" +@@ -514,11 +514,11 @@ + ctx.assertDocumentTextEquals( + "// test line comment \"|\n" + ); +- } +- +- +- // ------- Tests for completion of single quote (') ------------- +- ++ } ++ ++ ++ // ------- Tests for completion of single quote (') ------------- ++ + public void testTypeSingleQuoteInEmptyDoc () throws Exception { + Context ctx = new Context(new JavaKit(), + "|" +@@ -548,7 +548,7 @@ + " '|'" + ); + } +- ++ + public void testTypeSingleQuoteInWhiteSpaceArea () throws Exception { + Context ctx = new Context(new JavaKit(), + " | " +@@ -558,7 +558,7 @@ + " '|' " + ); + } +- ++ + public void testTypeSingleQuoteAtEOL () throws Exception { + Context ctx = new Context(new JavaKit(), + " |\n" +@@ -568,7 +568,7 @@ + " '|'\n" + ); + } +- ++ + public void testTypeSingleQuoteWithUnterminatedCharLiteral () throws Exception { + Context ctx = new Context(new JavaKit(), + " '| \n" +@@ -578,7 +578,7 @@ + " ''| \n" + ); + } +- ++ + public void testTypeSingleQuoteAtEOLWithUnterminatedCharLiteral () throws Exception { + Context ctx = new Context(new JavaKit(), + " ' |\n" +@@ -618,7 +618,7 @@ + " System.out.println('|some text) " + ); + } +- ++ + public void testTypeSingleQuoteInsideNonEmptyParenthesesBeforeClosingParentheses () throws Exception { + Context ctx = new Context(new JavaKit(), + " System.out.println(i+|) " +@@ -628,7 +628,7 @@ + " System.out.println(i+'|') " + ); + } +- ++ + public void testTypeSingleQuoteInsideNonEmptyParenthesesBeforeClosingParenthesesAndUnterminatedCharLiteral () throws Exception { + Context ctx = new Context(new JavaKit(), + " System.out.println(' |); " +@@ -698,7 +698,7 @@ + "\\'|" + ); + } +- ++ + public void testTypeSingleQuoteEaten() throws Exception { + Context ctx = new Context(new JavaKit(), + "|" +@@ -708,8 +708,8 @@ + ctx.assertDocumentTextEquals( + "''|" + ); +- } +- ++ } ++ + public void testTypeSingleQuoteInsideComments() throws Exception { + Context ctx = new Context(new JavaKit(), + "/* |\n */" +@@ -718,7 +718,7 @@ + ctx.assertDocumentTextEquals( + "/* \'|\n */" + ); +- } ++ } + + public void testTypeSingleQuoteAtTheEndOfLineCommentLine() throws Exception { + Context ctx = new Context(new JavaKit(), +@@ -748,7 +748,7 @@ + prefs.putBoolean(SimpleValueNames.COMPLETION_PAIR_CHARACTERS, orig); + } + } +- ++ + public void testDoNotSkipWhenNotBalanced147683a() throws Exception { + Context ctx = new Context(new JavaKit(), + "System.err.println((true|);" +@@ -789,6 +789,26 @@ + ); + } + ++ public void testKeepBalance148878() throws Exception { ++ Context ctx = new Context(new JavaKit(), ++ "Map[|] m = new HashMap[1];" ++ ); ++ ctx.typeChar(']'); ++ ctx.assertDocumentTextEquals( ++ "Map[]| m = new HashMap[1];" ++ ); ++ } ++ ++ public void testQuotes148878() throws Exception { ++ Context ctx = new Context(new JavaKit(), ++ "if (c == '\\\\|')" ++ ); ++ ctx.typeChar('\''); ++ ctx.assertDocumentTextEquals( ++ "if (c == '\\\\'|)" ++ ); ++ } ++ + private static final class Context { + + private JEditorPane pane; +diff -r 76d51071af8a -r af9499d919b8 java.j2seproject/nbproject/project.properties +--- a/java.j2seproject/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.j2seproject/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,7 +39,7 @@ + + javac.compilerargs=-Xlint -Xlint:-serial + javac.source=1.5 +-spec.version.base=1.21.1 ++spec.version.base=1.21.2 + + javadoc.arch=${basedir}/arch.xml + javadoc.apichanges=${basedir}/apichanges.xml +diff -r 76d51071af8a -r af9499d919b8 java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl +--- a/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.j2seproject/src/org/netbeans/modules/java/j2seproject/resources/build-impl.xsl Tue Mar 10 13:53:55 2009 +0300 +@@ -335,7 +335,7 @@ + + + sourcepath +- ++ /does/not/exist + + + customize +diff -r 76d51071af8a -r af9499d919b8 java.kit/manifest.mf +--- a/java.kit/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.kit/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.java.kit + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/kit/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.3.1 ++OpenIDE-Module-Specification-Version: 1.3.4 + +diff -r 76d51071af8a -r af9499d919b8 java.kit/src/org/netbeans/modules/java/kit/Bundle.properties +--- a/java.kit/src/org/netbeans/modules/java/kit/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.kit/src/org/netbeans/modules/java/kit/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -1,4 +1,8 @@ + OpenIDE-Module-Display-Category=Java + OpenIDE-Module-Name=Java +-OpenIDE-Module-Long-Description=Provides the general infrastructure for handling Java code in the IDE. Includes features such as syntax highlighting, error marking, code completion, code templates, refactoring, and other coding productivity features. ++OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ ++Provides the general infrastructure for handling Java code in the IDE. Includes features such as syntax highlighting, error marking, code completion, code templates, refactoring, and other coding productivity features. + OpenIDE-Module-Short-Description=Support for development in Java. +diff -r 76d51071af8a -r af9499d919b8 java.project/manifest.mf +--- a/java.project/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.project/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -3,7 +3,7 @@ + OpenIDE-Module-Layer: org/netbeans/modules/java/project/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/java/project/Bundle.properties + OpenIDE-Module-Needs: javax.script.ScriptEngine.freemarker +-OpenIDE-Module-Specification-Version: 1.22.1 ++OpenIDE-Module-Specification-Version: 1.22.2 + OpenIDE-Module-Recommends: org.netbeans.spi.java.project.runner.JavaRunnerImplementation + AutoUpdate-Show-In-Client: false + +diff -r 76d51071af8a -r af9499d919b8 java.project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java +--- a/java.project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.project/src/org/netbeans/spi/java/project/support/ui/PackageViewChildren.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1132,7 +1132,7 @@ + } + } + +- final class NoFoldersDataFilter implements ChangeListener, ChangeableDataFilter { ++ final class NoFoldersDataFilter implements ChangeListener, ChangeableDataFilter, DataFilter.FileBased { + + private final ChangeSupport cs = new ChangeSupport(this); + +@@ -1141,8 +1141,7 @@ + } + + public boolean acceptDataObject(DataObject obj) { +- FileObject fo = obj.getPrimaryFile(); +- return fo.isValid() && VisibilityQuery.getDefault().isVisible(fo) && !(obj instanceof DataFolder) && group.contains(fo); ++ return acceptFileObject(obj.getPrimaryFile()); + } + + public void stateChanged( ChangeEvent e) { +@@ -1156,6 +1155,10 @@ + public void removeChangeListener( ChangeListener listener ) { + cs.removeChangeListener(listener); + } ++ ++ public boolean acceptFileObject(FileObject fo) { ++ return fo.isValid() && VisibilityQuery.getDefault().isVisible(fo) && fo.isData() && group.contains(fo); ++ } + + } + +diff -r 76d51071af8a -r af9499d919b8 java.project/src/org/netbeans/spi/java/project/support/ui/TreeRootNode.java +--- a/java.project/src/org/netbeans/spi/java/project/support/ui/TreeRootNode.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.project/src/org/netbeans/spi/java/project/support/ui/TreeRootNode.java Tue Mar 10 13:53:55 2009 +0300 +@@ -52,7 +52,6 @@ + import javax.swing.Icon; + import javax.swing.event.ChangeEvent; + import javax.swing.event.ChangeListener; +-import javax.swing.event.EventListenerList; + import org.netbeans.api.project.SourceGroup; + import org.netbeans.api.queries.VisibilityQuery; + import org.openide.DialogDisplayer; +@@ -60,12 +59,14 @@ + import org.openide.filesystems.FileObject; + import org.openide.filesystems.FileUtil; + import org.openide.loaders.ChangeableDataFilter; ++import org.openide.loaders.DataFilter; + import org.openide.loaders.DataFolder; + import org.openide.loaders.DataObject; + import org.openide.nodes.FilterNode; + import org.openide.nodes.Node; + import org.openide.nodes.NodeNotFoundException; + import org.openide.nodes.NodeOp; ++import org.openide.util.ChangeSupport; + import org.openide.util.NbBundle; + import org.openide.util.Utilities; + import org.openide.util.WeakListeners; +@@ -88,7 +89,7 @@ + } + + private TreeRootNode(DataFolder folder, SourceGroup g) { +- this(new FilterNode(folder.getNodeDelegate(), folder.createNodeChildren(new VisibilityQueryDataFilter(g))), g); ++ this(new FilterNode(folder.getNodeDelegate(), folder.createNodeChildren(new GroupDataFilter(g))), g); + } + + private TreeRootNode (Node originalNode, SourceGroup g) { +@@ -204,53 +205,44 @@ + } + } + +- private static final class VisibilityQueryDataFilter implements ChangeListener, PropertyChangeListener, ChangeableDataFilter { ++ private static final class GroupDataFilter implements ChangeListener, PropertyChangeListener, ++ ChangeableDataFilter, DataFilter.FileBased { + + private static final long serialVersionUID = 1L; // in case a DataFolder.ClonedFilterHandle saves me + +- private final EventListenerList ell = new EventListenerList(); ++ private final ChangeSupport cs = new ChangeSupport(this); + private final SourceGroup g; + +- public VisibilityQueryDataFilter(SourceGroup g) { ++ public GroupDataFilter(SourceGroup g) { + this.g = g; + VisibilityQuery.getDefault().addChangeListener(WeakListeners.change(this, VisibilityQuery.getDefault())); + g.addPropertyChangeListener(WeakListeners.propertyChange(this, g)); + } + + public boolean acceptDataObject(DataObject obj) { +- FileObject fo = obj.getPrimaryFile(); +- return g.contains(fo) && VisibilityQuery.getDefault().isVisible(fo); ++ return acceptFileObject(obj.getPrimaryFile()); + } + + public void stateChanged(ChangeEvent e) { +- fireChange(); ++ cs.fireChange(); + } + + public void propertyChange(PropertyChangeEvent e) { + if (SourceGroup.PROP_CONTAINERSHIP.equals(e.getPropertyName())) { +- fireChange(); ++ cs.fireChange(); + } + } + +- private void fireChange() { +- Object[] listeners = ell.getListenerList(); +- ChangeEvent event = null; +- for (int i = listeners.length - 2; i >= 0; i -= 2) { +- if (listeners[i] == ChangeListener.class) { +- if (event == null) { +- event = new ChangeEvent(this); +- } +- ((ChangeListener) listeners[i+1]).stateChanged(event); +- } +- } +- } +- + public void addChangeListener(ChangeListener listener) { +- ell.add(ChangeListener.class, listener); ++ cs.addChangeListener(listener); + } + + public void removeChangeListener(ChangeListener listener) { +- ell.remove(ChangeListener.class, listener); ++ cs.removeChangeListener(listener); ++ } ++ ++ public boolean acceptFileObject(FileObject fo) { ++ return g.contains(fo) && VisibilityQuery.getDefault().isVisible(fo); + } + + } +diff -r 76d51071af8a -r af9499d919b8 java.source/nbproject/project.properties +--- a/java.source/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.source/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -43,7 +43,7 @@ + javadoc.title=Java Source + javadoc.arch=${basedir}/arch.xml + javadoc.apichanges=${basedir}/apichanges.xml +-spec.version.base=0.40.1 ++spec.version.base=0.40.4 + 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:\ +diff -r 76d51071af8a -r af9499d919b8 java.source/src/org/netbeans/api/java/source/WorkingCopy.java +--- a/java.source/src/org/netbeans/api/java/source/WorkingCopy.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.source/src/org/netbeans/api/java/source/WorkingCopy.java Tue Mar 10 13:53:55 2009 +0300 +@@ -291,7 +291,12 @@ + return null; + } + Tree repl = changeMap.remove(tree); +- Tree newRepl = super.translate(repl != null ? repl : tree); ++ Tree newRepl; ++ if (repl != null) { ++ newRepl = translate(repl); ++ } else { ++ newRepl = super.translate(tree); ++ } + return newRepl; + } + } +diff -r 76d51071af8a -r af9499d919b8 java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java +--- a/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.source/src/org/netbeans/modules/java/source/save/CasualDiff.java Tue Mar 10 13:53:55 2009 +0300 +@@ -333,6 +333,7 @@ + + protected int diffClassDef(JCClassDecl oldT, JCClassDecl newT, int[] bounds) { + int localPointer = bounds[0]; ++ final Name origOuterClassName = origClassName; + int insertHint = localPointer; + // skip the section when printing anonymous class + if (anonClass == false) { +@@ -442,8 +443,7 @@ + copyTo(localPointer, insertHint); + localPointer = diffList(filterHidden(oldT.defs), filterHidden(newT.defs), insertHint, est, Measure.MEMBER, printer); + printer.enclClassName = origName; +- // the reference is no longer needed. +- origClassName = null; ++ origClassName = origOuterClassName; + printer.undent(old); + if (localPointer != -1 && localPointer < origText.length()) { + if (origText.charAt(localPointer) == '}') { +diff -r 76d51071af8a -r af9499d919b8 java.source/src/org/netbeans/modules/java/source/save/Reformatter.java +--- a/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.source/src/org/netbeans/modules/java/source/save/Reformatter.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1497,6 +1497,11 @@ + alignIndent = col; + for (Iterator it = inits.iterator(); it.hasNext();) { + scan(it.next(), p); ++ if (it.hasNext() && !fieldGroup) { ++ spaces(cs.spaceBeforeComma() ? 1 : 0); ++ accept(COMMA); ++ spaces(cs.spaceAfterComma() ? 1 : 0); ++ } + } + spaces(cs.spaceBeforeSemi() ? 1 : 0); + } +@@ -2647,7 +2652,11 @@ + int index = tokens.index(); + int c = col; + Diff d = diffs.isEmpty() ? null : diffs.getFirst(); ++ old = indent; ++ if (alignIndent >= 0) ++ indent = alignIndent; + spaces(spacesCnt, true); ++ indent = old; + ret = col; + accept(first, rest); + if (this.col > rightMargin) { +@@ -2662,7 +2671,11 @@ + } + break; + case WRAP_NEVER: ++ old = indent; ++ if (alignIndent >= 0) ++ indent = alignIndent; + spaces(spacesCnt, true); ++ indent = old; + ret = col; + accept(first, rest); + break; +@@ -2686,7 +2699,11 @@ + int index = tokens.index(); + int c = col; + Diff d = diffs.isEmpty() ? null : diffs.getFirst(); ++ old = indent; ++ if (alignIndent >= 0) ++ indent = alignIndent; + spaces(spacesCnt, true); ++ indent = old; + ret = col; + wrapDepth++; + scan(tree, null); +@@ -2703,7 +2720,11 @@ + } + break; + case WRAP_NEVER: ++ old = indent; ++ if (alignIndent >= 0) ++ indent = alignIndent; + spaces(spacesCnt, true); ++ indent = old; + ret = col; + scan(tree, null); + break; +diff -r 76d51071af8a -r af9499d919b8 java.source/src/org/netbeans/modules/java/source/usages/RepositoryUpdater.java +--- a/java.source/src/org/netbeans/modules/java/source/usages/RepositoryUpdater.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.source/src/org/netbeans/modules/java/source/usages/RepositoryUpdater.java Tue Mar 10 13:53:55 2009 +0300 +@@ -283,11 +283,12 @@ + assert changedCp != null; + if (LOGGER.isLoggable(Level.FINE)) + LOGGER.log(Level.FINE, "ClassPath change, cp={0}", changedCp.toString()); +- for (ClassPath.Entry e : changedCp.entries()) { +- URL root = e.getURL(); +- scheduleCompilation(root,root, true, false); ++ final List entries = changedCp.entries(); ++ final List roots = new ArrayList(entries.size()); ++ for (ClassPath.Entry e : entries) { ++ roots.add (e.getURL()); + } +- ++ submit(Work.filterChange(roots, true)); + return ; + } + +@@ -617,6 +618,7 @@ + if (!noscan) { + synchronized (this) { + this.noSubmited++; ++ LOGGER.finest("submit()+: " + this.noSubmited); + } + final CompileWorker cw = new CompileWorker (work); + JavaSource.Priority p; +@@ -771,8 +773,14 @@ + Reference taskRef = url2CompileWithDepsTask.get(root); + Task t = taskRef != null ? taskRef.get() : null; + Collection storedFiles; ++ Boolean can = null; ++ ++ LOGGER.finest("t: " + t); + +- if (t == null || !t.cancel()) { ++ if (t == null || (can = !t.cancel())) { ++ if (can != null) { ++ LOGGER.finest("canceling: " + System.identityHashCode(t) + ", " + can); ++ } + if (lockRU == 0 || t != null) { + storedFiles = new LinkedHashSet(); + url2CompileWithDeps.put(root, storedFiles); +@@ -788,6 +796,7 @@ + //the task either does not exist, or has been already started - create new one: + LOGGER.log(Level.FINER, "creating a new task for root: {0}", root.toExternalForm()); + final Collection storedFilesFin = storedFiles; ++ final Task[] tt = new Task[1]; + t = WORKER.create(new Runnable() { + public void run() { + synchronized (RepositoryUpdater.this) { +@@ -795,25 +804,50 @@ + } + submit(Work.compileWithDeps(root, storedFilesFin)); + noSubmited--; ++ LOGGER.finest("assureCompiledWithDeps()-: " + noSubmited + ":" + System.identityHashCode(tt[0])); + } + }); +- url2CompileWithDepsTask.put(root, new WeakReference(t)); ++ tt[0] = t; ++ class WR extends WeakReference implements Runnable { ++ ++ long l; ++ public WR(Task t) { ++ super(t, Utilities.activeReferenceQueue()); ++ l = System.identityHashCode(t); ++ } ++ ++ public void run() { ++ LOGGER.finest("GCing: " + l); ++ } ++ ++ } ++ url2CompileWithDepsTask.put(root, new WR(t)); + compileScheduled++; +- noSubmited++; ++ LOGGER.finest("assureCompiledWithDeps()+: " + noSubmited + ":" + System.identityHashCode(t)); + } else { + url2CompileWithDepsTask.remove(root); + } + } else { + storedFiles = url2CompileWithDeps.get(root); ++ if (can != null) { ++ LOGGER.finest("2. canceling: " + System.identityHashCode(t) + ", " + can); ++ } ++ if (t != null) { ++ noSubmited--; ++ } + } + + assert storedFiles != null; + + storedFiles.add(file); +- ++ ++ LOGGER.finest("lockRU: " + lockRU); ++ + if (lockRU > 0) { + compileWithDepsToBeScheduled = true; + } else { ++ LOGGER.finest("scheduling: " + System.identityHashCode(t)); ++ noSubmited++; + t.schedule(DELAY); + } + } +@@ -914,9 +948,11 @@ + public void run() { + submit(Work.compileWithDeps(root, storedFilesFin)); + noSubmited--; ++ LOGGER.finest("unlockRU()-: " + noSubmited); + } + }); + noSubmited++; ++ LOGGER.finest("unlockRU()+: " + noSubmited); + url2CompileWithDepsTask.put(root, new WeakReference(t)); + } + +@@ -1612,6 +1648,7 @@ + if (!continuation) { + synchronized (RepositoryUpdater.this) { + RepositoryUpdater.this.noSubmited--; ++ LOGGER.finest("compileWorker.run()-: " + noSubmited); + if (RepositoryUpdater.this.noSubmited == 0) { + RepositoryUpdater.this.notifyAll(); + } +diff -r 76d51071af8a -r af9499d919b8 java.source/src/org/netbeans/modules/java/ui/FmtTabsIndents.form +--- a/java.source/src/org/netbeans/modules/java/ui/FmtTabsIndents.form Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.source/src/org/netbeans/modules/java/ui/FmtTabsIndents.form Tue Mar 10 13:53:55 2009 +0300 +@@ -36,6 +36,10 @@ + + + ++ ++ ++ ++ + + + +@@ -57,6 +61,8 @@ + + + ++ ++ + + + +@@ -123,5 +129,17 @@ + + + ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ + + +diff -r 76d51071af8a -r af9499d919b8 java.source/src/org/netbeans/modules/java/ui/FmtTabsIndents.java +--- a/java.source/src/org/netbeans/modules/java/ui/FmtTabsIndents.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.source/src/org/netbeans/modules/java/ui/FmtTabsIndents.java Tue Mar 10 13:53:55 2009 +0300 +@@ -65,6 +65,7 @@ + absoluteLabelIndentCheckBox.putClientProperty(OPTION_ID, absoluteLabelIndent); + indentTopLevelClassMembersCheckBox.putClientProperty(OPTION_ID, indentTopLevelClassMembers); + indentCasesFromSwitchCheckBox.putClientProperty(OPTION_ID, indentCasesFromSwitch); ++ addLeadingStarInCommentCheckBox.putClientProperty(OPTION_ID, addLeadingStarInComment); + // rightMarginField.putClientProperty(OPTION_ID, rightMargin); + } + +@@ -119,6 +120,7 @@ + absoluteLabelIndentCheckBox = new javax.swing.JCheckBox(); + indentTopLevelClassMembersCheckBox = new javax.swing.JCheckBox(); + indentCasesFromSwitchCheckBox = new javax.swing.JCheckBox(); ++ addLeadingStarInCommentCheckBox = new javax.swing.JCheckBox(); + + setName(org.openide.util.NbBundle.getMessage(FmtTabsIndents.class, "LBL_TabsAndIndents")); // NOI18N + setOpaque(false); +@@ -138,6 +140,9 @@ + org.openide.awt.Mnemonics.setLocalizedText(indentCasesFromSwitchCheckBox, org.openide.util.NbBundle.getMessage(FmtTabsIndents.class, "LBL_IndentCasesFromSwitch")); // NOI18N + indentCasesFromSwitchCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); + ++ org.openide.awt.Mnemonics.setLocalizedText(addLeadingStarInCommentCheckBox, org.openide.util.NbBundle.getMessage(FmtTabsIndents.class, "LBL_AddLeadingStarInComment")); // NOI18N ++ addLeadingStarInCommentCheckBox.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0)); ++ + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); + this.setLayout(layout); + layout.setHorizontalGroup( +@@ -153,6 +158,9 @@ + .add(indentCasesFromSwitchCheckBox) + .add(indentTopLevelClassMembersCheckBox) + .add(absoluteLabelIndentCheckBox) ++ .add(layout.createSequentialGroup() ++ .add(addLeadingStarInCommentCheckBox) ++ .addContainerGap()) + ); + + layout.linkSize(new java.awt.Component[] {continuationIndentSizeField, labelIndentField}, org.jdesktop.layout.GroupLayout.HORIZONTAL); +@@ -174,6 +182,8 @@ + .add(indentTopLevelClassMembersCheckBox) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(indentCasesFromSwitchCheckBox) ++ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) ++ .add(addLeadingStarInCommentCheckBox) + .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + ); + }// //GEN-END:initComponents +diff -r 76d51071af8a -r af9499d919b8 java.source/test/unit/src/org/netbeans/api/java/source/gen/MultipleRewritesTest.java +--- a/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultipleRewritesTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.source/test/unit/src/org/netbeans/api/java/source/gen/MultipleRewritesTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -42,6 +42,7 @@ + + import com.sun.source.tree.ClassTree; + import com.sun.source.tree.ExpressionTree; ++import com.sun.source.tree.IdentifierTree; + import com.sun.source.tree.MethodTree; + import com.sun.source.tree.ModifiersTree; + import com.sun.source.tree.TypeParameterTree; +@@ -119,6 +120,41 @@ + assertEquals(golden, res); + } + ++ public void testRewriteRewrittenTree2() throws Exception { ++ testFile = new File(getWorkDir(), "Test.java"); ++ TestUtilities.copyStringToFile(testFile, ++ "package hierbas.del.litoral;\n\n" + ++ "public class Test {\n" + ++ " String a;\n" + ++ "}\n" ++ ); ++ String golden = ++ "package hierbas.del.litoral;\n\n" + ++ "public class Test {\n" + ++ " Object a;\n" + ++ "}\n"; ++ JavaSource testSource = JavaSource.forFileObject(FileUtil.toFileObject(testFile)); ++ Task task = new Task() { ++ ++ 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); ++ VariableTree var = (VariableTree) clazz.getMembers().get(1); ++ IdentifierTree i = make.Identifier("Test"); ++ ++ workingCopy.rewrite(var.getType(), i); ++ workingCopy.rewrite(i, make.Identifier("Object")); ++ } ++ ++ }; ++ testSource.runModificationTask(task).commit(); ++ String res = TestUtilities.copyFileToString(testFile); ++ System.err.println(res); ++ assertEquals(golden, res); ++ } ++ + String getGoldenPckg() { + return ""; + } +diff -r 76d51071af8a -r af9499d919b8 java.sourceui/nbproject/project.properties +--- a/java.sourceui/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.sourceui/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -2,4 +2,4 @@ + javac.compilerargs=-Xlint -Xlint:-serial + javac.source=1.5 + javadoc.arch=${basedir}/arch.xml +-spec.version.base=1.6.1 ++spec.version.base=1.6.2 +diff -r 76d51071af8a -r af9499d919b8 java.sourceui/src/org/netbeans/modules/java/source/ui/JavaTypeDescription.java +--- a/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaTypeDescription.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaTypeDescription.java Tue Mar 10 13:53:55 2009 +0300 +@@ -87,7 +87,14 @@ + } + + public void open() { +- final ClasspathInfo ci = ClasspathInfo.create(cacheItem.getRoot()); ++ final FileObject root = cacheItem.getRoot(); ++ if (root == null) { ++ final String message = NbBundle.getMessage(JavaTypeDescription.class, "LBL_JavaTypeDescription_nosource",handle.getQualifiedName()); ++ StatusDisplayer.getDefault().setStatusText(message); ++ Toolkit.getDefaultToolkit().beep(); ++ return; ++ } ++ final ClasspathInfo ci = ClasspathInfo.create(root); + if ( cacheItem.isBinary() ) { + final JavaSource js = JavaSource.create( ci ); + final ElementHandle eh = handle; +diff -r 76d51071af8a -r af9499d919b8 java.sourceui/src/org/netbeans/modules/java/source/ui/JavaTypeProvider.java +--- a/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaTypeProvider.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/java.sourceui/src/org/netbeans/modules/java/source/ui/JavaTypeProvider.java Tue Mar 10 13:53:55 2009 +0300 +@@ -42,10 +42,12 @@ + package org.netbeans.modules.java.source.ui; + + import java.io.IOException; ++import java.net.URISyntaxException; + import java.net.URL; + import java.util.ArrayList; + import java.util.EnumSet; + import java.util.HashSet; ++import java.util.List; + import java.util.Set; + import java.util.concurrent.ExecutionException; + import java.util.concurrent.Future; +@@ -75,6 +77,7 @@ + import org.netbeans.spi.jumpto.type.TypeProvider; + import org.openide.filesystems.FileObject; + import org.openide.filesystems.FileStateInvalidException; ++import org.openide.filesystems.URLMapper; + import org.openide.util.Exceptions; + import org.openide.util.Lookup; + import org.openide.util.NbBundle; +@@ -176,19 +179,17 @@ + // Sources + time = System.currentTimeMillis(); + ClassPath scp = RepositoryUpdater.getDefault().getScannedSources(); +- FileObject roots[] = scp.getRoots(); ++ List entries = scp.entries(); + gss += System.currentTimeMillis() - time; +- FileObject root[] = new FileObject[1]; +- sources = new HashSet( roots.length ); +- for (int i = 0; i < roots.length; i++ ) { +- root[0] = roots[i]; ++ sources = new HashSet(entries.size()); ++ for (ClassPath.Entry entry : entries) { + time = System.currentTimeMillis(); +- ClasspathInfo ci = ClasspathInfo.create( EMPTY_CLASSPATH, EMPTY_CLASSPATH, ClassPathSupport.createClassPath(root)); //create(roots[i]); ++ ClasspathInfo ci = ClasspathInfo.create( EMPTY_CLASSPATH, EMPTY_CLASSPATH, ClassPathSupport.createClassPath(entry.getURL())); + if ( isCanceled ) { + return; + } + else { +- sources.add( new CacheItem( roots[i], ci, false ) ); ++ sources.add( new CacheItem( entry.getURL(), ci, false ) ); + } + cp += System.currentTimeMillis() - time; + } +@@ -198,31 +199,26 @@ + // Binaries + time = System.currentTimeMillis(); + scp = RepositoryUpdater.getDefault().getScannedBinaries(); +- roots = scp.getRoots(); ++ entries = scp.entries(); + gsb += System.currentTimeMillis() - time; +- root = new FileObject[1]; +- for (int i = 0; i < roots.length; i++ ) { ++ for (ClassPath.Entry entry : entries) { + try { + if ( isCanceled ) { + return; + } + time = System.currentTimeMillis(); + if (!hasBinaryOpen) { +- SourceForBinaryQuery.Result result = SourceForBinaryQuery.findSourceRoots(roots[i].getURL()); ++ SourceForBinaryQuery.Result result = SourceForBinaryQuery.findSourceRoots(entry.getURL()); + if ( result.getRoots().length == 0 ) { + continue; + } + } + sfb += System.currentTimeMillis() - time; + time = System.currentTimeMillis(); +- root[0] = roots[i]; +- ClasspathInfo ci = ClasspathInfo.create(ClassPathSupport.createClassPath(root), EMPTY_CLASSPATH, EMPTY_CLASSPATH );//create(roots[i]); +- sources.add( new CacheItem( roots[i], ci, true ) ); ++ ClasspathInfo ci = ClasspathInfo.create(ClassPathSupport.createClassPath(entry.getURL()), EMPTY_CLASSPATH, EMPTY_CLASSPATH );//create(roots[i]); ++ sources.add( new CacheItem( entry.getURL(), ci, true ) ); + cp += System.currentTimeMillis() - time; +- } +- catch ( FileStateInvalidException e ) { +- continue; +- } ++ } + finally { + if ( isCanceled ) { + return; +@@ -231,46 +227,46 @@ + } + } else { // user provided classpath + +- FileObject[] bootRoots = cpInfo.getClassPath(ClasspathInfo.PathKind.BOOT).getRoots(); +- FileObject[] compileRoots = cpInfo.getClassPath(ClasspathInfo.PathKind.COMPILE).getRoots(); +- FileObject[] sourceRoots = cpInfo.getClassPath(ClasspathInfo.PathKind.SOURCE).getRoots(); +- sources = new HashSet(bootRoots.length + compileRoots.length + sourceRoots.length); ++ final List bootRoots = cpInfo.getClassPath(ClasspathInfo.PathKind.BOOT).entries(); ++ final List compileRoots = cpInfo.getClassPath(ClasspathInfo.PathKind.COMPILE).entries(); ++ final List sourceRoots = cpInfo.getClassPath(ClasspathInfo.PathKind.SOURCE).entries(); ++ sources = new HashSet(bootRoots.size() + compileRoots.size() + sourceRoots.size()); + + // bootPath +- for (int i = 0; i < bootRoots.length; i++ ) { ++ for (ClassPath.Entry entry : bootRoots) { + time = System.currentTimeMillis(); +- ClasspathInfo ci = ClasspathInfo.create(ClassPathSupport.createClassPath(bootRoots[i]), EMPTY_CLASSPATH, EMPTY_CLASSPATH); ++ ClasspathInfo ci = ClasspathInfo.create(ClassPathSupport.createClassPath(entry.getURL()), EMPTY_CLASSPATH, EMPTY_CLASSPATH); + if ( isCanceled ) { + return; + } + else { +- sources.add( new CacheItem( bootRoots[i], ci, true ) ); ++ sources.add( new CacheItem( entry.getURL(), ci, true ) ); + } + cp += System.currentTimeMillis() - time; + } + + // classPath +- for (int i = 0; i < compileRoots.length; i++ ) { ++ for (ClassPath.Entry entry : compileRoots) { + time = System.currentTimeMillis(); +- ClasspathInfo ci = ClasspathInfo.create(EMPTY_CLASSPATH, ClassPathSupport.createClassPath(compileRoots[i]), EMPTY_CLASSPATH); ++ ClasspathInfo ci = ClasspathInfo.create(EMPTY_CLASSPATH, ClassPathSupport.createClassPath(entry.getURL()), EMPTY_CLASSPATH); + if ( isCanceled ) { + return; + } + else { +- sources.add( new CacheItem( compileRoots[i], ci, true ) ); ++ sources.add( new CacheItem( entry.getURL(), ci, true ) ); + } + cp += System.currentTimeMillis() - time; + } + + // sourcePath +- for (int i = 0; i < sourceRoots.length; i++ ) { ++ for (ClassPath.Entry entry : sourceRoots) { + time = System.currentTimeMillis(); +- ClasspathInfo ci = ClasspathInfo.create(EMPTY_CLASSPATH, EMPTY_CLASSPATH, ClassPathSupport.createClassPath(sourceRoots[i])); ++ ClasspathInfo ci = ClasspathInfo.create(EMPTY_CLASSPATH, EMPTY_CLASSPATH, ClassPathSupport.createClassPath(entry.getURL())); + if ( isCanceled ) { + return; + } + else { +- sources.add( new CacheItem( sourceRoots[i], ci, false ) ); ++ sources.add( new CacheItem( entry.getURL(), ci, false ) ); + } + cp += System.currentTimeMillis() - time; + } +@@ -412,15 +408,16 @@ + static class CacheItem { + + public final boolean isBinary; +- public final FileObject fileObject; ++ public final URL root; + public final ClasspathInfo classpathInfo; + public String projectName; + public Icon projectIcon; + private ClassPath.Entry defEntry; ++ private FileObject cachedRoot; + +- public CacheItem ( FileObject fileObject, ClasspathInfo classpathInfo, boolean isBinary ) { ++ public CacheItem ( URL root, ClasspathInfo classpathInfo, boolean isBinary ) { + this.isBinary = isBinary; +- this.fileObject = fileObject; ++ this.root = root; + this.classpathInfo = classpathInfo; + } + +@@ -443,20 +440,31 @@ + + @Override + public int hashCode () { +- return this.fileObject == null ? 0 : this.fileObject.hashCode(); ++ return this.root == null ? 0 : this.root.hashCode(); + } + + @Override + public boolean equals (Object other) { + if (other instanceof CacheItem) { + CacheItem otherItem = (CacheItem) other; +- return this.fileObject == null ? otherItem.fileObject == null : this.fileObject.equals(otherItem.fileObject); ++ return this.root == null ? otherItem.root == null : this.root.equals(otherItem.root); + } + return false; + } + + public FileObject getRoot() { +- return fileObject; ++ synchronized (this) { ++ if (cachedRoot != null) { ++ return cachedRoot; ++ } ++ } ++ FileObject _tmp = URLMapper.findFileObject(root); ++ synchronized (this) { ++ if (cachedRoot == null) { ++ cachedRoot = _tmp; ++ } ++ } ++ return _tmp; + } + + public boolean isBinary() { +@@ -478,11 +486,15 @@ + } + + private void initProjectInfo() { +- Project p = FileOwnerQuery.getOwner(fileObject); +- if (p != null) { +- ProjectInformation pi = ProjectUtils.getInformation( p ); +- projectName = pi.getDisplayName(); +- projectIcon = pi.getIcon(); ++ try { ++ Project p = FileOwnerQuery.getOwner(this.root.toURI()); ++ if (p != null) { ++ ProjectInformation pi = ProjectUtils.getInformation( p ); ++ projectName = pi.getDisplayName(); ++ projectIcon = pi.getIcon(); ++ } ++ } catch (URISyntaxException e) { ++ Exceptions.printStackTrace(e); + } + } + +diff -r 76d51071af8a -r af9499d919b8 javadoc/nbproject/project.properties +--- a/javadoc/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/javadoc/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,4 +39,4 @@ + build.compiler.deprecation=false + javac.compilerargs=-Xlint:unchecked + javac.source=1.5 +-spec.version.base=1.24.1 ++spec.version.base=1.24.2 +diff -r 76d51071af8a -r af9499d919b8 javadoc/src/org/netbeans/modules/javadoc/search/IndexSearch.java +--- a/javadoc/src/org/netbeans/modules/javadoc/search/IndexSearch.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/javadoc/src/org/netbeans/modules/javadoc/search/IndexSearch.java Tue Mar 10 13:53:55 2009 +0300 +@@ -456,7 +456,7 @@ + evt.consume(); + } + else +- showHelp(); ++ showHelpExternal(); + } + }//GEN-LAST:event_resultsListMouseClicked + +diff -r 76d51071af8a -r af9499d919b8 jumpto/manifest.mf +--- a/jumpto/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/jumpto/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,5 +2,5 @@ + OpenIDE-Module: org.netbeans.modules.jumpto/1 + OpenIDE-Module-Layer: org/netbeans/modules/jumpto/resources/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/jumpto/resources/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.7.1 ++OpenIDE-Module-Specification-Version: 1.7.2 + AutoUpdate-Show-In-Client: false +diff -r 76d51071af8a -r af9499d919b8 jumpto/nbproject/project.xml +--- a/jumpto/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/jumpto/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -177,6 +177,7 @@ + org.netbeans.modules.cnd.gotodeclaration + org.netbeans.modules.gsf + org.netbeans.modules.java.sourceui ++ org.netbeans.modules.javafx.editor + org.netbeans.modules.spring.beans + org.netbeans.api.jumpto.type + org.netbeans.spi.jumpto.symbol +diff -r 76d51071af8a -r af9499d919b8 lib.cvsclient/manifest.mf +--- a/lib.cvsclient/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/lib.cvsclient/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.lib.cvsclient/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/lib/cvsclient/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.17.1 ++OpenIDE-Module-Specification-Version: 1.17.3 + Specification-Version: 1.9 + Main-Class: org.netbeans.lib.cvsclient.commandLine.CVSCommand + +diff -r 76d51071af8a -r af9499d919b8 lib.cvsclient/src/org/netbeans/lib/cvsclient/admin/Entry.java +--- a/lib.cvsclient/src/org/netbeans/lib/cvsclient/admin/Entry.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/lib.cvsclient/src/org/netbeans/lib/cvsclient/admin/Entry.java Tue Mar 10 13:53:55 2009 +0300 +@@ -491,7 +491,8 @@ + */ + public boolean isNewUserFile() { + return revision != null +- && revision.startsWith(NEW_USER_FILE); ++ && revision.startsWith(NEW_USER_FILE) ++ && revision.indexOf(".") < 0; + } + + /** +diff -r 76d51071af8a -r af9499d919b8 libs.jna/manifest.mf +--- a/libs.jna/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/libs.jna/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -3,4 +3,4 @@ + OpenIDE-Module: org.netbeans.libs.jna/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/libs/jna/Bundle.properties + AutoUpdate-Essential-Module: true +-OpenIDE-Module-Specification-Version: 1.1.1 ++OpenIDE-Module-Specification-Version: 1.1.2 +diff -r 76d51071af8a -r af9499d919b8 masterfs/manifest.mf +--- a/masterfs/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/masterfs/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.masterfs/2 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/masterfs/resources/Bundle.properties +-OpenIDE-Module-Specification-Version: 2.15.1 ++OpenIDE-Module-Specification-Version: 2.15.2 + AutoUpdate-Show-In-Client: false + AutoUpdate-Essential-Module: true + +diff -r 76d51071af8a -r af9499d919b8 masterfs/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/LockForFile.java +--- a/masterfs/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/LockForFile.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/masterfs/src/org/netbeans/modules/masterfs/filebasedfs/fileobjects/LockForFile.java Tue Mar 10 13:53:55 2009 +0300 +@@ -105,7 +105,11 @@ + } + if (namesakes.putInstance(file, result) == null) { + FileAlreadyLockedException alreadyLockedException = new FileAlreadyLockedException(file.getAbsolutePath()); +- alreadyLockedException.initCause(namesakes.getInstance(file).lockedBy); ++ LockForFile previousLock = namesakes.getInstance(file); ++ // #151576 - check for null although it should not happen ++ if (previousLock != null) { ++ alreadyLockedException.initCause(previousLock.lockedBy); ++ } + throw alreadyLockedException; + } + result.valid = true; +diff -r 76d51071af8a -r af9499d919b8 mercurial/nbproject/project.properties +--- a/mercurial/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/mercurial/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -5,7 +5,7 @@ + nbm.homepage=http://wiki.netbeans.org/wiki/view/MercurialVersionControl + nbm.module.author=John Rice and Padraig O'Briain + nbm.needs.restart=true +-spec.version.base=1.7.1 ++spec.version.base=1.7.2 + + #qa-functional + test.qa-functional.cp.extra=${openide.nodes.dir}/modules/org-openide-nodes.jar:\${openide.util.dir}/lib/org-openide-util.jar +diff -r 76d51071af8a -r af9499d919b8 mercurial/src/org/netbeans/modules/mercurial/Bundle.properties +--- a/mercurial/src/org/netbeans/modules/mercurial/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/mercurial/src/org/netbeans/modules/mercurial/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,6 +39,10 @@ + + OpenIDE-Module-Display-Category=Base IDE + OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ ++\ + Integrates Mercurial functionality into NetBeans IDE + OpenIDE-Module-Name=Mercurial + OpenIDE-Module-Short-Description=Mercurial Versioning System +diff -r 76d51071af8a -r af9499d919b8 mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java +--- a/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/mercurial/src/org/netbeans/modules/mercurial/util/HgCommand.java Tue Mar 10 13:53:55 2009 +0300 +@@ -936,7 +936,7 @@ + } + + public static HgLogMessage[] getLogMessagesNoFileInfo(final String rootUrl, final Set files, int limit, OutputLogger logger) { +- return getLogMessages(rootUrl, files, null, null, true, false, limit, logger); ++ return getLogMessages(rootUrl, files, HG_STATUS_FLAG_TIP_CMD, "0", true, false, limit, logger); + } + + public static HgLogMessage[] getLogMessagesNoFileInfo(final String rootUrl, final Set files, OutputLogger logger) { +@@ -1520,6 +1520,16 @@ + revStr = "0:" + to; + } + ++ if(revStr == null) { ++ if(to == null) { ++ to = HG_STATUS_FLAG_TIP_CMD; ++ } ++ if(from == null) { ++ from = "0"; ++ } ++ revStr = from + ":" + to; ++ } ++ + return revStr; + } + /** +diff -r 76d51071af8a -r af9499d919b8 o.apache.tools.ant.module/nbproject/project.properties +--- a/o.apache.tools.ant.module/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/o.apache.tools.ant.module/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,7 +39,7 @@ + + javac.compilerargs=-Xlint:unchecked + javac.source=1.5 +-spec.version.base=3.32.1 ++spec.version.base=3.32.2 + compile.ant.jar=${ant.core.lib} + src-bridge.cp.extra=build/classes:${compile.ant.jar} + extra.module.files=\ +diff -r 76d51071af8a -r af9499d919b8 o.apache.tools.ant.module/src/org/apache/tools/ant/module/nodes/AntNavigatorPanel.java +--- a/o.apache.tools.ant.module/src/org/apache/tools/ant/module/nodes/AntNavigatorPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/o.apache.tools.ant.module/src/org/apache/tools/ant/module/nodes/AntNavigatorPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -42,7 +42,6 @@ + package org.apache.tools.ant.module.nodes; + + import java.awt.BorderLayout; +-import java.beans.PropertyVetoException; + import java.util.Collection; + import javax.swing.ActionMap; + import javax.swing.JComponent; +@@ -53,7 +52,6 @@ + import org.openide.explorer.ExplorerUtils; + import org.openide.explorer.view.ListView; + import org.openide.loaders.DataObject; +-import org.openide.nodes.Children; + import org.openide.nodes.Node; + import org.openide.util.Lookup; + import org.openide.util.LookupEvent; +@@ -109,25 +107,9 @@ + public ExplorerManager getExplorerManager() { + return manager; + } +- // Make sure list gets focus, with first node initially selected: + @Override + public boolean requestFocusInWindow() { +- boolean b = view.requestFocusInWindow(); +- Children.MUTEX.postReadRequest(new Runnable() { +- public void run() { +- if (manager.getSelectedNodes().length == 0) { +- Node[] children = manager.getRootContext().getChildren().getNodes(true); +- if (children.length > 0) { +- try { +- manager.setSelectedNodes(new Node[] {children[0]}); +- } catch (PropertyVetoException e) { +- // #146284 - happens sometimes; why? Ignore... +- } +- } +- } +- } +- }); +- return b; ++ return view.requestFocusInWindow(); + } + public Lookup getLookup() { + return lookup; +diff -r 76d51071af8a -r af9499d919b8 o.n.core/nbproject/project.properties +--- a/o.n.core/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/o.n.core/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,7 +39,7 @@ + + javac.compilerargs=-Xlint:unchecked + javac.source=1.5 +-spec.version.base=3.10.1 ++spec.version.base=3.10.4 + + javadoc.arch=${basedir}/arch.xml + +diff -r 76d51071af8a -r af9499d919b8 o.n.core/src/org/netbeans/beaninfo/editors/DataFolderPanel.form +--- a/o.n.core/src/org/netbeans/beaninfo/editors/DataFolderPanel.form Fri Nov 07 11:48:18 2008 +0100 ++++ b/o.n.core/src/org/netbeans/beaninfo/editors/DataFolderPanel.form Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,9 @@ + + +-
      ++ + ++ ++ + + + +diff -r 76d51071af8a -r af9499d919b8 o.n.core/src/org/netbeans/beaninfo/editors/DataFolderPanel.java +--- a/o.n.core/src/org/netbeans/beaninfo/editors/DataFolderPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/o.n.core/src/org/netbeans/beaninfo/editors/DataFolderPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -42,13 +42,16 @@ + package org.netbeans.beaninfo.editors; + + import java.awt.event.KeyEvent; ++import java.beans.PropertyChangeEvent; ++import java.beans.PropertyChangeListener; ++import java.beans.PropertyVetoException; ++import java.beans.VetoableChangeListener; + import java.io.IOException; +-import java.lang.ref.*; ++import java.io.File; ++import java.lang.ref.Reference; ++import java.lang.ref.WeakReference; + import java.util.Arrays; + import java.util.StringTokenizer; +-import java.beans.*; +-import java.io.File; +- + import javax.swing.event.DocumentListener; + import javax.swing.event.ChangeListener; + import javax.swing.event.ChangeEvent; +@@ -315,7 +318,7 @@ + return; + } + if (arr.length == 1) { +- if (!isValid ()) { ++ if (!isValidState()) { + setTargetFolder (null); + implSetDataFolder (null); + return ; +@@ -357,7 +360,7 @@ + public void run () { + String text = packageName.getText (); + if (text != null) { +- if (isValid()) { ++ if (isValidState()) { + setTargetFolder (text, false); + updatePropertyEditor(); + } +@@ -386,7 +389,7 @@ + } + String text = packageName.getText (); + if (text != null) { +- if (isValid()) { ++ if (isValidState()) { + setTargetFolder (text, true); + updatePropertyEditor(); + } +@@ -414,7 +417,7 @@ + * If the panel is valid, the "Next" (or "Finish") button will be enabled. + * @return true if the user has entered satisfactory information + */ +- public boolean isValid () { ++ private boolean isValidState () { + String text = packageName.getText (); + if (text.length () == 0) { + Node[] arr = packagesPanel.getExplorerManager ().getSelectedNodes (); +@@ -579,7 +582,7 @@ + * @exception IOException if the possible creation of the folder fails + */ + private DataFolder getTargetFolder(boolean create) throws IOException { +- if (create && isValid()) { ++ if (create && isValidState()) { + FileSystem fs = system.get (); + if (fs != null) { + DataFolder folder = DataFolder.findFolder (fs.getRoot ()); +@@ -767,7 +770,7 @@ + // bugfix #29401, correct notify all changes in data folders + private void implSetDataFolder (DataFolder df) { + if (editor != null) { +- if (!isValid ()) { ++ if (!isValidState()) { + editor.setDataFolder (null); + } else { + FileSystem fs = null; +@@ -819,7 +822,7 @@ + // nothing to create + createButton.setEnabled(false); + } else { +- createButton.setEnabled(isValid()); ++ createButton.setEnabled(isValidState()); + } + } + +@@ -830,7 +833,7 @@ + * (and thus it should not be set) + */ + private Object getPropertyValue() throws IllegalStateException { +- if (isValid()) { ++ if (isValidState()) { + try { + df = getTargetFolder(true); + return df; +diff -r 76d51071af8a -r af9499d919b8 o.n.core/src/org/netbeans/core/NotifyExcPanel.java +--- a/o.n.core/src/org/netbeans/core/NotifyExcPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/o.n.core/src/org/netbeans/core/NotifyExcPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -268,10 +268,21 @@ + } + + // #50018 Don't try to show any notify dialog when reporting headless exception +- if ("java.awt.HeadlessException".equals(t.getClassName()) && GraphicsEnvironment.isHeadless()) { ++ if ("java.awt.HeadlessException".equals(t.getClassName()) && GraphicsEnvironment.isHeadless()) { // NOI18N + t.printStackTrace(System.err); + return; + } ++ //#133092: Error in JDK 5 during printing #6704417. ++ if ("java.lang.NullPointerException".equals(t.getClassName())) { // NOI18N ++ StringWriter sw = new StringWriter(); ++ PrintWriter pw = new PrintWriter(sw); ++ t.printStackTrace(pw); ++ if (sw.toString().contains("sun.awt.windows.WComponentPeer.nativeHandleEvent") && // NOI18N ++ System.getProperty("java.version").startsWith("1.5")) { // NOI18N ++ t.printStackTrace(System.err); ++ return; ++ } ++ } + + SwingUtilities.invokeLater (new Runnable () { + public void run() { +diff -r 76d51071af8a -r af9499d919b8 openide.explorer/manifest.mf +--- a/openide.explorer/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.explorer/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,6 +1,6 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.openide.explorer +-OpenIDE-Module-Specification-Version: 6.16.1 ++OpenIDE-Module-Specification-Version: 6.16.3 + OpenIDE-Module-Implementation-Version: 1 + OpenIDE-Module-Localizing-Bundle: org/openide/explorer/Bundle.properties + AutoUpdate-Essential-Module: true +diff -r 76d51071af8a -r af9499d919b8 openide.explorer/src/org/openide/explorer/view/SheetCell.java +--- a/openide.explorer/src/org/openide/explorer/view/SheetCell.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.explorer/src/org/openide/explorer/view/SheetCell.java Tue Mar 10 13:53:55 2009 +0300 +@@ -537,10 +537,6 @@ + } + } + +- public boolean isValid() { +- return true; +- } +- + public boolean isShowing() { + return true; + } +diff -r 76d51071af8a -r af9499d919b8 openide.explorer/src/org/openide/explorer/view/TableSheetCell.java +--- a/openide.explorer/src/org/openide/explorer/view/TableSheetCell.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.explorer/src/org/openide/explorer/view/TableSheetCell.java Tue Mar 10 13:53:55 2009 +0300 +@@ -722,10 +722,6 @@ + } + } + +- public boolean isValid() { +- return true; +- } +- + public boolean isShowing() { + return true; + } +diff -r 76d51071af8a -r af9499d919b8 openide.explorer/src/org/openide/explorer/view/TreeView.java +--- a/openide.explorer/src/org/openide/explorer/view/TreeView.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.explorer/src/org/openide/explorer/view/TreeView.java Tue Mar 10 13:53:55 2009 +0300 +@@ -2148,7 +2148,8 @@ + } + + public void focusGained(FocusEvent e) { +- // Do nothing ++ // make sure nothing is selected ++ searchTextField.select(1, 1); + } + + public void focusLost(FocusEvent e) { +diff -r 76d51071af8a -r af9499d919b8 openide.loaders/apichanges.xml +--- a/openide.loaders/apichanges.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.loaders/apichanges.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -106,6 +106,32 @@ + + + ++ ++ ++ Faster Filtering based on FileObjects ++ ++ ++ ++ ++ ++

      ++ DataFilter ++ interface used to support filtering based on ++ DataObjects. ++ With the introduction of more ++ effective nodes, ++ this is slowing down the visualization of folders significantly. ++ That is why we introduce new ++ pre-filter ++ which can operate ++ on FileObjects, ++ whithout the need to instantiate ++ DataObjects. ++

      ++
      ++ ++ ++
      + + + Changes in FolderLookup are delivered in dedicated thread +diff -r 76d51071af8a -r af9499d919b8 openide.loaders/manifest.mf +--- a/openide.loaders/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.loaders/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,6 +1,6 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.openide.loaders +-OpenIDE-Module-Specification-Version: 7.2.1 ++OpenIDE-Module-Specification-Version: 7.2.3 + OpenIDE-Module-Localizing-Bundle: org/openide/loaders/Bundle.properties + OpenIDE-Module-Recommends: org.netbeans.modules.templates.v1_0 + AutoUpdate-Essential-Module: true +diff -r 76d51071af8a -r af9499d919b8 openide.loaders/src/org/openide/loaders/DataFilter.java +--- a/openide.loaders/src/org/openide/loaders/DataFilter.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.loaders/src/org/openide/loaders/DataFilter.java Tue Mar 10 13:53:55 2009 +0300 +@@ -41,6 +41,8 @@ + + package org.openide.loaders; + ++import org.openide.filesystems.FileObject; ++ + + /** Allows certain data objects to be excluded from being displayed. + * @see RepositoryNodeFactory +@@ -61,4 +63,18 @@ + /** @deprecated Only public by accident. */ + @Deprecated + /* public static final */ long serialVersionUID = 0L; ++ ++ /** Additional interface that can be implemented by the {@link DataFilter} ++ * implementors to do low level filtering based on the file objects. ++ * @since 7.4 ++ */ ++ public interface FileBased extends DataFilter { ++ /** Should this fileobject be considered for displaying? ++ * ++ * @param fo the file object ++ * @return true if the object should be displayed, ++ * false otherwise ++ */ ++ public boolean acceptFileObject(FileObject fo); ++ } + } +diff -r 76d51071af8a -r af9499d919b8 openide.loaders/src/org/openide/loaders/FolderChildren.java +--- a/openide.loaders/src/org/openide/loaders/FolderChildren.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.loaders/src/org/openide/loaders/FolderChildren.java Tue Mar 10 13:53:55 2009 +0300 +@@ -152,6 +152,12 @@ + Arrays.sort(arr, order); + List positioned = new ArrayList(arr.length); + for (FileObject fo : FileUtil.getOrder(Arrays.asList(arr), false)) { ++ if (filter instanceof DataFilter.FileBased) { ++ DataFilter.FileBased f =(DataFilter.FileBased)filter; ++ if (!f.acceptFileObject(fo)) { ++ continue; ++ } ++ } + positioned.add(new FolderChildrenPair(fo)); + } + +diff -r 76d51071af8a -r af9499d919b8 openide.loaders/src/org/openide/text/DataEditorSupport.java +--- a/openide.loaders/src/org/openide/text/DataEditorSupport.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.loaders/src/org/openide/text/DataEditorSupport.java Tue Mar 10 13:53:55 2009 +0300 +@@ -61,10 +61,10 @@ + import java.util.Date; + import java.util.HashMap; + import java.util.Map; +-import java.util.concurrent.atomic.AtomicReference; + import java.util.logging.Level; + import java.util.logging.Logger; + import javax.swing.text.BadLocationException; ++import javax.swing.text.Document; + import javax.swing.text.EditorKit; + import javax.swing.text.StyledDocument; + import org.netbeans.api.queries.FileEncodingQuery; +@@ -79,6 +79,7 @@ + import org.openide.filesystems.FileSystem.AtomicAction; + import org.openide.filesystems.FileUtil; + import org.openide.filesystems.FileLock; ++import org.openide.filesystems.FileRenameEvent; + import org.openide.filesystems.FileSystem; + import org.openide.loaders.DataFolder; + import org.openide.loaders.DataObject; +@@ -804,6 +805,13 @@ + firePropertyChange(Env.PROP_VALID, Boolean.TRUE, Boolean.FALSE); + */ + } ++ ++ /** Called from the EnvListener. ++ */ ++ final void fileRenamed () { ++ //#151787: Sync timestamp when svn client changes timestamp externally during rename. ++ firePropertyChange("expectedTime", null, getTime()); // NOI18N ++ } + + @Override + public CloneableOpenSupport findCloneableOpenSupport() { +@@ -921,6 +929,14 @@ + myEnv.fileChanged (fe.isExpected (), fe.getTime ()); + } + } ++ ++ @Override ++ public void fileRenamed(FileRenameEvent fe) { ++ Env myEnv = this.env.get(); ++ if (myEnv != null) { ++ myEnv.fileRenamed(); ++ } ++ } + + } + +diff -r 76d51071af8a -r af9499d919b8 openide.loaders/test/unit/src/org/openide/loaders/FolderChildrenTest.java +--- a/openide.loaders/test/unit/src/org/openide/loaders/FolderChildrenTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.loaders/test/unit/src/org/openide/loaders/FolderChildrenTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -47,6 +47,7 @@ + import java.io.IOException; + import java.util.*; + import java.lang.ref.WeakReference; ++import java.util.ArrayList; + import java.util.logging.Level; + import java.util.logging.Logger; + import javax.swing.event.ChangeEvent; +@@ -58,12 +59,15 @@ + import org.netbeans.junit.NbTestCase; + import org.netbeans.junit.NbTestSuite; + import org.netbeans.junit.RandomlyFails; ++import org.netbeans.spi.queries.VisibilityQueryImplementation; + import org.openide.filesystems.*; + + import org.openide.loaders.DefaultDataObjectTest.JspLoader; + import org.openide.loaders.MultiDataObject.Entry; ++import org.openide.nodes.AbstractNode; + import org.openide.nodes.Node; + import org.openide.nodes.Children; ++import org.openide.nodes.FilterNode; + import org.openide.nodes.NodeEvent; + import org.openide.nodes.NodeListener; + import org.openide.nodes.NodeMemberEvent; +@@ -95,7 +99,7 @@ + + public static Test suite() { + Test t = null; +-// t = new FolderChildrenTest("testDeadlockWithChildrenMutex"); ++// t = new FolderChildrenTest("testALotOfHiddenEntries"); + if (t == null) { + t = new NbTestSuite(FolderChildrenTest.class); + } +@@ -732,6 +736,84 @@ + assertNodes( arr, new String[] { "A" } ); + } + ++ public void testALotOfHiddenEntries() throws Exception { ++ FileSystem fs = Repository.getDefault ().getDefaultFileSystem(); ++ FileObject folder = FileUtil.createFolder(fs.getRoot(), "aLotOf"); ++ List arr = new ArrayList(); ++ final int FILES = 1000; ++ for (int i = 0; i < FILES; i++) { ++ arr.add(FileUtil.createData(folder, "" + i + ".dat")); ++ } ++ ++ DataFolder df = DataFolder.findFolder(folder); ++ ++ VisQ visq = new VisQ(); ++ ++ FilterNode fn = new FilterNode(new FilterNode(new AbstractNode(df.createNodeChildren(visq)))); ++ class L implements NodeListener { ++ int cnt; ++ ++ public void childrenAdded(NodeMemberEvent ev) { ++ cnt++; ++ } ++ ++ public void childrenRemoved(NodeMemberEvent ev) { ++ cnt++; ++ } ++ ++ public void childrenReordered(NodeReorderEvent ev) { ++ cnt++; ++ } ++ ++ public void nodeDestroyed(NodeEvent ev) { ++ cnt++; ++ } ++ ++ public void propertyChange(PropertyChangeEvent evt) { ++ cnt++; ++ } ++ } ++ L listener = new L(); ++ fn.addNodeListener(listener); ++ ++ List nodes = new ArrayList(); ++ int cnt = fn.getChildren().getNodesCount(true); ++ List snapshot = fn.getChildren().snapshot(); ++ assertEquals("Count as expected", cnt, snapshot.size()); ++ for (int i = 0; i < cnt; i++) { ++ nodes.add(snapshot.get(i)); ++ } ++ assertEquals("No events delivered", 0, listener.cnt); ++ assertEquals("Size is half cut", FILES / 2, fn.getChildren().getNodesCount(true)); ++ } ++ ++ public static final class VisQ implements VisibilityQueryImplementation, DataFilter.FileBased { ++ public boolean isVisible(FileObject file) { ++ try { ++ int number = Integer.parseInt(file.getName()); ++ return number % 2 == 0; ++ } catch (NumberFormatException numberFormatException) { ++ return true; ++ } ++ } ++ ++ public void addChangeListener(ChangeListener l) { ++ } ++ ++ public void removeChangeListener(ChangeListener l) { ++ } ++ ++ public boolean acceptDataObject(DataObject obj) { ++ return isVisible(obj.getPrimaryFile()); ++ } ++ ++ public boolean acceptFileObject(FileObject obj) { ++ return isVisible(obj); ++ } ++ ++ } ++ ++ + public static final class Pool extends DataLoaderPool { + private static Class loader; + +diff -r 76d51071af8a -r af9499d919b8 openide.nodes/nbproject/project.properties +--- a/openide.nodes/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.nodes/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -44,4 +44,4 @@ + javadoc.arch=${basedir}/arch.xml + javadoc.apichanges=${basedir}/apichanges.xml + +-spec.version.base=7.7.1 ++spec.version.base=7.7.3 +diff -r 76d51071af8a -r af9499d919b8 openide.nodes/src/org/openide/nodes/FilterNode.java +--- a/openide.nodes/src/org/openide/nodes/FilterNode.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.nodes/src/org/openide/nodes/FilterNode.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1641,7 +1641,7 @@ + } + + public Node[] callGetNodes(boolean optimalResult) { +- Node[] hold; ++ Node[] hold = null; + if (optimalResult) { + hold = original.getChildren().getNodes(true); + } +@@ -1650,7 +1650,7 @@ + } + + public int callGetNodesCount(boolean optimalResult) { +- Node[] hold; ++ Node[] hold = null; + if (optimalResult) { + hold = original.getChildren().getNodes(optimalResult); + } +@@ -1753,7 +1753,12 @@ + } + + public Node[] callGetNodes(boolean optimalResult) { +- return Children.this.getNodes(); ++ Node[] hold = null; ++ if (optimalResult) { ++ hold = original.getChildren().getNodes(true); ++ } ++ hold = Children.this.getNodes(); ++ return hold; + } + + public int callGetNodesCount(boolean optimalResult) { +diff -r 76d51071af8a -r af9499d919b8 openide.nodes/src/org/openide/nodes/Node.java +--- a/openide.nodes/src/org/openide/nodes/Node.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.nodes/src/org/openide/nodes/Node.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1045,31 +1045,37 @@ + * Can be null if one should find indices from current set of nodes + */ + final void fireSubNodesChange(boolean addAction, Node[] delta, Node[] from) { +- if (err.isLoggable(Level.FINER)) { +- err.finer("fireSubNodesChange() " + this); // NOI18N +- err.finer(" added: " + addAction); // NOI18N +- err.finer(" delta: " + Arrays.toString(delta)); // NOI18N +- err.finer(" from: " + Arrays.toString(from)); // NOI18N +- } ++ try { ++ // enter to readAccess to prevent firing another event before all listeners receive current event ++ Children.PR.enterReadAccess(); ++ if (err.isLoggable(Level.FINER)) { ++ err.finer("fireSubNodesChange() " + this); // NOI18N ++ err.finer(" added: " + addAction); // NOI18N ++ err.finer(" delta: " + Arrays.toString(delta)); // NOI18N ++ err.finer(" from: " + Arrays.toString(from)); // NOI18N ++ } + +- NodeMemberEvent ev = null; +- Object[] listeners = this.listeners.getListenerList(); ++ NodeMemberEvent ev = null; ++ Object[] listeners = this.listeners.getListenerList(); + +- // Process the listeners last to first, notifying +- // those that are interested in this event +- for (int i = listeners.length - 2; i >= 0; i -= 2) { +- if (listeners[i] == NodeListener.class) { +- // Lazily create the event: +- if (ev == null) { +- ev = new NodeMemberEvent(this, addAction, delta, from); +- } ++ // Process the listeners last to first, notifying ++ // those that are interested in this event ++ for (int i = listeners.length - 2; i >= 0; i -= 2) { ++ if (listeners[i] == NodeListener.class) { ++ // Lazily create the event: ++ if (ev == null) { ++ ev = new NodeMemberEvent(this, addAction, delta, from); ++ } + +- if (addAction) { +- ((NodeListener) listeners[i + 1]).childrenAdded(ev); +- } else { +- ((NodeListener) listeners[i + 1]).childrenRemoved(ev); ++ if (addAction) { ++ ((NodeListener) listeners[i + 1]).childrenAdded(ev); ++ } else { ++ ((NodeListener) listeners[i + 1]).childrenRemoved(ev); ++ } + } + } ++ } finally { ++ Children.PR.exitReadAccess(); + } + } + +diff -r 76d51071af8a -r af9499d919b8 openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java +--- a/openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.nodes/test/unit/src/org/openide/nodes/ChildrenKeysTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -256,6 +256,32 @@ + assertSame("Last node the same", now[2].getName(), after[1].getName()); + } + ++ public void testGetNodesOptimal() throws Exception { ++ class KOpt extends Keys { ++ ++ KOpt() { ++ super(lazy()); ++ } ++ int cnt; ++ ++ @Override ++ public Node[] getNodes(boolean optimal) { ++ assertTrue("Only calling with true", optimal); ++ cnt++; ++ return super.getNodes(optimal); ++ } ++ } ++ ++ KOpt k = new KOpt(); ++ k.keys("1", "2", "3"); ++ Node n = createNode(k); ++ ++ Node[] arr = n.getChildren().getNodes(true); ++ assertEquals("3 nodes", 3, arr.length); ++ assertEquals("Calling cnt once", 1, k.cnt); ++ ++ } ++ + public void testRefreshOnFavoritesAdding() throws Exception { + Keys k = new Keys(lazy()); + k.keys("1", "2", "3"); +diff -r 76d51071af8a -r af9499d919b8 openide.text/manifest.mf +--- a/openide.text/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.text/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,6 +1,6 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.openide.text +-OpenIDE-Module-Specification-Version: 6.21.1 ++OpenIDE-Module-Specification-Version: 6.21.2 + OpenIDE-Module-Localizing-Bundle: org/openide/text/Bundle.properties + AutoUpdate-Essential-Module: true + +diff -r 76d51071af8a -r af9499d919b8 openide.text/src/org/openide/text/CloneableEditorSupport.java +--- a/openide.text/src/org/openide/text/CloneableEditorSupport.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/openide.text/src/org/openide/text/CloneableEditorSupport.java Tue Mar 10 13:53:55 2009 +0300 +@@ -226,7 +226,7 @@ + */ + private boolean revertingUndoOrReloading; + private boolean justRevertedToNotModified; +- private int documentStatus = DOCUMENT_NO; ++ private volatile int documentStatus = DOCUMENT_NO; + private Throwable prepareDocumentRuntimeException; + + /** Reference to WeakHashMap that is used by all Line.Sets created +@@ -831,6 +831,10 @@ + if (redirect != null) { + return redirect.getDocument(); + } ++ //#149717 Do not block when document is loading ++ if (documentStatus != DOCUMENT_READY) { ++ return null; ++ } + synchronized (getLock()) { + while (true) { + switch (documentStatus) { +diff -r 76d51071af8a -r af9499d919b8 openide.text/test/unit/src/org/openide/text/CloneableEditorNeverendingLoadingTest.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/openide.text/test/unit/src/org/openide/text/CloneableEditorNeverendingLoadingTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -0,0 +1,258 @@ ++/* ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. ++ * ++ * Copyright 1997-2007 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-2006 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.openide.text; ++ ++import java.beans.PropertyChangeListener; ++import java.beans.VetoableChangeListener; ++import java.io.ByteArrayInputStream; ++import java.io.ByteArrayOutputStream; ++import java.io.IOException; ++import java.io.InputStream; ++import java.io.OutputStream; ++import java.io.Serializable; ++import java.util.ArrayList; ++import java.util.Date; ++import java.util.List; ++import org.netbeans.junit.NbTestCase; ++import org.openide.util.Exceptions; ++import org.openide.util.Lookup; ++import org.openide.util.RequestProcessor; ++import org.openide.util.RequestProcessor.Task; ++import org.openide.windows.CloneableOpenSupport; ++import org.openide.windows.CloneableTopComponent; ++ ++/** ++ * Test that CES.getDocument() is not blocked when document is being loaded. ++ * ++ * @author Marek Slama ++ */ ++public class CloneableEditorNeverendingLoadingTest extends NbTestCase ++implements CloneableEditorSupport.Env { ++ static { ++ System.setProperty("org.openide.windows.DummyWindowManager.VISIBLE", "false"); ++ } ++ /** the support to work with */ ++ private transient CES support; ++ ++ // Env variables ++ private transient String content = ""; ++ private transient boolean valid = true; ++ private transient boolean modified = false; ++ /** if not null contains message why this document cannot be modified */ ++ private transient String cannotBeModified; ++ private transient Date date = new Date (); ++ private transient List propL = new ArrayList(); ++ private transient VetoableChangeListener vetoL; ++ ++ private static CloneableEditorNeverendingLoadingTest RUNNING; ++ ++ private boolean blocked; ++ ++ public CloneableEditorNeverendingLoadingTest(String s) { ++ super(s); ++ } ++ ++ @Override ++ protected void setUp () { ++ support = new CES (this, Lookup.EMPTY); ++ RUNNING = this; ++ } ++ ++ @Override ++ protected boolean runInEQ() { ++ return true; ++ } ++ ++ private Object writeReplace () { ++ return new Replace (); ++ } ++ ++ public void testGetDocumentReturnsImmediatelly() throws Exception { ++ class R implements Runnable { ++ boolean running; ++ ++ public void run() { ++ running = true; ++ support.open(); ++ running = false; ++ } ++ } ++ ++ R running = new R(); ++ Task task = RequestProcessor.getDefault().post(running); ++ ++ assertFalse("Does not finish the opening as it is blocked", task.waitFinished(1000)); ++ synchronized (this) { ++ while (!blocked) { ++ wait(); ++ } ++ } ++ assertNull("No document is opened", support.getDocument()); ++ assertTrue("Open is still running", running.running); ++ synchronized (this) { ++ notifyAll(); ++ } ++ task.waitFinished(); ++ ++ assertNotNull("Document open finished", support.getDocument()); ++ } ++ ++ // ++ // Implementation of the CloneableEditorSupport.Env ++ // ++ ++ public synchronized void addPropertyChangeListener(PropertyChangeListener l) { ++ propL.add (l); ++ } ++ public synchronized void removePropertyChangeListener(PropertyChangeListener l) { ++ propL.remove (l); ++ } ++ ++ public synchronized void addVetoableChangeListener(VetoableChangeListener l) { ++ assertNull ("This is the first veto listener", vetoL); ++ vetoL = l; ++ } ++ public void removeVetoableChangeListener(VetoableChangeListener l) { ++ assertEquals ("Removing the right veto one", vetoL, l); ++ vetoL = null; ++ } ++ ++ public CloneableOpenSupport findCloneableOpenSupport() { ++ return RUNNING.support; ++ } ++ ++ public String getMimeType() { ++ return "text/plain"; ++ } ++ ++ public Date getTime() { ++ return date; ++ } ++ ++ public synchronized InputStream inputStream() throws IOException { ++ blocked = true; ++ notifyAll(); ++ try { ++ wait(); ++ } catch (InterruptedException ex) { ++ Exceptions.printStackTrace(ex); ++ } ++ blocked = false; ++ return new ByteArrayInputStream(new byte[0]); ++ } ++ public OutputStream outputStream() throws IOException { ++ class ContentStream extends ByteArrayOutputStream { ++ @Override ++ public void close () throws IOException { ++ super.close (); ++ content = new String (toByteArray ()); ++ } ++ } ++ ++ return new ContentStream (); ++ } ++ ++ public boolean isValid() { ++ return valid; ++ } ++ ++ public boolean isModified() { ++ return modified; ++ } ++ ++ public void markModified() throws IOException { ++ if (cannotBeModified != null) { ++ final String notify = cannotBeModified; ++ IOException e = new IOException () { ++ @Override ++ public String getLocalizedMessage () { ++ return notify; ++ } ++ }; ++ Exceptions.attachLocalizedMessage(e, cannotBeModified); ++ throw e; ++ } ++ ++ modified = true; ++ } ++ ++ public void unmarkModified() { ++ modified = false; ++ } ++ ++ /** Implementation of the CES */ ++ private final class CES extends CloneableEditorSupport { ++ public CES (Env env, Lookup l) { ++ super (env, l); ++ } ++ ++ public CloneableTopComponent.Ref getRef () { ++ return allEditors; ++ } ++ ++ protected String messageName() { ++ return "Name"; ++ } ++ ++ protected String messageOpened() { ++ return "Opened"; ++ } ++ ++ protected String messageOpening() { ++ return "Opening"; ++ } ++ ++ protected String messageSave() { ++ return "Save"; ++ } ++ ++ protected String messageToolTip() { ++ return "ToolTip"; ++ } ++ } ++ ++ private static final class Replace implements Serializable { ++ public Object readResolve () { ++ return RUNNING; ++ } ++ } ++} +diff -r 76d51071af8a -r af9499d919b8 options.api/manifest.mf +--- a/options.api/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/options.api/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,6 +2,6 @@ + OpenIDE-Module: org.netbeans.modules.options.api/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/options/Bundle.properties + OpenIDE-Module-Layer: org/netbeans/modules/options/resources/mf-layer.xml +-OpenIDE-Module-Specification-Version: 1.10.1 ++OpenIDE-Module-Specification-Version: 1.10.2 + AutoUpdate-Show-In-Client: false + AutoUpdate-Essential-Module: true +diff -r 76d51071af8a -r af9499d919b8 options.api/src/org/netbeans/modules/options/advanced/Model.java +--- a/options.api/src/org/netbeans/modules/options/advanced/Model.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/options.api/src/org/netbeans/modules/options/advanced/Model.java Tue Mar 10 13:53:55 2009 +0300 +@@ -183,10 +183,12 @@ + } + + boolean isValid () { +- Iterator it = categoryToController.values ().iterator (); +- while (it.hasNext ()) +- if (!((OptionsPanelController) it.next ()).isValid ()) ++ for (OptionsPanelController controller : categoryToController.values()) { ++ // if changed (#145569) and not valid ++ if (controller.isChanged() && !controller.isValid()) { + return false; ++ } ++ } + return true; + } + +diff -r 76d51071af8a -r af9499d919b8 project.ant/manifest.mf +--- a/project.ant/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.ant/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,6 +1,6 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.project.ant/1 +-OpenIDE-Module-Specification-Version: 1.26.1 ++OpenIDE-Module-Specification-Version: 1.26.3 + OpenIDE-Module-Layer: org/netbeans/modules/project/ant/resources/mf-layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/ant/Bundle.properties + OpenIDE-Module-Install: org/netbeans/modules/project/ant/AntProjectModule.class +diff -r 76d51071af8a -r af9499d919b8 project.ant/src/org/netbeans/modules/project/ant/FileChooserAccessory.java +--- a/project.ant/src/org/netbeans/modules/project/ant/FileChooserAccessory.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.ant/src/org/netbeans/modules/project/ant/FileChooserAccessory.java Tue Mar 10 13:53:55 2009 +0300 +@@ -214,7 +214,7 @@ + } + File f = FileUtil.normalizeFile(new File(copyTo.getText())); + FileUtil.createFolder(f); +- FileObject fo = FileUtil.toFileObject(FileUtil.normalizeFile(f)); ++ FileObject fo = FileUtil.toFileObject(f); + List selectedFiles = Arrays.asList(getSelectedFiles()); + copyFiles(selectedFiles, fo); + } +diff -r 76d51071af8a -r af9499d919b8 project.ant/src/org/netbeans/modules/project/ant/VariablePanel.form +--- a/project.ant/src/org/netbeans/modules/project/ant/VariablePanel.form Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.ant/src/org/netbeans/modules/project/ant/VariablePanel.form Tue Mar 10 13:53:55 2009 +0300 +@@ -12,6 +12,7 @@ + + + ++ + + + +diff -r 76d51071af8a -r af9499d919b8 project.ant/src/org/netbeans/modules/project/ant/VariablePanel.java +--- a/project.ant/src/org/netbeans/modules/project/ant/VariablePanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.ant/src/org/netbeans/modules/project/ant/VariablePanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -177,7 +177,7 @@ + } else if (variableBeingEditted == null && model.find(nameTextField.getText()) != null) { + error = NbBundle.getBundle(VariablePanel.class).getString("MSG_Variable_Already_Exists"); + } else if (locationTextField.getText().length() == 0 || +- !new File(locationTextField.getText()).exists()) { ++ !getVariableLocation().exists()) { + error = NbBundle.getBundle(VariablePanel.class).getString("MSG_Invalid_Location"); + } else if (variableBeingEditted == null && !PropertyUtils.isUsablePropertyName(nameTextField.getText())) { + error = NbBundle.getBundle(VariablePanel.class).getString("MSG_Invalid_Name"); +@@ -191,7 +191,7 @@ + } + + public File getVariableLocation() { +- return new File(locationTextField.getText()); ++ return FileUtil.normalizeFile(new File(locationTextField.getText())); + } + + +diff -r 76d51071af8a -r af9499d919b8 project.ant/src/org/netbeans/modules/project/ant/VariablesModel.java +--- a/project.ant/src/org/netbeans/modules/project/ant/VariablesModel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.ant/src/org/netbeans/modules/project/ant/VariablesModel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -47,6 +47,7 @@ + import org.netbeans.api.project.ProjectManager; + import org.netbeans.spi.project.support.ant.EditableProperties; + import org.netbeans.spi.project.support.ant.PropertyUtils; ++import org.openide.filesystems.FileUtil; + import org.openide.util.Exceptions; + + /** +@@ -119,7 +120,7 @@ + EditableProperties ep = PropertyUtils.getGlobalProperties(); + for (Map.Entry entry : ep.entrySet()) { + if (entry.getKey().startsWith(VARIABLE_PREFIX)) { +- vs.add(new Variable(entry.getKey().substring(VARIABLE_PREFIX.length()), new File(entry.getValue()))); ++ vs.add(new Variable(entry.getKey().substring(VARIABLE_PREFIX.length()), FileUtil.normalizeFile(new File(entry.getValue())))); + } + } + return vs; +diff -r 76d51071af8a -r af9499d919b8 project.ant/src/org/netbeans/spi/project/support/ant/ReferenceHelper.java +--- a/project.ant/src/org/netbeans/spi/project/support/ant/ReferenceHelper.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.ant/src/org/netbeans/spi/project/support/ant/ReferenceHelper.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1384,7 +1384,11 @@ + if (!cont) + continue; + +- String value = e.getValue(); ++ // #151648: do not try to fix references defined via property ++ String value = e.getValue(); ++ if (value.startsWith("${")) { // NOI18N ++ continue; ++ } + + File absolutePath = FileUtil.normalizeFile(PropertyUtils.resolveFile(originalPath, value)); + +@@ -1413,7 +1417,11 @@ + if (!cont) + continue; + +- String value = e.getValue(); ++ // #151648: do not try to fix references defined via property ++ String value = e.getValue(); ++ if (value.startsWith("${")) { // NOI18N ++ continue; ++ } + + File absolutePath = FileUtil.normalizeFile(PropertyUtils.resolveFile(originalPath, value)); + +diff -r 76d51071af8a -r af9499d919b8 projectapi/manifest.mf +--- a/projectapi/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/projectapi/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.projectapi/1 + OpenIDE-Module-Install: org/netbeans/modules/projectapi/Installer.class +-OpenIDE-Module-Specification-Version: 1.19.1 ++OpenIDE-Module-Specification-Version: 1.19.2 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/projectapi/Bundle.properties + OpenIDE-Module-Layer: org/netbeans/modules/projectapi/layer.xml + +diff -r 76d51071af8a -r af9499d919b8 projectapi/src/org/netbeans/modules/projectapi/AuxiliaryConfigBasedPreferencesProvider.java +--- a/projectapi/src/org/netbeans/modules/projectapi/AuxiliaryConfigBasedPreferencesProvider.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/projectapi/src/org/netbeans/modules/projectapi/AuxiliaryConfigBasedPreferencesProvider.java Tue Mar 10 13:53:55 2009 +0300 +@@ -429,7 +429,7 @@ + super(parent, name); + this.path = path; + } +- ++ + @Override + protected void putSpi(String key, String value) { + synchronized (AuxiliaryConfigBasedPreferencesProvider.this) { +@@ -626,7 +626,21 @@ + public void put(final String key, final String value) { + ProjectManager.mutex().writeAccess(new Action() { + public Void run() { +- AuxiliaryConfigBasedPreferences.super.put(key, value); ++ //#151856 ++ String oldValue = getSpi(key); ++ if (value.equals(oldValue)) { ++ return null; ++ } ++ try { ++ AuxiliaryConfigBasedPreferences.super.put(key, value); ++ } catch (IllegalArgumentException iae) { ++ if (iae.getMessage().contains("too long")) { ++ // Not for us! ++ putSpi(key, value); ++ } else { ++ throw iae; ++ } ++ } + return null; + } + }); +diff -r 76d51071af8a -r af9499d919b8 projectapi/test/unit/src/org/netbeans/modules/projectapi/AuxiliaryConfigBasedPreferencesProviderTest.java +--- a/projectapi/test/unit/src/org/netbeans/modules/projectapi/AuxiliaryConfigBasedPreferencesProviderTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/projectapi/test/unit/src/org/netbeans/modules/projectapi/AuxiliaryConfigBasedPreferencesProviderTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -234,6 +234,34 @@ + assertEquals("somevalue2", origNode.get("somekey", null)); + } + ++ public void testTooLong() throws IOException, BackingStoreException { ++ lookup.setDelegates(Lookups.fixed(new TestAuxiliaryConfigurationImpl())); ++ ++ AuxiliaryConfiguration ac = p.getLookup().lookup(AuxiliaryConfiguration.class); ++ ++ assertNotNull(ac); ++ ++ AuxiliaryConfigBasedPreferencesProvider toSync = new AuxiliaryConfigBasedPreferencesProvider(p, ac, null, true); ++ Preferences pref = toSync.findModule("test"); ++ //test length of key ++ char[] keyChars = new char[100]; ++ Arrays.fill(keyChars, 'X'); ++ String key = new String(keyChars); ++ pref.put(key, "test"); ++ ++ //test length of value ++ char[] valChars = new char[10 * 1024]; ++ Arrays.fill(valChars, 'X'); ++ String value = new String(valChars); ++ pref.put("test", value); ++ ++ pref.flush(); ++ ++ assertEquals(pref.get("test", null), value); ++ assertEquals(pref.get(key, null), "test"); ++ ++ } ++ + @RandomlyFails + public void testReclaimable() throws IOException, BackingStoreException, InterruptedException { + lookup.setDelegates(Lookups.fixed(new TestAuxiliaryConfigurationImpl())); only in patch2: unchanged: --- netbeans-6.5.orig/debian/patches/93-6.5.1-patches-3.patch +++ netbeans-6.5/debian/patches/93-6.5.1-patches-3.patch @@ -0,0 +1,3308 @@ +diff -r 76d51071af8a -r af9499d919b8 project.libraries/manifest.mf +--- a/project.libraries/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.libraries/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,7 +2,7 @@ + OpenIDE-Module: org.netbeans.modules.project.libraries/1 + OpenIDE-Module-Install: org/netbeans/modules/project/libraries/LibrariesModule.class + OpenIDE-Module-Layer: org/netbeans/modules/project/libraries/resources/mf-layer.xml +-OpenIDE-Module-Specification-Version: 1.19.1 ++OpenIDE-Module-Specification-Version: 1.19.2 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/project/libraries/resources/Bundle.properties + AutoUpdate-Show-In-Client: false + +diff -r 76d51071af8a -r af9499d919b8 project.libraries/src/org/netbeans/modules/project/libraries/LibrariesStorage.java +--- a/project.libraries/src/org/netbeans/modules/project/libraries/LibrariesStorage.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.libraries/src/org/netbeans/modules/project/libraries/LibrariesStorage.java Tue Mar 10 13:53:55 2009 +0300 +@@ -72,11 +72,14 @@ + import org.openide.filesystems.FileUtil; + import org.openide.filesystems.Repository; + import org.openide.util.NbBundle; ++import org.openide.util.Task; ++import org.openide.util.TaskListener; + import org.openide.xml.XMLUtil; + import org.xml.sax.InputSource; + import org.xml.sax.SAXException; + +-public class LibrariesStorage extends FileChangeAdapter implements WritableLibraryProvider { ++public class LibrariesStorage extends FileChangeAdapter ++implements WritableLibraryProvider, TaskListener { + + private static final String NB_HOME_PROPERTY = "netbeans.home"; //NOI18N + private static final String LIBRARIES_REPOSITORY = "org-netbeans-api-project-libraries/Libraries"; //NOI18N +@@ -205,6 +208,7 @@ + } + this.loadFromStorage(); + this.storage.addFileChangeListener (this); ++ LibraryTypeRegistry.getDefault().addTaskListener(this); + initialized = true; + } + } +@@ -563,4 +567,15 @@ + return sb.toString(); + } + ++ public void taskFinished(Task task) { ++ if (initialized) { ++ HashMap clone; ++ clone = new HashMap(libraries); ++ loadFromStorage(); ++ if (!clone.equals(libraries)) { ++ fireLibrariesChanged(); ++ } ++ } ++ } ++ + } +diff -r 76d51071af8a -r af9499d919b8 project.libraries/test/unit/src/org/netbeans/modules/project/libraries/LibrariesStorageRefreshTest.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/project.libraries/test/unit/src/org/netbeans/modules/project/libraries/LibrariesStorageRefreshTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -0,0 +1,89 @@ ++/* ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. ++ * ++ * Copyright 1997-2007 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-2006 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.project.libraries; ++ ++import org.netbeans.api.project.TestUtil; ++import org.netbeans.junit.NbTestCase; ++import org.netbeans.spi.project.libraries.LibraryImplementation; ++import org.openide.filesystems.FileObject; ++import org.openide.util.test.MockLookup; ++ ++ ++ ++/** Checks that libraries are updated as sson as correct library type ++ * provider is registered. ++ * ++ * @author Jaroslav Tulach ++ */ ++public class LibrariesStorageRefreshTest extends NbTestCase { ++ ++ private FileObject storageFolder; ++ LibrariesStorage storage; ++ ++ public LibrariesStorageRefreshTest(String testName) { ++ super(testName); ++ } ++ ++ @Override ++ protected void setUp() throws Exception { ++ super.setUp(); ++ MockLookup.setInstances(new LibrariesStorageTest.TestEntityCatalog()); ++ this.storageFolder = TestUtil.makeScratchDir(this); ++ LibrariesStorageTest.createLibraryDefinition(this.storageFolder,"Library1"); ++ this.storage = new LibrariesStorage (this.storageFolder); ++ } ++ ++ public void testGetLibrariesAfterEnablingProvider() throws Exception { ++ this.storage.getLibraries(); ++ LibraryImplementation[] libs = this.storage.getLibraries(); ++ LibrariesStorageTest.TestListener l = new LibrariesStorageTest.TestListener (); ++ this.storage.addPropertyChangeListener(l); ++ assertEquals("No libraries found", 0, libs.length); ++ LibrariesStorageTest.registerLibraryTypeProvider(); ++ LibraryTypeRegistry.getDefault().waitFinished(); ++ libs = this.storage.getLibraries(); ++ assertEquals("Libraries count",1,libs.length); ++ assertEquals("One change", 1, l.getEventNames().size()); ++ } ++ ++ ++} +diff -r 76d51071af8a -r af9499d919b8 project.libraries/test/unit/src/org/netbeans/modules/project/libraries/LibrariesStorageTest.java +--- a/project.libraries/test/unit/src/org/netbeans/modules/project/libraries/LibrariesStorageTest.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/project.libraries/test/unit/src/org/netbeans/modules/project/libraries/LibrariesStorageTest.java Tue Mar 10 13:53:55 2009 +0300 +@@ -174,7 +174,7 @@ + } + } + +- private static void registerLibraryTypeProvider () throws Exception { ++ static void registerLibraryTypeProvider () throws Exception { + StringTokenizer tk = new StringTokenizer("org-netbeans-api-project-libraries/LibraryTypeProviders","/"); + FileObject root = Repository.getDefault().getDefaultFileSystem().getRoot(); + while (tk.hasMoreElements()) { +@@ -192,7 +192,7 @@ + } + } + +- private static void createLibraryDefinition (final FileObject storageFolder, final String libName) throws IOException { ++ static void createLibraryDefinition (final FileObject storageFolder, final String libName) throws IOException { + storageFolder.getFileSystem().runAtomicAction(new FileSystem.AtomicAction() { + public void run () throws IOException { + FileObject defFile = storageFolder.createData(libName,"xml"); +@@ -222,7 +222,7 @@ + }); + } + +- private static class TestListener implements PropertyChangeListener { ++ static class TestListener implements PropertyChangeListener { + + private List eventNames = new ArrayList(); + +@@ -241,7 +241,7 @@ + } + + +- private static class TestEntityCatalog extends EntityCatalog { ++ static class TestEntityCatalog extends EntityCatalog { + + private static final String DTD = "\n" + + "\n" + +diff -r 76d51071af8a -r af9499d919b8 projectui/nbproject/project.properties +--- a/projectui/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/projectui/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -39,7 +39,7 @@ + + javac.compilerargs=-Xlint:unchecked + javac.source=1.5 +-spec.version.base=1.15.1 ++spec.version.base=1.15.3 + + javadoc.arch=${basedir}/arch.xml + javadoc.apichanges=${basedir}/apichanges.xml +diff -r 76d51071af8a -r af9499d919b8 projectui/nbproject/project.xml +--- a/projectui/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/projectui/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -97,7 +97,7 @@ + + + 1 +- 1.17 ++ 1.19.2 + + + +@@ -162,7 +162,7 @@ + + + +- 5.1 ++ 7.2.2 + + + +diff -r 76d51071af8a -r af9499d919b8 projectui/src/org/netbeans/modules/project/ui/PhysicalView.java +--- a/projectui/src/org/netbeans/modules/project/ui/PhysicalView.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/projectui/src/org/netbeans/modules/project/ui/PhysicalView.java Tue Mar 10 13:53:55 2009 +0300 +@@ -142,7 +142,7 @@ + return nodes; + } + +- static final class VisibilityQueryDataFilter implements ChangeListener, ChangeableDataFilter { ++ static final class VisibilityQueryDataFilter implements ChangeListener, ChangeableDataFilter, DataFilter.FileBased { + + private final ChangeSupport changeSupport = new ChangeSupport( this ); + +@@ -150,9 +150,8 @@ + VisibilityQuery.getDefault().addChangeListener( this ); + } + +- public boolean acceptDataObject(DataObject obj) { +- FileObject fo = obj.getPrimaryFile(); +- return VisibilityQuery.getDefault().isVisible( fo ); ++ public boolean acceptDataObject(DataObject obj) { ++ return acceptFileObject(obj.getPrimaryFile()); + } + + public void stateChanged( ChangeEvent e) { +@@ -171,6 +170,10 @@ + public void removeChangeListener( ChangeListener listener ) { + changeSupport.removeChangeListener( listener ); + } ++ ++ public boolean acceptFileObject(FileObject fo) { ++ return VisibilityQuery.getDefault().isVisible(fo); ++ } + + } + +diff -r 76d51071af8a -r af9499d919b8 projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java +--- a/projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/projectui/src/org/netbeans/modules/project/ui/SimpleTargetChooserPanelGUI.java Tue Mar 10 13:53:55 2009 +0300 +@@ -132,10 +132,10 @@ + + locationComboBox.setModel( new DefaultComboBoxModel( folders ) ); + // Guess the group we want to create the file in +- SourceGroup preselectedGroup = getPreselectedGroup( folders, preselectedFolder ); +- locationComboBox.setSelectedItem( preselectedGroup ); ++ SourceGroup preselectedGroup = getPreselectedGroup( folders, preselectedFolder ); + // Create OS dependent relative name + if (preselectedGroup != null) { ++ locationComboBox.setSelectedItem( preselectedGroup ); + folderTextField.setText( getRelativeNativeName( preselectedGroup.getRootFolder(), preselectedFolder ) ); + } + +@@ -404,7 +404,11 @@ + + private void updateCreatedFolder() { + +- FileObject root = ((SourceGroup)locationComboBox.getSelectedItem()).getRootFolder(); ++ SourceGroup sg = (SourceGroup) locationComboBox.getSelectedItem(); ++ if (sg == null) { ++ return; ++ } ++ FileObject root = sg.getRootFolder(); + + String folderName = folderTextField.getText().trim(); + String documentName = documentNameTextField.getText().trim(); +diff -r 76d51071af8a -r af9499d919b8 properties/manifest.mf +--- a/properties/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/properties/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,6 +1,6 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.properties/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/properties/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.25.1 ++OpenIDE-Module-Specification-Version: 1.25.2 + OpenIDE-Module-Layer: org/netbeans/modules/properties/Layer.xml + AutoUpdate-Show-In-Client: false +diff -r 76d51071af8a -r af9499d919b8 properties/src/org/netbeans/modules/properties/Element.java +--- a/properties/src/org/netbeans/modules/properties/Element.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/properties/src/org/netbeans/modules/properties/Element.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + /* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * +- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. ++ * 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 +@@ -24,7 +24,7 @@ + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original +- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun ++ * 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 +@@ -316,9 +316,6 @@ + if (c < 0x20) { + Basic.appendIsoControlChar(buf, c); + } else { +- if (c == '\\') { +- buf.append('\\'); +- } + buf.append(c); + } + } +diff -r 76d51071af8a -r af9499d919b8 properties/src/org/netbeans/modules/properties/PropertiesEditorSupport.java +--- a/properties/src/org/netbeans/modules/properties/PropertiesEditorSupport.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/properties/src/org/netbeans/modules/properties/PropertiesEditorSupport.java Tue Mar 10 13:53:55 2009 +0300 +@@ -67,6 +67,8 @@ + import java.util.Collections; + import java.util.Date; + import java.util.Enumeration; ++import java.util.HashMap; ++import java.util.Map; + import java.util.Set; + import java.util.WeakHashMap; + import java.util.logging.Level; +@@ -79,6 +81,7 @@ + import javax.swing.undo.CannotRedoException; + import javax.swing.undo.CannotUndoException; + import javax.swing.undo.UndoableEdit; ++import org.netbeans.api.queries.FileEncodingQuery; + import org.netbeans.modules.properties.PropertiesEncoding.PropCharset; + import org.netbeans.modules.properties.PropertiesEncoding.PropCharsetEncoder; + import org.openide.ErrorManager; +@@ -93,10 +96,12 @@ + import org.openide.filesystems.FileEvent; + import org.openide.filesystems.FileLock; + import org.openide.filesystems.FileObject; ++import org.openide.filesystems.FileRenameEvent; + import org.openide.filesystems.FileStatusEvent; + import org.openide.filesystems.FileStatusListener; + import org.openide.filesystems.FileSystem; + import org.openide.filesystems.FileStateInvalidException; ++import org.openide.filesystems.FileSystem.AtomicAction; + import org.openide.filesystems.FileUtil; + import org.openide.loaders.DataFolder; + import org.openide.loaders.DataObject; +@@ -137,6 +142,10 @@ + /** Generated serial version UID. */ + static final long serialVersionUID =1787354011149868490L; + ++ /** can hold the right charset to be used during save, needed for communication ++ * between saveFromKitToStream and saveDocument ++ */ ++ private static Map charsets = Collections.synchronizedMap(new HashMap()); + + /** Constructor. */ + public PropertiesEditorSupport(PropertiesFileEntry entry) { +@@ -145,6 +154,13 @@ + this.myEntry = entry; + } + ++ /** Getter for the environment that was provided in the constructor. ++ * @return the environment ++ */ ++ final CloneableEditorSupport.Env desEnv() { ++ return (CloneableEditorSupport.Env) env; ++ } ++ + /** + * Overrides superclass method. + * Should test whether all data is saved, and if not, prompt the user +@@ -171,6 +187,18 @@ + protected CloneableEditor createCloneableEditor() { + return new PropertiesEditor(this); + } ++ ++ /** Getter of the data object that this support is associated with. ++ * @return data object passed in constructor ++ */ ++ public final DataObject getDataObject () { ++ return myEntry.getDataObject(); ++ } ++ ++ private boolean isEnvReadOnly() { ++ CloneableEditorSupport.Env myEnv = desEnv(); ++ return myEnv instanceof Environment && !((Environment) myEnv).getFileImpl().canWrite(); ++ } + + /** + * +@@ -524,7 +552,9 @@ + + /** Helper method. Saves this entry. */ + private void saveThisEntry() throws IOException { +- super.saveDocument(); ++ FileSystem.AtomicAction aa = new SaveImpl(this); ++ FileUtil.runAtomicAction(aa); ++// super.saveDocument(); + // #32777 - it can happen that save operation was interrupted + // and file is still modified. Mark it unmodified only when it is really + // not modified. +@@ -532,6 +562,10 @@ + myEntry.setModified(false); + } + } ++ ++ final void superSaveDoc() throws IOException { ++ super.saveDocument(); ++ } + + /** + * Save the document under a new file name and/or extension. +@@ -674,9 +708,9 @@ + if(this.entry != null) + super.entry = this.entry; + } +- } ++ } + +- ++ + /** Nested class. Implementation of ClonableEditorSupport.Env interface. */ + private static class Environment implements CloneableEditorSupport.Env, + PropertyChangeListener, SaveCookie { +@@ -685,10 +719,15 @@ + static final long serialVersionUID = 354528097109874355L; + + /** Entry on which is support build. */ +- protected PropertiesFileEntry entry; +- ++ private PropertiesFileEntry entry; ++ + /** Lock acquired after the first modification and used in save method. */ + private transient FileLock fileLock; ++ ++ /** The file object this environment is associated to. ++ * This file object can be changed by a call to refresh file. ++ */ ++ private transient FileObject fileObject; + + /** Spport for firing of property changes. */ + private transient PropertyChangeSupport propSupp; +@@ -707,7 +746,18 @@ + entry.getFile().addFileChangeListener(new EnvironmentListener(this)); + entry.addPropertyChangeListener(this); + } ++ /** Getter for the file to work on. ++ * @return the file ++ */ ++ private FileObject getFileImpl () { ++ // updates the file if there was a change ++ changeFile(); ++ return fileObject; ++ } + ++ protected final DataObject getDataObject() { ++ return entry.getDataObject(); ++ } + /** Implements CloneableEditorSupport.Env inetrface. Adds property listener. */ + public void addPropertyChangeListener(PropertyChangeListener l) { + LOG.finer("Environment.addPropertyChangeListener(...)"); //NOI18N +@@ -826,6 +876,20 @@ + + entry.setModified(false); + } ++ /** ++ * Called from the EnvironmentListener. ++ */ ++ final void updateDocumentProperty () { ++ //Update document TitleProperty ++ EditorCookie ec = getDataObject().getCookie(EditorCookie.class); ++ if (ec != null) { ++ StyledDocument doc = ec.getDocument(); ++ if (doc != null) { ++ doc.putProperty(Document.TitleProperty, ++ FileUtil.getFileDisplayName(getDataObject().getPrimaryFile())); ++ } ++ } ++ } + + /** + * Implements CloneableEditorSupport.Env interface. +@@ -833,7 +897,7 @@ + * @return the mime type to use for the document + */ + public String getMimeType() { +- return entry.getFile().getMIMEType(); ++ return getFileImpl().getMIMEType(); + } + + /** +@@ -841,8 +905,59 @@ + * The time when the data has been modified. */ + public Date getTime() { + // #32777 - refresh file object and return always the actual time +- entry.getFile().refresh(false); +- return entry.getFile().lastModified(); ++ getFileImpl().refresh(); ++ return getFileImpl().lastModified(); ++ } ++ ++ /** Method that allows subclasses to notify this environment that ++ * the file associated with this support has changed and that ++ * the environment should listen on modifications of different ++ * file object. ++ */ ++ protected final void changeFile () { ++ FileObject newFile = entry.getFile (); ++ if (newFile.equals (fileObject)) { ++ // the file has not been updated ++ return; ++ } ++ ++ boolean lockAgain; ++ if (fileLock != null) { ++// <> NB #61818 In case the lock was not active (isValid() == false), the new lock was taken, ++// which seems to be incorrect. There is taken a lock on new file, while it there wasn't on the old one. ++// fileLock.releaseLock (); ++// lockAgain = true; ++// ===== ++ if(fileLock.isValid()) { ++ LOG.fine("changeFile releaseLock: " + fileLock + " for " + fileObject); // NOI18N ++ fileLock.releaseLock (); ++ lockAgain = true; ++ } else { ++ fileLock = null; ++ lockAgain = false; ++ } ++// ++ } else { ++ lockAgain = false; ++ } ++ ++ boolean wasNull = fileObject == null; ++ ++ fileObject = newFile; ++ LOG.fine("changeFile: " + newFile + " for " + fileObject); // NOI18N ++ fileObject.addFileChangeListener (new EnvironmentListener(this)); ++ ++ if (lockAgain) { // refresh lock ++ try { ++ fileLock = entry.takeLock (); ++ LOG.fine("changeFile takeLock: " + fileLock + " for " + fileObject); // NOI18N ++ } catch (IOException e) { ++ Logger.getLogger(PropertiesEditorSupport.class.getName()).log(Level.WARNING, null, e); ++ } ++ } ++ if (!wasNull) { ++ firePropertyChange("expectedTime", null, getTime()); // NOI18N ++ } + } + + /** +@@ -852,7 +967,7 @@ + */ + public InputStream inputStream() throws IOException { + LOG.finer("Environment.inputStream()"); //NOI18N +- return entry.getFile().getInputStream(); ++ return getFileImpl().getInputStream(); + } + + /** +@@ -862,7 +977,22 @@ + */ + public OutputStream outputStream() throws IOException { + LOG.finer("Environment.outputStream()"); //NOI18N +- return entry.getFile().getOutputStream(fileLock); ++ if (fileLock == null || !fileLock.isValid()) { ++ fileLock = entry.takeLock (); ++ } ++ LOG.fine("outputStream after takeLock: " + fileLock + " for " + fileObject); // NOI18N ++ try { ++ return getFileImpl ().getOutputStream (fileLock); ++ } catch (IOException fse) { ++ // [pnejedly] just retry once. ++ // Ugly workaround for #40552 ++ if (fileLock == null || !fileLock.isValid()) { ++ fileLock = entry.takeLock (); ++ } ++ LOG.fine("ugly workaround for #40552: " + fileLock + " for " + fileObject); // NOI18N ++ return getFileImpl ().getOutputStream (fileLock); ++ } ++// return entry.getFile().getOutputStream(fileLock); + } + + /** +@@ -875,7 +1005,7 @@ + // Do saving job. Note it gets editor support, not open support. + ((PropertiesEditorSupport)findCloneableOpenSupport()).saveThisEntry(); + } +- ++ + /** Fires property change. + * @param name the name of property that changed + * @param oldValue old value +@@ -955,6 +1085,12 @@ + } + } + ++ /** Called from the EnvironmentListener. ++ */ ++ final void fileRenamed () { ++ //#151787: Sync timestamp when svn client changes timestamp externally during rename. ++ firePropertyChange("expectedTime", null, getTime()); // NOI18N ++ } + + /** Called from the EnvironmentListener. + * The components are going to be closed anyway and in case of +@@ -1000,12 +1136,12 @@ + } + Environment environment = reference.get(); + if (environment != null) { +- if(!environment.entry.getFile().equals(evt.getFile()) ) { ++ if(!environment.getFileImpl().equals(evt.getFile()) ) { + // If the FileObject was changed. + // Remove old listener from old FileObject. + evt.getFile().removeFileChangeListener(this); + // Add new listener to new FileObject. +- environment.entry.getFile().addFileChangeListener(new EnvironmentListener(environment)); ++ environment.getFileImpl().addFileChangeListener(new EnvironmentListener(environment)); + return; + } + +@@ -1021,6 +1157,15 @@ + } + } + } ++ ++ @Override ++ public void fileRenamed(FileRenameEvent fe) { ++ Environment myEnv = this.reference.get(); ++ if (myEnv != null) { ++ myEnv.updateDocumentProperty(); ++ myEnv.fileRenamed(); ++ } ++ } + } // End of nested class EnvironmentListener. + + +@@ -1266,4 +1411,40 @@ + return atomicFlag; + } + } // End of nested class TimeStamp. ++ ++ private static class SaveImpl implements AtomicAction { ++ private static final SaveImpl DEFAULT = new SaveImpl(null); ++ private final PropertiesEditorSupport des; ++ ++ public SaveImpl(PropertiesEditorSupport des) { ++ this.des = des; ++ } ++ ++ public void run() throws IOException { ++ if (des.desEnv().isModified() && des.isEnvReadOnly()) { ++ IOException e = new IOException("File is read-only: " + ((Environment) des.env).getFileImpl()); // NOI18N ++// UIException.annotateUser(e, null, org.openide.util.NbBundle.getMessage(org.openide.loaders.DataObject.class, "MSG_FileReadOnlySaving", new java.lang.Object[]{((org.netbeans.modules.properties.PropertiesEditorSupport.Environment) des.env).getFileImpl().getNameExt()}), null, null); ++ throw e; ++ } ++ DataObject tmpObj = des.getDataObject(); ++ Charset c = FileEncodingQuery.getEncoding(tmpObj.getPrimaryFile()); ++ try { ++ charsets.put(tmpObj, c); ++ des.superSaveDoc(); ++ } finally { ++ charsets.remove(tmpObj); ++ } ++ } ++ ++ @Override ++ public int hashCode() { ++ return getClass().hashCode(); ++ } ++ ++ @Override ++ public boolean equals(Object obj) { ++ return obj != null && getClass() == obj.getClass(); ++ } ++ } ++ + } +diff -r 76d51071af8a -r af9499d919b8 properties/src/org/netbeans/modules/properties/PropertiesEncoding.java +--- a/properties/src/org/netbeans/modules/properties/PropertiesEncoding.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/properties/src/org/netbeans/modules/properties/PropertiesEncoding.java Tue Mar 10 13:53:55 2009 +0300 +@@ -787,13 +787,11 @@ + assert index <= 15; + unicodeValue = (unicodeValue << 4) | index; + if (++unicodeBytesRead == 4) { +- if ((unicodeValue == 0x20) +- || (unicodeValue == 0x09) +- || (unicodeValue == 0x0c)) { ++ if (unicodeValue <= 0x20) { + unicodeValueChars[3] = bChar; + /* +- * Do not translate sequences \\u0020 (Space), +- * \\u0009 (Tab) and \\u000c (Form-feed). ++ * Do not translate Unicode sequences of value ++ * 20h (space) or less (control characters). + * Changing form of these unicode sequences + * to one-character form might change + * semantics, which is not desirable +diff -r 76d51071af8a -r af9499d919b8 properties/src/org/netbeans/modules/properties/PropertiesParser.java +--- a/properties/src/org/netbeans/modules/properties/PropertiesParser.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/properties/src/org/netbeans/modules/properties/PropertiesParser.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,7 @@ + /* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * +- * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved. ++ * 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 +@@ -24,7 +24,7 @@ + * Contributor(s): + * + * The Original Software is NetBeans. The Initial Developer of the Original +- * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun ++ * 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 +@@ -234,7 +234,7 @@ + if(comment.charAt(comment.length() - 1) == '\n') + comHelp = comment.substring(0, comment.length() - 1); + +- commE = new Element.CommentElem(createBiasBounds(begPos, keyPos), UtilConvert.loadConvert(comHelp)); ++ commE = new Element.CommentElem(createBiasBounds(begPos, keyPos), comHelp); + // fl now contains the line after the comment or null if none exists + + +@@ -321,8 +321,8 @@ + valuePosFile = currentPos; + } + +- keyE = new Element.KeyElem (createBiasBounds(keyPos, valuePosFile), UtilConvert.loadConvert(key)); +- valueE = new Element.ValueElem(createBiasBounds(valuePosFile, currentPos), UtilConvert.loadConvert(value)); ++ keyE = new Element.KeyElem (createBiasBounds(keyPos, valuePosFile), key); ++ valueE = new Element.ValueElem(createBiasBounds(valuePosFile, currentPos), value); + } + + return new Element.ItemElem(createBiasBounds(begPos, in.position), keyE, valueE, commE); +diff -r 76d51071af8a -r af9499d919b8 refactoring.java/manifest.mf +--- a/refactoring.java/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/refactoring.java/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -3,6 +3,6 @@ + OpenIDE-Module-Install: org/netbeans/modules/refactoring/java/RefactoringModule.class + OpenIDE-Module-Layer: org/netbeans/modules/refactoring/java/resources/mf-layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/refactoring/java/resources/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.4.1 ++OpenIDE-Module-Specification-Version: 1.4.2 + AutoUpdate-Show-In-Client: false + +diff -r 76d51071af8a -r af9499d919b8 refactoring.java/src/org/netbeans/modules/refactoring/java/CopyHandler.java +--- a/refactoring.java/src/org/netbeans/modules/refactoring/java/CopyHandler.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/refactoring.java/src/org/netbeans/modules/refactoring/java/CopyHandler.java Tue Mar 10 13:53:55 2009 +0300 +@@ -50,6 +50,7 @@ + import org.netbeans.api.java.source.TreeMaker; + import org.netbeans.api.java.source.WorkingCopy; + import org.openide.filesystems.FileObject; ++import org.openide.filesystems.FileUtil; + import org.openide.loaders.DataLoaderPool; + import org.openide.loaders.OperationEvent; + import org.openide.loaders.OperationEvent.Copy; +@@ -68,24 +69,24 @@ + * @author Jan Pokorsky + */ + final class CopyHandler implements OperationListener { +- ++ + private static final CopyHandler INSTANCE = new CopyHandler(); +- ++ + public static CopyHandler getInstance() { + return INSTANCE; + } +- ++ + public void register() { + DataLoaderPool.getDefault().addOperationListener(this); + } + +- private static void renameFO(final JavaSource javaSource, +- final String packageName, +- final String newName, ++ private static void renameFO(final JavaSource javaSource, ++ final String packageName, ++ final String newName, + final String originalName) throws IOException { + + Task task = new Task() { +- ++ + public void run(WorkingCopy workingCopy) throws IOException { + workingCopy.toPhase(Phase.RESOLVED); + TreeMaker make = workingCopy.getTreeMaker(); +@@ -110,11 +111,11 @@ + } + } + } +- } ++ } + }; + javaSource.runModificationTask(task).commit(); + } +- ++ + // singleton + private CopyHandler() { + } +@@ -126,6 +127,11 @@ + if (js == null) { + return; + } ++ if (!"text/x-java".equals(FileUtil.getMIMEType(copyFO)) //NOI18N ++ && !"java".equals(copyFO.getExt())) { //NOI18N ++ // #151288: JavaSource may exist even for .class file ++ return; ++ } + ClassPath cp = ClassPath.getClassPath(copyFO, ClassPath.SOURCE); + if (cp == null) { + return; +diff -r 76d51071af8a -r af9499d919b8 registration/manifest.mf +--- a/registration/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/registration/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -4,5 +4,5 @@ + OpenIDE-Module-Install: org/netbeans/modules/registration/NbInstaller.class + OpenIDE-Module-Layer: org/netbeans/modules/registration/resources/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/registration/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.1.1 ++OpenIDE-Module-Specification-Version: 1.1.2 + +diff -r 76d51071af8a -r af9499d919b8 registration/nbproject/project.xml +--- a/registration/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/registration/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -60,7 +60,7 @@ + + + +- 1.1 ++ 1.2.2 + + + +diff -r 76d51071af8a -r af9499d919b8 reglib/manifest.mf +--- a/reglib/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/reglib/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,5 +2,5 @@ + AutoUpdate-Show-In-Client: false + OpenIDE-Module: org.netbeans.modules.reglib + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/reglib/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.2.1 ++OpenIDE-Module-Specification-Version: 1.2.4 + +diff -r 76d51071af8a -r af9499d919b8 reglib/src/org/netbeans/modules/reglib/Bundle.properties +--- a/reglib/src/org/netbeans/modules/reglib/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/reglib/src/org/netbeans/modules/reglib/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -73,21 +73,21 @@ + servicetag.javafxsdk.parent.urn=urn:uuid:bc76c157-8a3c-4da7-97d2-41d561ffe234 + servicetag.javafxsdk.parent.name=Development Tools + +-#For GFv2ur1 ++#For GFv2.1 + servicetag.gf.urn=urn:uuid:f49ff605-60a0-11dc-9b8e-080020a9ed93 + servicetag.gf.name=Sun Java System Application Server +-servicetag.gf.version=9.1 ++servicetag.gf.version=9.1.1 + servicetag.gf.parent.urn=urn:uuid:a573278d-43d6-11d9-9607-080020a9ed93 + servicetag.gf.parent.name=Sun Java System Application Server + +-#For GFv2ur1 ++#For GFv2.1 + servicetag.gf.urn.v2=urn:uuid:f49ff605-60a0-11dc-9b8e-080020a9ed93 + servicetag.gf.name.v2=Sun Java System Application Server +-servicetag.gf.version.v2=9.1 ++servicetag.gf.version.v2=9.1.1 + servicetag.gf.parent.urn.v2=urn:uuid:a573278d-43d6-11d9-9607-080020a9ed93 + servicetag.gf.parent.name.v2=Sun Java System Application Server + +-#For GFv2.1 ++#For SGESv2.1 + servicetag.gf.urn.v2.1=urn:uuid:f49ff605-60a0-11dc-9b8e-080020a9ed93 + servicetag.gf.name.v2.1=Sun GlassFish Enterprise Server + servicetag.gf.version.v2.1=2.1 +diff -r 76d51071af8a -r af9499d919b8 reglib/src/org/netbeans/modules/reglib/NbServiceTagSupport.java +--- a/reglib/src/org/netbeans/modules/reglib/NbServiceTagSupport.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/reglib/src/org/netbeans/modules/reglib/NbServiceTagSupport.java Tue Mar 10 13:53:55 2009 +0300 +@@ -183,13 +183,13 @@ + if (arrGF.length >= 2) { + if (arrGF[1].toUpperCase(Locale.ENGLISH).contains("GLASSFISH")) { // NOI18N + if (!isGFAdded) { +- names.add("GlassFish V2 UR2"); // NOI18N ++ names.add("GlassFish V2.1"); // NOI18N + isGFAdded = true; + } + } else if (arrGF[1].toUpperCase(Locale.ENGLISH).contains("APPSERVER") || // NOI18N + arrGF[1].toUpperCase(Locale.ENGLISH).contains("SDK")) { // NOI18N + if (!isASAdded) { +- names.add("Sun Java System Application Server 9.1 Update 2"); // NOI18N ++ names.add("Sun GlassFish Enterprise Server v2.1"); // NOI18N + isASAdded = true; + } + } +@@ -199,12 +199,12 @@ + } + } else if (st.getProductName().contains("Sun Java System Application Server")) { // NOI18N + if (!isASAdded) { +- names.add("Sun Java System Application Server 9.1 Update 2"); // NOI18N ++ names.add("GlassFish V2.1"); // NOI18N + isASAdded = true; + } + } else if (st.getProductName().contains("Sun GlassFish Enterprise Server")) { // NOI18N + if (!isGFAdded) { +- names.add("GlassFish V2 UR2"); // NOI18N ++ names.add("Sun GlassFish Enterprise Server v2.1"); // NOI18N + isGFAdded = true; + } + } else if (st.getProductName().contains("J2SE 5.0 Development Kit")) { // NOI18N +@@ -529,13 +529,25 @@ + } + if ((tmpFile != null) && tmpFile.exists()) { + tmpFile.delete(); +- targetFile = regXmlFileNb; ++ //Verify we can overwrite/delete target file in install dir ++ //to handle case whet target file is read only. ++ if (regXmlFileNb.exists()) { ++ if (regXmlFileNb.delete()) { ++ targetFile = regXmlFileNb; ++ } else { ++ targetFile = regXmlFileHome; ++ } ++ } else { ++ targetFile = regXmlFileNb; ++ } + } else { + targetFile = regXmlFileHome; + } + } else { + targetFile = regXmlFileHome; + } ++ LOG.log(Level.FINE,"writeRegistrationXml targetFile: " + targetFile); ++ + BufferedOutputStream out = null; + try { + out = new BufferedOutputStream(new FileOutputStream(targetFile)); +@@ -567,12 +579,38 @@ + } + + File srcFile = null; ++ //Below srcFile must be either set or method must return + if (regXmlFileNb.exists()) { +- srcFile = regXmlFileNb; +- LOG.log(Level.FINE,"Service tag will be loaded from NB install dir: " + srcFile); ++ //#151921 Check for empty file ++ if (regXmlFileNb.length() == 0) { ++ //Check file at home dir just in case install dir is read only ++ if (regXmlFileHome.exists()) { ++ if (regXmlFileHome.length() == 0) { ++ registration = new RegistrationData(); ++ LOG.log(Level.FINE,"Service tag file:" + regXmlFileHome + " is empty."); ++ return registration; ++ } else { ++ srcFile = regXmlFileHome; ++ } ++ } else { ++ registration = new RegistrationData(); ++ LOG.log(Level.FINE,"Service tag file:" + regXmlFileNb + " is empty."); ++ return registration; ++ } ++ } else { ++ srcFile = regXmlFileNb; ++ LOG.log(Level.FINE,"Service tag will be loaded from NB install dir: " + srcFile); ++ } + } else if (regXmlFileHome.exists()) { +- srcFile = regXmlFileHome; +- LOG.log(Level.FINE,"Service tag will be loaded from user home dir: " + srcFile); ++ //#151921 Check for empty file ++ if (regXmlFileHome.length() == 0) { ++ registration = new RegistrationData(); ++ LOG.log(Level.FINE,"Service tag file:" + regXmlFileHome + " is empty."); ++ return registration; ++ } else { ++ srcFile = regXmlFileHome; ++ LOG.log(Level.FINE,"Service tag will be loaded from user home dir: " + srcFile); ++ } + } else { + registration = new RegistrationData(); + LOG.log(Level.FINE,"Service tag file not found"); +diff -r 76d51071af8a -r af9499d919b8 reglib/src/org/netbeans/modules/servicetag/RegistrationDocument.java +--- a/reglib/src/org/netbeans/modules/servicetag/RegistrationDocument.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/reglib/src/org/netbeans/modules/servicetag/RegistrationDocument.java Tue Mar 10 13:53:55 2009 +0300 +@@ -158,7 +158,8 @@ + + DocumentBuilder builder = factory.newDocumentBuilder(); + Document doc = builder.parse(new InputSource(in)); +- validator.validate(new DOMSource(doc)); ++ //Switch off validation as workaround for issue #151843 ++ //validator.validate(new DOMSource(doc)); + return doc; + } catch (SAXException sxe) { + IllegalArgumentException e = new IllegalArgumentException("Error generated in parsing"); +diff -r 76d51071af8a -r af9499d919b8 reglib/src/org/netbeans/modules/servicetag/Util.java +--- a/reglib/src/org/netbeans/modules/servicetag/Util.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/reglib/src/org/netbeans/modules/servicetag/Util.java Tue Mar 10 13:53:55 2009 +0300 +@@ -54,6 +54,11 @@ + class Util { + private static boolean verbose = (System.getProperty("servicetag.verbose") != null); + private static String jrepath = null; ++ private static final String REGKEY_TAIL = ++ "microsoft\\windows\\currentversion\\app paths\\stclient.exe"; ++ private static final String STCLIENT_TAIL = "sun\\servicetag\\stclient.exe"; ++ private static final String WIN32_STCLIENT = ++ "c:\\Program Files (x86)\\" + STCLIENT_TAIL; + + // for debugging and tracing + static boolean isVerbose() { +@@ -231,15 +236,20 @@ + + /** + * Gets the stclient path using a well known location from +- * the Windows platform Registry, otherwise it will return null. ++ * the Windows platform Registry, ensuring the path returned ++ * by the registry is really the one we are looking for, ++ * otherwise it will return null. + */ +- static File getWindowsStClientFile() { ++ private static File getWindowsStClientFile(boolean wow64) { + File out = null; +- String regKey = "software\\microsoft\\windows\\currentversion\\app paths\\stclient.exe"; ++ String regKey = (wow64 == true) ++ ? "software\\Wow6432Node\\" + REGKEY_TAIL ++ : "software\\" + REGKEY_TAIL; + String keyName = "" ; // use the default key + String path = getRegistryKey(regKey, keyName); +- +- if (path != null && (new File(path)).exists()) { ++ if (path != null ++ && (new File(path)).exists() ++ && path.toLowerCase().endsWith(STCLIENT_TAIL.toLowerCase())) { + out = new File(path); + } + if (isVerbose()) { +@@ -249,6 +259,43 @@ + } + + /** ++ * Finds a stclient in 32 and 64 bit environments, first by querying ++ * the windows registry, if not then get the well known paths for ++ * 64bit see http://support.microsoft.com/kb/896459 ++ */ ++ ++ static File getWindowsStClientFile() { ++ File stclient = null; ++ ++ if (System.getProperty("os.arch").equals("x86")) { ++ // try to get the default entry ++ stclient = getWindowsStClientFile(false); ++ if (stclient != null) { ++ return stclient; ++ } ++ } else { // we are on 64-bit system ++ // try the wow64 area ++ stclient = getWindowsStClientFile(true); ++ if (stclient != null) { ++ return stclient; ++ } ++ // try the default hard coded path, maybe wow64 registry is missing ++ stclient = new File(WIN32_STCLIENT); ++ // 6.5 uses Java 1.5: canExecute() changed to canRead() ++ if (stclient.canRead()) { ++ if (isVerbose()) { ++ System.out.println("stclient(default)=" + stclient); ++ } ++ return stclient; ++ } ++ } ++ if (isVerbose()) { ++ System.out.println("stclient not found"); ++ } ++ return null; ++ } ++ ++ /** + * This uses reflection to access a private java windows registry + * interface, any changes to that Class must be appropriately adjusted. + * Returns a null if unsuccessful. +diff -r 76d51071af8a -r af9499d919b8 server/manifest.mf +--- a/server/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/server/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,6 +2,6 @@ + OpenIDE-Module: org.netbeans.modules.server/0 + OpenIDE-Module-Layer: org/netbeans/modules/server/resources/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/server/resources/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.2.1 ++OpenIDE-Module-Specification-Version: 1.2.2 + AutoUpdate-Show-In-Client: false + +diff -r 76d51071af8a -r af9499d919b8 server/src/org/netbeans/modules/server/ui/wizard/ServerWizardPanel.java +--- a/server/src/org/netbeans/modules/server/ui/wizard/ServerWizardPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/server/src/org/netbeans/modules/server/ui/wizard/ServerWizardPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -84,7 +84,7 @@ + } + + public boolean isValid() { +- return getVisual().isValid(); ++ return getVisual().hasValidData(); + } + + public void addChangeListener(ChangeListener listener) { +diff -r 76d51071af8a -r af9499d919b8 server/src/org/netbeans/modules/server/ui/wizard/ServerWizardVisual.java +--- a/server/src/org/netbeans/modules/server/ui/wizard/ServerWizardVisual.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/server/src/org/netbeans/modules/server/ui/wizard/ServerWizardVisual.java Tue Mar 10 13:53:55 2009 +0300 +@@ -141,8 +141,7 @@ + } + } + +- @Override +- public boolean isValid() { ++ boolean hasValidData() { + boolean result = isServerValid() && isDisplayNameValid(); + if (result) { + wizard.setErrorMessage(null); +diff -r 76d51071af8a -r af9499d919b8 spi.debugger.ui/manifest.mf +--- a/spi.debugger.ui/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/spi.debugger.ui/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,6 +2,6 @@ + OpenIDE-Module: org.netbeans.spi.debugger.ui/1 + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/debugger/ui/Bundle.properties + OpenIDE-Module-Layer: org/netbeans/modules/debugger/resources/mf-layer.xml +-OpenIDE-Module-Specification-Version: 2.14.1 ++OpenIDE-Module-Specification-Version: 2.14.2 + OpenIDE-Module-Provides: org.netbeans.spi.debugger.ui + OpenIDE-Module-Install: org/netbeans/modules/debugger/ui/DebuggerModule.class +diff -r 76d51071af8a -r af9499d919b8 spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddBreakpointAction.java +--- a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddBreakpointAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddBreakpointAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -194,7 +194,12 @@ + bOk.setEnabled (false); + return; + } +- bOk.setEnabled (controller.isValid ()); ++ if (panel.isNoValidityController()) { ++ // Always valid ++ bOk.setEnabled (true); ++ } else { ++ bOk.setEnabled (controller.isValid ()); ++ } + } + + /** @return true if OK button was pressed in dialog, +diff -r 76d51071af8a -r af9499d919b8 spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddBreakpointPanel.java +--- a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddBreakpointPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/AddBreakpointPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -57,6 +57,7 @@ + import org.netbeans.api.debugger.Breakpoint.*; + import org.netbeans.spi.debugger.ui.BreakpointType; + import org.netbeans.spi.debugger.ui.Controller; ++import org.openide.util.Exceptions; + + + /** +@@ -134,10 +135,11 @@ + return type; + } + +- public Controller getController () { ++ Controller getController () { + if (type != null) { + Controller c = type.getController(); + if (c == null && customizer instanceof Controller) { ++ //Exceptions.printStackTrace(new IllegalStateException("FIXME: JComponent "+customizer+" must not implement Controller interface!")); + return (Controller) customizer; + } else { + return c; +@@ -146,6 +148,11 @@ + return null; + } + } ++ ++ boolean isNoValidityController() { ++ // This controller must not be asked for isValid() ++ return type.getController() == null && customizer instanceof Controller; ++ } + + + // other methods ........................................................... +diff -r 76d51071af8a -r af9499d919b8 spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/BreakpointCustomizeAction.java +--- a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/BreakpointCustomizeAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/BreakpointCustomizeAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -204,6 +204,7 @@ + } + final Controller[] cPtr = new Controller[] { null }; + if (c instanceof Controller) { ++ //Exceptions.printStackTrace(new IllegalStateException("FIXME: JComponent "+c+" must not implement Controller interface!")); + cPtr[0] = (Controller) c; + } + final DialogDescriptor[] descriptorPtr = new DialogDescriptor[1]; +diff -r 76d51071af8a -r af9499d919b8 spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/ConnectorPanel.java +--- a/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/ConnectorPanel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/spi.debugger.ui/src/org/netbeans/modules/debugger/ui/actions/ConnectorPanel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -67,6 +67,7 @@ + import org.netbeans.spi.debugger.ui.Controller; + import org.openide.awt.Mnemonics; + ++import org.openide.util.Exceptions; + import org.openide.util.NbBundle; + + +@@ -166,6 +167,7 @@ + JComponent customizer = attachType.getCustomizer (); + controller = attachType.getController(); + if (controller == null && (customizer instanceof Controller)) { ++ Exceptions.printStackTrace(new IllegalStateException("FIXME: JComponent "+customizer+" must not implement Controller interface!")); + controller = (Controller) customizer; + } + firePropertyChange(PROP_TYPE, null, customizer); +diff -r 76d51071af8a -r af9499d919b8 spi.debugger.ui/src/org/netbeans/spi/debugger/ui/AttachType.java +--- a/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/AttachType.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/AttachType.java Tue Mar 10 13:53:55 2009 +0300 +@@ -60,12 +60,13 @@ + public abstract String getTypeDisplayName (); + + /** +- * Returns visual customizer for this Attach Type. Customizer can +- * optionally implement {@link Controller} interface. In that case please +- * notice the clash of {@link Controller#isValid()} method with +- * {@link javax.swing.JComponent#isValid()} and consider extending +- * {@link #getController()} method in case you need to provide +- * false validity in some cases. ++ * Returns visual customizer for this Attach Type. ++ *
      ++     * Customizer can not implement the {@link Controller} interface any more,
      ++     * due to a clash of {@link Controller#isValid()} method with
      ++     * {@link javax.swing.JComponent#isValid()}.
      ++     * Override {@link #getController()} method instead.
      ++     * 
      + * + * @return visual customizer for this Attach Type + */ +@@ -73,13 +74,13 @@ + + /** + * Return the implementation of {@link Controller} interface.
      +- * In cases when it's not desired to implement {@link Controller} interface +- * by the JComponent returned from {@link #getCustomizer()} method, because ++ * It's not desired to implement the {@link Controller} interface ++ * by JComponent returned from {@link #getCustomizer()} method, because + * of the clash of {@link Controller#isValid()} method with +- * {@link javax.swing.JComponent#isValid()}, an explicit implementation +- * can be returned by overriding this method. ++ * {@link javax.swing.JComponent#isValid()}. An explicit implementation ++ * should be returned by overriding this method. + * The default implementation returns null, in which case +- * the customizer component is cast to {@link Controller}. ++ * no {@link Controller} is used. + * + * @return Controller implementation or null. + * @since 2.14 +diff -r 76d51071af8a -r af9499d919b8 spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java +--- a/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/BreakpointType.java Tue Mar 10 13:53:55 2009 +0300 +@@ -67,12 +67,13 @@ + public abstract String getTypeDisplayName (); + + /** +- * Returns visual customizer for this breakpoint type. Customizer can +- * optionally implement {@link Controller} interface. In that case please +- * notice the clash of {@link Controller#isValid()} method with +- * {@link javax.swing.JComponent#isValid()} and consider extending +- * {@link #getController()} method in case you need to provide +- * false validity in some cases. ++ * Returns visual customizer for this breakpoint type. ++ *
      ++     * Customizer can not implement the {@link Controller} interface any more,
      ++     * due to a clash of {@link Controller#isValid()} method with
      ++     * {@link javax.swing.JComponent#isValid()}.
      ++     * Override {@link #getController()} method instead.
      ++     * 
      + * + * @return visual customizer for this breakpoint type + */ +@@ -80,13 +81,13 @@ + + /** + * Return the implementation of {@link Controller} interface.
      +- * In cases when it's not desired to implement {@link Controller} interface +- * by the JComponent returned from {@link #getCustomizer()} method, because ++ * It's not desired to implement the {@link Controller} interface ++ * by JComponent returned from {@link #getCustomizer()} method, because + * of the clash of {@link Controller#isValid()} method with +- * {@link javax.swing.JComponent#isValid()}, an explicit implementation +- * can be returned by overriding this method. +- * The default implementation returns null, in which case +- * the customizer component is cast to {@link Controller}. ++ * {@link javax.swing.JComponent#isValid()}. An explicit implementation ++ * should be returned by overriding this method. ++ * The default implementation returns null, in which case ++ * no {@link Controller} is used. + * + * @return Controller implementation or null. + * @since 2.14 +diff -r 76d51071af8a -r af9499d919b8 spi.debugger.ui/src/org/netbeans/spi/debugger/ui/Controller.java +--- a/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/Controller.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/spi.debugger.ui/src/org/netbeans/spi/debugger/ui/Controller.java Tue Mar 10 13:53:55 2009 +0300 +@@ -45,10 +45,10 @@ + + + /** +- * Support for validation of various customizers. This interface can be +- * optionally implemented by some customizers like Attach Panel (see +- * {@link AttachType#getCustomizer}) and breakpoint customizer (see +- * {@link BreakpointType#getCustomizer}). ++ * Support for validation of various customizers. This interface can not be ++ * implemented directly by the customizer component. See ++ * {@link AttachType#getController}) and ++ * {@link BreakpointType#getController}). + * + * @author Jan Jancura + */ +@@ -76,10 +76,9 @@ + * Return true whether value of this customizer + * is valid (and OK button can be enabled). + *

      +- * Please note that if this interface is implemented by a class that extends ++ * When this interface is implemented by a class that extends + * {@link javax.swing.JComponent}, this method clashes with +- * {@link javax.swing.JComponent#isValid()} method. Thus in case you need +- * to provide false validity in some cases, please implement ++ * {@link javax.swing.JComponent#isValid()} method. In this case please implement + * this by a different class and override {@link AttachType#getController()}, + * resp. {@link BreakpointType#getController()}. + * +diff -r 76d51071af8a -r af9499d919b8 subversion/manifest.mf +--- a/subversion/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -3,5 +3,5 @@ + OpenIDE-Module-Layer: org/netbeans/modules/subversion/resources/svn-layer.xml + OpenIDE-Module-Install: org/netbeans/modules/subversion/ModuleLifecycleManager.class + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/subversion/resources/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.4.1 ++OpenIDE-Module-Specification-Version: 1.4.2 + +diff -r 76d51071af8a -r af9499d919b8 subversion/nbproject/project.xml +--- a/subversion/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -157,7 +157,7 @@ + + + 1 +- 1.4 ++ 1.8.2 + + + +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/SubversionVisibilityQuery.java +--- a/subversion/src/org/netbeans/modules/subversion/SubversionVisibilityQuery.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/SubversionVisibilityQuery.java Tue Mar 10 13:53:55 2009 +0300 +@@ -93,7 +93,16 @@ + return true; + } + try { +- return getCache().getStatus(file).getStatus() != FileInformation.STATUS_VERSIONED_REMOVEDLOCALLY; ++ // get cached status so you won't block or trigger synchronous shareability calls ++ FileInformation info = getCache().getCachedStatus(file); ++ if(info != null) { ++ return info.getStatus() != FileInformation.STATUS_VERSIONED_REMOVEDLOCALLY; ++ } else { ++ // status isn't cached yet; lets be optimistic here and return true ++ // the visibility will be called again as soon as the refreshes finnishes ++ getCache().refreshAsync(file); ++ return true; ++ } + } catch (Exception e) { + Subversion.LOG.log(Level.SEVERE, e.getMessage(), e); + return true; +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/SvnModuleConfig.java +--- a/subversion/src/org/netbeans/modules/subversion/SvnModuleConfig.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/SvnModuleConfig.java Tue Mar 10 13:53:55 2009 +0300 +@@ -63,8 +63,9 @@ + public static final String KEY_EXECUTABLE_BINARY = "svnExecBinary"; // NOI18N + public static final String KEY_ANNOTATION_FORMAT = "annotationFormat"; // NOI18N + public static final String SAVE_PASSWORD = "savePassword"; // NOI18N ++ private static final String FILE_SELECTOR_PREFIX = "fileSelector"; // NOI18N + +- public static final String KEY_RECENT_URL = "repository.recentURL"; // NOI18N ++ public static final String KEY_RECENT_URL = "repository.recentURL"; // NOI18N + private static final String SHOW_CHECKOUT_COMPLETED = "checkoutCompleted.showCheckoutCompleted"; // NOI18N + + private static final String URL_EXP = "annotator.urlExp"; // NOI18N +@@ -72,6 +73,7 @@ + + public static final String TEXT_ANNOTATIONS_FORMAT_DEFAULT = "{DEFAULT}"; // NOI18N + ++ + private static final SvnModuleConfig INSTANCE = new SvnModuleConfig(); + + private Map urlCredentials; +@@ -151,7 +153,15 @@ + public void setSavePassword(boolean bl) { + getPreferences().putBoolean(SAVE_PASSWORD, bl); + } +- ++ ++ public String getFileSelectorPreset(String hash) { ++ return getPreferences().get(FILE_SELECTOR_PREFIX + "-" + hash, ""); ++ } ++ ++ public void setFileSelectorPreset(String hash, String path) { ++ getPreferences().put(FILE_SELECTOR_PREFIX + "-" + hash, path); ++ } ++ + public RepositoryConnection getRepositoryConnection(String url) { + if(url.endsWith("/")) url = url.substring(0, url.length() - 1); + List rcs = getRecentUrls(); +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/client/SvnClientExceptionHandler.java +--- a/subversion/src/org/netbeans/modules/subversion/client/SvnClientExceptionHandler.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/client/SvnClientExceptionHandler.java Tue Mar 10 13:53:55 2009 +0300 +@@ -502,21 +502,9 @@ + } + + private String getFingerprint(X509Certificate cert, String alg) { +- String str; + try { + byte[] encoded = cert.getEncoded(); +- MessageDigest md5 = MessageDigest.getInstance(alg); +- md5.update(encoded); +- byte[] md5digest = md5.digest(); +- String ret = ""; // NOI18N +- for (int i = 0; i < md5digest.length; i++) { +- String hex = Integer.toHexString(md5digest[i] & 0x000000FF); +- if(hex.length()==1) { +- hex = "0" + hex; // NOI18N +- } +- ret += hex + (i < md5digest.length - 1 ? ":" : ""); // NOI18N +- } +- return ret; ++ return SvnUtils.getHash(alg, encoded); + } catch (CertificateEncodingException ex) { + Subversion.LOG.log(Level.INFO, ex.getMessage(), ex); // should not happen + } catch (NoSuchAlgorithmException ex) { +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/resources/Bundle.properties +--- a/subversion/src/org/netbeans/modules/subversion/resources/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/resources/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -41,7 +41,11 @@ + OpenIDE-Module-Name=Subversion + OpenIDE-Module-Display-Category=Base IDE + OpenIDE-Module-Short-Description=Integrates Subversion actions into IDE workflow. +-OpenIDE-Module-Long-Description=Introduces project level Subversion features. Version control actions, such as diff, update, and commit aid in streamlining typical team development cycles. ++OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ ++Introduces project level Subversion features. Version control actions, such as diff, update, and commit aid in streamlining typical team development cycles. + + + ## svn-layer.xml +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/ui/copy/CreateCopyAction.java +--- a/subversion/src/org/netbeans/modules/subversion/ui/copy/CreateCopyAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/ui/copy/CreateCopyAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -95,7 +95,8 @@ + + Context ctx = getContext(nodes); + +- final File root = ctx.getRootFiles()[0]; ++ File root = SvnUtils.getActionRoot(ctx); ++ if(root == null) return; + File[] files = Subversion.getInstance().getStatusCache().listFiles(ctx, FileInformation.STATUS_LOCAL_CHANGE); + + final boolean hasChanges = files.length > 0; +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/ui/copy/MergeAction.java +--- a/subversion/src/org/netbeans/modules/subversion/ui/copy/MergeAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/ui/copy/MergeAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -94,7 +94,8 @@ + } + + Context ctx = getContext(nodes); +- final File root = ctx.getRootFiles()[0]; ++ final File root = SvnUtils.getActionRoot(ctx); ++ if(root == null) return; + SVNUrl rootUrl; + SVNUrl url; + try { +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/ui/copy/SwitchToAction.java +--- a/subversion/src/org/netbeans/modules/subversion/ui/copy/SwitchToAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/ui/copy/SwitchToAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -53,6 +53,7 @@ + import org.netbeans.modules.subversion.client.SvnProgressSupport; + import org.netbeans.modules.subversion.ui.actions.ContextAction; + import org.netbeans.modules.subversion.util.Context; ++import org.netbeans.modules.subversion.util.FileSelector; + import org.netbeans.modules.subversion.util.SvnUtils; + import org.netbeans.modules.versioning.util.Utils; + import org.openide.nodes.Node; +@@ -103,8 +104,9 @@ + } + + Context ctx = getContext(nodes); +- +- final File root = ctx.getRootFiles()[0]; ++ ++ File root = SvnUtils.getActionRoot(ctx); ++ if(root == null) return; + SVNUrl rootUrl; + + try { +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/ui/project/ImportAction.java +--- a/subversion/src/org/netbeans/modules/subversion/ui/project/ImportAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/ui/project/ImportAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -140,7 +140,7 @@ + final String message) + { + SVNUrl repository; +- try { ++ try { + repository = SvnUtils.getRepositoryRootUrl(context.getRootFiles()[0]); + } catch (SVNClientException ex) { + SvnClientExceptionHandler.notifyException(ex, true, true); +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/ui/properties/SvnPropertiesAction.java +--- a/subversion/src/org/netbeans/modules/subversion/ui/properties/SvnPropertiesAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/ui/properties/SvnPropertiesAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -68,7 +68,7 @@ + public final class SvnPropertiesAction extends ContextAction { + + protected boolean enable(Node[] nodes) { +- return getContext(nodes).getRootFiles().length == 1; ++ return nodes.length == 1; + } + + protected int getFileEnabledStatus() { +@@ -91,26 +91,16 @@ + + protected void performContextAction(Node[] nodes) { + final Context ctx = getContext(nodes); +- String ctxDisplayName = getContextDisplayName(nodes); +- File[] roots = ctx.getRootFiles(); +- +- openProperties(roots, ctxDisplayName); ++ String ctxDisplayName = getContextDisplayName(nodes); ++ File root = SvnUtils.getActionRoot(ctx); ++ openProperties(root, ctxDisplayName); + } + +- public static void openProperties(File[ ]roots, String ctxDisplayName) { ++ public static void openProperties(File root, String ctxDisplayName) { + if(!Subversion.getInstance().checkClientAvailable()) { + return; + } + +- SvnClient client; +- try { +- SVNUrl repositoryUrl = SvnUtils.getRepositoryRootUrl(roots[0]); +- client = Subversion.getInstance().getClient(repositoryUrl); +- } catch (SVNClientException ex) { +- SvnClientExceptionHandler.notifyException(ex, true, true); +- return; +- } +- + final PropertiesPanel panel = new PropertiesPanel(); + final PropertiesTable propTable; + propTable = new PropertiesTable(panel.labelForTable, PropertiesTable.PROPERTIES_COLUMNS, new String[] { PropertiesTableModel.COLUMN_NAME_VALUE}); +@@ -119,7 +109,7 @@ + JComponent component = propTable.getComponent(); + panel.propsPanel.setLayout(new BorderLayout()); + panel.propsPanel.add(component, BorderLayout.CENTER); +- SvnProperties svnProperties = new SvnProperties(panel, propTable, roots[0]); ++ SvnProperties svnProperties = new SvnProperties(panel, propTable, root); + ResourceBundle loc = NbBundle.getBundle(SvnPropertiesAction.class); + JButton cancel = new JButton(loc.getString("CTL_Properties_Action_Cancel")); // NOI18N + cancel.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(SvnPropertiesAction.class, "CTL_Properties_Action_Cancel")); // NOI18N +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/ui/relocate/RelocateAction.java +--- a/subversion/src/org/netbeans/modules/subversion/ui/relocate/RelocateAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/ui/relocate/RelocateAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -44,6 +44,7 @@ + import java.io.File; + import java.net.MalformedURLException; + import java.util.ResourceBundle; ++import java.util.logging.Level; + import javax.swing.JButton; + import javax.swing.event.DocumentEvent; + import javax.swing.event.DocumentListener; +@@ -71,13 +72,20 @@ + public class RelocateAction extends ContextAction { + + protected boolean enable(Node[] nodes) { ++ if(nodes.length != 1) { ++ return false; ++ } + final Context ctx = getContext(nodes); + File[] roots = ctx.getRootFiles(); +- if(roots == null || roots.length != 1) { ++ if(roots == null || roots.length < 1) { + return false; + } +- File file = roots[0]; +- return file != null && file.isDirectory(); ++ for (File file : roots) { ++ if(file.isDirectory()) { ++ return true; // at least one dir ++ } ++ } ++ return false; + } + + protected int getDirectoryEnabledStatus() { +@@ -86,21 +94,6 @@ + & ~FileInformation.STATUS_NOTVERSIONED_NEWLOCALLY; + } + +- private String getCurrentURL(File root) { +- try { +- SVNUrl repositoryUrl = SvnUtils.getRepositoryRootUrl(root); +- return repositoryUrl.toString(); +- } catch (SVNClientException ex) { +- SvnClientExceptionHandler.notifyException(ex, true, true); +- } +- return ""; +- } +- +- private String getWorkingCopy(File root) { +- final String working = root.getAbsolutePath(); +- return working; +- } +- + public void validate(RelocatePanel panel, JButton btnOk) { + try { + new SVNUrl(panel.getNewURL().getText()); +@@ -108,7 +101,6 @@ + } catch (MalformedURLException e) { + btnOk.setEnabled(false); + } +- + } + + protected String getBaseName(Node[] activatedNodes) { +@@ -117,21 +109,34 @@ + + protected void performContextAction(Node[] nodes) { + ResourceBundle loc = NbBundle.getBundle(RelocateAction.class); +- ++ + final Context ctx = getContext(nodes); + File[] roots = ctx.getRootFiles(); + if (roots == null) { + return; + } +- ++ + final RelocatePanel panel = new RelocatePanel(); +- panel.getCurrentURL().setText(getCurrentURL(roots[0])); +- panel.getWorkingCopy().setText(getWorkingCopy(roots[0])); +- ++ File root = SvnUtils.getActionRoot(ctx); ++ SVNUrl repositoryUrl = null; ++ try { ++ repositoryUrl = SvnUtils.getRepositoryRootUrl(root); ++ } catch (SVNClientException ex) { ++ SvnClientExceptionHandler.notifyException(ex, true, true); ++ return; ++ } ++ if(repositoryUrl == null) { ++ Subversion.LOG.log(Level.WARNING, "Could not retrieve repository root for context file {0}", new Object[]{ root }); ++ return; ++ } ++ final String wc = root.getAbsolutePath(); ++ panel.getCurrentURL().setText(repositoryUrl.toString()); ++ panel.getWorkingCopy().setText(wc); ++ + final JButton btnRelocate = new JButton(loc.getString("CTL_Relocate_Action_Name")); + btnRelocate.setEnabled(false); + btnRelocate.setToolTipText(loc.getString("TT_Relocate_Action")); +- ++ + panel.getNewURL().getDocument().addDocumentListener(new DocumentListener() { + public void insertUpdate(DocumentEvent event) { + validate(panel, btnRelocate); +@@ -143,7 +148,7 @@ + + public void changedUpdate(DocumentEvent event) { + validate(panel, btnRelocate); +- } ++ } + }); + JButton btnCancel = new JButton(loc.getString("CTL_Relocate_Action_Cancel")); + btnCancel.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(RelocateAction.class, "ACSD_Relocate_Action_Cancel")); // NOI18N +@@ -152,31 +157,24 @@ + descriptor.setHelpCtx(new HelpCtx(RelocateAction.class)); + Dialog dialog = DialogDisplayer.getDefault().createDialog(descriptor); + dialog.getAccessibleContext().setAccessibleDescription(loc.getString("ACSD_Relocate")); +- ++ + dialog.setVisible(true); +- if (descriptor.getValue() != btnRelocate) ++ if (descriptor.getValue() != btnRelocate) + return; +- ++ + final String newUrl = panel.getNewURL().getText(); +- +- final SVNUrl repositoryUrl; +- try { +- repositoryUrl = SvnUtils.getRepositoryRootUrl(roots[0]); +- } catch (SVNClientException ex) { +- SvnClientExceptionHandler.notifyException(ex, true, true); +- return; +- } +- final String wc = roots[0].getAbsolutePath(); ++ + RequestProcessor rp = Subversion.getInstance().getRequestProcessor(repositoryUrl); ++ final SVNUrl url = repositoryUrl; + SvnProgressSupport support = new SvnProgressSupport() { + SvnClient client = null; +- protected void perform() { ++ protected void perform() { + try { +- client = Subversion.getInstance().getClient(repositoryUrl); +- client.relocate(repositoryUrl.toString(), newUrl, wc, true); ++ client = Subversion.getInstance().getClient(url); ++ client.relocate(url.toString(), newUrl, wc, true); + } catch (SVNClientException ex) { + annotate(ex); +- } ++ } + } + }; + support.start(rp, repositoryUrl, loc.getString("LBL_Relocate_Progress")); +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/ui/update/RevertModificationsAction.java +--- a/subversion/src/org/netbeans/modules/subversion/ui/update/RevertModificationsAction.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/ui/update/RevertModificationsAction.java Tue Mar 10 13:53:55 2009 +0300 +@@ -90,7 +90,8 @@ + return; + } + final Context ctx = getContext(nodes); +- final File root = ctx.getRootFiles()[0]; ++ final File root = SvnUtils.getActionRoot(ctx); ++ if(root == null) return; + final SVNUrl rootUrl; + final SVNUrl url; + +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/ui/update/UpdateResultsTable.java +--- a/subversion/src/org/netbeans/modules/subversion/ui/update/UpdateResultsTable.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/ui/update/UpdateResultsTable.java Tue Mar 10 13:53:55 2009 +0300 +@@ -336,7 +336,7 @@ + } + + private void performOpenSvnProperties(File file) { +- SvnPropertiesAction.openProperties(new File[] {file}, file.getName()); ++ SvnPropertiesAction.openProperties(file, file.getName()); + } + + private File[] getSelectedFiles(int[] selection) { +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/util/Bundle.properties +--- a/subversion/src/org/netbeans/modules/subversion/util/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/util/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -2,3 +2,8 @@ + + MSG_too_old_WC=It seems that files you are working with were created with an unsupported client version.\n\ + Please check out your files again with SVN client 1.3.0 or later. ++FileSelector.jLabel1.text=Your selection applies to more than one folder. Please specify the folder you want to use: ++ ++CTL_FileSelector_Cancel=Cancel ++CTL_FileSelector_Select=Select ++LBL_FileSelector_Title=Select a Folder +\ No newline at end of file +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/util/FileSelector.form +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/subversion/src/org/netbeans/modules/subversion/util/FileSelector.form Tue Mar 10 13:53:55 2009 +0300 +@@ -0,0 +1,76 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/util/FileSelector.java +--- /dev/null Thu Jan 01 00:00:00 1970 +0000 ++++ b/subversion/src/org/netbeans/modules/subversion/util/FileSelector.java Tue Mar 10 13:53:55 2009 +0300 +@@ -0,0 +1,214 @@ ++/* ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. ++ * ++ * Copyright 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]" ++ * ++ * 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 2008 Sun Microsystems, Inc. ++ */ ++ ++/* ++ * RootSelectorPanel.java ++ * ++ * Created on Dec 1, 2008, 2:41:58 PM ++ */ ++ ++package org.netbeans.modules.subversion.util; ++ ++import java.awt.Dialog; ++import java.io.File; ++import java.security.NoSuchAlgorithmException; ++import java.util.Arrays; ++import java.util.logging.Level; ++import javax.swing.DefaultListModel; ++import javax.swing.JButton; ++import javax.swing.event.ListSelectionEvent; ++import javax.swing.event.ListSelectionListener; ++import org.netbeans.modules.subversion.Subversion; ++import org.netbeans.modules.subversion.SvnModuleConfig; ++import org.openide.DialogDescriptor; ++import org.openide.DialogDisplayer; ++import org.openide.util.Exceptions; ++import org.openide.util.HelpCtx; ++import org.openide.util.NbBundle; ++ ++/** ++ * ++ * @author Tomas Stuka ++ */ ++public class FileSelector extends javax.swing.JPanel implements ListSelectionListener { ++ private File[] files; ++ private DialogDescriptor dialogDescriptor; ++ private JButton okButton; ++ private JButton cancelButton; ++ ++ /** Creates new form RootSelectorPanel */ ++ public FileSelector() { ++ initComponents(); ++ filesList.addListSelectionListener(this); ++ ++ dialogDescriptor = new DialogDescriptor(this, org.openide.util.NbBundle.getMessage(FileSelector.class, "LBL_FileSelector_Title")); ++ ++ okButton = new JButton(org.openide.util.NbBundle.getMessage(FileSelector.class, "CTL_FileSelector_Select")); ++ okButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(FileSelector.class, "CTL_FileSelector_Select")); ++ okButton.setEnabled(false); ++ cancelButton = new JButton(org.openide.util.NbBundle.getMessage(FileSelector.class, "CTL_FileSelector_Cancel")); // NOI18N ++ cancelButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(FileSelector.class, "CTL_FileSelector_Cancel")); // NOI18N ++ dialogDescriptor.setOptions(new Object[] {okButton, cancelButton}); ++ ++ dialogDescriptor.setModal(true); ++ dialogDescriptor.setHelpCtx(new HelpCtx(this.getClass())); ++ dialogDescriptor.setValid(false); ++ } ++ ++ /** This method is called from within the constructor to ++ * initialize the form. ++ * WARNING: Do NOT modify this code. The content of this method is ++ * always regenerated by the Form Editor. ++ */ ++ @SuppressWarnings("unchecked") ++ // //GEN-BEGIN:initComponents ++ private void initComponents() { ++ ++ jLabel1 = new javax.swing.JLabel(); ++ jScrollPane1 = new javax.swing.JScrollPane(); ++ ++ jLabel1.setText(org.openide.util.NbBundle.getMessage(FileSelector.class, "FileSelector.jLabel1.text")); // NOI18N ++ ++ filesList.setModel(new javax.swing.AbstractListModel() { ++ String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" }; ++ public int getSize() { return strings.length; } ++ public Object getElementAt(int i) { return strings[i]; } ++ }); ++ filesList.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION); ++ jScrollPane1.setViewportView(filesList); ++ ++ org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); ++ this.setLayout(layout); ++ layout.setHorizontalGroup( ++ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) ++ .add(layout.createSequentialGroup() ++ .addContainerGap() ++ .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) ++ .add(org.jdesktop.layout.GroupLayout.LEADING, jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) ++ .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 572, Short.MAX_VALUE)) ++ .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ++ ); ++ layout.setVerticalGroup( ++ layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) ++ .add(layout.createSequentialGroup() ++ .addContainerGap() ++ .add(jLabel1) ++ .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) ++ .add(jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 109, Short.MAX_VALUE) ++ .addContainerGap()) ++ ); ++ }// //GEN-END:initComponents ++ ++ ++ // Variables declaration - do not modify//GEN-BEGIN:variables ++ final javax.swing.JList filesList = new javax.swing.JList(); ++ private javax.swing.JLabel jLabel1; ++ private javax.swing.JScrollPane jScrollPane1; ++ // End of variables declaration//GEN-END:variables ++ ++ public boolean show(File[] files) { ++ this.files = files; ++ DefaultListModel m = new DefaultListModel(); ++ for (File file : files) { ++ m.addElement(file); ++ } ++ filesList.setModel(m); ++ preselectFile(files); ++ ++ Dialog dialog = DialogDisplayer.getDefault().createDialog(dialogDescriptor); ++ dialog.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(FileSelector.class, "LBL_FileSelector_Title")); // NOI18N ++ ++ dialog.setVisible(true); ++ dialogDescriptor.setHelpCtx(new HelpCtx("org.netbeans.modules.subversion.FileSelector")); ++ boolean ret = dialogDescriptor.getValue() == okButton; ++ if(ret) { ++ saveSelectedFile(files); ++ } ++ return ret; ++ } ++ ++ public File getSelectedFile() { ++ return (File) filesList.getSelectedValue(); ++ } ++ ++ public void valueChanged(ListSelectionEvent e) { ++ boolean enabled = filesList.getSelectedValue() != null; ++ dialogDescriptor.setValid(enabled); ++ okButton.setEnabled(enabled); ++ } ++ ++ private void preselectFile(File[] files) { ++ String hash = getHash(files); ++ if(hash == null || hash.trim().equals("")) { ++ return; ++ } ++ String path = SvnModuleConfig.getDefault().getFileSelectorPreset(hash); ++ if(path != null && !path.trim().equals("")) { ++ File f = new File(path); ++ filesList.setSelectedValue(f, true); ++ } ++ } ++ ++ private void saveSelectedFile(File[] files) { ++ String hash = getHash(files); ++ if(hash == null || hash.trim().equals("")) { ++ return; ++ } ++ File file = getSelectedFile(); ++ if(file != null) { ++ SvnModuleConfig.getDefault().setFileSelectorPreset(hash, file.getAbsolutePath()); ++ } ++ } ++ ++ private String getHash(File[] files) { ++ Arrays.sort(files); ++ StringBuffer sb = new StringBuffer(); ++ for (File file : files) { ++ sb.append(file.getAbsolutePath()); ++ } ++ String hash = null; ++ try { ++ hash = SvnUtils.getHash("MD5", sb.toString().getBytes()); ++ } catch (NoSuchAlgorithmException ex) { ++ Subversion.LOG.log(Level.SEVERE, null, ex); // should not happen ++ } ++ return hash; ++ } ++ ++} +diff -r 76d51071af8a -r af9499d919b8 subversion/src/org/netbeans/modules/subversion/util/SvnUtils.java +--- a/subversion/src/org/netbeans/modules/subversion/util/SvnUtils.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/subversion/src/org/netbeans/modules/subversion/util/SvnUtils.java Tue Mar 10 13:53:55 2009 +0300 +@@ -53,8 +53,12 @@ + import org.netbeans.modules.subversion.Subversion; + import org.netbeans.modules.subversion.FileInformation; + import java.io.*; ++import java.io.File; ++import java.security.MessageDigest; ++import java.security.NoSuchAlgorithmException; + import java.util.*; + import java.text.ParseException; ++import java.util.ArrayList; + import java.util.logging.Level; + import java.util.logging.Logger; + import java.util.regex.Pattern; +@@ -980,4 +984,41 @@ + if(TY9_LOG == null) TY9_LOG = Logger.getLogger("org.netbeans.modules.subversion.t9y"); + TY9_LOG.log(Level.FINEST, msg); + } ++ ++ public static File getActionRoot(Context ctx) { ++ File[] roots = ctx.getRootFiles(); ++ List l = new ArrayList(); ++ for (File file : roots) { ++ if(isManaged(file)) { ++ l.add(file); ++ } ++ } ++ roots = l.toArray(new File[l.size()]); ++ if(roots.length > 1) { ++ FileSelector fs = new FileSelector(); ++ if(fs.show(roots)) { ++ return fs.getSelectedFile(); ++ } else { ++ return null; ++ } ++ } else { ++ return roots[0]; ++ } ++ } ++ ++ public static String getHash(String alg, byte[] encoded) throws NoSuchAlgorithmException { ++ MessageDigest md5 = MessageDigest.getInstance(alg); ++ md5.update(encoded); ++ byte[] md5digest = md5.digest(); ++ String ret = ""; // NOI18N ++ for (int i = 0; i < md5digest.length; i++) { ++ String hex = Integer.toHexString(md5digest[i] & 0x000000FF); ++ if (hex.length() == 1) { ++ hex = "0" + hex; // NOI18N ++ } ++ ret += hex + (i < md5digest.length - 1 ? ":" : ""); // NOI18N ++ } ++ return ret; ++ } ++ + } +diff -r 76d51071af8a -r af9499d919b8 swingapp/manifest.mf +--- a/swingapp/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/swingapp/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,6 +2,6 @@ + OpenIDE-Module: org.netbeans.modules.swingapp + OpenIDE-Module-Layer: org/netbeans/modules/swingapp/resources/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/swingapp/resources/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.3.1 ++OpenIDE-Module-Specification-Version: 1.3.2 + AutoUpdate-Show-In-Client: false + +diff -r 76d51071af8a -r af9499d919b8 swingapp/src/org/netbeans/modules/swingapp/templates/NewAppWizardIterator.java +--- a/swingapp/src/org/netbeans/modules/swingapp/templates/NewAppWizardIterator.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/swingapp/src/org/netbeans/modules/swingapp/templates/NewAppWizardIterator.java Tue Mar 10 13:53:55 2009 +0300 +@@ -44,7 +44,9 @@ + import java.beans.PropertyChangeEvent; + import java.beans.PropertyChangeListener; + import java.io.File; ++import java.io.FileOutputStream; + import java.io.IOException; ++import java.io.OutputStream; + import java.lang.reflect.InvocationTargetException; + import java.lang.reflect.Method; + import java.util.*; +@@ -246,6 +248,8 @@ + FileObject projectFolderFO = AppProjectGenerator.createProjectFromTemplate( + template, projectDirectory, templateNames, substNames); + ++ generatePrivateProperties(projectDirectory); ++ + // remember project location in ProjectChooser + ProjectChooser.setProjectsFolder(projectDirectory.getParentFile()); + +@@ -413,6 +417,28 @@ + public void uninitialize(WizardDescriptor wiz) { + } + ++ private void generatePrivateProperties(File projectLocation) throws IOException { ++ FileObject prjLoc = FileUtil.toFileObject(projectLocation); ++ String[] nameElements = AntProjectHelper.PRIVATE_PROPERTIES_PATH.split("/"); // NOI18N ++ FileObject fo = prjLoc; ++ for (int i=0; i + + +- 2.0 ++ 2.6.3 + +
      + +diff -r 76d51071af8a -r af9499d919b8 uihandler/manifest.mf +--- a/uihandler/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/uihandler/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,5 +2,5 @@ + OpenIDE-Module: org.netbeans.modules.uihandler + OpenIDE-Module-Install: org/netbeans/modules/uihandler/Installer.class + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/uihandler/Bundle.properties +-OpenIDE-Module-Specification-Version: 2.6.1 ++OpenIDE-Module-Specification-Version: 2.6.3 + +diff -r 76d51071af8a -r af9499d919b8 uihandler/src/org/netbeans/modules/uihandler/Installer.java +--- a/uihandler/src/org/netbeans/modules/uihandler/Installer.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/uihandler/src/org/netbeans/modules/uihandler/Installer.java Tue Mar 10 13:53:55 2009 +0300 +@@ -50,6 +50,7 @@ + import java.awt.image.BufferedImage; + import java.io.BufferedInputStream; + import java.io.BufferedOutputStream; ++import java.io.ByteArrayInputStream; + import java.io.DataOutputStream; + import java.io.File; + import java.io.FileInputStream; +@@ -73,7 +74,6 @@ + import java.text.MessageFormat; + import java.util.ArrayList; + import java.util.Arrays; +-import java.util.Collection; + import java.util.Collections; + import java.util.Date; + import java.util.LinkedList; +@@ -136,6 +136,8 @@ + import org.openide.windows.WindowManager; + import org.w3c.dom.Document; + import org.w3c.dom.NodeList; ++import org.xml.sax.EntityResolver; ++import org.xml.sax.InputSource; + import org.xml.sax.SAXException; + + /** +@@ -996,6 +998,17 @@ + factory.setValidating(false); + factory.setIgnoringComments(true); + DocumentBuilder builder = factory.newDocumentBuilder(); ++ builder.setEntityResolver(new EntityResolver() { ++ //Avoid connecting out to get DTD ++ public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException { ++ if (systemId.equals("http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd")) { ++ InputStream is = new ByteArrayInputStream(new byte[0]); ++ return new InputSource(is); ++ } else { ++ return null; ++ } ++ } ++ }); + + PushbackInputStream isWithProlog = new PushbackInputStream(is, 255); + byte[] xmlHeader = new byte[5]; +@@ -1020,12 +1033,8 @@ + NodeList forms = doc.getElementsByTagName("form"); + for (int i = 0; i < forms.getLength(); i++) { + String action = forms.item(i).getAttributes().getNamedItem("action").getNodeValue(); +- if ((action == null) || ("".equals(action))){// logging for issue #145167 +- Logger logger = Logger.getLogger("org.netbeans.ui.logger.Installer"); +- LogRecord rec = new LogRecord(Level.WARNING, "invalid action from doc:"); +- String[] params = new String[]{forms.item(i).toString(), doc.getTextContent(), doc.getDocumentURI()}; +- rec.setParameters(params); +- logger.log(rec); ++ if ((action == null) || ("".equals(action))) { ++ throw new IllegalStateException("Action should not be empty"); + } + Form f = new Form(action); + NodeList inputs = doc.getElementsByTagName("input"); +@@ -1037,7 +1046,14 @@ + String value = attrValue(in, "value"); + String align = attrValue(in, "align"); + String alt = attrValue(in, "alt"); +- boolean enabled = !"true".equals(attrValue(in, "disabled")); // NOI18N ++ //Incorrect value but we keep it here for backward compatibility ++ //Correct value of atribute "disabled" is "disabled" ++ boolean enabled = true; ++ if ("true".equals(attrValue(in, "disabled"))) { // NOI18N ++ enabled = false; ++ } else if ("disabled".equals(attrValue(in, "disabled"))) { // NOI18N ++ enabled = false; ++ } + + List addTo = "left".equals(align) ? left : buttons; + +@@ -1111,7 +1127,7 @@ + try { + url[0] = new URL((String) post); + } catch (MalformedURLException ex) { +- LOG.log(Level.WARNING, "Cannot decode URL: " + post, ex); // NOI18N ++ LOG.log(Level.INFO, "Cannot decode URL: " + post, ex); // NOI18N + url[0] = null; + return null; + } +@@ -1424,6 +1440,9 @@ + LOG.log(Level.WARNING, null, ex); + } catch (SAXException ex) { + LOG.log(Level.WARNING, url.toExternalForm(), ex); ++ } catch (IllegalStateException ex){ ++ catchConnectionProblem(ex); ++ continue; + } catch (java.net.SocketTimeoutException ex) { + catchConnectionProblem(ex); + continue; +diff -r 76d51071af8a -r af9499d919b8 uihandler/src/org/netbeans/modules/uihandler/UnknownHostException.html +--- a/uihandler/src/org/netbeans/modules/uihandler/UnknownHostException.html Fri Nov 07 11:48:18 2008 +0100 ++++ b/uihandler/src/org/netbeans/modules/uihandler/UnknownHostException.html Tue Mar 10 13:53:55 2009 +0300 +@@ -1,17 +1,20 @@ +- +- ++ ++ ++ + + +- UI Gestures Collector +- +- +-

      Welcome to the UI Gestures Collector

      +-

      ++ UI Gestures Collector ++ ++ ++

      Welcome to the UI Gestures Collector

      ++

      + This is the entry page to the world of statistics. The UI Gestures Collector + is a portal that allows you to find new tips on how to use NetBeans, + discover what developers using the same technologies do the most, and + also submit feedback to the NetBeans development team. +-

      ++

      + +

      + The basic idea is that you tell the server what you do, and the server, +@@ -37,10 +40,10 @@ +

      + + +- ++ + + +
      + +- +- ++ ++ +diff -r 76d51071af8a -r af9499d919b8 updatecenters/src/org/netbeans/modules/updatecenters/resources/Bundle.properties +--- a/updatecenters/src/org/netbeans/modules/updatecenters/resources/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/updatecenters/src/org/netbeans/modules/updatecenters/resources/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -52,8 +52,8 @@ + Services/AutoupdateType/thirdparty-update-provider.instance=3rd Party Plugins + Services/AutoupdateType/pluginportal-update-provider.instance=Plugin Portal + #NOI18N +-URL_Standard=http://updates.netbeans.org/netbeans/updates/6.5/uc/final/stable/catalog.xml.gz?{$netbeans.hash.code} +-URL_Beta=http://updates.netbeans.org/netbeans/updates/6.5/uc/final/beta/catalog.xml.gz?{$netbeans.hash.code} +-URL_ThirdParty=http://updates.netbeans.org/netbeans/updates/6.5/uc/final/thirdparty/catalog.xml.gz?{$netbeans.hash.code} ++URL_Standard=http://updates.netbeans.org/netbeans/updates/6.5.1/uc/final/stable/catalog.xml.gz?{$netbeans.hash.code} ++URL_Beta=http://updates.netbeans.org/netbeans/updates/6.5.1/uc/final/beta/catalog.xml.gz?{$netbeans.hash.code} ++URL_ThirdParty=http://updates.netbeans.org/netbeans/updates/6.5.1/uc/final/thirdparty/catalog.xml.gz?{$netbeans.hash.code} + URL_PluginPortal=http://plugins.netbeans.org/nbpluginportal/updates/6.5/catalog.xml.gz + +diff -r 76d51071af8a -r af9499d919b8 versioning.system.cvss/nbproject/project.properties +--- a/versioning.system.cvss/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/versioning.system.cvss/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -40,7 +40,7 @@ + javac.source=1.5 + javadoc.name=CVS Versioning System + javadoc.arch=${basedir}/arch.xml +-spec.version.base=1.11.1 ++spec.version.base=1.11.2 + + # copy paste magic to enable unit tests + test.unit.src.dir=${basedir}/test/unit/src +diff -r 76d51071af8a -r af9499d919b8 versioning.system.cvss/nbproject/project.xml +--- a/versioning.system.cvss/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/versioning.system.cvss/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -69,7 +69,7 @@ + + + 1 +- 1.0 ++ 1.17.3 + + + +diff -r 76d51071af8a -r af9499d919b8 versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Bundle.properties +--- a/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/versioning.system.cvss/src/org/netbeans/modules/versioning/system/cvss/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -40,7 +40,11 @@ + OpenIDE-Module-Name=CVS + OpenIDE-Module-Display-Category=Base IDE + OpenIDE-Module-Short-Description=Integrates CVS actions into IDE workflow. +-OpenIDE-Module-Long-Description=Introduces project level CVS (Concurrent Versioning System) features. Version control actions, such as diff, update, and commit aid in streamlining typical team development cycles. ++OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ ++ Introduces project level CVS (Concurrent Versioning System) features. Version control actions, such as diff, update, and commit aid in streamlining typical team development cycles. + + CTL_CVS_DisplayName = CVS + CTL_CVS_MainMenu = &CVS +diff -r 76d51071af8a -r af9499d919b8 versioning/nbproject/project.properties +--- a/versioning/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/versioning/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -41,7 +41,7 @@ + javac.source=1.5 + + javadoc.name=Versioning +-spec.version.base=1.8.1 ++spec.version.base=1.8.2 + is.autoload=true + + javadoc.arch=${basedir}/arch.xml +diff -r 76d51071af8a -r af9499d919b8 versioning/src/org/netbeans/modules/versioning/diff/DiffSidebar.java +--- a/versioning/src/org/netbeans/modules/versioning/diff/DiffSidebar.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/versioning/src/org/netbeans/modules/versioning/diff/DiffSidebar.java Tue Mar 10 13:53:55 2009 +0300 +@@ -116,6 +116,7 @@ + + private RequestProcessor.Task refreshDiffTask; + private VersioningSystem ownerVersioningSystem; ++ private File tempFolder; + + public DiffSidebar(JTextComponent target, File file) { + this.textComponent = target; +@@ -426,7 +427,7 @@ + + private void initialize() { + assert SwingUtilities.isEventDispatchThread(); +- ++ + document.addDocumentListener(this); + textComponent.addComponentListener(this); + foldHierarchy.addFoldHierarchyListener(this); +@@ -439,6 +440,10 @@ + private void shutdown() { + assert SwingUtilities.isEventDispatchThread(); + ++ if(tempFolder != null) { ++ Utils.deleteRecursively(tempFolder); ++ } ++ + if (fileObject != null) { + fileObject.removeFileChangeListener(this); + } +@@ -728,9 +733,13 @@ + if (vs == null) return null; + File mainFile = FileUtil.toFile(fileObject); + if (mainFile == null) return null; +- +- File tempFolder = Utils.getTempFolder(); +- ++ ++ if(tempFolder != null) { ++ Utils.deleteRecursively(tempFolder); ++ } ++ tempFolder = Utils.getTempFolder(); ++ tempFolder.deleteOnExit(); ++ + Set filesToCheckout = new HashSet(2); + filesToCheckout.add(mainFile); + DataObject dao = null; +@@ -750,6 +759,7 @@ + try { + for (File file : filesToCheckout) { + File originalFile = new File(tempFolder, file.getName()); ++ originalFile.deleteOnExit(); + vs.getOriginalFile(file, originalFile); + originalFiles.add(originalFile); + } +@@ -764,7 +774,6 @@ + if(encodinqQuery != null) { + encodinqQuery.resetEncodingForFiles(originalFiles); + } +- Utils.deleteRecursively(tempFolder); + } + } + +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.kit/manifest.mf +--- a/websvc.saas.kit/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.kit/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,5 @@ + Manifest-Version: 1.0 + OpenIDE-Module: org.netbeans.modules.websvc.saas.kit + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/kit/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.0.1 ++OpenIDE-Module-Specification-Version: 1.0.2 + AutoUpdate-Show-In-Client: true +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.kit/nbproject/project.xml +--- a/websvc.saas.kit/nbproject/project.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.kit/nbproject/project.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -52,13 +52,13 @@ + + org.netbeans.modules.websvc.saas.services.google + +- 1.0 ++ 1.1.2 + + + + org.netbeans.modules.websvc.saas.services.strikeiron + +- 1.0 ++ 1.1.2 + + + +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.kit/src/org/netbeans/modules/websvc/saas/kit/Bundle.properties +--- a/websvc.saas.kit/src/org/netbeans/modules/websvc/saas/kit/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.kit/src/org/netbeans/modules/websvc/saas/kit/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -1,5 +1,9 @@ + OpenIDE-Module-Display-Category=Java, Web, Java EE & PHP + OpenIDE-Module-Name=SaaS Services Support + OpenIDE-Module-Short-Description=Provides support for consuming SaaS services. +-OpenIDE-Module-Long-Description=Provides support for consuming SaaS services. ++OpenIDE-Module-Long-Description=\ ++For the list of included fixed bugs please check http://wiki.netbeans.org/NetBeans6.5PatchesInfo. \ ++
      \ ++
      \ ++Provides support for consuming SaaS services. + +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.services.google/manifest.mf +--- a/websvc.saas.services.google/manifest.mf Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.services.google/manifest.mf Tue Mar 10 13:53:55 2009 +0300 +@@ -2,6 +2,6 @@ + OpenIDE-Module: org.netbeans.modules.websvc.saas.services.google + OpenIDE-Module-Layer: org/netbeans/modules/websvc/saas/services/google/layer.xml + OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/websvc/saas/services/google/Bundle.properties +-OpenIDE-Module-Specification-Version: 1.1.1 ++OpenIDE-Module-Specification-Version: 1.1.2 + AutoUpdate-Show-In-Client: false + +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.services.google/src/org/netbeans/modules/websvc/saas/services/google/resources/GoogleMap.xml +--- a/websvc.saas.services.google/src/org/netbeans/modules/websvc/saas/services/google/resources/GoogleMap.xml Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.services.google/src/org/netbeans/modules/websvc/saas/services/google/resources/GoogleMap.xml Tue Mar 10 13:53:55 2009 +0300 +@@ -58,7 +58,7 @@ + + + +- ++ + + 0) { ++ Node node = list.item(0); ++ // Now that we have the desired element, delegate to JAXB. ++ JAXBContext jc = JAXBContext.newInstance("com.strikeiron.search"); ++ Unmarshaller unmarshaller = jc.createUnmarshaller(); ++ SearchResponse resp = (SearchResponse) unmarshaller.unmarshal(node); ++ return resp.getSearchResult(); ++ } ++ } catch (JAXBException jbe) { ++ throw new SearchException(jbe); ++ } catch (MalformedURLException mue) { ++ throw new SearchException(mue); ++ } catch (ParserConfigurationException pce) { ++ throw new SearchException(pce); ++ } catch (SAXException se) { ++ throw new SearchException(se); ++ } catch (IOException ioe) { ++ throw new SearchException(ioe); ++ } ++ return null; ++ } ++ ++ /** ++ * A wrapper around the various exceptions that can occur when invoking ++ * the StrikeIron search web service. Get the nested cause exception for ++ * the pertinent details on the error. ++ */ ++ public static class SearchException extends Exception { ++ private static final long serialVersionUID = 1L; ++ ++ public SearchException(Throwable cause) { ++ super(cause); ++ } ++ } ++} +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/actions/Bundle.properties +--- a/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/actions/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/actions/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -37,4 +37,4 @@ + # Version 2 license, then the option applies only if the new code is + # made subject to such option by the copyright holder. + +-LBL_FindStrikeIronServices=Find StrikeIron Services ++LBL_FindStrikeIronServices=Find StrikeIron Services... +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/Bundle.properties +--- a/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/Bundle.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/Bundle.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -151,8 +151,6 @@ + FindServiceUI.jlAuthenticationMode.text=Authentication Mode: + FindServiceUI.settingsPanel.TabConstraints.tabTitle=Settings + FindServiceUI.bSearch.text=Search +-FindServiceUI.addButton.label=Add +-FindServiceUI.addButton.actionCommand=Add + FindServiceUI.addButton.text=Add + +-MSG_ClickToOverride= +\ No newline at end of file ++MSG_ClickToOverride= +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/FindServiceUI.form +--- a/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/FindServiceUI.form Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/FindServiceUI.form Tue Mar 10 13:53:55 2009 +0300 +@@ -4,6 +4,7 @@ + + + ++ + + + +@@ -21,9 +22,9 @@ + + + +- +- +- ++ ++ ++ + + + +@@ -54,7 +55,7 @@ + + + +- ++ + + + +@@ -76,9 +77,9 @@ + + + +- ++ + +- ++ + + + +@@ -95,9 +96,9 @@ + + + +- ++ + +- ++ + + + +@@ -113,7 +114,7 @@ + + + +- ++ + + + +@@ -186,7 +187,7 @@ + + + +- ++ + + + +@@ -208,14 +209,11 @@ + + + +- +- +- + + +- ++ + +- ++ + + + +@@ -232,8 +230,8 @@ + + + +- +- ++ ++ + + + +@@ -252,7 +250,7 @@ + + + +- ++ + + + +@@ -261,14 +259,14 @@ + + + +- ++ + + + + + + +- ++ + + + +@@ -298,6 +296,9 @@ + + + ++ ++ ++ + + + +@@ -306,7 +307,7 @@ + + + +- ++ + + + +@@ -317,13 +318,7 @@ + + + +- +- +- +- +- +- +- ++ + + + +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/FindServiceUI.java +--- a/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/FindServiceUI.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/FindServiceUI.java Tue Mar 10 13:53:55 2009 +0300 +@@ -1,7 +1,42 @@ + /* +- * FindServiceUI.java ++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + * +- * Created on October 31, 2007, 2:42 PM ++ * Copyright 1997-2007 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-2007 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.websvc.saas.services.strikeiron.ui; +@@ -19,7 +54,6 @@ + import javax.swing.event.ListSelectionListener; + import org.netbeans.api.progress.ProgressHandle; + import org.netbeans.api.progress.ProgressHandleFactory; +-import org.netbeans.modules.websvc.saas.spi.ServiceData; + import org.netbeans.modules.websvc.saas.spi.websvcmgr.WsdlServiceData; + import org.netbeans.modules.websvc.saas.util.WsdlUtil; + import org.openide.util.Cancellable; +@@ -30,7 +64,7 @@ + * @author nam + */ + public class FindServiceUI extends javax.swing.JPanel { +- ++ private static final long serialVersionUID = 1L; + private ProgressHandle progressHandle; + private JComponent progressComponent; + private boolean jaxrpcWarned = false; +@@ -208,8 +242,8 @@ + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(bSearch) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) +- .add(progressContainerPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 277, Short.MAX_VALUE)) +- .add(org.jdesktop.layout.GroupLayout.TRAILING, spTab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 580, Short.MAX_VALUE)) ++ .add(progressContainerPanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 423, Short.MAX_VALUE)) ++ .add(org.jdesktop.layout.GroupLayout.TRAILING, spTab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 744, Short.MAX_VALUE)) + .addContainerGap()) + ); + searchPanelLayout.setVerticalGroup( +@@ -221,18 +255,12 @@ + .add(bSearch, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 19, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(progressContainerPanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) +- .add(spTab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 270, Short.MAX_VALUE) ++ .add(spTab, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 224, Short.MAX_VALUE) + .addContainerGap()) + ); + + tpTabs.addTab(org.openide.util.NbBundle.getMessage(FindServiceUI.class, "FindServiceUI.searchPanel.TabConstraints.tabTitle"), searchPanel); // NOI18N + +- settingsPanel.addMouseListener(new java.awt.event.MouseAdapter() { +- public void mousePressed(java.awt.event.MouseEvent evt) { +- settingsPanelMousePressed(evt); +- } +- }); +- + jlAuthenticationMode.setText(org.openide.util.NbBundle.getMessage(FindServiceUI.class, "FindServiceUI.jlAuthenticationMode.text")); // NOI18N + + jlSortBy.setText(org.openide.util.NbBundle.getMessage(FindServiceUI.class, "FindServiceUI.jlSortBy.text")); // NOI18N +@@ -262,8 +290,8 @@ + .add(jlSortBy)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(settingsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) +- .add(cbSortBy, 0, 467, Short.MAX_VALUE) +- .add(cbAuthenticationMode, 0, 467, Short.MAX_VALUE)) ++ .add(cbSortBy, 0, 607, Short.MAX_VALUE) ++ .add(cbAuthenticationMode, 0, 607, Short.MAX_VALUE)) + .addContainerGap()) + ); + settingsPanelLayout.setVerticalGroup( +@@ -277,7 +305,7 @@ + .add(settingsPanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) + .add(jlSortBy) + .add(cbSortBy, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)) +- .addContainerGap(249, Short.MAX_VALUE)) ++ .addContainerGap(226, Short.MAX_VALUE)) + ); + + tpTabs.addTab(org.openide.util.NbBundle.getMessage(FindServiceUI.class, "FindServiceUI.settingsPanel.TabConstraints.tabTitle"), settingsPanel); // NOI18N +@@ -289,8 +317,6 @@ + cancelButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); + + addButton.setText(org.openide.util.NbBundle.getMessage(FindServiceUI.class, "FindServiceUI.addButton.text")); // NOI18N +- addButton.setActionCommand(org.openide.util.NbBundle.getMessage(FindServiceUI.class, "FindServiceUI.addButton.actionCommand")); // NOI18N +- addButton.setLabel(org.openide.util.NbBundle.getMessage(FindServiceUI.class, "FindServiceUI.addButton.label")); // NOI18N + addButton.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM); + + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); +@@ -300,12 +326,12 @@ + .add(layout.createSequentialGroup() + .addContainerGap() + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) +- .add(labelDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 611, Short.MAX_VALUE) +- .add(tpTabs, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 611, Short.MAX_VALUE) ++ .add(labelDescription, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 807, Short.MAX_VALUE) ++ .add(tpTabs, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 807, Short.MAX_VALUE) + .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup() +- .add(statusMessage, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 449, Short.MAX_VALUE) +- .add(16, 16, 16) +- .add(addButton, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 67, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) ++ .add(statusMessage, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 638, Short.MAX_VALUE) ++ .add(8, 8, 8) ++ .add(addButton) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED) + .add(cancelButton))) + .addContainerGap()) +@@ -350,10 +376,6 @@ + getModel().setSortBy((SORTBY)cbSortBy.getSelectedItem()); + }//GEN-LAST:event_cbSortByActionPerformed + +- private void settingsPanelMousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_settingsPanelMousePressed +- // TODO add your handling code here: +- }//GEN-LAST:event_settingsPanelMousePressed +- + private void tpTabsStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_tpTabsStateChanged + if (settingsPanel.isShowing()) { + addButton.setEnabled(false); +diff -r 76d51071af8a -r af9499d919b8 websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/ServiceTableModel.java +--- a/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/ServiceTableModel.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/websvc.saas.services.strikeiron/src/org/netbeans/modules/websvc/saas/services/strikeiron/ui/ServiceTableModel.java Tue Mar 10 13:53:55 2009 +0300 +@@ -43,32 +43,22 @@ + + import com.strikeiron.search.AUTHENTICATIONSTYLE; + import com.strikeiron.search.ArrayOfMarketPlaceService; +-import com.strikeiron.search.LicenseInfo; + import com.strikeiron.search.MarketPlaceService; +-import com.strikeiron.search.ObjectFactory; +-import com.strikeiron.search.RegisteredUser; +-import com.strikeiron.search.SISearchService; +-import com.strikeiron.search.SISearchServiceSoap; + import com.strikeiron.search.SORTBY; + import com.strikeiron.search.SearchOutPut; +-//FIXME - Refactor +-//import com.sun.xml.ws.developer.WSBindingProvider; + import java.io.File; + import java.io.FileInputStream; + import java.io.IOException; +-import java.net.URL; + import java.util.ArrayList; + import java.util.EventListener; + import java.util.HashSet; + import java.util.List; + import java.util.Properties; + import java.util.Set; +-import java.util.logging.Level; +-import java.util.logging.Logger; + import javax.swing.event.ChangeEvent; + import javax.swing.table.DefaultTableModel; + import javax.xml.namespace.QName; +-import org.netbeans.modules.websvc.saas.spi.ServiceData; ++import org.netbeans.modules.websvc.saas.services.strikeiron.StrikeIronSearch; + import org.netbeans.modules.websvc.saas.spi.websvcmgr.WsdlServiceData; + import org.netbeans.modules.websvc.saas.spi.websvcmgr.WsdlServiceProxyDescriptor; + import org.openide.util.NbBundle; +@@ -79,6 +69,7 @@ + * @author nam + */ + public class ServiceTableModel extends DefaultTableModel { ++ private static final long serialVersionUID = 1L; + public static final QName SI_SEARCH_SERVICE = new QName("http://www.strikeiron.com", "SISearchService"); + public static final String STRIKE_IRON_HOME = WsdlServiceProxyDescriptor.WEBSVC_HOME + "/strikeiron"; + public static final String SEARCH_PROPERTIES = "search.properties"; +@@ -93,12 +84,11 @@ + static final int COLUMN_SELECT = 0; + + private String wsdlLocation; +- private String userId = "Sun_Search@strikeiron.com"; +- private String password = "SearchSun.01"; ++ private String userId; ++ private String password; + private AUTHENTICATIONSTYLE authenticationStyle = AUTHENTICATIONSTYLE.SIMPLE_PARAM; + private Boolean useCustomWSDL = Boolean.TRUE; + private SORTBY sortBy = SORTBY.NAME; +- private SISearchService sservice; + private List result; + + private String status; +@@ -149,27 +139,11 @@ + public void setSortBy(SORTBY v) { + sortBy = v; + } +- +- private String getUserId() { +- return userId; +- } +- +- private String getPassword() { +- return password; +- } +- +- public String getSearchServiceUrl() { +- return getWsdlLocation().toExternalForm(); +- } + + public WsdlServiceData getService(int row) { + return result.get(row); + } + +- public static final String SEARCH_COMPLETE = "searchCompleted"; +- public static final String SEARCH_CANCELLED = "searchCancelled"; +- public static final String SEARCH_ERROR = "searchError"; +- + public interface SearchListener extends EventListener { + void searchCompleted(ChangeEvent e); + void serviceSelectionChanged(ChangeEvent e); +@@ -228,18 +202,6 @@ + return warnsOrErrors; + } + +- private URL getWsdlLocation() { +- if (wsdlLocation == null) { +- return null; +- } +- try { +- return new URL(wsdlLocation); +- } catch(Exception ex) { +- Logger.global.log(Level.WARNING, ex.getLocalizedMessage(), ex); +- return null; +- } +- } +- + private List convertResult(List rawResult) { + List converted = new ArrayList(); + if (rawResult != null) { +@@ -273,52 +235,31 @@ + fireTableDataChanged(); + + try { +- // init service only when needed to avoid unecessary internet access +- if (sservice == null) { +- URL url = getWsdlLocation(); +- if (url == null) { +- sservice = new SISearchService(); +- } else { +- sservice = new SISearchService(url, SI_SEARCH_SERVICE); ++ SearchOutPut output = StrikeIronSearch.search(userId, password, ++ searchTerm, sortBy, useCustomWSDL, authenticationStyle); ++ if (output != null) { ++ ArrayOfMarketPlaceService amps = output.getStrikeIronWebServices(); ++ if (amps != null) { ++ result = convertResult(output.getStrikeIronWebServices().getMarketPlaceService()); ++ } ++ if (output.getServiceStatus() != null) { ++ String msg = output.getServiceStatus().getStatusDescription(); ++ if (msg == null || msg.trim().length() == 0 || msg.startsWith("Found")) { //NOI18N ++ setStatusMessage(NbBundle.getMessage(ServiceTableModel.class, "MSG_Found", result.size())); ++ } else { ++ setErrorMessage(NbBundle.getMessage(ServiceTableModel.class, "MSG_ERROR", msg)); ++ } + } + } +- SISearchServiceSoap port = sservice.getSISearchServiceSoap(); +- setHeaderParameters(port); +- //FIXME - Refactor +-// SearchOutPut output = port.search(searchTerm, sortBy, useCustomWSDL, authenticationStyle); +-// if (output != null) { +-// ArrayOfMarketPlaceService amps = output.getStrikeIronWebServices(); +-// if (amps != null) { +-// result = convertResult(output.getStrikeIronWebServices().getMarketPlaceService()); +-// } +-// } +-// if (output != null && output.getServiceStatus() != null) { +-// String msg = output.getServiceStatus().getStatusDescription(); +-// if (msg == null || msg.trim().length() == 0 || msg.startsWith("Found")) { //NOI18N +-// setStatusMessage(NbBundle.getMessage(ServiceTableModel.class, "MSG_Found", result.size())); +-// } else { +-// setErrorMessage(NbBundle.getMessage(ServiceTableModel.class, "MSG_ERROR", msg)); +-// } +-// } + fireTableDataChanged(); + } catch (Exception ex) { + setErrorMessage(ex.getLocalizedMessage()); ++ ex.printStackTrace(); + } finally { + fireSearchEnded(); + searchTask = null; + } + } +- +- private void setHeaderParameters(SISearchServiceSoap port) { +- RegisteredUser ru = new RegisteredUser(); +- ru.setUserID(userId); +- ru.setPassword(password); +- LicenseInfo li = new LicenseInfo(); +- li.setRegisteredUser(ru); +- //FIXME - Refactor +-// WSBindingProvider bp = (WSBindingProvider) port; +-// bp.setOutboundHeaders(new ObjectFactory().createLicenseInfo(li)); +- } + + @Override + public int getColumnCount() { +diff -r 76d51071af8a -r af9499d919b8 xml.text/nbproject/project.properties +--- a/xml.text/nbproject/project.properties Fri Nov 07 11:48:18 2008 +0100 ++++ b/xml.text/nbproject/project.properties Tue Mar 10 13:53:55 2009 +0300 +@@ -38,7 +38,7 @@ + # made subject to such option by the copyright holder. + + javac.source=1.5 +-spec.version.base=1.16.1 ++spec.version.base=1.16.2 + + test.unit.cp.extra=${openide.dir}/core/openide.jar:${openide.loaders.dir}/core/openide-loaders.jar + test.unit.run.cp.extra=${test.unit.cp.extra} +diff -r 76d51071af8a -r af9499d919b8 xml.text/src/org/netbeans/modules/xml/text/bracematch/XMLBraceMatcher.java +--- a/xml.text/src/org/netbeans/modules/xml/text/bracematch/XMLBraceMatcher.java Fri Nov 07 11:48:18 2008 +0100 ++++ b/xml.text/src/org/netbeans/modules/xml/text/bracematch/XMLBraceMatcher.java Tue Mar 10 13:53:55 2009 +0300 +@@ -50,6 +50,7 @@ + import org.netbeans.api.xml.lexer.XMLTokenId; + import org.netbeans.spi.editor.bracesmatching.BracesMatcher; + import org.netbeans.spi.editor.bracesmatching.MatcherContext; ++import org.netbeans.spi.editor.bracesmatching.support.BracesMatcherSupport; + + /** + * The brace matching algorithm is invokes by the brace matcher framework. +@@ -74,11 +75,14 @@ + private static final String DECLARATION_START = ""; //NOI18N + +- int searchOffset; +- javax.swing.text.Document document; ++ private int searchOffset; ++ private javax.swing.text.Document document; ++ private MatcherContext context; ++ private BracesMatcher defaultMatcher; + + public XMLBraceMatcher(MatcherContext context) { + this(context.getDocument(), context.getSearchOffset()); ++ this.context = context; + } + + //so that we could use it from unit test code +@@ -93,12 +97,12 @@ + return null; + } + //so that we could use this from unit tests +- try { +- return doFindOrigin(); +- } catch (Exception e) { +- //do nothing +- } +- return null; ++ int[] origin = doFindOrigin(); ++ if(origin != null) ++ return origin; ++ ++ defaultMatcher = BracesMatcherSupport.defaultMatcher(context, -1, -1); ++ return defaultMatcher.findOrigin(); + } + + public int[] doFindOrigin() throws InterruptedException, BadLocationException { +@@ -157,13 +161,12 @@ + if (MatcherContext.isTaskCanceled()) { + return null; + } +- try { +- //so that we could use this from unit tests +- return doFindMatches(); +- } catch (Exception e) { +- //do nothing ++ ++ if(defaultMatcher != null) { ++ return defaultMatcher.findMatches(); + } +- return null; ++ ++ return doFindMatches(); + } + + public int[] doFindMatches() throws InterruptedException, BadLocationException {