Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Lee2013-12-17 09:30:25 +0000
committerKen Lee2013-12-17 10:05:14 +0000
commite79de79bb4084b24114327caa771f1d8b537b471 (patch)
treed14d4c247e6fdc02843c43bdc38959c4f7d4e40e /bundles/org.eclipse.equinox.servletbridge
parent35033c8021dde91c3dab707604ceb3df689a7d10 (diff)
downloadrt.equinox.bundles-e79de79bb4084b24114327caa771f1d8b537b471.tar.gz
rt.equinox.bundles-e79de79bb4084b24114327caa771f1d8b537b471.tar.xz
rt.equinox.bundles-e79de79bb4084b24114327caa771f1d8b537b471.zip
Bug 424212 - SecurityException when using Apache Derby with Equinox Servletbridge
https://bugs.eclipse.org/bugs/show_bug.cgi?id=424212 Signed-off-by: Ken Lee <kle@bsiag.com>
Diffstat (limited to 'bundles/org.eclipse.equinox.servletbridge')
-rw-r--r--bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java
index 1a02d959a..821bf04ed 100644
--- a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java
+++ b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/CloseableURLClassLoader.java
@@ -4,7 +4,7 @@
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
- *
+ *
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
@@ -13,13 +13,13 @@
* The java.net.URLClassLoader class allows one to load resources from arbitrary URLs and in particular is optimized to handle
* "jar" URLs. Unfortunately for jar files this optimization ends up holding the file open which ultimately prevents the file from
* being deleted or update until the VM is shutdown.
- *
+ *
* The CloseableURLClassLoader is meant to replace the URLClassLoader and provides an additional method to allow one to "close" any
* resources left open. In the current version the CloseableURLClassLoader will only ensure the closing of jar file resources. The
* jar handling behavior in this class will also provides a construct to allow one to turn off jar file verification in performance
- * sensitive situations where the verification us not necessary.
- *
- * also see https://bugs.eclipse.org/bugs/show_bug.cgi?id=190279
+ * sensitive situations where the verification us not necessary.
+ *
+ * also see https://bugs.eclipse.org/bugs/show_bug.cgi?id=190279
*/
package org.eclipse.equinox.servletbridge;
@@ -77,7 +77,7 @@ public class CloseableURLClassLoader extends URLClassLoader {
/**
* @throws IOException
- * Documented to avoid warning
+ * Documented to avoid warning
*/
public JarFile getJarFile() throws IOException {
return jarFile;
@@ -330,8 +330,9 @@ public class CloseableURLClassLoader extends URLClassLoader {
if (mainAttributes != null)
sealed = mainAttributes.getValue(Name.SEALED);
}
- if (Boolean.valueOf(sealed).booleanValue())
+ if (!pkg.isSealed() && Boolean.valueOf(sealed).booleanValue())
throw new SecurityException("The package '" + packageName + "' was previously loaded unsealed. Cannot seal package."); //$NON-NLS-1$ //$NON-NLS-2$
+
}
/* (non-Javadoc)

Back to the top