Revision: 9790
Author: [email protected]
Date: Wed Mar 2 06:04:24 2011
Log: 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.
Review at http://gwt-code-reviews.appspot.com/1373803
http://code.google.com/p/google-web-toolkit/source/detail?r=9790
Modified:
/trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/TypeOracle.java
=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/TypeOracle.java
Tue Jan 11 19:35:02 2011
+++ /trunk/dev/core/src/com/google/gwt/dev/javac/typemodel/TypeOracle.java
Wed Mar 2 06:04:24 2011
@@ -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