Skip to content

Commit 2918286

Browse files
author
Corey Vaillancourt
committed
Issue #162 Adjustments
- Modified fMethodDescriptions to be final - Changed from put to putIfAbsent
1 parent 08719e9 commit 2918286

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/junit/runners/BlockJUnit4ClassRunner.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
* @since 4.5
5050
*/
5151
public class BlockJUnit4ClassRunner extends ParentRunner<FrameworkMethod> {
52-
private ConcurrentHashMap<FrameworkMethod, Description> fMethodDescriptions = new ConcurrentHashMap<FrameworkMethod, Description>();
52+
private final ConcurrentHashMap<FrameworkMethod, Description> fMethodDescriptions = new ConcurrentHashMap<FrameworkMethod, Description>();
5353
/**
5454
* Creates a BlockJUnit4ClassRunner to run {@code klass}
5555
*
@@ -80,7 +80,7 @@ protected Description describeChild(FrameworkMethod method) {
8080
if (description == null) {
8181
description = Description.createTestDescription(getTestClass().getJavaClass(),
8282
testName(method), method.getAnnotations());
83-
fMethodDescriptions.put(method, description);
83+
fMethodDescriptions.putIfAbsent(method, description);
8484
}
8585

8686
return description;

0 commit comments

Comments
 (0)