From a64f57f489c4a60dc20d26b34164991181223f21 Mon Sep 17 00:00:00 2001 From: chibash Date: Wed, 15 Nov 2017 03:46:02 +0900 Subject: [PATCH] adds Modifier#isVarArgs() --- javassist.jar | Bin 759198 -> 759217 bytes src/main/javassist/Modifier.java | 8 ++++++++ src/test/javassist/JvstTest5.java | 6 ++++++ 3 files changed, 14 insertions(+) diff --git a/javassist.jar b/javassist.jar index 823d1cc94b5dfa9830e501f27c9abf77ffe5ea56..9ae3c4bd585ce0012448c5adf94d768e6df2903a 100644 GIT binary patch delta 9374 zcmZWu30#fY`|rMYzo)vleP2-*hJ?$bbD%n!fB9)YikSrC^V@M1cJDC}>q{xhY z9ebggF=NIOhM__HpZA{J-@Wtq`Q&}S-{*VIdCqg5v%Kfl?sYn}*GWArkjs;(sfpCo zW}B^1@6V)|9dhSzG*isd1HV~uvVqT2Q|m(@^Ek(xvmPq(QRJSiQKq9E+SmS2hF9%d z{fgD8Np;p*t1F{^aPo{4mGR?VM_Fb^M?Q~wlb|+yc~-jDpxl|M(W%-+=bpTOSUSzK z`SZs&&T1KA!NA6Z#mv0ve^#F=u2o;ike&ukpV&NAG%XZP$?D|nJQ55qjw_wX*Bk!rknw>9a{+&^Aq zGe3tPEa@@piXGK6)@)Zv?1*J;yWE9)TyMoLE1StR8M9Aor*K8uhW-Arx1+2|mu_n{ zo!T(dI`EY3!0SWx){NVe`1aoA1%k+@QEOt(#u!vgihk+#^v0ipMW6n@SR@Kf{(O8y z$Jo*Z<*pA+Jr^afj@xJYtoz9C<@<^UmaiN?50>%DbGxErBMpCXNtxG^ecXR@hkeM( zWj%l0+c9K_(=&(Mj8(x!X70I$(eKX1J*&F6ZAyY)!#+`k!Tm!PLvtSQyLN5LUboDn z8d+LDTo{}hac!>HG4XX%QoBY$Md8IF?S97P1qN*oj$KxFbgnBm$Xv9@_Q)T$^PJ}{ z*0?m<{$|)eURy3Kl;$p3HX!}@g}A34tC&mWzjksjYGy_rm8Q6y-r?}APT9(z+C#os z|L#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FIFX zTKXu1fR*@2g5xW3qBpTr(HVkP;hqbaLdWR_%cjT;SUuiPkt<2ZYth~%r=fNgei+#> z8*Z$^WqCMTt_@>WqX!%2(C{r_%W52EQYr-w(6AaOHwK$E*s^vlVBGdKcpGv^V<0_E zZVHOEXx}fLG0|)BJ~@0b16vo%_1O`!FSAPq3Nx9)9i-tq z5PXBXfP#e-e8LSt!8HWj!s1Q%iEQvQM!_?=F8pMN4jwDQvtjopJR3&6qOuvarargs + * (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. diff --git a/src/test/javassist/JvstTest5.java b/src/test/javassist/JvstTest5.java index 346263cb..e7fdb28c 100644 --- a/src/test/javassist/JvstTest5.java +++ b/src/test/javassist/JvstTest5.java @@ -393,4 +393,10 @@ public class JvstTest5 extends JvstTestRoot { 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())); + } } -- 2.39.5