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

TextFieldListCell.converter_=(c) method does not work #262

atrosinenko opened this issue Feb 4, 2017 · 0 comments

TextFieldListCell.converter_=(c) method does not work #262

atrosinenko opened this issue Feb 4, 2017 · 0 comments


Copy link

@atrosinenko atrosinenko commented Feb 4, 2017

The TextFieldListCell.converter_=(c) method does not change text converter property of the underlying delegate.

How to reproduce

Run the following test:

package issues.issue262

import javafx.util.converter.IntegerStringConverter

import org.junit.runner.RunWith
import org.scalatest.FlatSpec
import org.scalatest.Matchers._
import org.scalatest.junit.JUnitRunner

import scalafx.Includes._
import scalafx.scene.control.cell.TextFieldListCell
import scalafx.testutil.RunOnApplicationThread

class Issue262Spec extends FlatSpec with RunOnApplicationThread {
  "TextFieldListCell" should "support changing of StringConverter" in {
    val cell = new TextFieldListCell[Integer]
    cell.converter = new IntegerStringConverter
    cell.converter.value.fromString("123") should be(123)

When executed, it throws an exception:

[info] Issue262Spec:
[info] TextFieldListCell
[info] - should support changing of StringConverter *** FAILED ***
[info]   java.lang.NullPointerException:
[info]   at scalafx.util.UtilIncludes$$anon$1.fromString(UtilIncludes.scala:115)
[info]   at issues.issue262.Issue262Spec$$anonfun$1.apply(Issue262Spec.scala:19)
[info]   at issues.issue262.Issue262Spec$$anonfun$1.apply(Issue262Spec.scala:16)
[info]   at org.scalatest.OutcomeOf$class.outcomeOf(OutcomeOf.scala:85)
[info]   at org.scalatest.OutcomeOf$.outcomeOf(OutcomeOf.scala:104)
[info]   at org.scalatest.Transformer.apply(Transformer.scala:22)
[info]   at org.scalatest.Transformer.apply(Transformer.scala:20)
[info]   at org.scalatest.FlatSpecLike$$anon$1.apply(FlatSpecLike.scala:1682)
[info]   at org.scalatest.TestSuite$class.withFixture(TestSuite.scala:196)
[info]   at issues.issue262.Issue262Spec.scalafx$testutil$RunOnApplicationThread$$super$withFixture(Issue262Spec.scala:15)
[info]   ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants