Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2017-11-13 06:00:43 -0500
committerAlexander Kurtakov2017-11-13 06:00:43 -0500
commitc51bc3e5f7a5378d3a315d48a96128d110d6a1da (patch)
tree6a90fabb6e29b39db2f981d6d0775dfc28ac66e4
parent883f97fb788018824c666d5bedc3d952e25a90f6 (diff)
downloadrt.equinox.bundles-c51bc3e5f7a5378d3a315d48a96128d110d6a1da.tar.gz
rt.equinox.bundles-c51bc3e5f7a5378d3a315d48a96128d110d6a1da.tar.xz
rt.equinox.bundles-c51bc3e5f7a5378d3a315d48a96128d110d6a1da.zip
Bug 527189 - Move jsp.* bundles to Java 8
Bump BREE, minor version. Update the codebase to modernize it. Change-Id: I8407f4437e865c0a26dcb80d21f6b035ec729222 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper.registry/.classpath2
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper.registry/.settings/org.eclipse.jdt.core.prefs72
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper.registry/META-INF/MANIFEST.MF7
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/internal/jsp/jasper/registry/Activator.java34
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/jsp/jasper/registry/JSPFactory.java6
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/.classpath4
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/.settings/org.eclipse.jdt.core.prefs78
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/META-INF/MANIFEST.MF7
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/pom.xml2
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/Activator.java39
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/BundleProxyClassLoader.java16
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JSPContextFinder.java75
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JspClassLoader.java26
-rw-r--r--bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/jsp/jasper/JspServlet.java54
15 files changed, 280 insertions, 144 deletions
diff --git a/bundles/org.eclipse.equinox.jsp.jasper.registry/.classpath b/bundles/org.eclipse.equinox.jsp.jasper.registry/.classpath
index c2ce266a..eca7bdba 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper.registry/.classpath
+++ b/bundles/org.eclipse.equinox.jsp.jasper.registry/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.0%Foundation-1.0"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.equinox.jsp.jasper.registry/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.jsp.jasper.registry/.settings/org.eclipse.jdt.core.prefs
index 2cad04a3..6cf49742 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper.registry/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.jsp.jasper.registry/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Tue Feb 26 11:04:42 CST 2008
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,29 +6,46 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.1
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.3
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@@ -37,41 +53,79 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
diff --git a/bundles/org.eclipse.equinox.jsp.jasper.registry/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.jsp.jasper.registry/META-INF/MANIFEST.MF
index 87bcdecc..b37ee507 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper.registry/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.jsp.jasper.registry/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.equinox.jsp.jasper.registry
-Bundle-Version: 1.0.300.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.equinox.internal.jsp.jasper.registry.Activator
Import-Package: org.eclipse.equinox.jsp.jasper,
org.osgi.framework;version="1.3.0",
@@ -15,8 +15,5 @@ Import-Package: org.eclipse.equinox.jsp.jasper,
Require-Bundle: org.eclipse.equinox.registry,
org.eclipse.equinox.common
Export-Package: org.eclipse.equinox.jsp.jasper.registry;version="1.0.0"
-Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
- J2SE-1.3
-Comment-Header: Both Eclipse-LazyStart and Bundle-ActivationPolicy are specified for compatibility with 3.2
-Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml b/bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml
index 196ce9cc..62ab5f1c 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml
+++ b/bundles/org.eclipse.equinox.jsp.jasper.registry/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.jsp.jasper.registry</artifactId>
- <version>1.0.300-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/internal/jsp/jasper/registry/Activator.java b/bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/internal/jsp/jasper/registry/Activator.java
index 493ff794..7dc63b9e 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/internal/jsp/jasper/registry/Activator.java
+++ b/bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/internal/jsp/jasper/registry/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others
+ * Copyright (c) 2007, 2017 IBM Corporation and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,30 +10,29 @@
*******************************************************************************/
package org.eclipse.equinox.internal.jsp.jasper.registry;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
+import org.osgi.framework.*;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
-public class Activator implements BundleActivator, ServiceTrackerCustomizer {
+public class Activator implements BundleActivator, ServiceTrackerCustomizer<PackageAdmin, PackageAdmin> {
- private ServiceTracker packageAdminTracker;
+ private ServiceTracker<?, PackageAdmin> packageAdminTracker;
private static PackageAdmin packageAdmin;
- private BundleContext context;
+ private BundleContext bundleContext;
+ @Override
public void start(BundleContext context) throws Exception {
- this.context = context;
- packageAdminTracker = new ServiceTracker(context, PackageAdmin.class.getName(), this);
+ this.bundleContext = context;
+ packageAdminTracker = new ServiceTracker<>(context, PackageAdmin.class, this);
packageAdminTracker.open();
}
+ @Override
public void stop(BundleContext context) throws Exception {
packageAdminTracker.close();
packageAdminTracker = null;
- this.context = null;
+ this.bundleContext = null;
}
public static synchronized Bundle getBundle(String symbolicName) {
@@ -52,19 +51,22 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
return null;
}
- public Object addingService(ServiceReference reference) {
+ @Override
+ public PackageAdmin addingService(ServiceReference<PackageAdmin> reference) {
synchronized (Activator.class) {
- packageAdmin = (PackageAdmin) context.getService(reference);
+ packageAdmin = bundleContext.getService(reference);
}
return packageAdmin;
}
- public void modifiedService(ServiceReference reference, Object service) {
+ @Override
+ public void modifiedService(ServiceReference<PackageAdmin> reference, PackageAdmin service) {
}
- public void removedService(ServiceReference reference, Object service) {
+ @Override
+ public void removedService(ServiceReference<PackageAdmin> reference, PackageAdmin service) {
synchronized (Activator.class) {
- context.ungetService(reference);
+ bundleContext.ungetService(reference);
packageAdmin = null;
}
}
diff --git a/bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/jsp/jasper/registry/JSPFactory.java b/bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/jsp/jasper/registry/JSPFactory.java
index ca653d09..30d0d22b 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/jsp/jasper/registry/JSPFactory.java
+++ b/bundles/org.eclipse.equinox.jsp.jasper.registry/src/org/eclipse/equinox/jsp/jasper/registry/JSPFactory.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2008 IBM Corporation and others.
+ * Copyright (c) 2007, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -34,17 +34,19 @@ public class JSPFactory implements IExecutableExtensionFactory, IExecutableExten
private IConfigurationElement config;
private String bundleResourcePath;
+ @Override
public void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
this.config = config;
if (data != null) {
if (data instanceof String)
bundleResourcePath = (String) data;
else if (data instanceof Hashtable) {
- bundleResourcePath = (String) ((Hashtable) data).get("path"); //$NON-NLS-1$
+ bundleResourcePath = ((Hashtable<String, String>) data).get("path"); //$NON-NLS-1$
}
}
}
+ @Override
public Object create() throws CoreException {
Bundle b = Activator.getBundle(config.getContributor().getName()); //check for null and illegal state exception
String alias = config.getAttribute("alias"); //$NON-NLS-1$
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/.classpath b/bundles/org.eclipse.equinox.jsp.jasper/.classpath
index ce0c7a5d..eca7bdba 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/.classpath
+++ b/bundles/org.eclipse.equinox.jsp.jasper/.classpath
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/CDC-1.0%Foundation-1.0"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.equinox.jsp.jasper/.settings/org.eclipse.jdt.core.prefs
index f31f2500..5247d807 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.equinox.jsp.jasper/.settings/org.eclipse.jdt.core.prefs
@@ -1,4 +1,3 @@
-#Tue Aug 21 11:27:47 CDT 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.builder.cleanOutputFolder=clean
org.eclipse.jdt.core.builder.duplicateResourceTask=warning
@@ -7,29 +6,45 @@ org.eclipse.jdt.core.builder.resourceCopyExclusionFilter=*.launch
org.eclipse.jdt.core.circularClasspath=error
org.eclipse.jdt.core.classpath.exclusionPatterns=enabled
org.eclipse.jdt.core.classpath.multipleOutputLocations=enabled
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=disabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.2
+org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnull.secondary=
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullable.secondary=
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.4
+org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.doc.comment.support=enabled
org.eclipse.jdt.core.compiler.maxProblemPerUnit=1000
+org.eclipse.jdt.core.compiler.problem.APILeak=warning
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=enabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=error
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
org.eclipse.jdt.core.compiler.problem.finalParameterBound=ignore
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
@@ -37,42 +52,80 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=private
org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocComments=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=public
org.eclipse.jdt.core.compiler.problem.missingJavadocTags=ignore
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=enabled
org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=public
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
+org.eclipse.jdt.core.compiler.problem.nonnullTypeVariableFromLegacyInvocation=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.pessimisticNullAnalysisForFreeTypeVariables=warning
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=warning
+org.eclipse.jdt.core.compiler.problem.terminalDeprecation=warning
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=warning
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentType=warning
+org.eclipse.jdt.core.compiler.problem.unlikelyCollectionMethodArgumentTypeStrict=disabled
+org.eclipse.jdt.core.compiler.problem.unlikelyEqualsArgumentType=info
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unsafeTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=error
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=enabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
+org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.3
+org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
@@ -144,7 +197,12 @@ org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4
-org.eclipse.jdt.core.formatter.insert_new_line_after_annotation=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.jsp.jasper/META-INF/MANIFEST.MF
index 518e0073..5fbb4bd2 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.jsp.jasper/META-INF/MANIFEST.MF
@@ -4,7 +4,7 @@ Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-SymbolicName: org.eclipse.equinox.jsp.jasper
-Bundle-Version: 1.0.500.qualifier
+Bundle-Version: 1.1.0.qualifier
Bundle-Activator: org.eclipse.equinox.internal.jsp.jasper.Activator
Import-Package: javax.servlet;version="[2.4, 3.2)",
javax.servlet.annotation;version="2.6";resolution:=optional,
@@ -17,8 +17,5 @@ Import-Package: javax.servlet;version="[2.4, 3.2)",
org.osgi.service.packageadmin;version="1.2.0",
org.osgi.util.tracker;version="1.3.1"
Export-Package: org.eclipse.equinox.jsp.jasper;version="1.0.0"
-Bundle-RequiredExecutionEnvironment: CDC-1.0/Foundation-1.0,
- J2SE-1.3
-Comment-Header: Both Eclipse-LazyStart and Bundle-ActivationPolicy are specified for compatibility with 3.2
-Eclipse-LazyStart: true
+Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-ActivationPolicy: lazy
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/pom.xml b/bundles/org.eclipse.equinox.jsp.jasper/pom.xml
index 989420c4..708c2e61 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/pom.xml
+++ b/bundles/org.eclipse.equinox.jsp.jasper/pom.xml
@@ -19,6 +19,6 @@
</parent>
<groupId>org.eclipse.equinox</groupId>
<artifactId>org.eclipse.equinox.jsp.jasper</artifactId>
- <version>1.0.500-SNAPSHOT</version>
+ <version>1.1.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/Activator.java b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/Activator.java
index a7ebe116..b07ad794 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/Activator.java
+++ b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/Activator.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2009 Cognos Incorporated, IBM Corporation and others.
+ * Copyright (c) 2005, 2017 Cognos Incorporated, IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,58 +14,61 @@ package org.eclipse.equinox.internal.jsp.jasper;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.FrameworkUtil;
import org.osgi.framework.ServiceReference;
import org.osgi.service.packageadmin.ExportedPackage;
import org.osgi.service.packageadmin.PackageAdmin;
import org.osgi.util.tracker.ServiceTracker;
import org.osgi.util.tracker.ServiceTrackerCustomizer;
-public class Activator implements BundleActivator, ServiceTrackerCustomizer {
+public class Activator implements BundleActivator, ServiceTrackerCustomizer<PackageAdmin, PackageAdmin> {
- private ServiceTracker packageAdminTracker;
+ private ServiceTracker<?, PackageAdmin> packageAdminTracker;
private static PackageAdmin packageAdmin;
private volatile static Bundle thisBundle;
- private BundleContext context;
+ private BundleContext bundleContext;
+ @Override
public void start(BundleContext context) throws Exception {
//disable the JSR99 compiler that does not work in OSGi;
//This will convince jasper to use the JDTCompiler that invokes ecj (see JSP-21 on the glassfish bug-tracker)
- System.setProperty("org.apache.jasper.compiler.disablejsr199", Boolean.TRUE.toString());
- this.context = context;
+ System.setProperty("org.apache.jasper.compiler.disablejsr199", Boolean.TRUE.toString()); //$NON-NLS-1$
+ this.bundleContext = context;
thisBundle = context.getBundle();
- packageAdminTracker = new ServiceTracker(context, PackageAdmin.class.getName(), this);
+ packageAdminTracker = new ServiceTracker<>(context, PackageAdmin.class, this);
packageAdminTracker.open();
}
+ @Override
public void stop(BundleContext context) throws Exception {
packageAdminTracker.close();
packageAdminTracker = null;
thisBundle = null;
- this.context = null;
+ this.bundleContext = null;
}
- public Object addingService(ServiceReference reference) {
+ @Override
+ public PackageAdmin addingService(ServiceReference<PackageAdmin> reference) {
synchronized (Activator.class) {
- packageAdmin = (PackageAdmin) context.getService(reference);
+ packageAdmin = bundleContext.getService(reference);
}
return packageAdmin;
}
- public void modifiedService(ServiceReference reference, Object service) {
+ @Override
+ public void modifiedService(ServiceReference<PackageAdmin> reference, PackageAdmin service) {
}
- public void removedService(ServiceReference reference, Object service) {
+ @Override
+ public void removedService(ServiceReference<PackageAdmin> reference, PackageAdmin service) {
synchronized (Activator.class) {
- context.ungetService(reference);
+ bundleContext.ungetService(reference);
packageAdmin = null;
}
}
- public static synchronized Bundle getBundle(Class clazz) {
- if (packageAdmin == null)
- throw new IllegalStateException("Not started"); //$NON-NLS-1$
-
- return packageAdmin.getBundle(clazz);
+ public static synchronized Bundle getBundle(Class<?> clazz) {
+ return FrameworkUtil.getBundle(clazz);
}
public static Bundle[] getFragments(Bundle bundle) {
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/BundleProxyClassLoader.java b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/BundleProxyClassLoader.java
index 44ed6651..e2ee87db 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/BundleProxyClassLoader.java
+++ b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/BundleProxyClassLoader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2007 Cognos Incorporated, IBM Corporation and others.
+ * Copyright (c) 2005, 2017 Cognos Incorporated, IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,7 +17,6 @@ import java.util.Enumeration;
import org.osgi.framework.Bundle;
-
/**
* A BundleProxyClassLoader wraps a bundle and uses the various Bundle methods to produce a ClassLoader.
*/
@@ -35,24 +34,29 @@ public class BundleProxyClassLoader extends ClassLoader {
this.bundle = bundle;
}
- public Enumeration findResources(String name) throws IOException {
+ @Override
+ public Enumeration<URL> findResources(String name) throws IOException {
return bundle.getResources(name);
}
+ @Override
public URL findResource(String name) {
return bundle.getResource(name);
}
- public Class findClass(String name) throws ClassNotFoundException {
+ @Override
+ public Class<?> findClass(String name) throws ClassNotFoundException {
return bundle.loadClass(name);
}
+ @Override
public URL getResource(String name) {
return (parent == null) ? findResource(name) : super.getResource(name);
}
- protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
- Class clazz = (parent == null) ? findClass(name) : super.loadClass(name, false);
+ @Override
+ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ Class<?> clazz = (parent == null) ? findClass(name) : super.loadClass(name, false);
if (resolve)
super.resolveClass(clazz);
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JSPContextFinder.java b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JSPContextFinder.java
index 89acf1b8..8e2ba88c 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JSPContextFinder.java
+++ b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JSPContextFinder.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005-2007 IBM Corporation and others.
+ * Copyright (c) 2005, 2017 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,28 +14,31 @@ import java.io.IOException;
import java.net.URL;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.*;
-
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Set;
// This class is a slightly augmented copy of org.eclipse.core.runtime.internal.adaptor.ContextFinder
// in particular basicFindClassLoaders has been altered to use PackageAdmin to determine if a class originated from
// a bundle and to skip over the various JspClassloader classes.
-public class JSPContextFinder extends ClassLoader implements PrivilegedAction {
+public class JSPContextFinder extends ClassLoader implements PrivilegedAction<ArrayList<ClassLoader>> {
static final class Finder extends SecurityManager {
- public Class[] getClassContext() {
+ @Override
+ public Class<?>[] getClassContext() {
return super.getClassContext();
}
}
+
//This is used to detect cycle that could be caused while delegating the loading to other classloaders
//It keeps track on a thread basis of the set of requested classes and resources
- private static ThreadLocal cycleDetector = new ThreadLocal();
+ private static ThreadLocal<Set<String>> cycleDetector = new ThreadLocal<>();
static Finder contextFinder;
static {
- AccessController.doPrivileged(new PrivilegedAction() {
- public Object run() {
- contextFinder = new Finder();
- return null;
- }
+ AccessController.doPrivileged((PrivilegedAction<Object>) () -> {
+ contextFinder = new Finder();
+ return null;
});
}
@@ -47,9 +50,9 @@ public class JSPContextFinder extends ClassLoader implements PrivilegedAction {
// JSPContextFinder classloader nor the boot classloader. The last classloader
// in the list is either a bundle classloader or the framework's classloader
// We assume that the bootclassloader never uses the context classloader to find classes in itself.
- ArrayList basicFindClassLoaders() {
- Class[] stack = contextFinder.getClassContext();
- ArrayList result = new ArrayList(1);
+ ArrayList<ClassLoader> basicFindClassLoaders() {
+ Class<?>[] stack = contextFinder.getClassContext();
+ ArrayList<ClassLoader> result = new ArrayList<>(1);
ClassLoader previousLoader = null;
for (int i = 1; i < stack.length; i++) {
ClassLoader tmp = stack[i].getClassLoader();
@@ -68,10 +71,8 @@ public class JSPContextFinder extends ClassLoader implements PrivilegedAction {
return result;
}
- private boolean checkClass(Class clazz) {
- return clazz != JSPContextFinder.class &&
- clazz != BundleProxyClassLoader.class &&
- clazz != JspClassLoader.class;
+ private boolean checkClass(Class<?> clazz) {
+ return clazz != JSPContextFinder.class && clazz != BundleProxyClassLoader.class && clazz != JspClassLoader.class;
}
// ensures that a classloader does not have the JSPContextFinder as part of the
@@ -86,25 +87,26 @@ public class JSPContextFinder extends ClassLoader implements PrivilegedAction {
return true;
}
- private ArrayList findClassLoaders() {
+ private ArrayList<ClassLoader> findClassLoaders() {
if (System.getSecurityManager() == null)
return basicFindClassLoaders();
- return (ArrayList) AccessController.doPrivileged(this);
+ return AccessController.doPrivileged(this);
}
- public Object run() {
+ @Override
+ public ArrayList<ClassLoader> run() {
return basicFindClassLoaders();
}
//Return whether the request for loading "name" should proceed.
//False is returned when a cycle is being detected
private boolean startLoading(String name) {
- Set classesAndResources = (Set) cycleDetector.get();
+ Set<String> classesAndResources = cycleDetector.get();
if (classesAndResources != null && classesAndResources.contains(name))
return false;
if (classesAndResources == null) {
- classesAndResources = new HashSet(3);
+ classesAndResources = new HashSet<>(3);
cycleDetector.set(classesAndResources);
}
classesAndResources.add(name);
@@ -112,19 +114,20 @@ public class JSPContextFinder extends ClassLoader implements PrivilegedAction {
}
private void stopLoading(String name) {
- ((Set) cycleDetector.get()).remove(name);
+ cycleDetector.get().remove(name);
}
- protected Class loadClass(String arg0, boolean arg1) throws ClassNotFoundException {
+ @Override
+ protected Class<?> loadClass(String arg0, boolean arg1) throws ClassNotFoundException {
//Shortcut cycle
if (startLoading(arg0) == false)
throw new ClassNotFoundException(arg0);
try {
- ArrayList toConsult = findClassLoaders();
- for (Iterator loaders = toConsult.iterator(); loaders.hasNext();)
+ ArrayList<ClassLoader> toConsult = findClassLoaders();
+ for (Iterator<ClassLoader> loaders = toConsult.iterator(); loaders.hasNext();)
try {
- return ((ClassLoader) loaders.next()).loadClass(arg0);
+ return loaders.next().loadClass(arg0);
} catch (ClassNotFoundException e) {
// go to the next class loader
}
@@ -134,14 +137,15 @@ public class JSPContextFinder extends ClassLoader implements PrivilegedAction {
}
}
+ @Override
public URL getResource(String arg0) {
//Shortcut cycle
if (startLoading(arg0) == false)
return null;
try {
- ArrayList toConsult = findClassLoaders();
- for (Iterator loaders = toConsult.iterator(); loaders.hasNext();) {
- URL result = ((ClassLoader) loaders.next()).getResource(arg0);
+ ArrayList<ClassLoader> toConsult = findClassLoaders();
+ for (Iterator<ClassLoader> loaders = toConsult.iterator(); loaders.hasNext();) {
+ URL result = loaders.next().getResource(arg0);
if (result != null)
return result;
// go to the next class loader
@@ -152,14 +156,15 @@ public class JSPContextFinder extends ClassLoader implements PrivilegedAction {
}
}
- protected Enumeration findResources(String arg0) throws IOException {
+ @Override
+ protected Enumeration<URL> findResources(String arg0) throws IOException {
//Shortcut cycle
if (startLoading(arg0) == false)
return null;
try {
- ArrayList toConsult = findClassLoaders();
- for (Iterator loaders = toConsult.iterator(); loaders.hasNext();) {
- Enumeration result = ((ClassLoader) loaders.next()).getResources(arg0);
+ ArrayList<ClassLoader> toConsult = findClassLoaders();
+ for (Iterator<ClassLoader> loaders = toConsult.iterator(); loaders.hasNext();) {
+ Enumeration<URL> result = loaders.next().getResources(arg0);
if (result != null && result.hasMoreElements())
return result;
// go to the next class loader
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JspClassLoader.java b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JspClassLoader.java
index cc1c97ba..d5501d15 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JspClassLoader.java
+++ b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/internal/jsp/jasper/JspClassLoader.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2010 Cognos Incorporated, IBM Corporation and others.
+ * Copyright (c) 2005, 2017 Cognos Incorporated, IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -11,7 +11,6 @@
*******************************************************************************/
package org.eclipse.equinox.internal.jsp.jasper;
-import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
@@ -40,23 +39,28 @@ public class JspClassLoader extends URLClassLoader {
private static final ClassLoader PARENT = JspClassLoader.class.getClassLoader().getParent();
private static final String JAVA_PACKAGE = "java."; //$NON-NLS-1$
private static final ClassLoader EMPTY_CLASSLOADER = new ClassLoader() {
+ @Override
public URL getResource(String name) {
return null;
}
- public Enumeration findResources(String name) throws IOException {
- return new Enumeration() {
+ @Override
+ public Enumeration<URL> findResources(String name) {
+ return new Enumeration<URL>() {
+ @Override
public boolean hasMoreElements() {
return false;
}
- public Object nextElement() {
+ @Override
+ public URL nextElement() {
return null;
}
};
}
- public Class loadClass(String name) throws ClassNotFoundException {
+ @Override
+ public Class<?> loadClass(String name) throws ClassNotFoundException {
throw new ClassNotFoundException(name);
}
};
@@ -73,8 +77,8 @@ public class JspClassLoader extends URLClassLoader {
}
private void addBundleClassPathJars(Bundle bundle) {
- Dictionary headers = bundle.getHeaders();
- String classPath = (String) headers.get(Constants.BUNDLE_CLASSPATH);
+ Dictionary<String, String> headers = bundle.getHeaders();
+ String classPath = headers.get(Constants.BUNDLE_CLASSPATH);
if (classPath != null) {
StringTokenizer tokenizer = new StringTokenizer(classPath, ","); //$NON-NLS-1$
while (tokenizer.hasMoreTokens()) {
@@ -95,14 +99,16 @@ public class JspClassLoader extends URLClassLoader {
}
}
- protected Class loadClass(String name, boolean resolve) throws ClassNotFoundException {
+ @Override
+ protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException {
if (PARENT != null && name.startsWith(JAVA_PACKAGE))
return PARENT.loadClass(name);
return super.loadClass(name, resolve);
}
// Classes should "not" be loaded by this classloader from the URLs - it is just used for TLD resource discovery.
- protected Class findClass(String name) throws ClassNotFoundException {
+ @Override
+ protected Class<?> findClass(String name) throws ClassNotFoundException {
throw new ClassNotFoundException(name);
}
}
diff --git a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/jsp/jasper/JspServlet.java b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/jsp/jasper/JspServlet.java
index 9adcfa9d..7e8e9d38 100644
--- a/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/jsp/jasper/JspServlet.java
+++ b/bundles/org.eclipse.equinox.jsp.jasper/src/org/eclipse/equinox/jsp/jasper/JspServlet.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2005, 2011 Cognos Incorporated, IBM Corporation and others.
+ * Copyright (c) 2005, 2017 Cognos Incorporated, IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -77,16 +77,19 @@ public class JspServlet extends HttpServlet {
super.setReadOnly();
}
+ @Override
public void add(Permission permission) {
throw new SecurityException();
}
+ @Override
public boolean implies(Permission permission) {
return bundle.hasPermission(permission);
}
- public Enumeration elements() {
- return Collections.enumeration(Collections.EMPTY_LIST);
+ @Override
+ public Enumeration<Permission> elements() {
+ return Collections.enumeration(Collections.emptyList());
}
}
@@ -108,6 +111,7 @@ public class JspServlet extends HttpServlet {
this(bundle, bundleResourcePath, null);
}
+ @Override
public void init(ServletConfig config) throws ServletException {
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
@@ -132,6 +136,7 @@ public class JspServlet extends HttpServlet {
}
}
+ @Override
public void destroy() {
ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
@@ -142,6 +147,7 @@ public class JspServlet extends HttpServlet {
}
}
+ @Override
public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
String pathInfo = request.getPathInfo();
if (pathInfo != null && pathInfo.startsWith("/WEB-INF/")) { //$NON-NLS-1$
@@ -158,10 +164,12 @@ public class JspServlet extends HttpServlet {
}
}
+ @Override
public ServletConfig getServletConfig() {
return jspServlet.getServletConfig();
}
+ @Override
public String getServletInfo() {
return jspServlet.getServletInfo();
}
@@ -181,35 +189,39 @@ public class JspServlet extends HttpServlet {
return adaptor.createServletContext();
}
+ @Override
public String getInitParameter(String arg0) {
return config.getInitParameter(arg0);
}
- public Enumeration getInitParameterNames() {
+ @Override
+ public Enumeration<String> getInitParameterNames() {
return config.getInitParameterNames();
}
+ @Override
public ServletContext getServletContext() {
return context;
}
+ @Override
public String getServletName() {
return config.getServletName();
}
}
- final static Map contextToHandlerMethods;
+ final static Map<Method, Method> contextToHandlerMethods;
static {
contextToHandlerMethods = createContextToHandlerMethods();
}
- private static Map createContextToHandlerMethods() {
- Map methods = new HashMap();
+ private static Map<Method, Method> createContextToHandlerMethods() {
+ Map<Method, Method> methods = new HashMap<>();
Method[] handlerMethods = ServletContextAdaptor.class.getDeclaredMethods();
for (int i = 0; i < handlerMethods.length; i++) {
Method handlerMethod = handlerMethods[i];
String name = handlerMethod.getName();
- Class[] parameterTypes = handlerMethod.getParameterTypes();
+ Class<?>[] parameterTypes = handlerMethod.getParameterTypes();
try {
Method m = ServletContext.class.getMethod(name, parameterTypes);
methods.put(m, handlerMethod);
@@ -228,23 +240,19 @@ public class JspServlet extends HttpServlet {
}
public ServletContext createServletContext() {
- Class clazz = getClass();
+ Class<?> clazz = getClass();
ClassLoader classLoader = clazz.getClassLoader();
- Class[] interfaces = new Class[] {ServletContext.class};
+ Class<?>[] interfaces = new Class[] {ServletContext.class};
InvocationHandler handler = createInvocationHandler();
return (ServletContext) Proxy.newProxyInstance(classLoader, interfaces, handler);
}
private InvocationHandler createInvocationHandler() {
- return new InvocationHandler() {
- public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- return ServletContextAdaptor.this.invoke(proxy, method, args);
- }
- };
+ return (proxy, method, args) -> ServletContextAdaptor.this.invoke(proxy, method, args);
}
Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
- Method m = (Method) JspServlet.contextToHandlerMethods.get(method);
+ Method m = JspServlet.contextToHandlerMethods.get(method);
if (m != null) {
return m.invoke(this, args);
}
@@ -264,9 +272,9 @@ public class JspServlet extends HttpServlet {
if (path.length() == 0)
path = "/"; //$NON-NLS-1$
String file = sanitizeEntryName(resourceName.substring(lastSlash + 1));
- Enumeration entryPaths = bundle.findEntries(path, file, false);
+ Enumeration<URL> entryPaths = bundle.findEntries(path, file, false);
if (entryPaths != null && entryPaths.hasMoreElements())
- return (URL) entryPaths.nextElement();
+ return entryPaths.nextElement();
return delegate.getResource(name);
}
@@ -305,14 +313,14 @@ public class JspServlet extends HttpServlet {
return null;
}
- public Set getResourcePaths(String name) {
- Set result = delegate.getResourcePaths(name);
- Enumeration e = bundle.findEntries(bundleResourcePath + name, null, false);
+ public Set<String> getResourcePaths(String name) {
+ Set<String> result = delegate.getResourcePaths(name);
+ Enumeration<URL> e = bundle.findEntries(bundleResourcePath + name, null, false);
if (e != null) {
if (result == null)
- result = new HashSet();
+ result = new HashSet<>();
while (e.hasMoreElements()) {
- URL entryURL = (URL) e.nextElement();
+ URL entryURL = e.nextElement();
result.add(entryURL.getFile().substring(bundleResourcePath.length()));
}
}

Back to the top