You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by tv...@apache.org on 2009/05/08 20:48:13 UTC

svn commit: r773063 - /incubator/pivot/trunk/wtk/src/pivot/wtkx/BindProcessor.java

Author: tvolkert
Date: Fri May  8 18:48:13 2009
New Revision: 773063

URL: http://svn.apache.org/viewvc?rev=773063&view=rev
Log:
Fixed issue with BindProcessor's creating of the WTKX resources object

Modified:
    incubator/pivot/trunk/wtk/src/pivot/wtkx/BindProcessor.java

Modified: incubator/pivot/trunk/wtk/src/pivot/wtkx/BindProcessor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/pivot/wtkx/BindProcessor.java?rev=773063&r1=773062&r2=773063&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/pivot/wtkx/BindProcessor.java (original)
+++ incubator/pivot/trunk/wtk/src/pivot/wtkx/BindProcessor.java Fri May  8 18:48:13 2009
@@ -279,16 +279,17 @@
                             }
                         }
 
+                        // Attempt to load the resources
+                        sourceCode.append("resources = null;");
                         if (baseName != null) {
-                            // Attempt to load the resources
                             if (language == null) {
                                 sourceCode.append("locale = java.util.Locale.getDefault();");
                             } else {
                                 sourceCode.append(String.format("locale = new java.util.Locale(\"%s\");", language));
                             }
-                            sourceCode.append("resources = null;");
                             sourceCode.append("try {");
-                            sourceCode.append(String.format("resources = new pivot.util.Resources(\"%s\", locale, \"UTF8\");", baseName));
+                            sourceCode.append(String.format("resources = new pivot.util.Resources(%s, locale, \"UTF8\");",
+                                defaultResources ? (baseName + ".class.getName()") : ("\"" + baseName + "\"")));
                             sourceCode.append("} catch(java.io.IOException ex) {");
                             sourceCode.append("throw new pivot.wtkx.BindException(ex);");
                             sourceCode.append("} catch (pivot.serialization.SerializationException ex) {");
@@ -301,11 +302,7 @@
                         }
 
                         // Load the WTKX resource
-                        if (baseName == null) {
-                            sourceCode.append("wtkxSerializer = new pivot.wtkx.WTKXSerializer();");
-                        } else {
-                            sourceCode.append("wtkxSerializer = new pivot.wtkx.WTKXSerializer(resources);");
-                        }
+                        sourceCode.append("wtkxSerializer = new pivot.wtkx.WTKXSerializer(resources);");
                         sourceCode.append(String.format("location = getClass().getResource(\"%s\");", resourceName));
                         sourceCode.append("try {");
                         sourceCode.append("object = wtkxSerializer.readObject(location);");