X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fresources%2FBundle.java;h=83069f90793bdc9baabce94e76ee4a21846e6951;hb=d827da2aba3d8b0e4a76426b5a76a9045ca584b2;hp=bad7f3e6c46679c31622b8e34bb8b6b0c0bb955a;hpb=db31c35860081535d6e7ddc83ab4af573bb0522e;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/resources/Bundle.java b/src/be/nikiroo/utils/resources/Bundle.java index bad7f3e..83069f9 100644 --- a/src/be/nikiroo/utils/resources/Bundle.java +++ b/src/be/nikiroo/utils/resources/Bundle.java @@ -384,7 +384,7 @@ public class Bundle> { for (Field field : type.getDeclaredFields()) { Meta meta = field.getAnnotation(Meta.class); if (meta != null) { - E id = E.valueOf(type, field.getName()); + E id = Enum.valueOf(type, field.getName()); String info = getMetaInfo(meta); if (info != null) { @@ -657,7 +657,7 @@ public class Bundle> { * @param bundle * the bundle to copy */ - private void resetMap(ResourceBundle bundle) { + protected void resetMap(ResourceBundle bundle) { this.map.clear(); if (bundle != null) { @@ -698,7 +698,7 @@ public class Bundle> { if (snap instanceof Map) { changeMap = (Map) snap; } else { - throw new Error( + throw new RuntimeException( "Restoring changes in a Bundle must be done on a changes snapshot, " + "or NULL to discard current changes"); } @@ -739,9 +739,9 @@ public class Bundle> { file = new File(dir, name + loc + ".properties"); if (file.exists()) { break; - } else { - file = null; } + + file = null; } return file;