Skip to content

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

Closed

Description

@atrosinenko

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

@RunWith(classOf[JUnitRunner])
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]   ...

Activity

  1. added this to the 8.0.*-R12 milestone on Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions