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

Possible NullPointerException in XYChart.java

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • 9
    • javafx

      The following method in XYChart.java:

      http://hg.openjdk.java.net/openjfx/9-dev/rt/file/9c2e8ff4fa26/modules/controls/src/main/java/javafx/scene/chart/XYChart.java#l910

      Copied here for convenience:

      /**
       * This should be called from seriesRemoved() when you are finished with any animation for deleting the series from
       * the chart. It will remove the series from showing up in the Iterator returned by getDisplayedSeriesIterator().
       *
       * @param series The series to remove
       */
      protected final void removeSeriesFromDisplay(Series<X, Y> series) {
          if (series != null) series.setToRemove = false;
          series.setChart(null);
          displayedSeries.remove(series);
      }

      Seems like it could throw a NullPointerException if the given series argument is null. Perhaps it should actually be:

      /**
       * This should be called from seriesRemoved() when you are finished with any animation for deleting the series from
       * the chart. It will remove the series from showing up in the Iterator returned by getDisplayedSeriesIterator().
       *
       * @param series The series to remove
       */
      protected final void removeSeriesFromDisplay(Series<X, Y> series) {
          if (series != null) {
              series.setToRemove = false;
              series.setChart(null);
          }
          displayedSeries.remove(series);
      }

            Unassigned Unassigned
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Imported: