Revision: 6814 Author: [email protected] Date: Tue Nov 10 12:46:07 2009 Log: Mark artificially-rescued fields as volatile.
Patch by: bobv Review by: scottb (desk) http://code.google.com/p/google-web-toolkit/source/detail?r=6814 Modified: /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java Mon Oct 26 14:02:26 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JField.java Tue Nov 10 12:46:07 2009 @@ -91,6 +91,13 @@ public void setInitializer(JDeclarationStatement declStmt) { this.declStmt = declStmt; } + + public void setVolatile() { + if (isFinal()) { + throw new IllegalStateException("Final fields cannot be set volatile"); + } + isVolatile = true; + } public void traverse(JVisitor visitor, Context ctx) { if (visitor.visit(this, ctx)) { ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java Fri Oct 16 16:19:37 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/impl/GenerateJavaAST.java Tue Nov 10 12:46:07 2009 @@ -2534,6 +2534,9 @@ } currentClass.addArtificialRescue((JNode) node); + if (node instanceof JField) { + ((JField) node).setVolatile(); + } } } } --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
