X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fresources%2FBundle.java;h=83069f90793bdc9baabce94e76ee4a21846e6951;hb=d827da2aba3d8b0e4a76426b5a76a9045ca584b2;hp=1dbb251f942b4d3a95d0720e29a8ddcdc48a444e;hpb=b771aed5070864bbcbae286c8de74478f6837618;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/resources/Bundle.java b/src/be/nikiroo/utils/resources/Bundle.java index 1dbb251..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) { @@ -671,7 +671,7 @@ public class Bundle> { } } } - + /** * Take a snapshot of the changes in memory in this {@link Bundle} made by * the "set" methods ( {@link Bundle#setString(Enum, String)}...) at the @@ -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;