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

Calling scalafx.scene.Node.localToParentTransform / localToSceneTransform results in StackOverflow exception #205

Closed
albel727 opened this Issue Jul 16, 2015 · 2 comments

Comments

Projects
None yet
2 participants
@albel727

albel727 commented Jul 16, 2015

The problem stems from their definition, e.g.

  def localToSceneTransform: Transform = delegate.localToSceneTransform

But the javafx.scene.Node delegate doesn't have the method localToSceneTransform(). It has getLocalToSceneTransform(). Since this is the case, what scala compiler does instead is applying the implicit conversion of jfxs.Node into scalafx.scene.Node... Yes! Right back into the same Node class we're starting from!... And calls its localToSceneTransform, i.e. the very same function we're in already.

Solution: change definitions to

  def localToSceneTransform: Transform = delegate.getLocalToSceneTransform
  def localToParentTransform: Transform = delegate.getLocalToParentTransform

I'd also advise to investigate whether implicit conversions produced similar recursion bugs in other places.

@jpsacha jpsacha added the bug label Aug 25, 2015

@jpsacha jpsacha added this to the 8.0.*-R9 milestone Aug 25, 2015

jpsacha added a commit that referenced this issue Sep 9, 2015

Partial fix for #205 : Calling scalafx.scene.Node.localToParentTransf…
…orm / localToSceneTransform results in StackOverflow exception.

There may be other infinite recursions.

jpsacha added a commit that referenced this issue Sep 20, 2015

Partial fix for #205: eliminate infinite recursion due to incorrect m…
…ethod signatures.

Remove redundant code - no need to have methods that have exactly the same signature as delegate.

jpsacha added a commit that referenced this issue Sep 20, 2015

@jpsacha

This comment has been minimized.

Member

jpsacha commented Sep 20, 2015

I create for IDEA Live-Plugin to detect recursive methods:
https://gist.github.com/jpsacha/9864e30dc884683bee18

I will try to find other instances of infinite recursion, before closing this issue.

jpsacha added a commit that referenced this issue Sep 20, 2015

@jpsacha

This comment has been minimized.

Member

jpsacha commented Sep 20, 2015

All infinite recursion calls should be corrected now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment