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

java support cleanup and improvements #2624

Closed
wants to merge 45 commits into from

Conversation

Projects
None yet
2 participants
@kares
Copy link
Member

commented Feb 26, 2015

details at commits .. I'm happy to re-iterate leave some out as needed

kares added some commits Feb 3, 2015

unify proxy class/module setup and hide methods such as lockProxy whi…
…ch are internal

also hidden JavaClass' constructor as if it's ever instantiated outside JavaSupport's class-value cache it will start to break things badly
simplify JavaObject internals avoiding unnecessary NPEs + fix compari…
…son typos

... `obj == NEVER` when really unwrapped value was meant to be compared
guard against concurrent Java:: package module initializations (in mu…
…ltiple threads)

avoid warnings such as rb:42 warning: already initialized constant JavaUtilConcurrent

probably related to #2014
unify internal Java class loading into a single getProxyClassOrNull m…
…ethod

... has a desired side effect of improving "initial" performance
due not re-raising ClassNotFoundExceptions within the Ruby runtime

they also will no longer be reported by the runtime with log.exeptions=true
simplify and avoid unnecessary code
- only pass context to (internal) getTopLevelProxyOrPackage method
- setupJavaClass does not need a java_class argument (it's not used)
- only intern string on addMethod (although it's likely redundat there as well)
name.trim-ing seems "dangerous" as we're assuming a valid constant na…
…me up the stack

... it very likely never-ever trimmed anything
refactor internal getRuntime invokes (esp. in loops) - pass it around
also (package) "internalized" JavaClass.getRubyArray as toRubyArray

kares added some commits Feb 5, 2015

rename ProxyMethodImpl's internal fields (for better identification) …
…& also :

- invoke implementation now avoids unnecessary System.arraycopy call
- pre-maturily optimized some from "excessive" getRuntime() invocations
@headius

This comment has been minimized.

Copy link
Member

commented Feb 26, 2015

This has been merged into test-refactor-ji and I'm continuing some refactoring there. Will merge that branch to jruby-1_7 shortly.

@headius headius closed this Feb 26, 2015

@headius headius added this to the JRuby 1.7.20 milestone Feb 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.