If Java had non-nullable types, I wouldn't be so paranoid.  I propose to 
address your comment with the following fix:

--- SWF9ParseTreePrinter.java   (revision 17266)
+++ SWF9ParseTreePrinter.java   (working copy)
@@ -260,9 +260,7 @@
   // We have to translate types in the `lz` "namespace" to their
   // actual type
   public String lzTypeToPlatformType(String type) {
-    if (type == null) {
-      return "";
-    } else if (type.startsWith("lz.")) {
+    if ((type != null) && type.startsWith("lz.")) {
       return ClassModel.LZXTag2JSClass(type.substring(3));
     } else {
       return type;

On 2010-08-13, at 07:25, André Bargull wrote:

> Why does lzTypeToPlatformType() transform 'null' to the empty string for 
> SWF9ParseTreePrinter whereas the general version in ParseTreePrinter just 
> returns 'null' in that case?
> 
> Otherwise approved!
> 
> On 8/12/2010 7:06 PM, P T Withington wrote:
>> [UPDATE: This also fixes LPP-9271 now]
>> 
>> Change 20100811-ptw-o by [email protected] on 2010-08-11 17:17:24 EDT
>>     in /Users/ptw/OpenLaszlo/trunk-2
>>     for http://svn.openlaszlo.org/openlaszlo/trunk
>> 
>> Summary: Allow type identifiers to be in a package, including `lz` 
>> pseudo-package
>> 
>> Bugs Fixed:
>>     LPP-8188 compiler cannot handle package names in method argument var 
>> type declarations
>>     LPP-9271 Specifying a class type for an arg does not appear to be 
>> supported when the class is lz.Foo
>> 
>> Technical Reviewer: [email protected] (pending)
>> QA Reviewer: [email protected] (pending)
>> 
>> Details:
>>     *ParseTreePrinter:  Add a hook to translate lz pseudo-package
>>     types to platform types.  Override it in the SWF9 back end.
>> 
>>     Parser: Teach the parser to accept a "dot expression" as a type name
>> 
>> Tests:
>>     Test case from bugs compile, inspected intermediate .as files for 
>> correctness
>> 
>> Files:
>> M       WEB-INF/lps/server/src/org/openlaszlo/sc/SWF9ParseTreePrinter.java
>> M       WEB-INF/lps/server/src/org/openlaszlo/sc/ParseTreePrinter.java
>> M       WEB-INF/lps/server/sc/src/org/openlaszlo/sc/Parser.jjt
>> 
>> Changeset: http://svn.openlaszlo.org/openlaszlo/patches/20100811-ptw-o.tar
>> 


Reply via email to