|
From: <jo...@us...> - 2004-01-07 13:26:10
|
Update of /cvsroot/jaxme/JaxMe/src/generator/de/ispsoft/jaxme/generator/types
In directory sc8-pr-cvs1:/tmp/cvs-serv8480/src/generator/de/ispsoft/jaxme/generator/types
Modified Files:
ResourceBundleFormattedType.java
Log Message:
Patterns have not been handled properly.
Index: ResourceBundleFormattedType.java
===================================================================
RCS file: /cvsroot/jaxme/JaxMe/src/generator/de/ispsoft/jaxme/generator/types/ResourceBundleFormattedType.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- ResourceBundleFormattedType.java 17 Dec 2002 20:59:09 -0000 1.6
+++ ResourceBundleFormattedType.java 7 Jan 2004 13:26:07 -0000 1.7
@@ -216,6 +216,7 @@
*/
protected String getFormatter(String pResourceBundleOwner) {
String pattern = getPattern();
+ boolean usePattern;
if (pattern == null) {
String key = getKey();
if (key == null) {
@@ -250,8 +251,10 @@
JavaSource.getQuoted(key) + ", " + JavaSource.getQuoted(defaultPattern) + ")";
}
}
+ usePattern = false;
} else {
pattern = JavaSource.getQuoted(pattern);
+ usePattern = true;
}
if (type == null) {
String className = getFormatClass();
@@ -260,7 +263,8 @@
}
return className + ".getInstance(" + pattern + ")";
} else if ("date".equals(type)) {
- return pResourceBundleOwner + ".getDateFormat(" + pattern + ")";
+ String method = usePattern ? "getDateFormatForPattern" : "getDateFormat";
+ return pResourceBundleOwner + "." + method + "(" + pattern + ")";
} else if ("decimal".equals(type)) {
return pResourceBundleOwner + ".getNumberFormat(" + pattern + ")";
} else if ("message".equals(type)) {
|