}
protected Properties getPropertiesBase(String n) {
- Properties r = p.getJavaScriptObject(n);
- return r != null ? r : Properties.create();
+ if (p.getJavaScriptObject(n) == null) {
+ p.set(n, Properties.create());
+ }
+ return p.getJavaScriptObject(n);
}
public String toString() {
} else if (isTypeAssignableTo(method.getReturnType(), jsonBuilderType)) {
String q = method.getReturnType().getQualifiedSourceName();
sw.println("return " + "((" + q + ")GWT.create(" + q + ".class))"
- + ".load(p.getJavaScriptObject(\"" + name + "\"));");
+ + ".load(getPropertiesBase(\"" + name + "\"));");
} else if (isTypeAssignableTo(method.getReturnType(), settingsType)) {
String q = method.getReturnType().getQualifiedSourceName();
- sw.println("return " + "((" + q + ")p.getJavaScriptObject(\"" + name + "\"));");
+ sw.println("return " + "((" + q + ")getPropertiesBase(\"" + name + "\"));");
} else if (retType.equals(Properties.class.getName())) {
sw.println("return getPropertiesBase(\"" + name + "\");");
} else if (isTypeAssignableTo(method.getReturnType(), jsType)) {