Better warnings for deprecated java_import forms#7143
Merged
headius merged 1 commit intojruby:jruby-9.3from Mar 16, 2022
Merged
Better warnings for deprecated java_import forms#7143headius merged 1 commit intojruby:jruby-9.3from
headius merged 1 commit intojruby:jruby-9.3from
Conversation
Member
Author
|
This does introduce a visible change that might not be appropriate: the old logic overwrite the deprecated instance-method |
4f624d5 to
431a297
Compare
Member
Author
|
I modified this to undeprecate the instance method form of def foo
java_import some.class.we.need.Now
do something with Now
end |
* import in any context: warn of deprecation, recommend java_import instead. * java_import from a non-module object: removed deprecated definition since it was being overwritten by toplevel definition and lazy import is a good use case to support. * java_import from toplevel: works without warning. Fixes jruby#6976 ``` $ jruby -e 'java_import java.lang.System; p System' Java::JavaLang::System $ jruby -e 'import java.lang.System; p System' -e:1: warning: import is deprecated; use java_import Java::JavaLang::System $ jruby -e 'class X; def foo; java_import java.lang.System; p System; end; end; X.new.foo' Java::JavaLang::System ```
431a297 to
23a31d4
Compare
robbavey
added a commit
to robbavey/logstash-input-beats
that referenced
this pull request
Apr 14, 2022
As of jruby-9.3, the use of `import` in ruby file to import java classes has been deprecated, and the use of `java_import` is recommended. Relates: jruby/jruby#6976, jruby/jruby#7143
robbavey
added a commit
to logstash-plugins/logstash-input-beats
that referenced
this pull request
Apr 26, 2022
* Remove use of deprecated java `import` from ruby As of jruby-9.3, the use of `import` in ruby file to import java classes has been deprecated, and the use of `java_import` is recommended. Relates: jruby/jruby#6976, jruby/jruby#7143
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
java_import instead.
definition since it was being overwritten by toplevel
definition and lazy import is a good use case to support.
Fixes #6976