Skip to content

Commit 354104e

Browse files
java-team-github-botError Prone Team
authored and
Error Prone Team
committed
Remove ThreadSafe.TypeParameter now that it's been replaced by ThreadSafeTypeParameter.
PiperOrigin-RevId: 667635245
1 parent 7542d36 commit 354104e

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ThreadSafeChecker.java

+2-4
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ public Description matchTypeParameter(TypeParameterTree tree, VisitorState state
137137
ThreadSafeAnalysis analysis = new ThreadSafeAnalysis(this, state, wellKnownThreadSafety);
138138
if (analysis.hasThreadSafeTypeParameterAnnotation((TypeVariableSymbol) sym)) {
139139
if (analysis.getThreadSafeAnnotation(sym.owner, state) == null) {
140-
// TODO: b/324092874 -- Update this message to use the new annotation name.
141140
return buildDescription(tree)
142-
.setMessage("@ThreadSafe.TypeParameter is only supported on threadsafe classes")
141+
.setMessage("@ThreadSafeTypeParameter is only supported on threadsafe classes")
143142
.build();
144143
}
145144
}
@@ -199,11 +198,10 @@ public Description matchClass(ClassTree tree, VisitorState state) {
199198
.map(Entry::getKey)
200199
.collect(toImmutableSet());
201200
if (!threadSafeAndContainer.isEmpty()) {
202-
// TODO: b/324092874 -- Update this message to use the new annotation name.
203201
return buildDescription(tree)
204202
.setMessage(
205203
String.format(
206-
"using both @ThreadSafe.TypeParameter and @ThreadSafe.Element is redundant: %s",
204+
"using both @ThreadSafeTypeParameter and @ThreadSafe.Element is redundant: %s",
207205
Joiner.on("', '").join(threadSafeAndContainer)))
208206
.build();
209207
}

core/src/test/java/com/google/errorprone/bugpatterns/threadsafety/ThreadSafeCheckerTest.java

-19
Original file line numberDiff line numberDiff line change
@@ -1001,16 +1001,6 @@ public void knownThreadSafeFlag() {
10011001
.doTest();
10021002
}
10031003

1004-
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.
1005-
1006-
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.
1007-
1008-
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.
1009-
1010-
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.
1011-
1012-
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.
1013-
10141004
@Test
10151005
public void annotatedClassType() {
10161006
compilationHelper
@@ -1025,16 +1015,7 @@ public void annotatedClassType() {
10251015
.doTest();
10261016
}
10271017

1028-
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.
1029-
10301018
// Regression test for b/117937500
1031-
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.
1032-
1033-
// Regression test for b/117937500
1034-
1035-
// javac does not instantiate type variables when they are not used for target typing, so we
1036-
// cannot check whether their instantiations are thread-safe.
1037-
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.
10381019

10391020
// javac does not instantiate type variables when they are not used for target typing, so we
10401021
// cannot check whether their instantiations are thread-safe.

0 commit comments

Comments
 (0)