Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristoph Läubrich2020-12-19 11:48:10 +0000
committerMickael Istria2021-01-08 07:38:47 +0000
commit08eece6cff8f1a274c87e0ccc92542c0cc4907a7 (patch)
tree72be91ba2db882b0ab9b8e2695cf9345a64e9386
parent932ed3d417317c0d291d4116ce477a4c8ef03455 (diff)
downloadrt.equinox.p2-08eece6cff8f1a274c87e0ccc92542c0cc4907a7.tar.gz
rt.equinox.p2-08eece6cff8f1a274c87e0ccc92542c0cc4907a7.tar.xz
rt.equinox.p2-08eece6cff8f1a274c87e0ccc92542c0cc4907a7.zip
fine in RCP target - Add instanceof check - make sure RTE does not interrupt exception flow Change-Id: I071b339f985e73adc4cc8aecfa0b20e063b285a9 Signed-off-by: Christoph Läubrich <laeubi@laeubi-soft.de>
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java14
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java9
6 files changed, 20 insertions, 11 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
index 1fc6599e3..b2f0e902b 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.metadata.repository;singleton:=true
-Bundle-Version: 1.3.400.qualifier
+Bundle-Version: 1.3.500.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Export-Package: org.eclipse.equinox.internal.p2.metadata.repository;
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/pom.xml b/bundles/org.eclipse.equinox.p2.metadata.repository/pom.xml
index 97ec7e6cc..c112723f5 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/pom.xml
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.p2.metadata.repository</artifactId>
- <version>1.3.400-SNAPSHOT</version>
+ <version>1.3.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
index 06707e85a..e679ea682 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/LocalMetadataRepository.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2018 IBM Corporation and others.
+ * Copyright (c) 2007, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -11,6 +11,7 @@
* Contributors:
* IBM Corporation - initial API and implementation
* Prashant Deva - Bug 194674 [prov] Provide write access to metadata repository
+ * Christoph Läubrich - Bug 481443 - CLassCastException While Downloading Repository that loads fine in RCP target
*******************************************************************************/
package org.eclipse.equinox.internal.p2.metadata.repository;
@@ -296,11 +297,14 @@ public class LocalMetadataRepository extends AbstractMetadataRepository implemen
return oldValue;
save();
}
- //force repository manager to reload this repository because it caches properties
- MetadataRepositoryManager manager = (MetadataRepositoryManager) getProvisioningAgent()
+ IMetadataRepositoryManager manager = getProvisioningAgent()
.getService(IMetadataRepositoryManager.class);
- if (manager.removeRepository(getLocation()))
- manager.addRepository(this);
+ if (manager instanceof MetadataRepositoryManager) {
+ // force repository manager to reload this repository because it caches
+ // properties
+ if (manager.removeRepository(getLocation()))
+ ((MetadataRepositoryManager) manager).addRepository(this);
+ }
return oldValue;
} finally {
if (monitor != null)
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF
index 9186c37d6..115a12aa3 100644
--- a/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.updatesite/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.equinox.p2.updatesite;singleton:=true
-Bundle-Version: 1.1.400.qualifier
+Bundle-Version: 1.1.500.qualifier
Bundle-Activator: org.eclipse.equinox.internal.p2.updatesite.Activator
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/pom.xml b/bundles/org.eclipse.equinox.p2.updatesite/pom.xml
index e398c7f95..bc731abc3 100644
--- a/bundles/org.eclipse.equinox.p2.updatesite/pom.xml
+++ b/bundles/org.eclipse.equinox.p2.updatesite/pom.xml
@@ -9,6 +9,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.p2.updatesite</artifactId>
- <version>1.1.400-SNAPSHOT</version>
+ <version>1.1.500-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java
index 815d8baa6..97f805994 100644
--- a/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java
+++ b/bundles/org.eclipse.equinox.p2.updatesite/src/org/eclipse/equinox/internal/p2/updatesite/metadata/UpdateSiteMetadataRepositoryFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2017 IBM Corporation and others.
+ * Copyright (c) 2008, 2020 IBM Corporation and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
@@ -13,6 +13,7 @@
* Ray Braithwood (ray@genuitec.com) - fix for bug 220605
* Code 9 - ongoing development
* Sonatype, Inc. - transport split
+ * Christoph Läubrich - Bug 481443 - CLassCastException While Downloading Repository that loads fine in RCP target
*******************************************************************************/
package org.eclipse.equinox.internal.p2.updatesite.metadata;
@@ -60,7 +61,11 @@ public class UpdateSiteMetadataRepositoryFactory extends MetadataRepositoryFacto
try {
initializeRepository(repository, location, monitor);
} catch (Exception e) {
- resetCache(repository);
+ try {
+ resetCache(repository);
+ } catch (RuntimeException rte) {
+ e.addSuppressed(rte);
+ }
if (e instanceof ProvisionException)
throw (ProvisionException) e;
if (e instanceof OperationCanceledException)

Back to the top