diff options
author | David A. Madore <david+git@madore.org> | 2010-04-16 17:38:31 +0200 |
---|---|---|
committer | David A. Madore <david+git@madore.org> | 2010-04-16 17:38:31 +0200 |
commit | 0c124ba807b8a16f4119df64cb11734ed8e4ac1b (patch) | |
tree | 242eb8f22604739fba5af23ed40268c7d5522d85 /org/madore/damlengine/TodoElement.java | |
parent | c18d6e561179a3a96d93a9ae8c6034115ba36923 (diff) | |
download | damlengine-0c124ba807b8a16f4119df64cb11734ed8e4ac1b.tar.gz damlengine-0c124ba807b8a16f4119df64cb11734ed8e4ac1b.tar.bz2 damlengine-0c124ba807b8a16f4119df64cb11734ed8e4ac1b.zip |
Use static initializers correctly (I had forgotten the "static" keyword!).
Diffstat (limited to 'org/madore/damlengine/TodoElement.java')
-rw-r--r-- | org/madore/damlengine/TodoElement.java | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/org/madore/damlengine/TodoElement.java b/org/madore/damlengine/TodoElement.java index f8dcca1..a069b36 100644 --- a/org/madore/damlengine/TodoElement.java +++ b/org/madore/damlengine/TodoElement.java @@ -10,8 +10,7 @@ public abstract class TodoElement extends TodoItem { protected static Map<String,Constructor<? extends TodoElement>> damlConstructors; - protected static void initializeDamlConstructors() { - // FIXME: this should be a static initializer, but for some reason does not work... + static { damlConstructors = new HashMap<String,Constructor<? extends TodoElement>>(); } @@ -30,8 +29,6 @@ public abstract class TodoElement extends TodoItem { Map<String,Object> options) { Constructor<? extends TodoElement> constructor = null; String nsuri = node.getNamespaceURI(); - if ( damlConstructors == null ) - initializeDamlConstructors(); // FIXME: see above if ( nsuri != null && nsuri.equals(DamlEngine.DAML_NS) ) constructor = damlConstructors.get(node.getLocalName()); if ( constructor != null ) |