-
Notifications
You must be signed in to change notification settings - Fork 186
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
Support for deferred proxies using JImplements #656
Conversation
Codecov Report
@@ Coverage Diff @@
## master #656 +/- ##
==========================================
- Coverage 78.52% 78.39% -0.14%
==========================================
Files 118 118
Lines 8755 8774 +19
Branches 3715 3715
==========================================
+ Hits 6875 6878 +3
- Misses 1373 1389 +16
Partials 507 507
Continue to review full report at Codecov.
|
|
||
# Return the augmented class | ||
return type("proxy.%s" % cls.__name__, (cls, _jpype._JProxy), members) | ||
if _jpype.isStarted(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given the conversation at #504 I'm not sure JVM is started is the right test for deciding whether we should be doing interface/override checking. I rather think explicit control is a good thing here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do interface and override checking regardless. If it is prior to starting then checking is done at the first create, else we execute it immediately.
return actualIntf | ||
|
||
def new(tp, *args, **kwargs): | ||
actualIntf = init(cls) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to only do this once, as we do with the non deferred case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe line 49 ensures we do this only once.
I also took a shot at this in #659. |
In tonight's endless PR, we change the pattern for proxy creation so that classes can implement interfaces before the JVM is actually started. Proxies created in this fashion are not actually checked until the first object using the Proxy is created, but are otherwise the same as normal proxies.
Fixes #653