diff --git a/src/main/java/org/jpeek/skeleton/OpsOf.java b/src/main/java/org/jpeek/skeleton/OpsOf.java index 815ece1e..d45aaf3a 100644 --- a/src/main/java/org/jpeek/skeleton/OpsOf.java +++ b/src/main/java/org/jpeek/skeleton/OpsOf.java @@ -84,6 +84,22 @@ public void visitFieldInsn(final int opcode, final String owner, ).up().up(); } + // @todo #403:30min Method call description has to contain + // information about the method's arguments. + // That is important to differentiate overloaded methods to calculate LCOM4. + // We need to add a tag 'name' to reflect the method name + // and a tag 'args' to reflect the method's arguments. + // skeleton.xsd should be changed to support the method's arguments. + // Also, don't forget to delete @Disabled lines in + // SkeletonTest#skeletonShouldReflectExactOverloadedCalledMethod. + // Example: + // + // OverloadMethods.methodOne + // + // ? + // ? + // + // @Override public void visitMethodInsn(final int opcode, final String owner, final String mtd, diff --git a/src/test/java/org/jpeek/skeleton/SkeletonTest.java b/src/test/java/org/jpeek/skeleton/SkeletonTest.java index 3274b527..065c1f04 100644 --- a/src/test/java/org/jpeek/skeleton/SkeletonTest.java +++ b/src/test/java/org/jpeek/skeleton/SkeletonTest.java @@ -26,6 +26,7 @@ import com.jcabi.matchers.XhtmlMatchers; import org.jpeek.Base; import org.jpeek.FakeBase; +import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.llorllale.cactoos.matchers.Assertion; @@ -61,6 +62,25 @@ public void createsXml() { ).affirm(); } + @Test + @Disabled + public void skeletonShouldReflectExactOverloadedCalledMethod() { + new Assertion<>( + "Must find arguments of overloaded method", + XhtmlMatchers.xhtml( + new Skeleton( + new FakeBase("OverloadMethods") + ).xml().toString() + ), + XhtmlMatchers.hasXPaths( + // @checkstyle LineLength (3 lines) + "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/name[.='OverloadMethods.methodOne']", + "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/args[count(arg)=2]", + "//method[@name='methodOne' and @desc='(Ljava/lang/String;)D']/ops/op[@code='call']/args/arg[@type='Ljava/lang/String' and .='?']" + ) + ).affirm(); + } + @Test public void findsMethodsAndArgs() { new Assertion<>(