diff options
author | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-05-06 21:26:29 +0200 |
---|---|---|
committer | Reinier Zwitserloot <r.zwitserloot@projectlombok.org> | 2019-05-06 21:26:29 +0200 |
commit | d41e804fe73faed5f8b90f4b472728bc3a0c85b7 (patch) | |
tree | f47d82c4f383cfdb242c803c88eadde5c2982944 /src/utils/lombok/javac/Javac.java | |
parent | 2335f251665d43b4c8cebe00b980f07ef33bdb17 (diff) | |
download | lombok-d41e804fe73faed5f8b90f4b472728bc3a0c85b7.tar.gz lombok-d41e804fe73faed5f8b90f4b472728bc3a0c85b7.tar.bz2 lombok-d41e804fe73faed5f8b90f4b472728bc3a0c85b7.zip |
[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).
Diffstat (limited to 'src/utils/lombok/javac/Javac.java')
-rw-r--r-- | src/utils/lombok/javac/Javac.java | 8 |
1 files changed, 6 insertions, 2 deletions
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) { |