Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8095769

[Charts] Series: NPE when adding data items after deletion of data

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 8u5
    • Fix Version/s: 8u40
    • Component/s: javafx
    • Labels:

      Description

      Happens if the data had been deleted while the chart is null. Below is a failing code snippet, more details at SO http://stackoverflow.com/a/24533160/203657

          @Test
          public void testSeriesAddDeleteAdd() {
              Series<String, Number> series = new Series<String, Number>();
              Number value1 = new Integer(5);
              Number value2 = new Integer(6);
              Data<String, Number> point1 = new Data<String, Number>("Something", value1);
              Data<String, Number> point2 = new Data<String, Number>("Something", value2);
              series.getData().add(point1);
              series.getData().add(point2);
              // remove data
              series.getData().clear();

              Number value3 = new Integer(7);
              Data<String, Number> point3 = new Data<String, Number>("Something", value3);
              // add again: here's the NPE
              series.getData().add(point3);
          }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              msladecek Martin Sládeček
              Reporter:
              fastegal Jeanette Winzenburg
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported: