Skip to content

Commit

Permalink
Update dependencies - fixes 2
Browse files Browse the repository at this point in the history
  • Loading branch information
mkondratek committed Oct 4, 2022
1 parent 46b6bb5 commit 01c15e8
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ public void check(JavaMethod method, ConditionEvents events) {
}
}

method.getCallsFromSelf().forEach(access -> {
AccessTarget accessTarget = access.getTarget();
if (accessTarget.isAnnotatedWith(UIThreadUnsafe.class)) {
method.getCallsFromSelf().forEach(call -> {
AccessTarget accessTarget = call.getTarget();
if (call.isDeclaredInLambda()) {
// ignore
} else if (accessTarget.isAnnotatedWith(UIThreadUnsafe.class)) {
String message = "a non-${UIThreadUnsafeName} method ${method.getFullName()} " +
"calls a ${UIThreadUnsafeName} method ${accessTarget.getFullName()}";
events.add(SimpleConditionEvent.violated(method, message));
Expand Down Expand Up @@ -156,7 +158,9 @@ public void check(JavaMethod method, ConditionEvents events) {
AccessTarget.CodeUnitCallTarget callTarget = call.getTarget();
String callTargetPackageName = callTarget.getOwner().getPackageName();
String calledMethodFullName = callTarget.getFullName();
if (callTargetPackageName.startsWith("git4idea")) {
if (call.isDeclaredInLambda()) {
// ignore
} else if (callTargetPackageName.startsWith("git4idea")) {
if (!Arrays.asList(whitelistedMethodFullNames_git4idea).contains(calledMethodFullName)) {
String message = "a non-${UIThreadUnsafeName} method ${method.getFullName()} " +
"calls method ${calledMethodFullName} from git4idea";
Expand Down

0 comments on commit 01c15e8

Please sign in to comment.