Just when you thought you were done, right?
I took to heart your feedback on the whole JFieldRef.hasClinit statefulness.
 When I went in to look at it, it felt so yucky that I aborted the
constructor change and instead decided to solve it the way we discussed, by
adding a stateful flag to JReferenceType instead, moving that state out of
JTypeOracle.

To make it easy to review, I committed each incremental, valid transition to
the change branch to make it easy to verify the parts:

5176: All this does is tweak the debug output of the Java AST.  JSNI methods
have proper indentation in an AST dump now (I was using AST dumps to verify
incremental correctness.)

5177: Fairly self-explanatory; added the state to JReferenceType, but kept
it in JTypeOracle at first to assert there was no difference.  Aside: I'm
kind of displeased with the type hierarchy of JReferenceType.  It really
feels like JClassType and JInterfaceType should share a common ancestor that
JArrayType and JNullType do not.  If this were the structure, I'd have put
abstract methods into JReferenceType and put the statefulness in that common
ancestor.

5178: Also tightened up the recursive method slightly, and managing the
"computed" set better.  This works because once a class transitions from
hasClinit -> !hasClinit, there's no possible way it can ever go back.

5179: I should have actually squashed this tiny fix into a previous commit;
apparently sometimes people were calling hasClinit with nulls.

5180: Note the assertion in JFieldRef... I added this because I ran into a
null JFieldRef.enclosingType() late in the compile.  This assertion
uncovered a major problem... JsniFieldRefs always had a null enclosing type.
 I didn't check, but it's possible this could have been resulting in a
failure to clinit a class when one of its fields is first accessed from
JSNI.  The fix is in GenerateJavaAST in this patch.

5181: Should be self-explanatory.

Thanks!
Scott

--~--~---------~--~----~------------~-------~--~----~
http://groups.google.com/group/Google-Web-Toolkit-Contributors
-~----------~----~----~----~------~----~------~--~---

Reply via email to