From d1c1ac4ceab2f1ee4634335e5c1da455d877d7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Wed, 9 Nov 2022 08:26:09 +0200 Subject: [PATCH] Minor changes in o.e.equinox.http.jetty Jarsigner verify gives ``` Warning: This jar contains entries whose TSA certificate chain is invalid. Reason: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target POSIX file permission and/or symlink attributes detected. These attributes are ignored when signing and are not protected by the signature. ``` for this bundle so this change is to get it resigned. --- .../META-INF/MANIFEST.MF | 2 +- .../http/jetty/internal/Activator.java | 37 ++++++++++++------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/bundles/org.eclipse.equinox.http.jetty/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.http.jetty/META-INF/MANIFEST.MF index 3d81d7eba7d..271f0a4ce8e 100644 --- a/bundles/org.eclipse.equinox.http.jetty/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.http.jetty/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: %bundleName Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-SymbolicName: org.eclipse.equinox.http.jetty -Bundle-Version: 3.8.100.qualifier +Bundle-Version: 3.8.200.qualifier Bundle-Activator: org.eclipse.equinox.http.jetty.internal.Activator Import-Package: javax.servlet;version="[3.1.0,5.0.0)", javax.servlet.http;version="[3.1.0,5.0.0)", diff --git a/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/Activator.java b/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/Activator.java index 4e08e8af711..4089cb6e6d8 100644 --- a/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/Activator.java +++ b/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/Activator.java @@ -35,17 +35,23 @@ public class Activator implements BundleActivator { private static final String ORG_OSGI_SERVICE_HTTP_PORT = "org.osgi.service.http.port"; //$NON-NLS-1$ private static final String ORG_OSGI_SERVICE_HTTP_PORT_SECURE = "org.osgi.service.http.port.secure"; //$NON-NLS-1$ - // controls whether start() should automatically start an Http Service based on BundleContext properties (default is false) - // Note: only used if the bundle is explicitly started (e.g. not "lazy" activated) + // controls whether start() should automatically start an Http Service based on + // BundleContext properties (default is false) + // Note: only used if the bundle is explicitly started (e.g. not "lazy" + // activated) private static final String AUTOSTART = "org.eclipse.equinox.http.jetty.autostart"; //$NON-NLS-1$ - // Jetty will use a basic stderr logger if no other logging mechanism is provided. - // This setting can be used to over-ride the stderr logger threshold(and only this default logger) - // Valid values are in increasing threshold: "debug", "info", "warn", "error", and "off" + // Jetty will use a basic stderr logger if no other logging mechanism is + // provided. + // This setting can be used to over-ride the stderr logger threshold(and only + // this default logger) + // Valid values are in increasing threshold: "debug", "info", "warn", "error", + // and "off" // (default threshold is "warn") private static final String LOG_STDERR_THRESHOLD = "org.eclipse.equinox.http.jetty.log.stderr.threshold"; //$NON-NLS-1$ - // The staticServerManager is use by the start and stopServer methods and must be accessed in a static synchronized block + // The staticServerManager is use by the start and stopServer methods and must + // be accessed in a static synchronized block // to ensure it is correctly handled in terms of the bundle life-cycle. private static HttpServerManager staticServerManager; @@ -76,7 +82,8 @@ private boolean isBundleLazyActivationPolicyUsed(BundleContext context) { if (context.getBundle().adapt(BundleStartLevel.class).isActivationPolicyUsed()) { // checking for lazy capability; NOTE this is equinox specific // but we fall back to header lookup for other frameworks - List moduleData = context.getBundle().adapt(BundleRevision.class).getDeclaredCapabilities("equinox.module.data"); //$NON-NLS-1$ + List moduleData = context.getBundle().adapt(BundleRevision.class) + .getDeclaredCapabilities("equinox.module.data"); //$NON-NLS-1$ String activationPolicy = null; if (moduleData.isEmpty()) { activationPolicy = context.getBundle().getHeaders("").get(Constants.BUNDLE_ACTIVATIONPOLICY); //$NON-NLS-1$ @@ -188,12 +195,14 @@ private Dictionary createDefaultSettings(BundleContext context) defaultSettings.put(JettyConstants.CONTEXT_PATH, contextpath); // Session Inactive Interval (timeout) - String sessionInactiveInterval = Details.getStringProp(context, JettyConstants.CONTEXT_SESSIONINACTIVEINTERVAL, null); + String sessionInactiveInterval = Details.getStringProp(context, JettyConstants.CONTEXT_SESSIONINACTIVEINTERVAL, + null); if (sessionInactiveInterval != null) { try { - defaultSettings.put(JettyConstants.CONTEXT_SESSIONINACTIVEINTERVAL, Integer.valueOf(sessionInactiveInterval)); + defaultSettings.put(JettyConstants.CONTEXT_SESSIONINACTIVEINTERVAL, + Integer.valueOf(sessionInactiveInterval)); } catch (NumberFormatException e) { - //(log this) ignore + // (log this) ignore } } @@ -203,7 +212,7 @@ private Dictionary createDefaultSettings(BundleContext context) try { defaultSettings.put(JettyConstants.HOUSEKEEPER_INTERVAL, Long.valueOf(houseKeeperInterval)); } catch (NumberFormatException e) { - //(log this) ignore + // (log this) ignore } } @@ -220,19 +229,19 @@ private Dictionary createDefaultSettings(BundleContext context) return defaultSettings; } - public synchronized static void startServer(String pid, Dictionary settings) throws Exception { + public static synchronized void startServer(String pid, Dictionary settings) throws Exception { if (staticServerManager == null) throw new IllegalStateException("Inactive"); //$NON-NLS-1$ staticServerManager.updated(pid, settings); } - public synchronized static void stopServer(String pid) throws Exception { + public static synchronized void stopServer(String pid) throws Exception { if (staticServerManager != null) staticServerManager.deleted(pid); } - private synchronized static void setStaticServerManager(HttpServerManager httpServerManager) { + private static synchronized void setStaticServerManager(HttpServerManager httpServerManager) { staticServerManager = httpServerManager; } }