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 23616 Fixed generators on jdk11 + tests #23621

Merged

Conversation

dmatej
Copy link
Contributor

@dmatej dmatej commented Sep 24, 2021

Originally PFL used Unsafe class to generate classes. Since JDK11 it uses MethodInvocations, which verifies that the generated class has the same package as the anchor class. Generators were breaking the rule and under some circumstances it caused exceptions.

This PR also includes several tests and new test dependency: OpenJDK JMH. It's license is here.

- JMH test to reproduce race condition (already fixed)
- tests for generator issues
- imports, enhanced loops, finals, curly braces, generics
…ssible any more

- I removed the test too, because now it is already covered by the benchmark
- now uses GenericHomeGenerator as an anchor instead of EJBUtils
- stop using deprecated methods
- synchronization moved to method level and loading to one single caller which
  didn't do that yet -> reduced duplicit actions
- cleanup around leaky api of generateAndLoad which relied on consistency of
  it's parameters
- the anchor class was moved to the generator to keep JDK rules
- removeRedundantMethods was and is slow -> TODO: optimize + test
- ServiceInterfaceGenerator changed output class name and package, because
  original addition of jaxws.internal is forbidden in JDK11+
- tests were enhanced to be able to compare loading of cached classes.
…nerated classes

- we have to use deprecated methods yet for a while ...
@dmatej dmatej force-pushed the issue-23616-fixed-generators-jdk11 branch from 851d63e to e9a30b8 Compare September 27, 2021 11:09
@dmatej dmatej added this to the 6.2.3 milestone Sep 27, 2021
@arjantijms arjantijms marked this pull request as draft September 27, 2021 15:09
@dmatej
Copy link
Contributor Author

dmatej commented Sep 27, 2021

Current status: 4 tests of the TCK fail with StackOverflow when JDK does some class loading.
Hypothesis: Perhaps caused by a cyclic dependency between classloaders of a generated interface and generated proxy for a method of the interface.

@dmatej
Copy link
Contributor Author

dmatej commented Sep 29, 2021

I was wrong, the StackOverflow was caused by this property used in ts.override.properties:
-Djava.protocol.handler.pkgs=javax.net.ssl
When I removed it, tests run (didn't finish yet).

@dmatej dmatej marked this pull request as ready for review September 29, 2021 06:52
@dmatej
Copy link
Contributor Author

dmatej commented Sep 29, 2021

Ok, we are back, after I fixed my TCK test configuration, all failing tests passed, ufff:
Not passed: 0/20 /media/data-samsung/data/dmatej/work/repo/git/jakartaeetck-runner/cts_home/jakartaeetck-report/ejb_ee_bb_localaccess/text/summary.txt

@arjantijms arjantijms marked this pull request as draft September 29, 2021 11:03
@arjantijms
Copy link
Contributor

Note: see targeted version: 6.2.3, which means don't merge until 6.2.2 is released.

@arjantijms arjantijms marked this pull request as ready for review October 2, 2021 13:19
@arjantijms arjantijms merged commit ad6fefc into eclipse-ee4j:master Oct 2, 2021
@dmatej dmatej deleted the issue-23616-fixed-generators-jdk11 branch October 4, 2021 05:59
@dmatej dmatej linked an issue Oct 10, 2021 that may be closed by this pull request
2 tasks
@arjantijms arjantijms added the enhancement New feature or request label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some usages of generateAndLoad in GlassFish fail on JDK11+
2 participants