New JoinVarArgsContains inspection that will detect multiple .contains(), .doesNotContain(), and .containsOnlyOnce() calls within the same statement that could be joined together using variadic arguments.
This commit is contained in:
@@ -31,6 +31,13 @@ public class GuavaOptional {
|
||||
assertThat(opt.orNull()).isNotEqualTo(null);
|
||||
assertThat(opt.orNull()).isNotNull();
|
||||
|
||||
//assertThat(opt.get()).isEqualTo(opt.get()); // there's a better version than contains(opt.get())
|
||||
assertThat(opt.orNull()).isEqualTo(opt.get());
|
||||
//assertThat(opt.get()).isEqualTo(opt.orNull()); // there's a better version than contains(opt.orNull())
|
||||
|
||||
assertThat(opt).contains(opt.get());
|
||||
assertThat(opt).contains(opt.orNull());
|
||||
|
||||
String possibleNullString = System.getProperty("username");
|
||||
String notNullString = "Narf";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user