diff options
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java | 6 | ||||
-rw-r--r-- | tools/BUILD | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java b/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java index 84bf214607..b437f635f5 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/nls/GlobalBundleCache.java @@ -43,6 +43,7 @@ package org.eclipse.jgit.nls; +import java.lang.reflect.InvocationTargetException; import java.util.HashMap; import java.util.Locale; import java.util.Map; @@ -92,12 +93,13 @@ class GlobalBundleCache { } TranslationBundle bundle = bundles.get(type); if (bundle == null) { - bundle = type.newInstance(); + bundle = type.getDeclaredConstructor().newInstance(); bundle.load(locale); bundles.put(type, bundle); } return (T) bundle; - } catch (InstantiationException | IllegalAccessException e) { + } catch (InstantiationException | IllegalAccessException + | InvocationTargetException | NoSuchMethodException e) { throw new Error(e); } } diff --git a/tools/BUILD b/tools/BUILD index 9abecc5f72..20c82c5700 100644 --- a/tools/BUILD +++ b/tools/BUILD @@ -32,7 +32,7 @@ java_package_configuration( "-Xep:BoxedPrimitiveConstructor:ERROR", "-Xep:CannotMockFinalClass:ERROR", "-Xep:ClassCanBeStatic:ERROR", - "-Xep:ClassNewInstance:WARN", + "-Xep:ClassNewInstance:ERROR", "-Xep:DefaultCharset:ERROR", "-Xep:DoubleCheckedLocking:ERROR", "-Xep:ElementsCountedInLoop:ERROR", |