Giter Club home page Giter Club logo

Comments (12)

byteit101 avatar byteit101 commented on July 24, 2024

@Hobogrammer do you have a small app that I can use to reproduce this?

from jrubyfx.

Hobogrammer avatar Hobogrammer commented on July 24, 2024

@byteit101 This was the code I was using in my tiny app before the work around. https://github.com/Hobogrammer/Tadoku-Character-Counter/tree/b8ff291cb4d16c0d88586f8f62856d06a3a7b127

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

I don't even see the .addChangeListener in official JavaFX docs. Where is this method coming from?

http://docs.oracle.com/javafx/2/api/javafx/beans/property/SimpleStringProperty.html

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

oh duh, its a jrubyfx method with the same name as a javafx 1 method which makes it hard to google

from jrubyfx.

edubkendo avatar edubkendo commented on July 24, 2024

Yeah, the actual javafx 2.0 method is just addListener, but in our dsl its add_change_listener:

https://github.com/jruby/jrubyfx/blob/master/lib/jrubyfx/core_ext/observable_value.rb#L28

from jrubyfx.

enebo avatar enebo commented on July 24, 2024

For current users of jrubyfx I think things are still in enough flux where we can just change the API to match current JavaFX, but does JRubyFX even work with older JavaFX? (sorry for the aside in this report :) )

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

I don't think so, its something completely different. I just found it confusing until I realized what was going on that we (@enebo actually) called it add_change_listener to wrap addListener, and javafx 1 had addChangeListener

from jrubyfx.

enebo avatar enebo commented on July 24, 2024

Perhaps there was an overload issue? I don't know why I would have added that name without following what I thought was FX naming. Hmmm I bet this was some mongo commit where I explained nothing too...

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

https://github.com/jruby/jrubyfx/blob/689a37004590ceeda7509d42bb0c6c8148903767/lib/jrubyfx/core_ext/observable_value.rb

anyway, the interesting issue is why does jarification make this fail? its just a simple wrapper

from jrubyfx.

enebo avatar enebo commented on July 24, 2024

This is typically the execution environment which causes these issues. If we extend a class we cannot really extend it in the Java sense since we are not actually constructing a Java class at runtime which extends the signatures. This in turn means to access protected methods (or package) we end up using setAccessible to make those methods execute in spite of being called from a non-extending (or non-package) Java object (our Ruby wrapped one). This is just speculation.

@Hobogrammer Can you describe the way in which you execute the jar and how you created it?

from jrubyfx.

Hobogrammer avatar Hobogrammer commented on July 24, 2024

Sorry about the delay.

simply used jrubyfx-jarify /projects/JavaFX/Tadoku-Character-Counter/src --main /projects/JavaFX/Tadoku-Character-Counter/src/charcount.rb TCC.jar to build the jar and java -jar TCC.jar to run it.

from jrubyfx.

byteit101 avatar byteit101 commented on July 24, 2024

I think this is actually a bug in JRuby as I was modifying this stuff, and the following happened:

  • direct calling add_listener works but gives off warning
  • using java_send throws odd access permission
  • using java_method calls wrong method but no errors

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.