Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Sewe2016-09-08 11:46:32 +0000
committerAndreas Sewe2016-09-08 12:35:39 +0000
commit1f2340995fb730cf776b47ee4b84a45469c5e392 (patch)
tree1c2f11929a88dd3cc316f720791244c96097b7e3 /bundles/org.eclipse.osgi/container
parentfef33690b9c5b85c608f5466aeede64a8c18b9b7 (diff)
downloadrt.equinox.framework-1f2340995fb730cf776b47ee4b84a45469c5e392.tar.gz
rt.equinox.framework-1f2340995fb730cf776b47ee4b84a45469c5e392.tar.xz
rt.equinox.framework-1f2340995fb730cf776b47ee4b84a45469c5e392.zip
Change-Id: I8e8dde9b777054ea62c5e6d0ce38191d50bf8c92 Signed-off-by: Andreas Sewe <andreas.sewe@codetrails.com>
Diffstat (limited to 'bundles/org.eclipse.osgi/container')
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java2
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java8
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java4
-rw-r--r--bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java2
9 files changed, 14 insertions, 16 deletions
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java
index 7ea943a64..46083640d 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/core/runtime/internal/adaptor/DefaultStartupMonitor.java
@@ -36,10 +36,10 @@ public class DefaultStartupMonitor implements StartupMonitor {
try {
updateMethod = splashHandler.getClass().getMethod("updateSplash", (Class[]) null); //$NON-NLS-1$
} catch (SecurityException e) {
- throw (IllegalStateException) new IllegalStateException(e.getMessage()).initCause(e);
+ throw new IllegalStateException(e.getMessage(), e);
} catch (NoSuchMethodException e) {
//TODO maybe we could do something else in the update method in this case, like print something to the console?
- throw (IllegalStateException) new IllegalStateException(e.getMessage()).initCause(e);
+ throw new IllegalStateException(e.getMessage(), e);
}
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java
index 081d81b50..bb12a4c4a 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/framework/util/SecureAction.java
@@ -318,9 +318,7 @@ public class SecureAction {
zipNameException.initCause(e);
throw zipNameException;
} catch (IOException e) {
- IOException fileNameException = new IOException("Exception in opening zip file: " + file.getPath()); //$NON-NLS-1$
- fileNameException.initCause(e);
- throw fileNameException;
+ throw new IOException("Exception in opening zip file: " + file.getPath(), e); //$NON-NLS-1$
}
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
index 15cbe5641..35846321c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/framework/FilterImpl.java
@@ -1460,7 +1460,7 @@ public class FilterImpl implements Filter /* since Framework 1.1 */ {
try {
filter = parse_filter();
} catch (ArrayIndexOutOfBoundsException e) {
- throw new InvalidSyntaxException(Msg.FILTER_TERMINATED_ABRUBTLY, filterstring);
+ throw new InvalidSyntaxException(Msg.FILTER_TERMINATED_ABRUBTLY, filterstring, e);
}
if (pos != filterChars.length) {
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java
index 1be00ba06..e00277735 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/permadmin/PermissionInfoCollection.java
@@ -65,7 +65,7 @@ public final class PermissionInfoCollection extends PermissionCollection {
try {
addPermissions(collection, permClass);
} catch (Exception e) {
- throw (SecurityException) new SecurityException("Exception creating permissions: " + permClass + ": " + e.getMessage()).initCause(e); //$NON-NLS-1$ //$NON-NLS-2$
+ throw new SecurityException("Exception creating permissions: " + permClass + ": " + e.getMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
}
synchronized (cachedPermissionCollections) {
// check to see if another thread beat this thread at adding the collection
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java
index ef63417b3..26436f8d8 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/service/security/KeyStoreTrustEngine.java
@@ -148,7 +148,7 @@ public class KeyStoreTrustEngine extends TrustEngine {
}
}
} catch (KeyStoreException e) {
- throw (IOException) new IOException(e.getMessage()).initCause(e);
+ throw new IOException(e.getMessage(), e);
} catch (GeneralSecurityException e) {
if (signedBundleHook != null) {
signedBundleHook.log(e.getMessage(), FrameworkLogEntry.WARNING, e);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java
index eed079e5e..177aad357 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/PKCS7Processor.java
@@ -223,7 +223,7 @@ public class PKCS7Processor implements SignedContentConstants {
dateFormt.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$
signingTime = dateFormt.parse(dateString);
} catch (ParseException e) {
- throw (SignatureException) new SignatureException(SignedContentMessages.PKCS7_Parse_Signing_Time).initCause(e);
+ throw new SignatureException(SignedContentMessages.PKCS7_Parse_Signing_Time, e);
}
}
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java
index c29391094..0d4de3be6 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedBundleHook.java
@@ -217,13 +217,13 @@ public class SignedBundleHook implements ActivatorHookFactory, BundleFileWrapper
try {
result.initializeSignedContent();
} catch (InvalidKeyException e) {
- throw (InvalidKeyException) new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
+ throw new InvalidKeyException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content), e);
} catch (SignatureException e) {
- throw (SignatureException) new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
+ throw new SignatureException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content), e);
} catch (CertificateException e) {
- throw (CertificateException) new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
+ throw new CertificateException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content), e);
} catch (NoSuchAlgorithmException e) {
- throw (NoSuchAlgorithmException) new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
+ throw new NoSuchAlgorithmException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content), e);
} catch (NoSuchProviderException e) {
throw (NoSuchProviderException) new NoSuchProviderException(NLS.bind(SignedContentMessages.Factory_SignedContent_Error, content)).initCause(e);
}
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java
index 15243f33a..4d369ad36 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/signedcontent/SignedStorageHook.java
@@ -104,7 +104,7 @@ public class SignedStorageHook extends StorageHookFactory<List<SignerInfo>, List
try {
certs[i] = PKCS7Processor.certFact.generateCertificate(new ByteArrayInputStream(certBytes));
} catch (CertificateException e) {
- throw (IOException) new IOException(e.getMessage()).initCause(e);
+ throw new IOException(e.getMessage(), e);
}
}
int anchorIdx = is.readInt();
@@ -168,7 +168,7 @@ public class SignedStorageHook extends StorageHookFactory<List<SignerInfo>, List
try {
certBytes = certs[i].getEncoded();
} catch (CertificateEncodingException e) {
- throw (IOException) new IOException(e.getMessage()).initCause(e);
+ throw new IOException(e.getMessage(), e);
}
os.writeInt(certBytes.length);
os.write(certBytes);
diff --git a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java
index d6351e1a3..c4295534c 100644
--- a/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java
+++ b/bundles/org.eclipse.osgi/container/src/org/eclipse/osgi/internal/url/URLStreamHandlerProxy.java
@@ -231,7 +231,7 @@ public class URLStreamHandlerProxy extends URLStreamHandler implements ServiceTr
throw (RuntimeException) e.getTargetException();
} catch (Exception e) {
// expected on JRE < 1.5
- throw (UnsupportedOperationException) new UnsupportedOperationException().initCause(e);
+ throw new UnsupportedOperationException(e);
}
}
}

Back to the top