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

common_converters.rb gets loaded twice causing errors #106

Open
korzry opened this issue Aug 23, 2016 · 0 comments
Open

common_converters.rb gets loaded twice causing errors #106

korzry opened this issue Aug 23, 2016 · 0 comments

Comments

@korzry
Copy link

korzry commented Aug 23, 2016

Depending on where the jrubyfx gem is installed, common_converters.rb gets loaded twice. When the gem is installed in GEM_HOME along side the ruby installation, no warnings are issues. When installed in the the user's home directory, the following warning are issue:

/net/sunshine/vol/homes/ryan_/.gem/jruby/2.3.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/utils/common_converters.rb:28: warning: already initialized constant ARG_CONVERTER_SUFFIX                                                                                     
/net/sunshine/vol/homes/ryan/.gem/jruby/2.3.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/utils/common_converters.rb:31: warning: already initialized constant NAME_TO_COLORS                                                                                           
/net/sunshine/vol/homes/ryan/.gem/jruby/2.3.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/utils/common_converters.rb:137: warning: already initialized constant CONVERTERS                                                                                              
/net/sunshine/vol/homes/ryan/.gem/jruby/2.3.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/utils/common_converters.rb:172: warning: already initialized constant ENUM_CACHE                                                                                              
/net/sunshine/vol/homes/ryan/.gem/jruby/2.3.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/utils/common_converters.rb:175: warning: already initialized constant ENUM_OVERRIDES  

This seems to be related to using require vs require_relative.

>> grep common_converters */*
core_ext/drag_event.rb:require 'jrubyfx/utils/common_converters'
core_ext/radial_gradient.rb:require 'jrubyfx/utils/common_converters'
utils/common_utils.rb:require_relative 'common_converters'

Notice that common_utils.rb uses require_relative. With jruby_9.1.2.0, the require and require_relative are not resolving to the same file causing common_converters to be loaded twice. Changing the require_relative to require solves this issue.

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