Skip to content

Commit 798dd08

Browse files
Disallow @Uninterruptible(calleeMustBe = true) if there isn't a proper reason used for documentation.
1 parent 5bb0493 commit 798dd08

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/code/UninterruptibleAnnotationChecker.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ private void checkSpecifiedOptions(HostedMethod method, Uninterruptible annotati
127127
violations.add("Method " + method.format("%H.%n(%p)") +
128128
" uses an unspecific reason but is annotated with 'callerMustBe = true'. Please document in the reason why the callers need to be uninterruptible.");
129129
}
130+
131+
if (!annotation.calleeMustBe()) {
132+
violations.add("Method " + method.format("%H.%n(%p)") +
133+
" uses an unspecific reason but is annotated with 'calleeMustBe = false'. Please document in the reason why it is safe to execute interruptible code.");
134+
}
130135
} else if (isSimilarToUnspecificReason(annotation.reason())) {
131136
violations.add("Method " + method.format("%H.%n(%p)") + " uses a reason that is similar to the unspecific reason '" + Uninterruptible.CALLED_FROM_UNINTERRUPTIBLE_CODE + "'. " +
132137
"If the method has an inherent reason for being uninterruptible, besides being called from uninterruptible code, then please improve the reason. " +

0 commit comments

Comments
 (0)