Skip to content

Commit 10c5130

Browse files
committed
Remove mention of jcip-annotations from NOTICE.txt
Reduce diffs
1 parent 2873269 commit 10c5130

File tree

6 files changed

+24
-46
lines changed

6 files changed

+24
-46
lines changed

Diff for: NOTICE.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,4 @@
22
== Notices and attributions required by libraries that the project depends on ==
33
===================================================================================
44

5-
The JUnit depends on Java Hamcrest (http://hamcrest.org/JavaHamcrest).
6-
7-
The JUnit depends on net.jcip:jcip-annotations:1.0 (http://jcip.net).
5+
JUnit depends on Java Hamcrest (http://hamcrest.org/JavaHamcrest).

Diff for: src/main/java/org/junit/experimental/annotations/ThreadSafe.java

-17
This file was deleted.

Diff for: src/main/java/org/junit/runner/notification/RunNotifier.java

+16-15
Original file line numberDiff line numberDiff line change
@@ -21,37 +21,37 @@
2121
* @since 4.0
2222
*/
2323
public class RunNotifier {
24-
private final List<RunListener> fListeners = new CopyOnWriteArrayList<RunListener>();
24+
private final List<RunListener> fListeners = new CopyOnWriteArrayList<RunListener>();
2525
private volatile boolean fPleaseStop = false;
2626

2727
/**
2828
* Internal use only
2929
*/
3030
public void addListener(RunListener listener) {
31-
if (listener == null) {
32-
throw new NullPointerException("Cannot add a null listener");
33-
}
34-
fListeners.add(SynchronizedRunListener.wrapIfNotThreadSafe(listener));
31+
if (listener == null) {
32+
throw new NullPointerException("Cannot add a null listener");
33+
}
34+
fListeners.add(SynchronizedRunListener.wrapIfNotThreadSafe(listener));
3535
}
3636

3737
/**
3838
* Internal use only
3939
*/
4040
public void removeListener(RunListener listener) {
41-
if (listener == null) {
42-
throw new NullPointerException("Cannot remove a null listener");
43-
}
44-
fListeners.remove(SynchronizedRunListener.wrapIfNotThreadSafe(listener));
41+
if (listener == null) {
42+
throw new NullPointerException("Cannot remove a null listener");
43+
}
44+
fListeners.remove(SynchronizedRunListener.wrapIfNotThreadSafe(listener));
4545
}
4646

4747
private abstract class SafeNotifier {
4848
private final List<RunListener> currentListeners;
4949

50-
public SafeNotifier() {
50+
SafeNotifier() {
5151
this(fListeners);
5252
}
5353

54-
public SafeNotifier(List<RunListener> currentListeners) {
54+
SafeNotifier(List<RunListener> currentListeners) {
5555
this.currentListeners = currentListeners;
5656
}
5757

@@ -124,7 +124,8 @@ public void fireTestFailure(Failure failure) {
124124
fireTestFailures(fListeners, asList(failure));
125125
}
126126

127-
private void fireTestFailures(List<RunListener> listeners, final Collection<Failure> failures) {
127+
private void fireTestFailures(List<RunListener> listeners,
128+
final List<Failure> failures) {
128129
if (!failures.isEmpty()) {
129130
new SafeNotifier(listeners) {
130131
@Override
@@ -198,8 +199,8 @@ public void pleaseStop() {
198199
*/
199200
public void addFirstListener(RunListener listener) {
200201
if (listener == null) {
201-
throw new NullPointerException("Cannot remove a null listener");
202-
}
203-
fListeners.add(0, SynchronizedRunListener.wrapIfNotThreadSafe(listener));
202+
throw new NullPointerException("Cannot remove a null listener");
203+
}
204+
fListeners.add(0, SynchronizedRunListener.wrapIfNotThreadSafe(listener));
204205
}
205206
}

Diff for: src/main/java/org/junit/runner/notification/SynchronizedRunListener.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,11 @@
44
import org.junit.runner.Result;
55

66
/**
7-
* SynchronizedRunListener decorates {@link RunListener}, has all methods
8-
* synchronized and is <em>not</em> public.
9-
*
10-
* <p>Due to backward compatibility, this synchronized listener behaves thread
11-
* safe as {@link RunListener} in the old synchronized {@link RunNotifier}.
7+
* Thread-safe decorator for {@link RunListener} implementations that synchronizes
8+
* calls to the delegate.
129
*
1310
* @author Tibor Digana (tibor17)
1411
* @author Kevin Cooney (kcooney)
15-
* @version 4.12
1612
* @since 4.12
1713
*
1814
* @see RunNotifier

Diff for: src/test/java/org/junit/runner/notification/ConcurrentRunNotifierTest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ private static class ConcurrentRunListener extends RunListener {
2626
final AtomicInteger testStarted = new AtomicInteger(0);
2727

2828
@Override
29-
public void testStarted(Description description) throws Exception {
29+
public void testStarted(Description description) throws Exception {
3030
testStarted.incrementAndGet();
3131
}
3232
}
@@ -66,14 +66,14 @@ private static class ExaminedListener extends RunListener {
6666
}
6767

6868
@Override
69-
public void testStarted(Description description) throws Exception {
69+
public void testStarted(Description description) throws Exception {
7070
if (!useMe) {
7171
throw new Exception();
7272
}
7373
}
7474

7575
@Override
76-
public void testFailure(Failure failure) throws Exception {
76+
public void testFailure(Failure failure) throws Exception {
7777
hasTestFailure = true;
7878
}
7979
}

Diff for: src/test/java/org/junit/runner/notification/RunNotifierTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* other tests (including causing failed tests to appear to be passing).
1616
*/
1717
public class RunNotifierTest extends TestCase {
18-
private RunNotifier notifier;
18+
private RunNotifier notifier;
1919

2020
@Override
2121
protected void setUp() throws Exception {
@@ -108,7 +108,7 @@ private static class CountingListener extends RunListener {
108108
final AtomicInteger testStarted = new AtomicInteger(0);
109109

110110
@Override
111-
public void testStarted(Description description) throws Exception {
111+
public void testStarted(Description description) throws Exception {
112112
testStarted.incrementAndGet();
113113
}
114114
}

0 commit comments

Comments
 (0)