Reviewers: jgw,
Description:
Fixes a bug in TypeOracle for computing information about single JSO
impls.
If you have an interface (lets call it B) that doesn't declare any new
methods,
but implements some other interface (lets call it A) that may or may not
declare
methods, then it should be permissible to have a JSO implement B so long
as all
the methods in A are implemented by a superclass of the JSO.
Currently, classFullyImplements() requires that the JSO that actually
implements the methods of A, needs to nominally implement B. This patch
simply loosens the restriction such that if B declares no new methods,
then it is sufficent to check that all the methods inheritable from B
are implemented by the JSO.
The method classFullyImplements() will still check to make sure that
some
overlay type implements the inheritable methods of the interface. Which
should
be sufficient.
Please review this at http://gwt-code-reviews.appspot.com/1373803/
Affected files:
M dev/core/src/com/google/gwt/dev/javac/typemodel/TypeOracle.java
Index: dev/core/src/com/google/gwt/dev/javac/typemodel/TypeOracle.java
===================================================================
--- dev/core/src/com/google/gwt/dev/javac/typemodel/TypeOracle.java
(revision 9789)
+++ dev/core/src/com/google/gwt/dev/javac/typemodel/TypeOracle.java
(working copy)
@@ -712,8 +712,9 @@
* directly or via inherited methods).
*/
private boolean classFullyImplements(JClassType cls, JClassType intf) {
- // The class must at least nominally implement the interface.
- if (!intf.isAssignableFrom(cls)) {
+ // If the interface has at least 1 method, then the class must at
+ // least nominally implement the interface.
+ if ((intf.getMethods().length > 0) && !intf.isAssignableFrom(cls)) {
return false;
}
--
http://groups.google.com/group/Google-Web-Toolkit-Contributors