-
-
Notifications
You must be signed in to change notification settings - Fork 926
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
Undefined Method java_kind_of? in JRuby-9.3.0.0 #6862
Comments
Yes, it was deprecated in # @deprecated
def java_kind_of?(other) # TODO: this can go away now, but people may be using it
return true if self.kind_of?(other)
return false unless self.respond_to?(:java_class) && other.respond_to?(:java_class) &&
other.kind_of?(Module) && !self.kind_of?(Module)
return other.java_class.assignable_from?(self.java_class)
end |
So what are our options then? Use |
@ThomasKoppensteiner @michaelklishin Is kind_of? working for your needs here: a = java.util.ArrayList.new; p a.kind_of?(java.util.ArrayList) #=> true
a = java.util.ArrayList.new; p a.kind_of?(java.util.List) #=> true |
@enebo thank you for your suggestion. I used it in this PR for |
@ThomasKoppensteiner we talked about this on chat and realized for instance of sorts of checks kind_of? works but if you ask on Java type itself (e.g. java.util.ArrayList.kind_of?(java.lang.Class)) it does not. I think this is probably very uncommon but if you happen to ever notice this case we probably need to augment kind_of?. |
The use-case in the ticket is the following:
@enebo Would this be a valid? I searched for LONG_STRING_TYPE and found that value. https://github.com/ruby-amqp/march_hare/search?q=LONG_STRING_TYPE |
I believe these should work with |
Closing as won't fix since |
Hello, I am using Logstash to process python script in my pipeline between SQL and ElasticSearch but if I use this filter in my logstash-sample.conf file
I am not sure it causes problems but what could I do to prevent that? |
@AxelPatron I don't know how you insert Ruby into conf (or some other file which happens to be Ruby syntax) but if you figure out such a place you can: class Object; alias java_kind_of? kind_of?; end I am guessing java_kind_of? is still being used by whatever provides python support. |
Environment Information
JRuby:
jruby 9.3.0.0 (2.6.8) 2021-09-17 85c20e780f OpenJDK 64-Bit Server VM 11.0.12+0 on 11.0.12+0 [darwin-x86_64]
Dev OS:
Darwin ofc-03052-m 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:31 PDT 2021; root:xnu-7195.141.2~5/RELEASE_X86_64 x86_64
java_kind_of?
is called here by themarch_hare
gem (version4.3.0-java
) (ruby-amqp/march_hare#155).Expected Behavior
java_kind_of?
method is supported byJRuby-9.3.0.0
Actual Behavior
java_kind_of?
method is not supported byJRuby-9.3.0.0
java_kind_of?
method is supported byJRuby-9.2.19.0
Is
java_kind_of?
deprecated? Is there a replacement inJRuby-9.3.0.0
?The text was updated successfully, but these errors were encountered: