diff --git a/apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/IdenticonServlet.java b/apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/IdenticonServlet.java index 5628fb74b66c06ac28b7d007920be7ab0ae893b9..7cf6d0e3f05279c61be597241bd376c228aaf1f7 100644 --- a/apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/IdenticonServlet.java +++ b/apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/IdenticonServlet.java @@ -88,7 +88,7 @@ public class IdenticonServlet extends HttpServlet { if (cacheProvider != null) { try { Class<?> cacheClass = Class.forName(cacheProvider); - this.cache = (IdenticonCache) cacheClass.newInstance(); + this.cache = (IdenticonCache) cacheClass.getDeclaredConstructor().newInstance(); } catch (Exception e) { e.printStackTrace(); } diff --git a/apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/QRServlet.java b/apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/QRServlet.java index e11f8d62729d1e1c290f9b2bc9444dcba510dc24..272ac5a13d64b396bae90b6081ceb6babe0f5a0f 100644 --- a/apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/QRServlet.java +++ b/apps/imagegen/imagegen/webapp/src/main/java/net/i2p/imagegen/QRServlet.java @@ -89,7 +89,7 @@ public class QRServlet extends HttpServlet { if (cacheProvider != null) { try { Class<?> cacheClass = Class.forName(cacheProvider); - this.cache = (IdenticonCache) cacheClass.newInstance(); + this.cache = (IdenticonCache) cacheClass.getDeclaredConstructor().newInstance(); } catch (Exception e) { e.printStackTrace(); } diff --git a/apps/susimail/src/src/i2p/susi/webmail/encoding/EncodingFactory.java b/apps/susimail/src/src/i2p/susi/webmail/encoding/EncodingFactory.java index c2ede6cc69acc47716b215910cb516af9522752f..c7b1ee0af9962bb3c1a162a1797ca89584e3fc2c 100644 --- a/apps/susimail/src/src/i2p/susi/webmail/encoding/EncodingFactory.java +++ b/apps/susimail/src/src/i2p/susi/webmail/encoding/EncodingFactory.java @@ -51,7 +51,7 @@ public class EncodingFactory { for( int i = 0; i < classNames.length; i++ ) { try { Class<?> c = Class.forName( classNames[i] ); - Encoding e = (Encoding)c.newInstance(); + Encoding e = (Encoding) (c.getDeclaredConstructor().newInstance()); encodings.put( e.getName(), e ); Debug.debug( Debug.DEBUG, "Registered " + e.getClass().getName() ); } diff --git a/core/java/src/net/i2p/kademlia/KBucketSet.java b/core/java/src/net/i2p/kademlia/KBucketSet.java index f8ce16f195881491a9fc07a5c46b8d75fcb59a78..d0d8ef3568596c9683bf5760b661e58b7c0b0043 100644 --- a/core/java/src/net/i2p/kademlia/KBucketSet.java +++ b/core/java/src/net/i2p/kademlia/KBucketSet.java @@ -637,7 +637,7 @@ public class KBucketSet<T extends SimpleDataStructure> { throw new IllegalArgumentException("bad length " + dlen + " > " + len); T rv; try { - rv = (T) _us.getClass().newInstance(); + rv = (T) _us.getClass().getDeclaredConstructor().newInstance(); } catch (Exception e) { _log.error("fail", e); throw new RuntimeException(e); diff --git a/router/java/src/org/cybergarage/upnp/UPnP.java b/router/java/src/org/cybergarage/upnp/UPnP.java index db5042a2d0d8773cac1f92621f275b468dd3e4f5..d4a8d4caa30542618c6f303984ef1fcc2f76c8c7 100644 --- a/router/java/src/org/cybergarage/upnp/UPnP.java +++ b/router/java/src/org/cybergarage/upnp/UPnP.java @@ -269,7 +269,7 @@ public class UPnP if(parserClass[i]==null) continue; try { - parser = (Parser) Class.forName(parserClass[i]).newInstance(); + parser = (Parser) Class.forName(parserClass[i]).getDeclaredConstructor().newInstance(); return parser; } catch (Throwable e) { Debug.warning("Unable to load "+parserClass[i]+" as XMLParser due to "+e);