Skip to content

Commit

Permalink
spotlessApply
Browse files Browse the repository at this point in the history
  • Loading branch information
JuditKnoll committed Dec 4, 2024
1 parent c8f0221 commit dec02fd
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,15 +141,17 @@ private void checkAndReportBug(int seen, XMethod method) {
if (field != null && !field.isFinal()) {
boolean fieldReadInOtherMethod = mapContainsFieldWithOtherMethod(field, method, readFieldsByMethods);
if (fieldReadInOtherMethod) {
if (!relevantFields.isEmpty() && relevantFields.contains(field) && !MultiThreadedCodeIdentifierUtils.isFromAtomicPackage(field.getSignature())) {
if (!relevantFields.isEmpty() && relevantFields.contains(field)
&& !MultiThreadedCodeIdentifierUtils.isFromAtomicPackage(field.getSignature())) {
bugAccumulator.accumulateBug(
new BugInstance(this, "AT_NONATOMIC_OPERATIONS_ON_SHARED_VARIABLE", NORMAL_PRIORITY)
.addClass(this)
.addMethod(method)
.addField(field),
this);
} else if (!field.isVolatile() && ClassName.isValidBaseTypeFieldDescriptor(field.getSignature())) {
String bugType = is64bitPrimitive(field.getSignature()) ? "AT_NONATOMIC_64BIT_PRIMITIVE" : "AT_STALE_THREAD_WRITE_OF_PRIMITIVE";
String bugType = is64bitPrimitive(field.getSignature()) ? "AT_NONATOMIC_64BIT_PRIMITIVE"
: "AT_STALE_THREAD_WRITE_OF_PRIMITIVE";
bugAccumulator.accumulateBug(
new BugInstance(this, bugType, NORMAL_PRIORITY)
.addClass(this)
Expand Down

0 comments on commit dec02fd

Please sign in to comment.