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::float is a class not a method call #1410

Closed
PragTob opened this issue Oct 29, 2014 · 0 comments
Closed

Java::float is a class not a method call #1410

PragTob opened this issue Oct 29, 2014 · 0 comments

Comments

@PragTob
Copy link

PragTob commented Oct 29, 2014

jruby-1.7.16 :001 > Java::float
 => #<Class:0x1e75cf1d>

In JRuby Java::float and the like are used to access primitive Java classes (like byte etc.), see: https://github.com/jruby/jruby/wiki/CallingJavaFromJRuby#java-primitive-classes . Rubocop falsely marks them with the Style/ColonMethodCall cop.

The auto-correct gladly doesn't break code as Java.float seems to work as well, but overall I prefer Java::float.new over the dot version, as it is a class.

I deactivated the cop for now, a fix would be great, though. Dunno how that would be best done other than white listing "Java::#{all_the_types}"

Cheers and thanks for rubucop!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant