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

JavaFX controls that appear in certain expressions get clobbered names #9033

Closed
scabug opened this issue Dec 6, 2014 · 3 comments
Closed
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 6, 2014

JavaFXML loader cannot properly load my controller class, because the required variables compile to names like

private javafx.scene.control.TextField ui$FXMLAttrEditorController$$intField;
private javafx.scene.control.TextField ui$FXMLAttrEditorController$$xField;
private javafx.scene.control.TextField ui$FXMLAttrEditorController$$yField;
.
The correct names would be

private javafx.scene.control.TextField intField;
private javafx.scene.control.TextField xField;
private javafx.scene.control.TextField yField;

(as reported by javap.exe).

See attached file. It is extracted from a working project, but should compile alone, if you remove the "irrelevant" parameter. The problem gets triggered around line 40.

If you need build.sbt, try this:

scalaVersion := "2.11.4"

libraryDependencies ++= Seq(
"org.scalafx" %% "scalafx" % "8.0.20-R6",
)

@scabug
Copy link
Author

scabug commented Dec 6, 2014

Imported From: https://issues.scala-lang.org/browse/SI-9033?orig=1
Reporter: Isa Dasa (oldwo)
Affected Versions: 2.11.2, 2.11.4
See #7085
Attachments:

@scabug
Copy link
Author

scabug commented Dec 6, 2014

Isa Dasa (oldwo) said:
This is no longer a problem, by making the variables of controls public (not private), the names stay normal.

@scabug
Copy link
Author

scabug commented Dec 8, 2014

@retronym said:
If we were to fix #7085 you could leave them private. Currently, accessing a private member from an inner class or anonymous function triggers the transformation to a public, name mangled member.

@scabug scabug closed this as completed Dec 8, 2014
@scabug scabug added the quickfix label Apr 7, 2017
@scabug scabug added this to the 2.11.5 milestone Apr 7, 2017
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

2 participants