Skip to content

Commit 79b34c9

Browse files
committed
Ignore spotbugs warnings about annotations
* These are made RetentionPolicy.RUNTIME during linting.
1 parent ab7f7bd commit 79b34c9

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/main/java/org/truffleruby/builtins/AmbiguousOptionalArgumentChecker.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import com.oracle.truffle.api.dsl.NodeFactory;
1414
import com.oracle.truffle.api.dsl.Specialization;
1515
import org.truffleruby.RubyLanguage;
16+
import org.truffleruby.SuppressFBWarnings;
1617
import org.truffleruby.language.RubyNode;
1718

1819
import java.lang.reflect.Method;
@@ -38,6 +39,7 @@ public static void verifyNoAmbiguousOptionalArguments(NodeFactory<? extends Ruby
3839
}
3940
}
4041

42+
@SuppressFBWarnings("Dm")
4143
private static void verifyNoAmbiguousOptionalArgumentsWithReflection(NodeFactory<? extends RubyNode> nodeFactory, CoreMethod methodAnnotation) {
4244
if (methodAnnotation.optional() > 0 || methodAnnotation.needsBlock()) {
4345
final int opt = methodAnnotation.optional();
@@ -121,8 +123,14 @@ private static boolean isParameterUnguarded(Method method, Parameter[] parameter
121123

122124
private static List<Method> specializations(Class<?> node) {
123125
Method[] methods = node.getDeclaredMethods();
124-
return Arrays.stream(methods).filter(m -> m.isAnnotationPresent(Specialization.class)).collect(Collectors.toList());
126+
return Arrays.stream(methods).filter(m -> isSpecialization(m)).collect(Collectors.toList());
125127
}
128+
129+
@SuppressFBWarnings("Dm")
130+
private static boolean isSpecialization(Method m) {
131+
return m.isAnnotationPresent(Specialization.class);
132+
}
133+
126134
private static boolean isGuarded(String name, String[] guards) {
127135
for (String guard : guards) {
128136
if (guard.equals("wasProvided(" + name + ")") ||

src/main/java/org/truffleruby/builtins/LowerFixnumChecker.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import com.oracle.truffle.api.dsl.Specialization;
1515
import com.oracle.truffle.api.frame.VirtualFrame;
1616
import org.truffleruby.RubyLanguage;
17+
import org.truffleruby.SuppressFBWarnings;
1718
import org.truffleruby.core.array.ArrayUtils;
1819
import org.truffleruby.language.RubyNode;
1920

@@ -24,6 +25,7 @@ public class LowerFixnumChecker {
2425

2526
public static boolean SUCCESS = true;
2627

28+
@SuppressFBWarnings("Dm")
2729
public static void checkLowerFixnumArguments(NodeFactory<? extends RubyNode> nodeFactory, int initialSkip, int[] lowerFixnum) {
2830
final Class<? extends RubyNode> nodeClass = nodeFactory.getNodeClass();
2931
byte[] lowerArgs = null;

0 commit comments

Comments
 (0)