diff --git a/eclipse-ebz548211-2.patch b/eclipse-ebz548211-2.patch new file mode 100644 index 0000000..d082dd4 --- /dev/null +++ b/eclipse-ebz548211-2.patch @@ -0,0 +1,114 @@ +From 9ecc34bf838eae50a356b20c76d35fb62a423563 Mon Sep 17 00:00:00 2001 +From: Stephan Herrmann +Date: Tue, 18 Jun 2019 16:28:49 +0200 +Subject: Bug 548211 - "Remove" in the Module dependencies tab does not remove + system modules + +- more fixes, concerning update on Apply and re-open with only java.base + +Change-Id: I39a7a1da6c8ae733010009372fd36a88814e4faf +--- + .../ui/wizards/buildpaths/BuildPathsBlock.java | 3 +++ + .../ui/wizards/buildpaths/CPListElement.java | 24 +++++++++++++++------- + .../wizards/buildpaths/ModuleDependenciesPage.java | 13 ++++++++++++ + 3 files changed, 33 insertions(+), 7 deletions(-) + +diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java +index 3fec77d579..37229a834b 100644 +--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java ++++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/BuildPathsBlock.java +@@ -395,6 +395,9 @@ public class BuildPathsBlock { + } + + protected void doUpdateUI() { ++ if (fModulesPage.needReInit()) { ++ init(fCurrJProject, null, null); // extent of system modules was changed, re-init fClassPathList ++ } + fBuildPathDialogField.refresh(); + fClassPathList.refresh(); + boolean is9OrHigherAfter= JavaModelUtil.is9OrHigher(fCurrJProject); +diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java +index a3c475e7ea..c670c0770f 100644 +--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java ++++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/CPListElement.java +@@ -42,6 +42,7 @@ import org.eclipse.jdt.core.IModuleDescription; + import org.eclipse.jdt.core.IPackageFragmentRoot; + import org.eclipse.jdt.core.JavaCore; + import org.eclipse.jdt.core.JavaModelException; ++import org.eclipse.jdt.core.provisional.JavaModelAccess; + + + import org.eclipse.jdt.internal.corext.util.JavaModelUtil; +@@ -207,13 +208,22 @@ public class CPListElement { + boolean modulesAdded= false; + if (containerEntry != null) { + IPackageFragmentRoot[] fragmentRoots= fProject.findPackageFragmentRoots(containerEntry); +- if (fragmentRoots != null && fragmentRoots.length > 1) { +- for (IPackageFragmentRoot fragmentRoot : fragmentRoots) { +- IModuleDescription currModule= fragmentRoot.getModuleDescription(); +- if (currModule != null) { +- CPListElement curr= create(this, pseudoEntry, currModule, true, fProject); +- fChildren.add(curr); +- modulesAdded= true; ++ if (fragmentRoots != null) { ++ // detect if system library: ++ boolean addChildren= false; ++ if (fragmentRoots.length > 0) { ++ IModuleDescription module= fragmentRoots[0].getModuleDescription(); ++ if (module != null && JavaModelAccess.isSystemModule(module)) ++ addChildren= true; ++ } ++ if (addChildren) { ++ for (IPackageFragmentRoot fragmentRoot : fragmentRoots) { ++ IModuleDescription currModule= fragmentRoot.getModuleDescription(); ++ if (currModule != null) { ++ CPListElement curr= create(this, pseudoEntry, currModule, true, fProject); ++ fChildren.add(curr); ++ modulesAdded= true; ++ } + } + } + } +diff --git a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ModuleDependenciesPage.java b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ModuleDependenciesPage.java +index b813d22956..e9f1c9feff 100644 +--- a/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ModuleDependenciesPage.java ++++ b/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/buildpaths/ModuleDependenciesPage.java +@@ -164,6 +164,7 @@ public class ModuleDependenciesPage extends BuildPathBasePage { + private Collection fAllDefaultSystemModules; // if current is unnamed module: transitive closure of default root modules (names) + + public final Map fPatchMap= new HashMap<>(); ++ private boolean needReInit= false; + + public ModuleDependenciesPage(IStatusChangeListener context, CheckedListDialogField classPathList) { + fClassPathList= classPathList; +@@ -530,6 +531,7 @@ public class ModuleDependenciesPage extends BuildPathBasePage { + } + updateLimitModules(cpListElement.findAttributeElement(CPListElement.MODULE)); + fModuleList.refresh(); ++ this.needReInit= true; + } + + public void addToSystemModules(List modulesToAdd) throws JavaModelException { +@@ -655,8 +657,19 @@ public class ModuleDependenciesPage extends BuildPathBasePage { + } + } + } ++ this.needReInit= true; + } + ++ /** Destructively reed the needReInit flag. ++ * @return {@code true} if the classpath needs to be reinitialized due to change of extent of the system library ++ */ ++ public boolean needReInit() { ++ try { ++ return this.needReInit; ++ } finally { ++ this.needReInit= false; ++ } ++ } + private Set computeForwardClosure(List seeds) { + Set closure= new HashSet<>(); + collectForwardClosure(seeds, closure); +-- +cgit v1.2.1 + diff --git a/eclipse.spec b/eclipse.spec index e026a1f..a5bc453 100644 --- a/eclipse.spec +++ b/eclipse.spec @@ -41,7 +41,7 @@ Epoch: 1 Summary: An open, extensible IDE Name: eclipse Version: 4.12 -Release: 1%{?dist} +Release: 2%{?dist} License: EPL-2.0 URL: http://www.eclipse.org/ @@ -120,9 +120,10 @@ Patch25: eclipse-patch-out-fileupload-dep.patch # See https://bugs.eclipse.org/bugs/show_bug.cgi?id=548211 Patch26: eclipse-ebz548211.patch +Patch27: eclipse-ebz548211-2.patch # See https://bugs.eclipse.org/bugs/show_bug.cgi?id=542708 -Patch27: eclipse-ebz542708.patch +Patch28: eclipse-ebz542708.patch # Upstream no longer supports non-64bit arches ExcludeArch: s390 %{arm} %{ix86} @@ -411,6 +412,7 @@ rm -rf rt.equinox.binaries/org.eclipse.equinox.executable/{bin,contributed}/ %patch25 %patch26 -p1 %patch27 -p1 +%patch28 -p1 # Optional (unused) multipart support (see patch 25) rm rt.equinox.bundles/bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/multipart/MultipartSupport{Impl,FactoryImpl,Part}.java @@ -1100,6 +1102,9 @@ echo "%{version}-%{release}" > %{buildroot}%{_eclipsedir}/.pkgs/Distro%{?dist} %{_eclipsedir}/plugins/org.eclipse.osgi.util_* %changelog +* Wed Jun 19 2019 Mat Booth - 1:4.12-2 +- Additional fixes for ebz548211 + * Mon Jun 17 2019 Mat Booth - 1:4.12-1 - Update to 2019-06 release