-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
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
Add toDescriptor to ResolvedMethodDeclaration #3819
Conversation
- add necessary implementations - add toDescriptor to ResolvedType with necessary implementations - extend DescriptorTest with new cases
acd4cff
to
d975c3e
Compare
javaparser-core/src/main/java/com/github/javaparser/utils/TypeUtils.java
Outdated
Show resolved
Hide resolved
...lver-testing/src/test/java/com/github/javaparser/symbolsolver/resolution/DescriptorTest.java
Outdated
Show resolved
Hide resolved
718f582
to
acd4cff
Compare
- remove else if cases - get correct descriptor for primitive classes (e.g. int.class) - and also their wrapper classes (Integer.class) - add toDescriptor to Primitive
javaparser-core/src/main/java/com/github/javaparser/utils/TypeUtils.java
Outdated
Show resolved
Hide resolved
0a03be2
to
64b101a
Compare
Can you add unit test for all primitive type and remove the unit test dependency with the javassist library. |
- TypeDescriptorTest testing descriptors for all primitive types - rename DescriptorTest to MethodDescriptorTest
Thank you for your contribution which will be the last of the year. It will be available in the next version (end of January) because version 3.24.10 was released this afternoon. |
Codecov Report
@@ Coverage Diff @@
## master #3819 +/- ##
===============================================
+ Coverage 57.571% 57.604% +0.033%
- Complexity 2182 2185 +3
===============================================
Files 638 639 +1
Lines 33911 33959 +48
Branches 5864 5870 +6
===============================================
+ Hits 19523 19562 +39
- Misses 12306 12314 +8
- Partials 2082 2083 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Very nice, thanks! Seems like maven_test (windows-latest, 8) failed the second time (even though it was successful the first time). |
Please stop modifying the PR so that I can validate it. |
Fixes #3808.
Adds
toDescriptor()
to ResolvedMethodDeclarations with all the needed implementations. It was also necessary to addtoDescriptor()
for ResolvedType.For convenience, a TypeUtils class was added that contains utility methods for getting the descriptors for
java.lang.reflect.Method
and primitive classes (compare to ASM).Found issue:
Inner classes(/enums) do not have the correct fully qualified name. You get Class.InnerClass instead of Class$InnerClass. This also effects my test cases for the
valueOf
andvalues
method of enums.For now, it should be fine, but I think this needs to be addressed in a future issue and PR.