On Wed, Feb 9, 2011 at 7:54 AM, <[email protected]> wrote:

>
> http://gwt-code-reviews.appspot.com/1295806/diff/1/10
> File user/src/com/google/gwt/user/client/ui/HTMLTable.java (right):
>
> http://gwt-code-reviews.appspot.com/1295806/diff/1/10#newcode1105
> user/src/com/google/gwt/user/client/ui/HTMLTable.java:1105: Element td =
> cleanCell(row, column, true);
> I guess the answer is... probably.  The question is, what should the
> code below do?
>
> table.setText(0, 0, "hello world");
> table.setWidget(0, 0, null);
>
> If you think the call to setWidget should clear the text "hello world"
> (and I think that makes sense), then yes, cleanCell() should be outside
> of the conditional. If you think "hello world" should remain, then no
> change is needed.
>
> Assuming we want to change it, we should add a test case.  Do you want
> me to take care of it?


Love those breaking changes for correctness. :-/ This is why lines that
start if (foo == null) should require papal dispensation.

// null check cert #38828 granted by His Holiness Pope John Paul Secondus 19
Jan 2005

What would happen in this case?

table.setWidget(0, 0, new Label("Dude!"));
table.setWidget(0, 0, null);

If the answer is that the widget will just stay there, it seems like we
should make the fix, even on the chance it will cause some surprises for
code relying on the unfriendly friendliness. And yes, if you could make that
change it would be very kind of you.


>
> http://gwt-code-reviews.appspot.com/1295806/show
>

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

Reply via email to