From 0c124ba807b8a16f4119df64cb11734ed8e4ac1b Mon Sep 17 00:00:00 2001 From: "David A. Madore" Date: Fri, 16 Apr 2010 17:38:31 +0200 Subject: Use static initializers correctly (I had forgotten the "static" keyword!). --- org/madore/damlengine/TodoElement.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'org/madore/damlengine/TodoElement.java') 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> damlConstructors; - protected static void initializeDamlConstructors() { - // FIXME: this should be a static initializer, but for some reason does not work... + static { damlConstructors = new HashMap>(); } @@ -30,8 +29,6 @@ public abstract class TodoElement extends TodoItem { Map options) { Constructor 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 ) -- cgit v1.2.3