-
Notifications
You must be signed in to change notification settings - Fork 578
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug#1418 Improve annotation of SIC_INNER_SHOULD_BE_STATIC_ANON
- Loading branch information
Showing
4 changed files
with
100 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package sfBugsNew; | ||
|
||
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings; | ||
import edu.umd.cs.findbugs.annotations.ExpectWarning; | ||
import edu.umd.cs.findbugs.annotations.NoWarning; | ||
|
||
public class Bug1418 { | ||
@NoWarning("SIC") | ||
@SuppressFBWarnings("SIC") | ||
private final ThreadLocal<Integer> field=new ThreadLocal<Integer>() { | ||
@Override | ||
protected Integer initialValue() { | ||
return 0; | ||
} | ||
}; | ||
|
||
@NoWarning("SIC") | ||
@SuppressFBWarnings("SIC") | ||
public void test() { | ||
ThreadLocal<Integer> local=new ThreadLocal<Integer>() { | ||
@Override | ||
protected Integer initialValue() { | ||
return 0; | ||
} | ||
}; | ||
System.out.println(local+"/"+field); | ||
} | ||
|
||
@ExpectWarning("SIC") | ||
private final ThreadLocal<Integer> field2=new ThreadLocal<Integer>() { | ||
@Override | ||
protected Integer initialValue() { | ||
return 0; | ||
} | ||
}; | ||
|
||
@ExpectWarning("SIC") | ||
public void test2() { | ||
ThreadLocal<Integer> local=new ThreadLocal<Integer>() { | ||
@Override | ||
protected Integer initialValue() { | ||
return 0; | ||
} | ||
}; | ||
System.out.println(local+"/"+field2); | ||
} | ||
} |