pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Re: Little things (by FindBugs)
Date Wed, 02 Dec 2009 12:39:35 GMT
> Now a look of these warnings:
> TerraAlertSkin.java:144 Unchecked/unconfirmed cast from
> org.apache.pivot.wtk.Window to org.apache.pivot.wtk.Alert
> TerraPromptSkin.java:137 Unchecked/unconfirmed cast from
> org.apache.pivot.wtk.Window to org.apache.pivot.wtk.Prompt
> TerraMenuPopupSkin.java:202 Unchecked/unconfirmed cast from
> org.apache.pivot.wtk.Window to org.apache.pivot.wtk.MenuPopup
> TerraFileBrowserSheetSkin.java:292 Unchecked/unconfirmed cast from
> org.apache.pivot.wtk.Sheet to org.apache.pivot.wtk.FileBrowserSheet
> 
> What do you think on a simple fix like:
>        if (!(window instanceof Alert))
>            throw new IllegalArgumentException();
> or maybe
>            throw new IllegalArgumentException("window must be an Alert");
> and similar in other cases ...

Not necessary. We know that, in this case (and others like it) the window will only ever be
an Alert.


Mime
View raw message