-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Annotate some UI classes for nullness #86
Conversation
This includes: * DefaultListCellRenderer * DefaultTableCellRenderer * DefaultTreeCellRender * the classes that they call to get possibly null values
@mernst
|
The way that the cache is setup in Locale, get cannot return null since createObject cannot return null and null keys are not allowed.
It's an internal sun class and shouldn't be used outside. I had started annotating it to help with the annotations for Locale and realized that this was a mistake.
The build is failing only because of the changes in |
These changes have been moved to PR typetools#89.
@@ -532,7 +533,7 @@ public void setSelectedFile(File file) { | |||
*/ | |||
@BeanProperty(description | |||
= "The list of selected files if the chooser is in multiple selection mode.") | |||
public void setSelectedFiles(File[] selectedFiles) { | |||
public void setSelectedFiles(@Nullable File[] selectedFiles) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, too, @Nullable
should be on the array type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the array itself can be null, so I've pushed a fix for this.
The elements of the array "may" be null, but probably shouldn't be null.
private File[] selectedFiles; | ||
private @Nullable File currentDirectory = null; | ||
private @Nullable File selectedFile = null; | ||
private @Nullable File[] selectedFiles; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the code, I believe this should be File @Nullable []
(a possibly-null array of non-null files) rather than @Nullable File[]
(a non-null array of possibly-null files).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, pending the comment above about possibly allowing nulls inside the array.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good (thanks!), except for a concern about an array type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good now. Thanks a lot for these annotations!
List of classes annotated for nullness: