We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consider the following interface file demoInterface.java, there is a inner interface called AnotherInterface.
demoInterface.java
AnotherInterface
package org.example; public interface demoInterface { interface AnotherInterface { void anotherMethod(); void anotherMethod2(); void anotherMethod3(); } }
Now a class implements the above interface as below:
package org.example; public class demoTest implements demoInterface { public AnotherInterface fakeMethod() { return null; } }
When QDox parses the fakeMethod(), it cannot correctly get the method infomration. The parsing code is:
fakeMethod()
JavaProjectBuilder builder = new JavaProjectBuilder(); builder.addSourceTree(${path_to_org_example_package}); JavaClass javaClass = builder.getClassByName("org.example.demoTest"); // iterate all the methods for (JavaMethod method : javaClass.getMethods()) { JavaClass returnClass = method.getReturns(); if (returnClass != null) { System.out.println("Class: " + returnClass.getFullyQualifiedName()); System.out.println("Method: " + method.getName() + " returns: " + returnClass.getFullyQualifiedName()); System.out.println(returnClass.getMethods()); } }
You will see the output:
Class: AnotherInterface Method: fakeMethod returns: AnotherInterface []
The expected output should be:
Class: org.example.demoInterface.AnotherInterface Method: fakeMethod returns: org.example.demoInterface.AnotherInterface [public void anotherMethod(), public void anotherMethod2(), public void anotherMethod3()]
The text was updated successfully, but these errors were encountered:
I found that the issue only happens if the target class implements the interface.
So the below code works:
package org.example; public class demoTest { public demoInterface.AnotherInterface fakeMethod() { return null; } }
But this code does not work:
Sorry, something went wrong.
No branches or pull requests
Consider the following interface file
demoInterface.java
, there is a inner interface calledAnotherInterface
.Now a class implements the above interface as below:
When QDox parses the
fakeMethod()
, it cannot correctly get the method infomration.The parsing code is:
You will see the output:
The expected output should be:
The text was updated successfully, but these errors were encountered: