-
Notifications
You must be signed in to change notification settings - Fork 180
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
Allow FunctionalInterface conversion when the annotation is not present #1110
Allow FunctionalInterface conversion when the annotation is not present #1110
Conversation
9dc2aac
to
5b4d598
Compare
Codecov Report
@@ Coverage Diff @@
## master #1110 +/- ##
==========================================
+ Coverage 88.65% 88.67% +0.01%
==========================================
Files 111 111
Lines 10211 10211
Branches 4016 4016
==========================================
+ Hits 9053 9055 +2
+ Misses 699 698 -1
+ Partials 459 458 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
5b4d598
to
49d082a
Compare
Does this code all work with jdk 8? |
It should. I don't think I used anything that wasn't available in jdk 8. The reason I got a |
Okay. I will verify it on jdk8 when it is ready for review. I dont think our cloud currently tests old versions. |
I added some test but unfortunately they are failing at the moment. There is something lingering elsewhere that is causing the cast to fail and I'm not sure where it is. |
@Thrameos any ideas where the cast might be failing? |
Should be able to look at it Friday. |
So two problems. It didn't check that the method exists for setting the FUNCTIONAL around line 460 in Unfortunately, doing that also exposes a race condition during initialization. Normally it won't search for the function name in the ClassDescriptor until after the type system is initialized, but once we start triggering on functions that could be considered functional but don't have the annotation we trigger on things like |
Okay I put in a pull request with the recommended fix. Hopefully it resolved the issue with the testbench. |
@Thrameos I think it is ready for review. The option to request a review is not available. |
It all looks fine to me. Though I am somewhat worried that we changed the definition of a public method in |
That definition change may have been unintentional and something I did while troubleshooting. I'll look again after work but it should be trivial to avoid that change. |
No, it was required because of the order of operations. When we make it recognize classes as Lambdas before Making this method static was the shortest path to solution. And given noone is supposed to be accessing those JPypeContext methods outside of diagnostics it should be fine. The other solutions are not terribly hard to implement, but they are more involved and thus would make for a much larger PR that your original intent. So lets see if the simplest solution is acceptable first. But is the maintainer wants a better solution then I will make it so. Sadly if you remove the static then the system will crash because with a NullPointerException or hook install failure during initialization. |
Oh I didn't realize you made that change (or I did forget about it and it just worked out well) |
I will have a look at the current tests tomorrow and see what I can add to throw the kitchen sink at this.
I tried to follow the formatting as close as possible.
Fixes #1107