Giter Club home page Giter Club logo

Comments (5)

amiracam avatar amiracam commented on July 24, 2024

ok, some back and for with byteit101, uncovered that there is a conflict with jrubyfx's redefinition of java.util.Set which conflicts with Set.rb, the fix was to remove 'java.util.Set' from the from the java import call i.e. jrubyfx-fxmlloader.rb line 63

from jrubyfx.

QRaid avatar QRaid commented on July 24, 2024

Got the same problem when using jrubyfx in combination with activerecord. Fix described by amiracam worked for me, too. Thanks man.

from jrubyfx.

amiracam avatar amiracam commented on July 24, 2024

NP, the more we whack at jrubyfx the better. Finally, a reasonable enterprise real app gui framework for Ruby.

Anyhow, you may encounter a similar issue with to_array being sent when using to retrieve the underlying collection from a one to many dm association. The jrubyfx interface implementation sends :to_array which fails. It seems this is dynamically generated so I don't know where to look.

the stack can be found here:

https://gist.github.com/amiracam/6055902

my gut feeling is that its a similar issue i.e. to the Set issue.

However, I needed to carry on and so I was ok with being explicit and I used :to_a which is made available via lazy_array.rb which is part of dm-core / support.

e.g.

instead of my my_object.my_relationship.all

I do

my_object.my_relationship.all.to_a

where my_relationship is a Datamapper one to many i.e.

has n, :name_of_associated_model
e.g.

has n, Friends

not ideal I suppose but I didn't want to take the time to understand what the implications would be to a similar strategy to the Set issue i.e. which was to simply not import the java set class i.e. thus not to import the java array class.

I would be curious to know if you experience the same issue with active-record. Basically , I was trying to populate a javafx list widget with a collection of objects retrieved via a dm one to many e.g.

@list.items.add_all (my_object.my_relationship.all.to_a)

from jrubyfx.

komax avatar komax commented on July 24, 2024

I'll get the same behavior with the latest jrubyfx on rspec:

rspec spec/compiler_data_spec.rb                                                              :(
file:/home/max/Programmierung/gsoc/jruby/lib/jruby.jar!/jruby/java/core_ext/object.rb:73 warning: already initialized constant Set
ArgumentError: wrong number of arguments calling `initialize` (1 for 0)
                                   new at org/jruby/java/proxies/JavaInterfaceTemplate.java:387
                                to_set at /home/max/Programmierung/gsoc/jruby/lib/ruby/1.9/set.rb:626
                               Matcher at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:27
                                   DSL at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:8
                              Matchers at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:5
                                 RSpec at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:4
                                (root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:3
                               require at org/jruby/RubyKernel.java:1082
                               require at /home/max/Programmierung/gsoc/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:58
                                (root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers.rb:1
                               require at org/jruby/RubyKernel.java:1082
                               require at /home/max/Programmierung/gsoc/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:58
                                (root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers.rb:5
                               require at org/jruby/RubyKernel.java:1082
                               require at /home/max/Programmierung/gsoc/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:110
                               require at /home/max/Programmierung/gsoc/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:106
                                (root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/expectations.rb:1
                                   map at org/jruby/RubyArray.java:2414
                                (root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/expectations.rb:2
                                (root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:1
                           expect_with at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:447
                           expect_with at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:442
                expectation_frameworks at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:410
       configure_expectation_framework at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:889
  ensure_example_groups_are_configured at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/example_group.rb:280
                             set_it_up at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/example_group.rb:294
                              subclass at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/example_group.rb:244
                                  load at org/jruby/RubyKernel.java:1101
                              describe at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/example_group.rb:230
                                  each at org/jruby/RubyArray.java:1614
                              describe at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/dsl.rb:18
                                (root) at /home/max/Programmierung/gsoc/jruby-visualizer/spec/compiler_data_spec.rb:3
                                (root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:1
                       load_spec_files at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896
rspec spec/compiler_data_spec.rb  14,82s user 0,18s system 237% cpu 6,321 total

And with proposed exlude of Set from @amiracam, I get this:

% rspec spec/compiler_data_spec.rb     
#<CompilerData:0x605be4bb>
F

Failures:

  1) CompilerData should update AST and IR Scope after updating ruby code
     Failure/Error: updated_ast_root.should be_true
       expected: true value
            got: false
     # ./spec/compiler_data_spec.rb:22:in `(root)'

Finished in 0.084 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/compiler_data_spec.rb:9 # CompilerData should update AST and IR Scope after updating ruby code
rspec spec/compiler_data_spec.rb  14,89s user 0,26s system 233% cpu 6,477 total

Hey @byteit101, can you please integrate this fix into your repo? Thanks.

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

fixed on fxmlloader master

from jrubyfx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.