Skip to content

Commit

Permalink
Remove ThreadSafe.TypeParameter now that it's been replaced by `Thr…
Browse files Browse the repository at this point in the history
…eadSafeTypeParameter`.

PiperOrigin-RevId: 666407988
  • Loading branch information
java-team-github-bot authored and Error Prone Team committed Aug 26, 2024
1 parent 0a5a5b8 commit 7335133
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ public Description matchTypeParameter(TypeParameterTree tree, VisitorState state
ThreadSafeAnalysis analysis = new ThreadSafeAnalysis(this, state, wellKnownThreadSafety);
if (analysis.hasThreadSafeTypeParameterAnnotation((TypeVariableSymbol) sym)) {
if (analysis.getThreadSafeAnnotation(sym.owner, state) == null) {
// TODO: b/324092874 -- Update this message to use the new annotation name.
return buildDescription(tree)
.setMessage("@ThreadSafe.TypeParameter is only supported on threadsafe classes")
.setMessage("@ThreadSafeTypeParameter is only supported on threadsafe classes")
.build();
}
}
Expand Down Expand Up @@ -199,11 +198,10 @@ public Description matchClass(ClassTree tree, VisitorState state) {
.map(Entry::getKey)
.collect(toImmutableSet());
if (!threadSafeAndContainer.isEmpty()) {
// TODO: b/324092874 -- Update this message to use the new annotation name.
return buildDescription(tree)
.setMessage(
String.format(
"using both @ThreadSafe.TypeParameter and @ThreadSafe.Element is redundant: %s",
"using both @ThreadSafeTypeParameter and @ThreadSafe.Element is redundant: %s",
Joiner.on("', '").join(threadSafeAndContainer)))
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1001,16 +1001,6 @@ public void knownThreadSafeFlag() {
.doTest();
}

// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.

// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.

// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.

// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.

// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.

@Test
public void annotatedClassType() {
compilationHelper
Expand All @@ -1025,16 +1015,7 @@ public void annotatedClassType() {
.doTest();
}

// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.

// Regression test for b/117937500
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.

// Regression test for b/117937500

// javac does not instantiate type variables when they are not used for target typing, so we
// cannot check whether their instantiations are thread-safe.
// TODO: b/324092874 - Remove this test once ThreadSafe.TypeParameter is removed.

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

0 comments on commit 7335133

Please sign in to comment.