return (mod & STRICT) != 0;
}
+ /**
+ * Returns true if the modifiers include the <tt>varargs</tt>
+ * (variable number of arguments) modifier.
+ */
+ public static boolean isVarArgs(int mod) {
+ return (mod & VARARGS) != 0;
+ }
+
/**
* Truns the public bit on. The protected and private bits are
* cleared.
private InnerClassesAttribute getInnerClassAttr(CtClass cc) {
return (InnerClassesAttribute)cc.getClassFile2().getAttribute(InnerClassesAttribute.tag);
}
+
+ public void testVarArgsModifier() throws Exception {
+ CtClass cc = sloader.get("test5.VarArgsMethod");
+ assertTrue(Modifier.isVarArgs(cc.getDeclaredMethod("foo").getModifiers()));
+ assertFalse(Modifier.isVarArgs(cc.getDeclaredMethod("bar").getModifiers()));
+ }
}