13
13
import com .oracle .truffle .api .dsl .NodeFactory ;
14
14
import com .oracle .truffle .api .dsl .Specialization ;
15
15
import org .truffleruby .RubyLanguage ;
16
+ import org .truffleruby .SuppressFBWarnings ;
16
17
import org .truffleruby .language .RubyNode ;
17
18
18
19
import java .lang .reflect .Method ;
@@ -38,6 +39,7 @@ public static void verifyNoAmbiguousOptionalArguments(NodeFactory<? extends Ruby
38
39
}
39
40
}
40
41
42
+ @ SuppressFBWarnings ("Dm" )
41
43
private static void verifyNoAmbiguousOptionalArgumentsWithReflection (NodeFactory <? extends RubyNode > nodeFactory , CoreMethod methodAnnotation ) {
42
44
if (methodAnnotation .optional () > 0 || methodAnnotation .needsBlock ()) {
43
45
final int opt = methodAnnotation .optional ();
@@ -121,8 +123,14 @@ private static boolean isParameterUnguarded(Method method, Parameter[] parameter
121
123
122
124
private static List <Method > specializations (Class <?> node ) {
123
125
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 ());
125
127
}
128
+
129
+ @ SuppressFBWarnings ("Dm" )
130
+ private static boolean isSpecialization (Method m ) {
131
+ return m .isAnnotationPresent (Specialization .class );
132
+ }
133
+
126
134
private static boolean isGuarded (String name , String [] guards ) {
127
135
for (String guard : guards ) {
128
136
if (guard .equals ("wasProvided(" + name + ")" ) ||
0 commit comments