rpms/netbeans-platform8/devel netbeans-platform8-6.1-issue_143729.patch, NONE, 1.1 netbeans-platform8.spec, 1.1, 1.2

Victor G. Vasilyev victorv at fedoraproject.org
Mon Sep 22 21:00:10 UTC 2008


Author: victorv

Update of /cvs/pkgs/rpms/netbeans-platform8/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv10868

Modified Files:
	netbeans-platform8.spec 
Added Files:
	netbeans-platform8-6.1-issue_143729.patch 
Log Message:
Patch for the issue http://www.netbeans.org/issues/show_bug.cgi?id=143729


netbeans-platform8-6.1-issue_143729.patch:

--- NEW FILE netbeans-platform8-6.1-issue_143729.patch ---
diff -Nur -x '*.orig' -x '*~' netbeans-6.1/core.startup/test/unit/src/org/netbeans/core/startup/ModuleManagerTest.java netbeans-6.1.new/core.startup/test/unit/src/org/netbeans/core/startup/ModuleManagerTest.java
--- libnb-platform-java-6.1/core.startup/test/unit/src/org/netbeans/core/startup/ModuleManagerTest.java	2008-05-30 03:09:24.000000000 +0400
+++ libnb-platform-java-6.1.new/core.startup/test/unit/src/org/netbeans/core/startup/ModuleManagerTest.java	2008-08-20 19:48:17.000000000 +0400
@@ -439,6 +439,31 @@
             Module m2 = mgr.create(new File(jars, "depends-on-simple-module.jar"), null, false, false, true);
             assertTrue(m1.isEnabled());
             assertTrue(m2.isEnabled());
+        } finally {
+            mgr.mutexPrivileged().exitWriteAccess();
+	}
+    }
+
+    public void testEagerEnablementRobust() throws Exception { // #144005
+        FileObject dir = FileUtil.toFileObject(getWorkDir());
+        assertNotNull(dir);
+        FakeModuleInstaller installer = new FakeModuleInstaller();
+        FakeEvents ev = new FakeEvents();
+        ModuleManager mgr = new ModuleManager(installer, ev);
+        mgr.mutexPrivileged().enterWriteAccess();
+        try {
+            Module eager1 = mgr.create(FileUtil.toFile(TestFileUtils.writeZipFile(dir, "eager1.jar",
+                "META-INF/MANIFEST.MF:OpenIDE-Module: eager1\nOpenIDE-Module-Module-Dependencies: autoload\n\n")), null, false, false, true);
+            assertEquals(Collections.emptySet(), mgr.getEnabledModules());
+            Module autoload = mgr.create(FileUtil.toFile(TestFileUtils.writeZipFile(dir, "autoload.jar",
+                "META-INF/MANIFEST.MF:OpenIDE-Module: autoload\n\n")), null, false, true, false);
+            assertEquals(new HashSet<Module>(Arrays.asList(autoload, eager1)), mgr.getEnabledModules());
+            Module eager2 = mgr.create(FileUtil.toFile(TestFileUtils.writeZipFile(dir, "eager2.jar",
+                "META-INF/MANIFEST.MF:OpenIDE-Module: eager2\nOpenIDE-Module-Module-Dependencies: missing\n\n")), null, false, false, true);
+            assertEquals(new HashSet<Module>(Arrays.asList(autoload, eager1)), mgr.getEnabledModules());
+            Module eager3 = mgr.create(FileUtil.toFile(TestFileUtils.writeZipFile(dir, "eager3.jar",
+                "META-INF/MANIFEST.MF:OpenIDE-Module: eager3\nOpenIDE-Module-Module-Dependencies: autoload\n\n")), null, false, false, true);
+            assertEquals(new HashSet<Module>(Arrays.asList(autoload, eager1, eager3)), mgr.getEnabledModules());
         } finally {
             mgr.mutexPrivileged().exitWriteAccess();
         }
diff -Nur -x '*.orig' -x '*~' netbeans-6.1/o.n.bootstrap/src/org/netbeans/ModuleManager.java netbeans-6.1.new/o.n.bootstrap/src/org/netbeans/ModuleManager.java
--- libnb-platform-java-6.1/o.n.bootstrap/src/org/netbeans/ModuleManager.java	2008-05-30 03:10:46.000000000 +0400
+++ libnb-platform-java-6.1.new/o.n.bootstrap/src/org/netbeans/ModuleManager.java	2008-08-20 19:56:00.000000000 +0400
@@ -511,24 +511,24 @@
                         history, reloadable, autoload, eager, this, ev);
         ev.log(Events.FINISH_CREATE_REGULAR_MODULE, jar);
         subCreate(m);
-        if (m.isEager()) {
-            List<Module> immediate = simulateEnable(Collections.<Module>emptySet());
-            if (!immediate.isEmpty()) {
-                if (!immediate.contains(m)) {
-                    throw new IllegalStateException("Can immediately enable modules " + immediate + ", but not including " + m + "; its problems: " + m.getProblems()); // NOI18N
-                }
-                boolean ok = true;
-		for (Module other: immediate) {
-                    if (!other.isAutoload() && !other.isEager()) {
-                        // Nope, would require a real module to be turned on first.
-                        ok = false;
-                        break;
-                    }
-                }
-                if (ok) {
-                    Util.err.fine("Enabling " + m + " immediately");
-                    enable(Collections.<Module>emptySet());
-                }
+        // Must run eager enablement check for *every* module that is created,
+        // even if it itself is not eager. Otherwise it is possible that an eager
+        // module gets created, followed immediately by one of its dependencies,
+        // and does not get turned on.
+        List<Module> immediate = simulateEnable(Collections.<Module>emptySet());
+        if (!immediate.isEmpty()) {
+            assert immediate.contains(m) : "Can immediately enable modules " + immediate + ", but not including " + m + "; its problems: " + m.getProblems();
+            boolean ok = true;
+            for (Module other: immediate) {
+                if (!other.isAutoload() && !other.isEager()) {
+                    // Nope, would require a real module to be turned on first.
+                    ok = false;
+                    break;
+                }
+            }
+            if (ok) {
+                Util.err.fine("Enabling " + m + " immediately");
+                enable(Collections.<Module>emptySet());
             }
         }
         return m;


Index: netbeans-platform8.spec
===================================================================
RCS file: /cvs/pkgs/rpms/netbeans-platform8/devel/netbeans-platform8.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- netbeans-platform8.spec	8 Sep 2008 16:35:53 -0000	1.1
+++ netbeans-platform8.spec	22 Sep 2008 20:59:40 -0000	1.2
@@ -31,7 +31,7 @@
 
 Name:         %{nb_}-%{nb_platform}
 Version:      %{nb_ver}
-Release:      4%{?dist}
+Release:      5%{?dist}
 Summary:      NetBeans Platform %{nb_platform_ver}
 Group:        Development/Libraries
 License:      GPLv2 with exceptions or CDDL
@@ -42,8 +42,10 @@
 
 Patch0: %{name}-%{version}-build_bootstrap.patch
 Patch1: %{name}-%{version}-properties.patch
-# Issue http://www.netbeans.org/issues/show_bug.cgi?id=134544
+# http://www.netbeans.org/issues/show_bug.cgi?id=134544
 Patch2: %{name}-%{version}-win_launcher.patch
+# http://www.netbeans.org/issues/show_bug.cgi?id=143729
+Patch3: %{name}-%{version}-issue_143729.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildArch: noarch
@@ -120,6 +122,7 @@
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 
@@ -241,6 +244,9 @@
 %doc %{nb_javadoc_dir}/
 
 %changelog
+* Mon Sep 22 2008 Victor Vasilyev <victor.vasilyev at sun.com> 6.1-5
+- Patch3: Issue http://www.netbeans.org/issues/show_bug.cgi?id=143729
+
 * Mon Sep 08 2008 Victor Vasilyev <victor.vasilyev at sun.com> 6.1-4
 - Linking to the external JARs is moved to the %%install script from the %%post scripts
 - Canonical value for %%defattr is used




More information about the fedora-extras-commits mailing list