-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Refactor: Replace explicit type arguments with diamond operator wherever possible across the project #17567
base: master
Are you sure you want to change the base?
Refactor: Replace explicit type arguments with diamond operator wherever possible across the project #17567
Conversation
@@ -247,7 +247,7 @@ | |||
@Override | |||
protected OrderedSequenceNumber<String> makeSequenceNumber(String seq, boolean isExclusive) | |||
{ | |||
return new OrderedSequenceNumber<String>(seq, isExclusive) | |||
return new OrderedSequenceNumber<>(seq, isExclusive) |
Check warning
Code scanning / CodeQL
Inconsistent compareTo Warning test
compareTo
@@ -2908,7 +2908,7 @@ | |||
@Override | |||
protected OrderedSequenceNumber<String> makeSequenceNumber(String seq, boolean isExclusive) | |||
{ | |||
return new OrderedSequenceNumber<String>(seq, isExclusive) | |||
return new OrderedSequenceNumber<>(seq, isExclusive) |
Check warning
Code scanning / CodeQL
Inconsistent compareTo Warning test
compareTo
log.warn("ScheduledExecutorService is ShutDown. Return 'Signal.STOP' and stopped rescheduling %s (delay %s)", this, delay); | ||
log.warn( | ||
"ScheduledExecutorService is ShutDown. Return 'Signal.STOP' and stopped rescheduling %s (delay %s)", | ||
this, |
Check notice
Code scanning / CodeQL
Use of default toString() Note
{ | ||
@Override | ||
public Sequence<Integer> apply(final ImmutableList<Integer> input) | ||
{ | ||
if (lastSeqFullyRead.getAndSet(false)) { | ||
return Sequences.simple( | ||
new Iterable<Integer>() | ||
new Iterable<>() |
Check warning
Code scanning / CodeQL
Iterable wrapping an iterator Warning test
Description
As pointed out in this review comment, since we aren't supporting Java 8 anymore, we can switch to diamond operators wherever possible without specifying explicit type arguments.
Examples:
This PR makes this change across the project.
Note: This change was done with IntelliJ's project-wide inspection results for warnings like
Explicit type argument Integer, Iterator<Integer> can be replaced with <>
. With that, there were a few compilation issues, which were manually fixed.This PR has: