File tree Expand file tree Collapse file tree 3 files changed +5
-29
lines changed
junit-platform-engine/src/main/java/org/junit/platform/engine
junit-platform-launcher/src/main/java/org/junit/platform/launcher
platform-tests/src/test/java/org/junit/platform/commons/support/conversion Expand file tree Collapse file tree 3 files changed +5
-29
lines changed Original file line number Diff line number Diff line change @@ -132,10 +132,7 @@ public String getName() {
132
132
133
133
@ Override
134
134
public boolean equals (Object obj ) {
135
- if (obj instanceof TestTag that ) {
136
- return Objects .equals (this .name , that .name );
137
- }
138
- return false ;
135
+ return (obj instanceof TestTag that && Objects .equals (this .name , that .name ));
139
136
}
140
137
141
138
@ Override
Original file line number Diff line number Diff line change @@ -251,10 +251,7 @@ public Set<TestTag> getTags() {
251
251
252
252
@ Override
253
253
public boolean equals (Object obj ) {
254
- if (obj instanceof TestIdentifier that ) {
255
- return Objects .equals (this .uniqueId , that .uniqueId );
256
- }
257
- return false ;
254
+ return (obj instanceof TestIdentifier that && Objects .equals (this .uniqueId , that .uniqueId ));
258
255
}
259
256
260
257
@ Override
Original file line number Diff line number Diff line change @@ -158,13 +158,7 @@ Book nonStaticFactory(String title) {
158
158
159
159
@ Override
160
160
public boolean equals (Object obj ) {
161
- if (this == obj ) {
162
- return true ;
163
- }
164
- if (!(obj instanceof Book that )) {
165
- return false ;
166
- }
167
- return Objects .equals (this .title , that .title );
161
+ return (this == obj ) || (obj instanceof Book that && Objects .equals (this .title , that .title ));
168
162
}
169
163
170
164
@ Override
@@ -184,13 +178,7 @@ static class Journal {
184
178
185
179
@ Override
186
180
public boolean equals (Object obj ) {
187
- if (this == obj ) {
188
- return true ;
189
- }
190
- if (!(obj instanceof Journal that )) {
191
- return false ;
192
- }
193
- return Objects .equals (this .title , that .title );
181
+ return (this == obj ) || (obj instanceof Journal that && Objects .equals (this .title , that .title ));
194
182
}
195
183
196
184
@ Override
@@ -218,13 +206,7 @@ static Newspaper of(String title) {
218
206
219
207
@ Override
220
208
public boolean equals (Object obj ) {
221
- if (this == obj ) {
222
- return true ;
223
- }
224
- if (!(obj instanceof Newspaper that )) {
225
- return false ;
226
- }
227
- return Objects .equals (this .title , that .title );
209
+ return (this == obj ) || (obj instanceof Newspaper that && Objects .equals (this .title , that .title ));
228
210
}
229
211
230
212
@ Override
You can’t perform that action at this time.
0 commit comments