I compiled with detailed style  and debugged both versions and it
appears to the newer version is not handling one of my finally blocks
correctly.

In 2.1.0 the if statement in the finally block is not generated, but
it is there in the 2.0.4.

Should I open an issue for this?

Thanks,
-Rob

Here's the Java:
try{
  dosomething()...
   } catch (Throwable jjte000) {
          if (jjtc000) {
            jjtree.clearNodeScope(jjtn000);
            jjtc000 = false;
          } else {
            jjtree.popNode();
          }
          if (jjte000 instanceof RuntimeException) {
            {if (true) throw (RuntimeException)jjte000;}
          }
          if (jjte000 instanceof ParseException) {
            {if (true) throw (ParseException)jjte000;}
          }
          {if (true) throw (Error)jjte000;}
    } finally {
          if (jjtc000) {
            jjtree.closeNodeScope(jjtn000, true);
            jjtreeCloseNodeScope(jjtn000);
          }
    }

Here's gwt-2.1.0
catch ($e0) {
    $e0 =
com_google_gwt_lang_Exceptions_caught__Ljava_lang_Object_2Ljava_lang_Object_2($e0);
    if
(com_google_gwt_lang_Cast_instanceOf__Ljava_lang_Object_2IZ($e0, 3)) {
      jjte000 = $e0;
      com_coco_prod_client_JJTCLBParseState_
$clearNodeScope__Lcom_coco_prod_client_JJTCLBParseState_2Lcom_coco_prod_client_Node_2V(this
$static.com_coco_prod_client_CLBParse_jjtree);
      if (jjte000 != null && jjte000.java_lang_Object_castableTypeMap$
&& !!jjte000.java_lang_Object_castableTypeMap$[2]) {
        throw
com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(jjte000,
2);
      }
      if (jjte000 != null && jjte000.java_lang_Object_castableTypeMap$
&& !!jjte000.java_lang_Object_castableTypeMap$[4]) {
        throw
com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(jjte000,
4);
      }
      throw
com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(jjte000,
5);
    }
     else
      throw $e0;
  }
   finally {
    com_coco_prod_client_JJTCLBParseState_
$closeNodeScope__Lcom_coco_prod_client_JJTCLBParseState_2Lcom_coco_prod_client_Node_2ZV(this
$static.com_coco_prod_client_CLBParse_jjtree, jjtn000);
    jjtn000.com_coco_prod_client_SimpleNode_last_1token =
com_coco_prod_client_CLBParse_
$getToken__Lcom_coco_prod_client_CLBParse_2ILcom_coco_prod_client_Token_2(this
$static, 0);
  }



gwt-2.0.4:
   catch ($e0) {
    $e0 =
com_google_gwt_lang_Exceptions_caught__Ljava_lang_Object_2Ljava_lang_Object_2($e0);
    if
(com_google_gwt_lang_Cast_instanceOf__Ljava_lang_Object_2IZ($e0, 3)) {
      jjte000 = $e0;
      if (jjtc000) {
        com_coco_prod_client_JJTCLBParseState_
$clearNodeScope__Lcom_coco_prod_client_JJTCLBParseState_2Lcom_coco_prod_client_Node_2V(this
$static.com_coco_prod_client_CLBParse_jjtree);
        jjtc000 = false;
      }
       else {
        com_coco_prod_client_JJTCLBParseState_
$popNode__Lcom_coco_prod_client_JJTCLBParseState_2Lcom_coco_prod_client_Node_2(this
$static.com_coco_prod_client_CLBParse_jjtree);
      }
      if (jjte000 != null &&
com_google_gwt_lang_Cast_canCast__IIZ(jjte000.java_lang_Object_typeId
$, 2)) {
        throw
com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(jjte000,
2);
      }
      if (jjte000 != null &&
com_google_gwt_lang_Cast_canCast__IIZ(jjte000.java_lang_Object_typeId
$, 4)) {
        throw
com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(jjte000,
4);
      }
      throw
com_google_gwt_lang_Cast_dynamicCast__Ljava_lang_Object_2ILjava_lang_Object_2(jjte000,
5);
    }
     else
      throw $e0;
  }
   finally {
    if (jjtc000) {
      com_coco_prod_client_JJTCLBParseState_
$closeNodeScope__Lcom_coco_prod_client_JJTCLBParseState_2Lcom_coco_prod_client_Node_2ZV(this
$static.com_coco_prod_client_CLBParse_jjtree, jjtn000, true);
      jjtn000.com_coco_prod_client_SimpleNode_last_1token =
com_coco_prod_client_CLBParse_
$getToken__Lcom_coco_prod_client_CLBParse_2ILcom_coco_prod_client_Token_2(this
$static, 0);
    }
  }
}



ep wrote:
> what about debugging? you can compile with no obfuscation (detailed
> level would be best) and use browser's debugger to get the place where
> the error arises, i.e. remove the throwable catch, compile detailed,
> enable debugger in IE (or install firebug in FF) and let the error
> appear. when clicking on that error the debugger brings you to the
> place where it happens. maybe you could post those JS fragment found.
>
> maybe CLBParse class is not 2.1 compatible
>
> On 17 Nov., 23:23, Rob Hennessy <[email protected]> wrote:
> > Hi All,
> >
> > I have a web app where I exposed a class's static method using JSNI,
> > as in the JSNI example. I execute the method from the native event
> > handler.
> >
> > Within the method, I try and catch, and return any exception's message
> > as the method's return value.
> >
> > The method works properly in 2.0.4, but in 2.1.0 it only works in
> > devmode
> >
> > In 2.1.0 production mode any exception I get returns "Index:-1, Size:
> > 0" and is always in the Throwable catch. With no Throwable catch, the
> > browser states "object error".
> >
> > public static String parse(String script) throws ParseException{
> >         try {
> >             CLBParse parser = new CLBParse(new
> > MyStringReader(script));
> >             SimpleNode root = parser.Input();
> >             return "";
> >         } catch (ParseException e) {
> >             return e.getMessage();
> >         }catch( Throwable e) {
> >             GWT.log("something bad", e);
> >
> >             return e.getMessage();
> >         }
> >        return "";
> >
> > }
> >
> >     public native void export() /*-{
> >
> >       $wnd.TryParse =
> > $entry(@com.test.app.client.CalcScriptReformatter::parse(Ljava/lang/
> > String;));
> >
> > }-*/;
> >
> > I've tried with and without the $entry wrapper.
> >
> > Is this a bug in 2.1.0, or should I be doing something different?
> >
> > Thanks,
> > -Rob

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to