You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by jk...@apache.org on 2007/05/03 07:03:07 UTC

svn commit: r534711 - in /tapestry/tapestry4/trunk: tapestry-examples/Workbench/ tapestry-examples/Workbench/src/context/ tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/ tapestry-examples/Workbench/src/java/org/apache/tap...

Author: jkuhnert
Date: Wed May  2 22:03:05 2007
New Revision: 534711

URL: http://svn.apache.org/viewvc?view=rev&rev=534711
Log:
Fixes new as of yet uncaught bug related to component specification location changes. Modified ShowError component to have a properties file so that the bug would surface.

Added:
    tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.properties
Removed:
    tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/ShowError.java
Modified:
    tapestry/tapestry4/trunk/tapestry-examples/Workbench/pom.xml
    tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Home.html
    tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.html
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ComponentMessagesSourceImpl.java
    tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java

Modified: tapestry/tapestry4/trunk/tapestry-examples/Workbench/pom.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/pom.xml?view=diff&rev=534711&r1=534710&r2=534711
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/Workbench/pom.xml (original)
+++ tapestry/tapestry4/trunk/tapestry-examples/Workbench/pom.xml Wed May  2 22:03:05 2007
@@ -60,6 +60,7 @@
                     <include>**/*.jwc</include>
                     <include>**/*.page</include>
                     <include>**/*.html</include>
+                    <include>**/*.properties</include>
                 </includes>
             </resource>
         </resources>

Modified: tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Home.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Home.html?view=diff&rev=534711&r1=534710&r2=534711
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Home.html (original)
+++ tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/context/Home.html Wed May  2 22:03:05 2007
@@ -13,5 +13,4 @@
 <p>The Tapestry icon in the lower right corner raises the Tapestry Inspector in a new window.
 The Inspector is a mini-application used
 to explore a running Tapestry application.</p>
-
 </span>

Modified: tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.html
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.html?view=diff&rev=534711&r1=534710&r2=534711
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.html (original)
+++ tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.html Wed May  2 22:03:05 2007
@@ -5,4 +5,4 @@
             <span jwcid="@RenderBody" />
         </td>
     </tr>
-</table>
\ No newline at end of file
+</table>

Added: tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.properties
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.properties?view=auto&rev=534711
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.properties (added)
+++ tapestry/tapestry4/trunk/tapestry-examples/Workbench/src/java/org/apache/tapestry/workbench/components/form/ShowError.properties Wed May  2 22:03:05 2007
@@ -0,0 +1 @@
+Value=Something {0}

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ComponentMessagesSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ComponentMessagesSourceImpl.java?view=diff&rev=534711&r1=534710&r2=534711
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ComponentMessagesSourceImpl.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/ComponentMessagesSourceImpl.java Wed May  2 22:03:05 2007
@@ -15,20 +15,6 @@
 package org.apache.tapestry.services.impl;
 
 import edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap;
-
-import java.io.BufferedInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Properties;
-
 import org.apache.hivemind.ApplicationRuntimeException;
 import org.apache.hivemind.Messages;
 import org.apache.hivemind.Resource;
@@ -42,6 +28,12 @@
 import org.apache.tapestry.services.ComponentPropertySource;
 import org.apache.tapestry.util.text.LocalizedProperties;
 
+import java.io.BufferedInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.*;
+
 /**
  * Service used to access localized properties for a component.
  * 
@@ -275,7 +267,7 @@
         String fileName = baseResourceLocation.getName();
         int dotx = fileName.lastIndexOf('.');
 
-        return fileName.substring(0, dotx);
+        return dotx > -1 ? fileName.substring(0, dotx) : fileName;
     }
 
     private Properties readComponentProperties(IComponent component,
@@ -296,7 +288,8 @@
 
     private Properties readPropertiesResource(URL resourceURL, String encoding, Properties parent)
     {
-        if (resourceURL == null) return parent;
+        if (resourceURL == null)
+            return parent;
         
         Properties result = new Properties(parent);
         

Modified: tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java?view=diff&rev=534711&r1=534710&r2=534711
==============================================================================
--- tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java (original)
+++ tapestry/tapestry4/trunk/tapestry-framework/src/java/org/apache/tapestry/services/impl/HiveMindExpressionCompiler.java Wed May  2 22:03:05 2007
@@ -33,6 +33,7 @@
  *
  */
 public class HiveMindExpressionCompiler extends ExpressionCompiler implements OgnlExpressionCompiler {
+    
     private static final Log _log = LogFactory.getLog(HiveMindExpressionCompiler.class);
 
     private ClassFactory _classFactory;
@@ -155,6 +156,14 @@
                 // The target object may not fully resolve yet because of a partial tree with a null somewhere, we
                 // don't want to bail out forever because it might be enhancable on another pass eventually
                 return;
+            } catch (javassist.CannotCompileException e) {
+
+                _log.error("Error generating OGNL getter for expression " + expression + " with root " + root + " and body:\n" + getBody, e);
+
+                e.printStackTrace();
+
+                generateFailSafe(context, expression, root);
+                return;
             }
 
             try {
@@ -363,7 +372,7 @@
             body += "}";
 
             body = body.replaceAll("\\.\\.", ".");
-            
+
             MethodSignature method = new MethodSignature(ref.getType(), ref.getName(), params, null);
             classFab.addMethod(Modifier.PUBLIC, method, body);
         }