From d41e804fe73faed5f8b90f4b472728bc3a0c85b7 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 6 May 2019 21:26:29 +0200 Subject: [trivial] replacing all calls to Class.newInstance() with Class.getConstructor().newInstance to avoid warnings which are default in many JDK11+ environments, and it shouldn’t change anything (we handle the change from sneaky throwing to InvocationTargetException appropriately). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/lombok/javac/Javac.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/utils/lombok/javac') diff --git a/src/utils/lombok/javac/Javac.java b/src/utils/lombok/javac/Javac.java index 7a264e39..3cc72f4e 100644 --- a/src/utils/lombok/javac/Javac.java +++ b/src/utils/lombok/javac/Javac.java @@ -409,10 +409,14 @@ public class Javac { } else { try { if (CTC_VOID.equals(tag)) { - return (Type) JC_VOID_TYPE.newInstance(); + return (Type) JC_VOID_TYPE.getConstructor().newInstance(); } else { - return (Type) JC_NO_TYPE.newInstance(); + return (Type) JC_NO_TYPE.getConstructor().newInstance(); } + } catch (InvocationTargetException e) { + throw sneakyThrow(e.getCause()); + } catch (NoSuchMethodException e) { + throw sneakyThrow(e); } catch (IllegalAccessException e) { throw sneakyThrow(e); } catch (InstantiationException e) { -- cgit