http://gwt-code-reviews.appspot.com/993801/diff/1/2
File user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java
(right):

http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode46
user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:46:
private static HashMap<String, Integer> typeRank;
On 2010/10/13 20:50:11, rjrjr wrote:
Make this final. You can build it in another map in your static
initializer, and
fill in typeRank via Collections.unmodifiableMap()

Done.

http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode46
user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:46:
private static HashMap<String, Integer> typeRank;
On 2010/10/13 20:50:11, rjrjr wrote:
Make this final. You can build it in another map in your static
initializer, and
fill in typeRank via Collections.unmodifiableMap()

Done.

http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode51
user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:51:
typeRank.put("java.lang.Boolean", 2);
On 2010/10/13 20:50:11, rjrjr wrote:
Seems like you could rank the java.lang types as 3, so that you prefer
setBaz(boolean) to setBaz(Boolean). (Remember to add that test if you
make this
change, and to set your default cost to 4. And you might want to put
that
default cost in a constant next to this map.)

I will take your suggestion, though it is not entirely clear to me the
benefits of this approach. the original thinking was that a type would
be either in the primitive type family or in the reference type family.
the current approach was to choose the autoboxed primitive types as
reference types the same way java treats boxed primitive types. anyhow,
I think you are right.

http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode186
user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:186:
!sameParameterTypes(preferredMethod, method)) {
On 2010/10/13 20:50:11, rjrjr wrote:
The sameParameterTypes call is required to distinguish overrides from
super
methods, right?
yes. when you say 'mention that', I am assuming you mean comment that.
(done).

Should mention that, and be sure unit test covers it.
2) Will add a specific unit test for this case. just to be clear on what
to expect in terms of behavior, an overridden method with the same
formal signature will *not* be considered ambiguous.

http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode334
user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:334:
* Ranks given method based on parameter conversion cost.
On 2010/10/13 20:50:11, rjrjr wrote:
Please document the ranking here, like you did in the patch
description

Done.

http://gwt-code-reviews.appspot.com/993801/diff/1/2#newcode362
user/src/com/google/gwt/uibinder/rebind/model/OwnerFieldClass.java:362:
private boolean sameParameterTypes(final JMethod m1, final JMethod m2) {
On 2010/10/13 20:50:11, rjrjr wrote:
why?

Done.

http://gwt-code-reviews.appspot.com/993801/show

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

Reply via email to