diff options
author | Andrey Loskutov | 2017-03-10 13:35:03 +0000 |
---|---|---|
committer | Ed Merks | 2017-03-11 10:11:28 +0000 |
commit | a791ac1892cee17f483bb568fefac122391ff1ce (patch) | |
tree | 66b749acefe6b036fd303c4c04bf2d3cf5380621 | |
parent | cc66c993507ade50e4b3a824a3adb4e94c4ac25f (diff) | |
download | org.eclipse.oomph-change/92778/1.tar.gz org.eclipse.oomph-change/92778/1.tar.xz org.eclipse.oomph-change/92778/1.zip |
[513449] Installer fails due the broken unrelated p2 profilechange/92778/1
https://bugs.eclipse.org/bugs/show_bug.cgi?id=513449
Change-Id: Icbc7b950174542dda0cd87633f143972e7b88266
Signed-off-by: Andrey Loskutov <loskutov@gmx.de>
-rw-r--r-- | plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/LazyProfileRegistry.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/LazyProfileRegistry.java b/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/LazyProfileRegistry.java index d4dfe79eb..64d306f13 100644 --- a/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/LazyProfileRegistry.java +++ b/plugins/org.eclipse.oomph.p2.core/src/org/eclipse/oomph/p2/internal/core/LazyProfileRegistry.java @@ -18,6 +18,7 @@ import org.eclipse.oomph.util.ReflectUtil.ReflectionException; import org.eclipse.emf.common.CommonPlugin; import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.equinox.internal.p2.engine.EngineActivator; import org.eclipse.equinox.internal.p2.engine.Profile; @@ -39,7 +40,9 @@ import java.lang.ref.SoftReference; import java.lang.reflect.Constructor; import java.lang.reflect.Field; import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; /** @@ -123,6 +126,27 @@ public class LazyProfileRegistry extends SimpleProfileRegistry } @Override + public synchronized IProfile[] getProfiles() + { + Map<String, Profile> profileMap = getProfileMap(); + List<Profile> result = new ArrayList<Profile>(profileMap.size()); + for (Profile profile : profileMap.values()) + { + try + { + Profile snapshot = profile.snapshot(); + result.add(snapshot); + } + catch (RuntimeException ex) + { + P2CorePlugin.INSTANCE.log(ex, IStatus.WARNING); + } + } + + return result.toArray(new Profile[result.size()]); + } + + @Override public synchronized void removeProfile(String id, long timestamp) throws ProvisionException { if (SELF.equals(id)) |