Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move o.e.equinox.http.servlet and tests to Java 17 #321

Merged
merged 2 commits into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bundles/org.eclipse.equinox.http.servlet.tests/.classpath
Original file line number Diff line number Diff line change
@@ -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/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src">
<attributes>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ 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.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand All @@ -27,6 +27,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
Expand Down Expand Up @@ -72,6 +73,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warn
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
Expand Down Expand Up @@ -110,8 +112,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
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.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Name: org.eclipse.equinox.http.servlet.tests
Bundle-Vendor: Eclipse.org - Equinox
Bundle-SymbolicName: org.eclipse.equinox.http.servlet.tests
Bundle-Version: 1.8.500.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-Version: 1.9.0.qualifier
Bundle-RequiredExecutionEnvironment: JavaSE-17
Eclipse-BundleShape: dir
Require-Bundle: org.junit;bundle-version="4.0",
org.apache.felix.scr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class TestFilter1 extends AbstractTestServlet {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerServlet(regexAlias(), this, null, null);
service.registerFilter(regexAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class TestFilter2 extends AbstractTestServlet {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerServlet(regexAlias(), this, null, null);
service.registerFilter(regexAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<>(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public class TestFilter3 extends AbstractTestServlet {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerServlet(regexAlias(), this, null, null);
service.registerFilter(regexAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f3, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f3, new Hashtable<>(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class TestFilter4 extends AbstractTestServlet {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerServlet(regexAlias(), this, null, null);
service.registerFilter(regexAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<>(), null);
Hashtable<String, String> hashtable = new Hashtable<>();
hashtable.put("filter-priority", "1");
service.registerFilter(regexAlias(), f3, hashtable, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class TestFilter5 extends AbstractTestServlet {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerServlet(extensionAlias(), this, null, null);
service.registerFilter(extensionAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(extensionAlias(), f1, new Hashtable<>(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class TestFilter6 extends AbstractTestServlet {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerServlet(extensionAlias(), this, null, null);
service.registerFilter(extensionAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<String, String>(), null);
service.registerFilter(extensionAlias(), f1, new Hashtable<>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<>(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public class TestFilter7 extends AbstractTestServlet {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerServlet(extensionAlias(), this, null, null);
service.registerFilter(extensionAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<String, String>(), null);
service.registerFilter(extensionAlias(), f3, new Hashtable<String, String>(), null);
service.registerFilter(extensionAlias(), f1, new Hashtable<>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<>(), null);
service.registerFilter(extensionAlias(), f3, new Hashtable<>(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public class TestFilter8 extends AbstractTestServlet {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerServlet(extensionAlias(), this, null, null);
service.registerFilter(extensionAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<String, String>(), null);
service.registerFilter(extensionAlias(), f1, new Hashtable<>(), null);
service.registerFilter(extensionAlias(), f2, new Hashtable<>(), null);
Hashtable<String, String> hashtable = new Hashtable<>();
hashtable.put("filter-priority", "1");
service.registerFilter(extensionAlias(), f3, hashtable, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.eclipse.equinox.http.servlet.ExtendedHttpService;
import org.eclipse.equinox.http.servlet.tests.tb.AbstractTestResource;
import org.eclipse.equinox.http.servlet.tests.util.BaseFilter;

import org.osgi.service.component.ComponentContext;
import org.osgi.service.http.NamespaceException;

Expand All @@ -35,9 +34,9 @@ public class TestResource2 extends AbstractTestResource {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerResources(regexAlias(), getName() , null);
service.registerFilter(regexAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f3, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f3, new Hashtable<>(), null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ public class TestResource4 extends AbstractTestResource {
public void activate(ComponentContext componentContext) throws ServletException, NamespaceException {
ExtendedHttpService service = (ExtendedHttpService)getHttpService();
service.registerResources(regexAlias(), getName() , null);
service.registerFilter(regexAlias(), f1, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<String, String>(), null);
service.registerFilter(regexAlias(), f1, new Hashtable<>(), null);
service.registerFilter(regexAlias(), f2, new Hashtable<>(), null);
Hashtable<String, String> hashtable = new Hashtable<>();
hashtable.put("filter-priority", "1");
service.registerFilter(regexAlias(), f3, hashtable, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.Hashtable;
import java.util.concurrent.atomic.AtomicReference;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextListener;

import org.eclipse.equinox.http.servlet.testbase.BaseTest;
Expand All @@ -44,7 +43,7 @@ public void test_140_7_validation() {
Dictionary<String, Object> properties = new Hashtable<>();
properties.put(HttpWhiteboardConstants.HTTP_WHITEBOARD_LISTENER, "true");
ServiceRegistration<?> sr = context.registerService(
ServletContextListener.class, new MockSCL(new AtomicReference<ServletContext>()), properties);
ServletContextListener.class, new MockSCL(new AtomicReference<>()), properties);
registrations.add(sr);

ListenerDTO listenerDTO = getListenerDTOByServiceId(DEFAULT, getServiceId(sr));
Expand Down
2 changes: 1 addition & 1 deletion bundles/org.eclipse.equinox.http.servlet/.classpath
Original file line number Diff line number Diff line change
@@ -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/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul
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.targetPlatform=17
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
Expand All @@ -34,6 +34,7 @@ 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.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
Expand Down Expand Up @@ -87,6 +88,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
Expand Down Expand Up @@ -120,8 +122,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=error
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
org.eclipse.jdt.core.formatter.align_assignment_statements_on_columns=false
org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
Expand Down
4 changes: 2 additions & 2 deletions bundles/org.eclipse.equinox.http.servlet/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Bundle-ManifestVersion: 2
Bundle-Name: %bundleName
Bundle-Vendor: %providerName
Bundle-SymbolicName: org.eclipse.equinox.http.servlet
Bundle-Version: 1.7.400.qualifier
Bundle-Version: 1.8.0.qualifier
Bundle-Activator: org.eclipse.equinox.http.servlet.internal.Activator
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Bundle-RequiredExecutionEnvironment: JavaSE-17
Export-Package: org.eclipse.equinox.http.servlet;version="1.2.0",
org.eclipse.equinox.http.servlet.context;version="1.0.0";x-internal:=true,
org.eclipse.equinox.http.servlet.session;version="1.0.0";x-internal:=true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,9 @@

final HttpContextHolder httpContextHolder = getHttpContextHolder(httpContext);
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
@Override
public Void run() {
httpServiceRuntime.registerHttpServiceFilter(bundle, alias, filter, initparams, httpContextHolder);
return null;
}
AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {

Check warning on line 75 in bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java

View check run for this annotation

Jenkins - Eclipse Equinox / Java Compiler

tycho-compiler:compile

NORMAL:
httpServiceRuntime.registerHttpServiceFilter(bundle, alias, filter, initparams, httpContextHolder);
return null;
});
}
catch (PrivilegedActionException e) {
Expand Down Expand Up @@ -105,12 +102,9 @@
checkShutdown();
final HttpContextHolder httpContextHolder = getHttpContextHolder(httpContext);
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {
@Override
public Void run() throws NamespaceException {
httpServiceRuntime.registerHttpServiceResources(bundle, alias, name, httpContextHolder);
return null;
}
AccessController.doPrivileged((PrivilegedExceptionAction<Void>) () -> {

Check warning on line 105 in bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java

View check run for this annotation

Jenkins - Eclipse Equinox / Java Compiler

tycho-compiler:compile

NORMAL:
httpServiceRuntime.registerHttpServiceResources(bundle, alias, name, httpContextHolder);
return null;
});
} catch (PrivilegedActionException e) {
Throw.unchecked(e.getException());
Expand All @@ -131,7 +125,7 @@
checkShutdown();
final HttpContextHolder httpContextHolder = getHttpContextHolder(httpContext);
try {
AccessController.doPrivileged(new PrivilegedExceptionAction<Void>() {

Check warning on line 128 in bundles/org.eclipse.equinox.http.servlet/src/org/eclipse/equinox/http/servlet/internal/HttpServiceImpl.java

View check run for this annotation

Jenkins - Eclipse Equinox / Java Compiler

tycho-compiler:compile

NORMAL:
@Override
public Void run() throws NamespaceException, ServletException {
httpServiceRuntime.registerHttpServiceServlet(bundle, alias, servlet, initparams, httpContextHolder);
Expand Down
Loading
Loading