diff options
author | Alexander Kurtakov | 2018-10-08 18:13:35 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2018-10-08 18:20:31 +0000 |
commit | 71020425f5b69c5c6a32e68fc3e9f466b48c9ed7 (patch) | |
tree | e5f4b530e81993739897cab68ab6105afcb66b97 | |
parent | cb336c56c1eeecbe817ab3289c8550e520c83192 (diff) | |
download | rt.equinox.bundles-71020425f5b69c5c6a32e68fc3e9f466b48c9ed7.tar.gz rt.equinox.bundles-71020425f5b69c5c6a32e68fc3e9f466b48c9ed7.tar.xz rt.equinox.bundles-71020425f5b69c5c6a32e68fc3e9f466b48c9ed7.zip |
Don't use deprecated Class.newInstance.
Change-Id: I3d5cbe3d0b8ad9cde58d78ba62c4becf344c7a7f
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
8 files changed, 12 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java index fc7479ff4..5b97644ea 100755 --- a/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java +++ b/bundles/org.eclipse.equinox.console/src/org/eclipse/equinox/console/commands/EquinoxCommandProvider.java @@ -1437,7 +1437,7 @@ public class EquinoxCommandProvider implements SynchronousBundleListener { toThrow = throwable.getConstructor(String.class).newInstance(message); } catch (Exception e) { - toThrow = throwable.newInstance(); + toThrow = throwable.getDeclaredConstructor().newInstance(); } } // Initialize the cause. Its stack trace will be that of the current thread. 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 1e716d04c..8969336dc 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.6.100.qualifier +Bundle-Version: 3.6.200.qualifier Bundle-Activator: org.eclipse.equinox.http.jetty.internal.Activator Import-Package: javax.servlet;version="[2.6.0,4.0.0)", javax.servlet.http;version="[2.6.0,4.0.0)", diff --git a/bundles/org.eclipse.equinox.http.jetty/pom.xml b/bundles/org.eclipse.equinox.http.jetty/pom.xml index 27ed14a37..205d5615b 100644 --- a/bundles/org.eclipse.equinox.http.jetty/pom.xml +++ b/bundles/org.eclipse.equinox.http.jetty/pom.xml @@ -21,6 +21,6 @@ </parent> <groupId>org.eclipse.equinox</groupId> <artifactId>org.eclipse.equinox.http.jetty</artifactId> - <version>3.6.100-SNAPSHOT</version> + <version>3.6.200-SNAPSHOT</version> <packaging>eclipse-plugin</packaging> </project> diff --git a/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java b/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java index 203839f3a..94c3f96fa 100644 --- a/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java +++ b/bundles/org.eclipse.equinox.http.jetty/src/org/eclipse/equinox/http/jetty/internal/HttpServerManager.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2017 IBM Corporation and others. + * Copyright (c) 2007, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -241,7 +241,7 @@ public class HttpServerManager implements ManagedServiceFactory { return null; try { - return (JettyCustomizer) Class.forName(customizerClass).newInstance(); + return (JettyCustomizer) Class.forName(customizerClass).getDeclaredConstructor().newInstance(); } catch (Exception e) { // TODO: consider logging this, but we should still continue e.printStackTrace(); diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryStrategyOSGI.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryStrategyOSGI.java index 4ba193ba0..40715fbc2 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryStrategyOSGI.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/internal/registry/osgi/RegistryStrategyOSGI.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -138,7 +138,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { */ private final ReferenceMap bundleMap = new ReferenceMap(ReferenceMap.SOFT, DEFAULT_BUNDLECACHE_SIZE, DEFAULT_BUNDLECACHE_LOADFACTOR); - private ReadWriteLock bundleMapLock = new ReentrantReadWriteLock(); + private final ReadWriteLock bundleMapLock = new ReentrantReadWriteLock(); // String Id to OSGi Bundle conversion private Bundle getBundle(String id) { @@ -203,7 +203,7 @@ public class RegistryStrategyOSGI extends RegistryStrategy { // create a new instance Object result = null; try { - result = classInstance.newInstance(); + result = classInstance.getDeclaredConstructor().newInstance(); } catch (Exception e) { throwException(NLS.bind(RegistryMessages.plugin_instantiateClassError, contributingBundle.getSymbolicName(), className), e); } catch (LinkageError e1) { diff --git a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/spi/RegistryStrategy.java b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/spi/RegistryStrategy.java index fe7070998..54c103ec9 100644 --- a/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/spi/RegistryStrategy.java +++ b/bundles/org.eclipse.equinox.registry/src/org/eclipse/core/runtime/spi/RegistryStrategy.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2005, 2009 IBM Corporation and others. + * Copyright (c) 2005, 2018 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -223,7 +223,7 @@ public class RegistryStrategy { } try { - result = classInstance.newInstance(); + result = classInstance.getDeclaredConstructor().newInstance(); } catch (Exception e) { String message = NLS.bind(RegistryMessages.exExt_instantiateClassError, contributor.getActualName(), className); throw new CoreException(new Status(IStatus.ERROR, RegistryMessages.OWNER_NAME, IRegistryConstants.PLUGIN_ERROR, message, e)); diff --git a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java index 6ec319559..49b2a9217 100644 --- a/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java +++ b/bundles/org.eclipse.equinox.servletbridge/src/org/eclipse/equinox/servletbridge/BridgeServlet.java @@ -85,7 +85,7 @@ public class BridgeServlet extends HttpServlet { if (frameworkLauncherClassParameter != null) { try { Class<?> frameworkLauncherClass = this.getClass().getClassLoader().loadClass(frameworkLauncherClassParameter); - framework = (FrameworkLauncher) frameworkLauncherClass.newInstance(); + framework = (FrameworkLauncher) frameworkLauncherClass.getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new ServletException(e); } diff --git a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectPool.java b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectPool.java index fbd265241..9947b7ed7 100644 --- a/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectPool.java +++ b/bundles/org.eclipse.equinox.util/src/org/eclipse/equinox/internal/util/pool/ObjectPool.java @@ -47,7 +47,7 @@ public class ObjectPool { protected ObjectCreator oc; public Object getInstance() throws Exception { - return oc != null ? oc.getInstance() : template.newInstance(); + return oc != null ? oc.getInstance() : template.getDeclaredConstructor().newInstance(); } public ObjectPool(ObjectCreator oc, int size, int factor) { |