Fixed bug where type.properties of newly created prototypes were potentially
not updated correctly because another freshly created DbMapping was still missing.
This commit is contained in:
parent
6b06734adc
commit
fa53c338ac
1 changed files with 15 additions and 9 deletions
|
@ -124,17 +124,23 @@ public final class TypeManager {
|
||||||
zipfiles.put (filename, zipped);
|
zipfiles.put (filename, zipped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
// update prototype's type mapping
|
}
|
||||||
DbMapping dbmap = proto.getDbMapping ();
|
|
||||||
if (dbmap != null && dbmap.needsUpdate ()) {
|
// loop through prototypes and check if type.properties needs updates
|
||||||
dbmap.update ();
|
// it's important that we do this _after_ potentially new prototypes
|
||||||
|
// have been created in the previous loop.
|
||||||
|
for (Iterator i=prototypes.values().iterator(); i.hasNext(); ) {
|
||||||
|
Prototype proto = (Prototype) i.next ();
|
||||||
|
// update prototype's type mapping
|
||||||
|
DbMapping dbmap = proto.getDbMapping ();
|
||||||
|
if (dbmap != null && dbmap.needsUpdate ()) {
|
||||||
|
dbmap.update ();
|
||||||
// set parent prototype, in case it has changed.
|
// set parent prototype, in case it has changed.
|
||||||
String parentName = dbmap.getExtends ();
|
String parentName = dbmap.getExtends ();
|
||||||
if (parentName == null)
|
if (parentName == null)
|
||||||
parentName = "hopobject";
|
parentName = "hopobject";
|
||||||
proto.setParentPrototype (getPrototype (parentName));
|
proto.setParentPrototype (getPrototype (parentName));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,9 +156,9 @@ public final class TypeManager {
|
||||||
|
|
||||||
|
|
||||||
private boolean isValidTypeName (String str) {
|
private boolean isValidTypeName (String str) {
|
||||||
if (str == null)
|
if (str == null)
|
||||||
return false;
|
return false;
|
||||||
char[] c = str.toCharArray ();
|
char[] c = str.toCharArray ();
|
||||||
for (int i=0; i<c.length; i++)
|
for (int i=0; i<c.length; i++)
|
||||||
if (!Character.isJavaIdentifierPart (c[i]))
|
if (!Character.isJavaIdentifierPart (c[i]))
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue