Revision: 10227
Author: sco...@google.com
Date: Wed May 25 15:35:34 2011
Log: Bugfixes in ControlFlowAnalyzer
- Instantiating Interface[] failed to rescue Object[]
- Field initializers being visited twice
http://gwt-code-reviews.appspot.com/1443807/
Review by: jbrosenb...@google.com
http://code.google.com/p/google-web-toolkit/source/detail?r=10227
Modified:
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
=======================================
---
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
Tue May 24 12:34:23 2011
+++
/trunk/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
Wed May 25 15:35:34 2011
@@ -107,6 +107,10 @@
rescue(program.getTypeArray(superClass, dims), true,
isInstantiated);
didSuperType = true;
}
+ } else if (leafType instanceof JInterfaceType) {
+ // Intf[] -> Object[]
+ rescue(program.getTypeArray(program.getTypeJavaLangObject(),
dims), true, isInstantiated);
+ didSuperType = true;
}
if (!didSuperType) {
if (dims > 1) {
@@ -297,7 +301,7 @@
boolean isInstantiated = instantiatedTypes.contains(type);
assert (isReferenced || isInstantiated);
- // Rescue my clinit (it won't ever be explicitly referenced
+ // Rescue my clinit (it won't ever be explicitly referenced)
if (type.hasClinit()) {
rescue(type.getMethods().get(0));
}
@@ -309,11 +313,6 @@
rescue(intfType, false, true);
}
}
-
- // visit any field initializers
- for (JField it : type.getFields()) {
- accept(it);
- }
rescueMembersIfInstantiable(type);
return false;
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors