Skip to content
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

Issue 2669 infinite recursion object javassist for java.lang.Object supertype #2693

Conversation

MysterAitch
Copy link
Member

Fixes #2669.

…l, added `#isJavaLangObject()` and `#isJavaLangObject()` to reduce repetition throughout the codebase, made `#getParent()` return Optional, added TypeSolver#getSolvedJavaLangObject() to return a solved reference to `java.lang.Object` to avoid repetition of this throughout the codebase,

note that this is a suggested commit message from intellij following a rebase.. probably okay, but noted here anyway just in case..
@MysterAitch MysterAitch added the API or Behaviour Change Issues / PRs where there is potentially a breaking change label May 22, 2020
@MysterAitch
Copy link
Member Author

Ooh interesting, this fails on java 12 -- seemingly due to the addition of java.lang.constant.Constable...

Another one to add to #1701 ?

[ERROR] Failures: 
[ERROR]   ReferenceTypeTest.testDirectAncestorsOfClassWithInterfaces:706 
Expected: iterable with items ["java.lang.CharSequence", "java.lang.Object", "java.lang.Comparable<java.lang.String>", "java.io.Serializable"] in any order
     but: not matched: "java.lang.constant.Constable"
[INFO] 
[ERROR] Tests run: 1083, Failures: 1, Errors: 0, Skipped: 3

@MysterAitch MysterAitch added this to the next release 3.15.23 milestone May 22, 2020
…hod have either `orElseThrow` or the logic around it's use has been edited to make use of `isPresent()` / `ifPresent()`
… optional, and all uses of this method have either `orElseThrow` or the logic around it's use has been edited to make use of `isPresent()` / `ifPresent()`
…o issue_2669_infinite_recursion_object_javassist
@MysterAitch
Copy link
Member Author

Ooh interesting, this fails on java 12 -- seemingly due to the addition of java.lang.constant.Constable...

Another one to add to #1701 ?

[ERROR] Failures: 
[ERROR]   ReferenceTypeTest.testDirectAncestorsOfClassWithInterfaces:706 
Expected: iterable with items ["java.lang.CharSequence", "java.lang.Object", "java.lang.Comparable<java.lang.String>", "java.io.Serializable"] in any order
     but: not matched: "java.lang.constant.Constable"
[INFO] 
[ERROR] Tests run: 1083, Failures: 1, Errors: 0, Skipped: 3

Yes, an issue with JDK 12 adding Constable and ConstantDesc which makes the test invalid.

https://docs.oracle.com/en/java/javase/12/docs/api/java.base/java/lang/String.html

I have added an enum and helper methods to AbstractSymbolResolutionTest which can be used to detect the current java version, thus allows tests to be run on specific Java versions.

This feels very "hacky" thus is immediately marked as as deprecated to strongly discourage its use in the future as anything other than a quick workaround, though it may be a potential solution to #1701 .

…viour )due to my confusion about whether ancestors includes implicit ancestors or not, and whether getDirectAncestors should do so -- see also javaparser#2696 )
… -- edited to fix/undo a previous change that introduced a change in behaviour )due to my confusion about whether ancestors includes implicit ancestors or not, and whether getDirectAncestors should do so -- see also javaparser#2696 )
@MysterAitch MysterAitch merged commit 8377581 into javaparser:master May 24, 2020
@MysterAitch MysterAitch deleted the issue_2669_infinite_recursion_object_javassist branch May 24, 2020 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API or Behaviour Change Issues / PRs where there is potentially a breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Infinite recursin on "java.lang.Object"
1 participant