On Fri, Sep 25, 2009 at 8:52 AM, <b...@vawter.org> wrote:

> What's the de-facto version of Eclipse that's canonical for formatting?


Good question, I have an 3.3 based Eclipse that's probably out of date now,
and should probably update.  But I was talking less about the particular
settings, and more meant to suggest committing the reformat separately so as
to make clear the syntactic vs. semantic change in the history.

http://gwt-code-reviews.appspot.com/71802/diff/1/3
> File
> dev/core/src/com/google/gwt/dev/jjs/impl/JavaScriptObjectNormalizer.java
> (right):
>
> http://gwt-code-reviews.appspot.com/71802/diff/1/3#newcode197
> Line 197: if
> (program.typeOracle.getAllVirtualOverrides(m).contains(method)) {
>
>> I *think* getAllOverrides() includes getAllVirtualOverrides(); if so,
>>
> can you
>
>> roll the two separate loops together?
>>
>
> No, getMethods() only returns methods declared on the type, not methods
> inherited from supertypes.  In this second loop, the code is examining
> methods declared on the supertypes (c.f. 194), and only virtual
> overrides are relevant here.


I'm sure you're right on this, but as I haven't looked into it deeply, I
don't quite understand your explanation.  Specifically, what would break if
you simply deleted lines 181-194 (inclusive) and changed like 197 to
"getAllOverrides".  In other words:

private JMethod findConcreteImplementation(JMethod method, JClassType
concreteType) {
  /*
   * Include supertypes so we can find virtual overrides via subclass. See
   * {...@link JTypeOracle#getAllVirtualOverrides()} for an example.
   */
  while (concreteType != null) {
    for (JMethod m : concreteType.getMethods()) {
      if (!m.isAbstract()) {
        if (program.typeOracle.getAllOverrides(m).contains(method)) {
          return m;
        }
      }
    }
    concreteType = concreteType.getSuperClass();
  }
}

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

Reply via email to