This is an automated email from the ASF dual-hosted git repository. ggregory pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/commons-bcel.git
The following commit(s) were added to refs/heads/master by this push: new 02e7ad4 Sort members. 02e7ad4 is described below commit 02e7ad47d1cff65b0b36ffa2bb9c486e5bef9c09 Author: Gary Gregory <garydgreg...@gmail.com> AuthorDate: Tue Apr 14 13:44:45 2020 -0400 Sort members. --- .../org/apache/bcel/generic/MethodGenTestCase.java | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/test/java/org/apache/bcel/generic/MethodGenTestCase.java b/src/test/java/org/apache/bcel/generic/MethodGenTestCase.java index 180a2af..99baab7 100644 --- a/src/test/java/org/apache/bcel/generic/MethodGenTestCase.java +++ b/src/test/java/org/apache/bcel/generic/MethodGenTestCase.java @@ -28,14 +28,6 @@ import junit.framework.TestCase; public class MethodGenTestCase extends TestCase { - public static class Foo { - public void bar() { - @SuppressWarnings("unused") - final - int a = 1; - } - } - @interface A { } @@ -50,6 +42,14 @@ public class MethodGenTestCase extends TestCase { } } + public static class Foo { + public void bar() { + @SuppressWarnings("unused") + final + int a = 1; + } + } + private MethodGen getMethod(final Class<?> cls, final String name) throws ClassNotFoundException { final JavaClass jc = Repository.lookupClass(cls); final ConstantPoolGen cp = new ConstantPoolGen(jc.getConstantPool()); @@ -63,6 +63,16 @@ public class MethodGenTestCase extends TestCase { return null; } + public void testAnnotationsAreUnpacked() throws Exception { + final JavaClass jc = Repository.lookupClass(Bar.Inner.class); + final ClassGen cg = new ClassGen(jc); + final MethodGen mg = new MethodGen(cg.getMethodAt(0), cg.getClassName(), cg.getConstantPool()); + final List<AnnotationEntryGen> firstParamAnnotations = mg.getAnnotationsOnParameter(0); + assertEquals("Wrong number of annotations in the first parameter", 1, firstParamAnnotations.size()); + final List<AnnotationEntryGen> secondParamAnnotations = mg.getAnnotationsOnParameter(1); + assertEquals("Wrong number of annotations in the second parameter", 1, secondParamAnnotations.size()); + } + public void testRemoveLocalVariable() throws Exception { final MethodGen mg = getMethod(Foo.class, "bar"); @@ -104,14 +114,4 @@ public class MethodGenTestCase extends TestCase { assertNull("scope start", lv.getStart()); assertNull("scope end", lv.getEnd()); } - - public void testAnnotationsAreUnpacked() throws Exception { - final JavaClass jc = Repository.lookupClass(Bar.Inner.class); - final ClassGen cg = new ClassGen(jc); - final MethodGen mg = new MethodGen(cg.getMethodAt(0), cg.getClassName(), cg.getConstantPool()); - final List<AnnotationEntryGen> firstParamAnnotations = mg.getAnnotationsOnParameter(0); - assertEquals("Wrong number of annotations in the first parameter", 1, firstParamAnnotations.size()); - final List<AnnotationEntryGen> secondParamAnnotations = mg.getAnnotationsOnParameter(1); - assertEquals("Wrong number of annotations in the second parameter", 1, secondParamAnnotations.size()); - } }