Commits

Anonymous committed 559e5e7 Merge

merged some fixes not destined for 6.8

Comments (0)

Files changed (7)

apisupport.harness/release/README

 subfolder. 
 
 
-UPGRADING FROM NETBEANS 5.x
----------------------------
-
-Upgrading from NetBeans 5.x (including 5.0, 5.0 with Update 1 of the module
-development support, and 5.5) is trivial. If you do not need to specify test
-dependencies, you do not need to do anything. If you do:
-
-1. Make sure you are using a 5.0u2+ harness.
-
-2. Execute the 'fix-test-dependencies' Ant target for your module project. It
-will switch your project.xml to the /3 schema. Test dependencies defined in
-${test.unit.cp.extra} and/or ${test.unit.run.cp.extra} in project.properties are
-moved to <test-dependencies> in project.xml. Only dependencies which do not
-correspond to modules will be left as is.
-
-UPGRADING FROM NETBEANS 4.0/4.1
--------------------------------
-
-Upgrading an NBM project from an older 4.x version of NetBeans is not trivial
-but should not pose too much difficulty once you get the hang of it. (A tool may
-be provided in the future to do it for you.)
-
-1. Switch to the /2 or /3 XML schema for project.xml *and validate the result*
-to make sure it is syntactically correct. Delete any <javadoc/> element.
-
-2. Delete the <path> element from project.xml. Add <suite-component/> or
-<standalone/> for an external module.
-
-3. For externally located modules in a suite, create a module suite project and
-refer to it from suite.properties; for standalone external modules, just create
-platform.properties with "nbplatform.active=default". Delete build.xml and open
-the project to create a default version (which you can edit as needed to
-override some targets); opening the project should also make you a
-build-impl.xml and set 'user.properties.file' in suite-private.properties or
-platform-private.properties.
-
-4. Some targets that used to be defined in projectized.xml are now imported
-indirectly from common.xml, so overrides like
-
-    <target name="compile" depends="projectized.compile">...</target>
-
-must be changed to
-
-    <target name="compile" depends="projectized-common.compile">...</target>
-
-Targets currently moved to common.xml:
-
-    -pre-debug-fix
-    arch
-    arch-nb
-    basic-init
-    clean
-    compile
-    compile-single
-    compile-test-single
-    debug-fix-nb
-    debug-fix-test-nb
-    debug-test-single
-    debug-test-single-nb
-    do-debug-test-single
-    files-init
-    jar (*)
-    jar-prep
-    module-auto-deps
-    module-xml-autoload
-    module-xml-eager
-    module-xml-regular
-    nbm
-    netbeans
-    netbeans-extra
-    reload
-    test
-    test-build
-    test-init
-    test-preinit
-    test-single
-
-(*) 'jar-no-module-deps' and 'jar-with-module-deps' were replaced with just
-'jar'. If you are overriding this target, be sure to use the new
-<jarwithmoduleattributes> task which predefines a number of useful manifest
-attributes for you.
-
-5. Clean out unnecessary stuff from manifest.mf: remove all substituted values
-(@SOMETHING@), and pay attention to these attributes in particular:
-
-5a. OpenIDE-Module-Specification-Version - still OK, but if you import and/or
-export implementation dependencies, you may prefer to define spec.version.base
-in project.properties (see above).
-
-5b. OpenIDE-Module-Implementation-Version - still OK, *if* you are exporting an
-implementation dependency, but now strongly encouraged to be a literal integer.
-
-5c. OpenIDE-Module-Build-Version - delete; it will be inserted by the build
-harness automatically.
-
-5d. Class-Path - delete and use <class-path-extension>s in project.xml instead.
-
-5e. OpenIDE-Module-Module-Dependencies,
-OpenIDE-Module-Public-Packages - you should not have been using these to begin
-with, but if you were, delete them now: the harness generates them for you as
-appropriate.
-
-6. Avoid use of cp.extra in project.properties if possible. In most cases it is
-no longer necessary: any <class-path-extension>s you define, or which are
-defined by a module you declare a compile-time dependency on, will automatically
-be inserted into your classpath for you.
-
-Currently there is no clean way to declare inter-module unit test dependencies,
-but this may be added in the future. For now, use ${test.unit.cp.extra} and/or
-${test.unit.run.cp.extra} (see above).
-
-7. Do not override files-init; it is rarely necessary any more. Instead specify
-extra.module.files in project.properties. Or for files you are just copying
-unmodified, just put them in the correct folder structure beneath a subdirectory
-called "release".
-
-8. Delete any complicated build.xml tricks to handle implementation
-dependencies. Just declare the dependency normally in project.xml using
-<implementation-version/> (and use ${spec.version.base}, above) and you are
-done.
-
-9. Remove any special definitions relating to Rich Unger's "cluster harness",
-which is obsoleted by this new system.
-
-10. Consider using <friend-packages> instead of <public-packages> if you want to
-export a limited API without using implementation dependencies. *Will not work
-in NB 4.1, only 5.0+.*
-
-11. Do not pick an explicit name for your module; accept
-modules/${code.name.base.dashes}.jar. It can be autoload or eager just by
-setting properties in project.properties, without using modules/autoload or
-modules/eager.
-
-12. All properties of the form ${nb.*.dir} were removed and replaced by the
-literal directory name. For example, ${nb.modules.dir} is now just "modules". Be
-careful - some names were tricky, e.g. ${nb.lib.dir} was "core", and
-${nb.bin.dir} and ${nb.lib/ext.dir} were both "lib"!
-
-13. ${netbeans.dest.dir}/${cluster.dir} should be replaced by just ${cluster}.
-
-14. Have fun!
-
-
 ----------------
 Hey Emacs!
 Local Variables:

core.ui/src/org/netbeans/core/ui/sysopen/SystemOpenAction.java

 import org.openide.util.ContextAwareAction;
 import org.openide.util.Lookup;
 import org.openide.util.NbBundle;
+import org.openide.util.RequestProcessor;
 import org.openide.util.Utilities;
 import org.openide.util.actions.Presenter;
 
             if (performer == null) {
                 return;
             }
-            for (File f : files) {
-                try {
-                    performer.open(f);
-                } catch (IOException x) {
-                    Logger.getLogger(SystemOpenAction.class.getName()).log(Level.INFO, null, x);
-                    // XXX or perhaps notify user of problem
+            RequestProcessor.getDefault().post(new Runnable() { // #176879: asynch
+                public void run() {
+                    for (File f : files) {
+                        try {
+                            performer.open(f);
+                        } catch (IOException x) {
+                            Logger.getLogger(SystemOpenAction.class.getName()).log(Level.INFO, null, x);
+                            // XXX or perhaps notify user of problem
+                        }
+                    }
                 }
-            }
+            });
         }
 
         public JMenuItem getPopupPresenter() {

java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEActionProvider.java

                     if (AppletSupport.isApplet(file)) {
 
                         EditableProperties ep = updateHelper.getProperties (AntProjectHelper.PROJECT_PROPERTIES_PATH);
-                        String jvmargs = ep.getProperty("run.jvmargs");
+                        String jvmargs = ep.getProperty(J2SEProjectProperties.RUN_JVM_ARGS);
 
                         URL url = null;
 
                         if ((jvmargs == null) || !(jvmargs.indexOf("java.security.policy") > 0)) {  //NOI18N
                             AppletSupport.generateSecurityPolicy(project.getProjectDirectory());
                             if ((jvmargs == null) || (jvmargs.length() == 0)) {
-                                ep.setProperty("run.jvmargs", "-Djava.security.policy=applet.policy"); //NOI18N
+                                ep.setProperty(J2SEProjectProperties.RUN_JVM_ARGS, "-Djava.security.policy=applet.policy"); //NOI18N
                             } else {
-                                ep.setProperty("run.jvmargs", jvmargs + " -Djava.security.policy=applet.policy"); //NOI18N
+                                ep.setProperty(J2SEProjectProperties.RUN_JVM_ARGS, jvmargs + " -Djava.security.policy=applet.policy"); //NOI18N
                             }
                             updateHelper.putProperties(AntProjectHelper.PROJECT_PROPERTIES_PATH, ep);
                             try {

java.j2seproject/src/org/netbeans/modules/java/j2seproject/J2SEProjectGenerator.java

         ep.setProperty("dist.javadoc.dir", "${dist.dir}/javadoc"); // NOI18N
         ep.setProperty("platform.active", "default_platform"); // NOI18N
 
-        ep.setProperty("run.jvmargs", ""); // NOI18N
-        ep.setComment("run.jvmargs", new String[] {
+        ep.setProperty(J2SEProjectProperties.RUN_JVM_ARGS, ""); // NOI18N
+        ep.setComment(J2SEProjectProperties.RUN_JVM_ARGS, new String[] {
             "# " + NbBundle.getMessage(J2SEProjectGenerator.class, "COMMENT_run.jvmargs"), // NOI18N
             "# " + NbBundle.getMessage(J2SEProjectGenerator.class, "COMMENT_run.jvmargs_2"), // NOI18N
             "# " + NbBundle.getMessage(J2SEProjectGenerator.class, "COMMENT_run.jvmargs_3"), // NOI18N

javahelp/src/org/netbeans/modules/javahelp/JavaHelp.java

             // Issue #168849
             Installer.log.severe(
                "Unable to find a JavaHelp Content Viewer component."); // NOI18N
-            Installer.log.severe("JavaHelp manifest: " +
-                                 getCodeLocation(jh.getClass()) +
-                                 "/META-INF/MANIFEST.MF"); // NOI18N
+            Installer.log.severe("JavaHelp loaded from: " +
+                                 getCodeLocation(jh.getClass())); // NOI18N
             Installer.log.severe("Current thread: " +
                                  Thread.currentThread().toString()); // NOI18N
             return;

openide.filesystems/src/org/openide/filesystems/annotations/LayerBuilder.java

 import javax.tools.Diagnostic.Kind;
 import javax.tools.StandardLocation;
 import org.w3c.dom.Document;
+import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 /**
             org.w3c.dom.Element e = doc.getDocumentElement();
             String[] pieces = path.split("/");
             for (String piece : Arrays.asList(pieces).subList(0, pieces.length - 1)) {
-                org.w3c.dom.Element kid = find(e, piece);
+                org.w3c.dom.Element kid = find(e, piece, "file|folder");
                 if (kid != null) {
                     if (!kid.getNodeName().equals("folder")) {
                         throw new IllegalArgumentException(path);
                 }
             }
             String piece = pieces[pieces.length - 1];
-            org.w3c.dom.Element file = find(e,piece);
+            org.w3c.dom.Element file = find(e, piece, "file|folder");
             if (folder) {
                 if (file == null) {
                     file = (org.w3c.dom.Element) e.appendChild(doc.createElement("folder"));
             }
             file.setAttribute("name", piece);
             for (Map.Entry<String,String[]> entry : attrs.entrySet()) {
+                org.w3c.dom.Element former = find(file, entry.getKey(), "attr");
+                if (former != null) {
+                    file.removeChild(former);
+                }
                 org.w3c.dom.Element attr = (org.w3c.dom.Element) file.appendChild(doc.createElement("attr"));
                 attr.setAttribute("name", entry.getKey());
                 attr.setAttribute(entry.getValue()[0], entry.getValue()[1]);
             return LayerBuilder.this;
         }
 
-        private org.w3c.dom.Element find(org.w3c.dom.Element parent, String name) {
-            NodeList nl = parent.getElementsByTagName("*");
+        private org.w3c.dom.Element find(org.w3c.dom.Element parent, String name, String kindRx) {
+            NodeList nl = parent.getChildNodes();
             for (int i = 0; i < nl.getLength(); i++) {
-                org.w3c.dom.Element e = (org.w3c.dom.Element) nl.item(i);
-                if (e.getAttribute("name").equals(name)) {
+                Node item = nl.item(i);
+                if (item.getNodeType() != Node.ELEMENT_NODE) {
+                    continue;
+                }
+                org.w3c.dom.Element e = (org.w3c.dom.Element) item;
+                if (e.getAttribute("name").equals(name) && e.getNodeName().matches(kindRx)) {
                     return e;
                 }
             }

openide.filesystems/test/unit/src/org/openide/filesystems/annotations/LayerBuilderTest.java

                 "</folder></filesystem>", dump());
     }
 
+    public void testRedundantNames() throws Exception {
+        b.folder("f1/f2").write();
+        b.folder("f2").write();
+        assertEquals("<filesystem><folder name='f1'>" +
+                "<folder name='f2'/>" +
+                "</folder><folder name='f2'/></filesystem>", dump());
+    }
+
+    public void testFolderAttributes() throws Exception {
+        b.folder("f").intvalue("a", 7).write();
+        b.file("f/x").write();
+        b.folder("f").stringvalue("a", "v").write();
+        assertEquals("<filesystem><folder name='f'>" +
+                "<file name='x'/>" +
+                "<attr name='a' stringvalue='v'/>" +
+                "</folder></filesystem>", dump());
+    }
+
 }