No, you should not expect internal compiler exceptions. Whether you've tripped 
up on a known bug or not, I don't know. The GWT issue tracker may help you
    http://code.google.com/p/google-web-toolkit/issues 
<http://code.google.com/p/google-web-toolkit/issues>

HTH
Paul

On 10/03/11 02:42, David Heimann wrote:
I was fiddling with the gwt canvas demo and ran across an Internal
Compiler Exception.
Not that I mind, because I am nothing if not flexible!
Should I poke into the compiler code since gwt developers have to
handle this all the time, or is it just because I've done something
very wrong?

Thanks if you know and thanks if you don't.

Sincerely,

David Heimann


Ubuntu 10.04.1 LTS \n \l


     Eclipse SDK        3.6.1.M20100909-0800
     Google App Engine Java SDK 1.4.2   1.4.2.v201102111811
     Google Plugin for Eclipse 3.6      2.2.0.v201102111811
       Eclipse Platform
3.6.1.r361_v20100909-9gF78GrkFqw7GrsZnvz0JWNTeb6fue6896L
         Eclipse Help System    1.2.0.v20100427-7e7jEQFEp4jsWcboLU9l93
         Eclipse RCP    3.6.1.r361_v20100827-9OArFLdFjY-ThSQXmKvKz0_T
         Equinox p2 Provisioning
2.0.1.r361_v20100903-897HFZFFZRuSD2LMtVxyz0Vr
       GWT Designer Core        2.2.0.r36x201102111446
       GWT Designer Editor      2.2.0.r36x201102111505
       WindowBuilder Core       0.9.0.r36x201102111430
         Eclipse Plug-in Development Environment
3.6.1.r361_v20100727-7b7mFL-FET3dhESDgE5_bkJ
       WindowBuilder CSS Support        0.9.0.r36x201102051550
       WindowBuilder XML Core   0.9.0.r36x201102111443
     Google Web Toolkit SDK 2.2.0       2.2.0.v201102111811


Source:
package com.gae01.egypt.client;

import com.google.gwt.canvas.client.Canvas;
import com.google.gwt.canvas.dom.client.Context2d;
import com.google.gwt.canvas.dom.client.CssColor;
import com.google.gwt.canvas.dom.client.FillStrokeStyle;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;

public class Papyrus implements EntryPoint {
          static final String holderId = "canvasholder";
          static final String upgradeMessage = "Your browser does not support
the HTML5 Canvas. Please upgrade your browser to view this demo.";
          Canvas canvas;
          Canvas backBuffer;
          Context2d context;
          Context2d backBufferContext;
          static final int height = 400;
          static final int width = 400;
          final FillStrokeStyle strokeStyle = CssColor.make("#333300");
          final CssColor redrawColor =
CssColor.make("rgba(255,255,255,0.6)");

          @Override
        public void onModuleLoad() {
                // TODO Auto-generated method stub
                    canvas = Canvas.createIfSupported();
                    backBuffer = Canvas.createIfSupported();
                    if (canvas == null) {
                      RootPanel.get(holderId).add(new Label(upgradeMessage));
                      return;
                    }
                    canvas.setWidth(width + "px");
                    canvas.setHeight(height + "px");
                    canvas.setCoordinateSpaceWidth(width);
                    canvas.setCoordinateSpaceHeight(height);
                    backBuffer.setCoordinateSpaceWidth(width);
                    backBuffer.setCoordinateSpaceHeight(height);
                    RootPanel.get(holderId).add(canvas);
                    context = canvas.getContext2d();
                    backBufferContext = backBuffer.getContext2d();

        }
          void doUpdate() {
                    // update the back canvas
                    backBufferContext.setFillStyle(redrawColor);
                    backBufferContext.fillRect(0, 0, width, height);
                        context.setStrokeStyle(strokeStyle);
                        context.beginPath();
                        context.arc(0,0,20,0, Math.PI * 2, true);
                        context.closePath();
                        context.stroke();
                  }
}


Error:


Compiling module com.gae01.egypt.Papyrus
    [ERROR] An internal compiler exception occurred
com.google.gwt.dev.jjs.InternalCompilerException: Unexpected error
during visit.
        at
com.google.gwt.dev.jjs.ast.JVisitor.translateException(JVisitor.java:
108)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:127)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:119)
        at com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer
$RescueVisitor.rescue(ControlFlowAnalyzer.java:557)
        at com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer
$RescueVisitor.rescueAndInstantiate(ControlFlowAnalyzer.java:614)
        at com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer
$RescueVisitor.visit(ControlFlowAnalyzer.java:371)
        at com.google.gwt.dev.jjs.ast.JNewInstance.traverse(JNewInstance.java:
84)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:119)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:115)
        at
com.google.gwt.dev.jjs.ast.JThrowStatement.traverse(JThrowStatement.java:
38)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:143)
        at
com.google.gwt.dev.jjs.ast.JVisitor.acceptWithInsertRemoveImmutable(JVisitor.java:
169)
        at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:83)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:136)
        at com.google.gwt.dev.jjs.ast.JIfStatement.traverse(JIfStatement.java:
53)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:143)
        at
com.google.gwt.dev.jjs.ast.JVisitor.acceptWithInsertRemoveImmutable(JVisitor.java:
169)
        at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:83)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:136)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:132)
        at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:
82)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:119)
        at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:329)
        at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:297)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:119)
        at com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer
$RescueVisitor.rescue(ControlFlowAnalyzer.java:502)
        at com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer
$RescueVisitor.visit(ControlFlowAnalyzer.java:335)
        at com.google.gwt.dev.jjs.ast.JMethodCall.traverse(JMethodCall.java:
170)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:119)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:115)
        at
com.google.gwt.dev.jjs.ast.JReturnStatement.traverse(JReturnStatement.java:
39)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:143)
        at
com.google.gwt.dev.jjs.ast.JVisitor.acceptWithInsertRemoveImmutable(JVisitor.java:
169)
        at com.google.gwt.dev.jjs.ast.JBlock.traverse(JBlock.java:83)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:136)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:132)
        at com.google.gwt.dev.jjs.ast.JMethodBody.traverse(JMethodBody.java:
82)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:119)
        at com.google.gwt.dev.jjs.ast.JMethod.visitChildren(JMethod.java:329)
        at com.google.gwt.dev.jjs.ast.JMethod.traverse(JMethod.java:297)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:119)
        at com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer
$RescueVisitor.rescue(ControlFlowAnalyzer.java:502)
        at com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer
$RescueVisitor.access$1200(ControlFlowAnalyzer.java:91)
        at
com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer.traverseFrom(ControlFlowAnalyzer.java:
801)
        at
com.google.gwt.dev.jjs.impl.Pruner.traverseFromCodeGenTypes(Pruner.java:
678)
        at com.google.gwt.dev.jjs.impl.Pruner.execImpl(Pruner.java:642)
        at com.google.gwt.dev.jjs.impl.Pruner.exec(Pruner.java:526)
        at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.optimizeLoop(JavaToJavaScriptCompiler.java:
796)
        at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.optimize(JavaToJavaScriptCompiler.java:
709)
        at
com.google.gwt.dev.jjs.JavaToJavaScriptCompiler.precompile(JavaToJavaScriptCompiler.java:
635)
        at
com.google.gwt.dev.jjs.JavaScriptCompiler.precompile(JavaScriptCompiler.java:
35)
        at com.google.gwt.dev.Precompile.precompile(Precompile.java:541)
        at com.google.gwt.dev.Precompile.precompile(Precompile.java:495)
        at com.google.gwt.dev.Precompile.precompile(Precompile.java:407)
        at com.google.gwt.dev.Compiler.run(Compiler.java:215)
        at com.google.gwt.dev.Compiler.run(Compiler.java:187)
        at com.google.gwt.dev.Compiler$1.run(Compiler.java:159)
        at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:
87)
        at
com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:
81)
        at com.google.gwt.dev.Compiler.main(Compiler.java:166)
Caused by: java.lang.NullPointerException
        at com.google.gwt.dev.jjs.impl.ControlFlowAnalyzer
$RescueVisitor.visit(ControlFlowAnalyzer.java:205)
        at com.google.gwt.dev.jjs.ast.JClassType.traverse(JClassType.java:60)
        at com.google.gwt.dev.jjs.ast.JVisitor.accept(JVisitor.java:124)
        ... 67 more
       [ERROR] at ArithmeticException.java(26): final class
ArithmeticException extends RuntimeException
          com.google.gwt.dev.jjs.ast.JClassType
       [ERROR] at LongLibBase.java(118): new ArithmeticException()
          com.google.gwt.dev.jjs.ast.JNewInstance
       [ERROR] at LongLibBase.java(118): throw new
ArithmeticException()
          com.google.gwt.dev.jjs.ast.JThrowStatement
       [ERROR] at LongLibBase.java(117): {
   throw new ArithmeticException();
}
          com.google.gwt.dev.jjs.ast.JBlock
       [ERROR] at LongLibBase.java(117): if (LongLibBase.getLNative(b)
== 0&&  LongLibBase.getMNative(b) == 0&&  LongLibBase.getHNative(b) ==
0) {
   throw new ArithmeticException();
}
          com.google.gwt.dev.jjs.ast.JIfStatement
       [ERROR] at LongLibBase.java(115): {
   if (LongLibBase.getLNative(b) == 0&&  LongLibBase.getMNative(b) == 0
&&  LongLibBase.getHNative(b) == 0) {
     throw new ArithmeticException();
   }
   if (LongLibBase.getLNative(a) == 0&&  LongLibBase.getMNative(a) == 0
&&  LongLibBase.getHNative(a) == 0) {
     computeRemainder&&  (LongLibBase.remainder =
LongLibBase.create0(0, 0, 0));
     return LongLibBase.create0(0, 0, 0);
   }
   if (LongLibBase.getHNative(b) == 524288&&  LongLibBase.getMNative(b)
== 0&&  LongLibBase.getLNative(b) == 0) {
     return LongLibBase.divModByMinValue(a, computeRemainder);
   }
   boolean negative = false;
   if (LongLibBase.getHNative(b)>>  19 != 0) {
     b = LongLib.neg(b);
     negative = !negative;
   }
   final int bpower = LongLibBase.powerOfTwo(b);
   boolean aIsNegative = false;
   boolean aIsMinValue = false;
   boolean aIsCopy = false;
   if (LongLibBase.getHNative(a) == 524288&&  LongLibBase.getMNative(a)
== 0&&  LongLibBase.getLNative(a) == 0) {
     aIsMinValue = true;
     aIsNegative = true;
     if (bpower == -1) {
       a = LongLibBase.create(LongLib$Const.MAX_VALUE);
       aIsCopy = true;
       negative = !negative;
     } else {
       final LongLibBase$LongEmul c = LongLib.shr(a, bpower);
       negative&&  LongLibBase.negate(c);
       computeRemainder&&  (LongLibBase.remainder =
LongLibBase.create0(0, 0, 0));
       return c;
     }
   } else if (LongLibBase.getHNative(a)>>  19 != 0) {
     aIsNegative = true;
     a = LongLib.neg(a);
     aIsCopy = true;
     negative = !negative;
   }
   if (bpower != -1) {
     return LongLibBase.divModByShift(a, bpower, negative, aIsNegative,
computeRemainder);
   }
   if (!LongLib.gte(a, b)) {
     computeRemainder&&  (aIsNegative ? (LongLibBase.remainder =
LongLib.neg(a)) : (LongLibBase.remainder =
LongLibBase.create0(LongLibBase.getLNative(a),
LongLibBase.getMNative(a), LongLibBase.getHNative(a))));
     return LongLibBase.create0(0, 0, 0);
   }
   return LongLibBase.divModHelper(aIsCopy ? a :
LongLibBase.create0(LongLibBase.getLNative(a),
LongLibBase.getMNative(a), LongLibBase.getHNative(a)), b, negative,
aIsNegative, aIsMinValue, computeRemainder);
}
          com.google.gwt.dev.jjs.ast.JBlock
       [ERROR] at LongLibBase.java(115): {
   if (LongLibBase.getLNative(b) == 0&&  LongLibBase.getMNative(b) == 0
&&  LongLibBase.getHNative(b) == 0) {
     throw new ArithmeticException();
   }
   if (LongLibBase.getLNative(a) == 0&&  LongLibBase.getMNative(a) == 0
&&  LongLibBase.getHNative(a) == 0) {
     computeRemainder&&  (LongLibBase.remainder =
LongLibBase.create0(0, 0, 0));
     return LongLibBase.create0(0, 0, 0);
   }
   if (LongLibBase.getHNative(b) == 524288&&  LongLibBase.getMNative(b)
== 0&&  LongLibBase.getLNative(b) == 0) {
     return LongLibBase.divModByMinValue(a, computeRemainder);
   }
   boolean negative = false;
   if (LongLibBase.getHNative(b)>>  19 != 0) {
     b = LongLib.neg(b);
     negative = !negative;
   }
   final int bpower = LongLibBase.powerOfTwo(b);
   boolean aIsNegative = false;
   boolean aIsMinValue = false;
   boolean aIsCopy = false;
   if (LongLibBase.getHNative(a) == 524288&&  LongLibBase.getMNative(a)
== 0&&  LongLibBase.getLNative(a) == 0) {
     aIsMinValue = true;
     aIsNegative = true;
     if (bpower == -1) {
       a = LongLibBase.create(LongLib$Const.MAX_VALUE);
       aIsCopy = true;
       negative = !negative;
     } else {
       final LongLibBase$LongEmul c = LongLib.shr(a, bpower);
       negative&&  LongLibBase.negate(c);
       computeRemainder&&  (LongLibBase.remainder =
LongLibBase.create0(0, 0, 0));
       return c;
     }
   } else if (LongLibBase.getHNative(a)>>  19 != 0) {
     aIsNegative = true;
     a = LongLib.neg(a);
     aIsCopy = true;
     negative = !negative;
   }
   if (bpower != -1) {
     return LongLibBase.divModByShift(a, bpower, negative, aIsNegative,
computeRemainder);
   }
   if (!LongLib.gte(a, b)) {
     computeRemainder&&  (aIsNegative ? (LongLibBase.remainder =
LongLib.neg(a)) : (LongLibBase.remainder =
LongLibBase.create0(LongLibBase.getLNative(a),
LongLibBase.getMNative(a), LongLibBase.getHNative(a))));
     return LongLibBase.create0(0, 0, 0);
   }
   return LongLibBase.divModHelper(aIsCopy ? a :
LongLibBase.create0(LongLibBase.getLNative(a),
LongLibBase.getMNative(a), LongLibBase.getHNative(a)), b, negative,
aIsNegative, aIsMinValue, computeRemainder);
}
          com.google.gwt.dev.jjs.ast.JMethodBody
       [ERROR] at LongLibBase.java(115): public static final LongLibBase
$LongEmul divMod(LongLibBase$LongEmul a, LongLibBase$LongEmul b,
boolean computeRemainder);

          com.google.gwt.dev.jjs.ast.JMethod
       [ERROR] at LongLib.java(77): LongLibBase.divMod(a, b, false)
          com.google.gwt.dev.jjs.ast.JMethodCall
       [ERROR] at LongLib.java(77): return LongLibBase.divMod(a, b,
false)
          com.google.gwt.dev.jjs.ast.JReturnStatement
       [ERROR] at LongLib.java(76): {
   return LongLibBase.divMod(a, b, false);
}
          com.google.gwt.dev.jjs.ast.JBlock
       [ERROR] at LongLib.java(76): {
   return LongLibBase.divMod(a, b, false);
}
          com.google.gwt.dev.jjs.ast.JMethodBody
       [ERROR] at LongLib.java(76): public static final LongLibBase
$LongEmul div(LongLibBase$LongEmul a, LongLibBase$LongEmul b);

          com.google.gwt.dev.jjs.ast.JMethod



--
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