-
Notifications
You must be signed in to change notification settings - Fork 287
Import jsr305 and use it to mark @Nullable stuff. #158
Conversation
@@ -17,7 +19,7 @@ | |||
this.converter = converter; | |||
} | |||
|
|||
@Override public QueueFile file() { | |||
@Override public @Nonnull QueueFile file() { |
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.
I can do this, right? It counts as a covariant 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.
Seems plausible. If it was the other way around I'd be surprised.
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.
Yeah, the other way is not definitely not covariant.
9c23bf0
to
fe1c47a
Compare
Checkstyle needs updated? |
fe1c47a
to
a70912f
Compare
Yeah, checkstyle is complaining about the order of the annotations. It didn't complain for the other projects, but I appeased it. |
3301d4c
to
d1d35fe
Compare
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.
deps on the checkstyle update for the order of the annotations, if that matters.
@@ -78,12 +76,13 @@ public void testAddWithReadOnlyFileMissesMonitor() throws Exception { | |||
|
|||
// Should throw an exception. | |||
FileObjectQueue<String> queue = | |||
new FileObjectQueue<String>(qf, new FileObjectQueue.Converter<String>() { | |||
new FileObjectQueue<>(qf, new FileObjectQueue.Converter<String>() { | |||
@Override public String from(byte[] bytes) throws IOException { |
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.
from and toStream only produce and accept nullable types if the generic type is nullable, so it's not needed there.
@@ -42,7 +43,7 @@ public boolean isEmpty() { | |||
* Returns the head of the queue, or {@code null} if the queue is empty. Does not modify the | |||
* queue. | |||
*/ | |||
public abstract T peek() throws IOException; | |||
public abstract @Nullable T peek() throws IOException; |
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.
Does this return null instead of throwing for parity with other dequeue interfaces?
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.
Yes
d1d35fe
to
abe267f
Compare
Rebase and should be good to go |
abe267f
to
8d87c7d
Compare
No description provided.