On January 27th, this site will be read-only as we migrate to Oracle Forums for an improved community experience. You will not be able to initiate activity until January 30th, when you will be able to use this site as normal.

    Forum Stats

  • 3,889,605 Users
  • 2,269,766 Discussions


warning: [unchecked] unchecked call to Data(X,Y) as a member of the raw type Data

HarrySatt Member Posts: 26
edited Mar 1, 2016 10:50AM in JavaFX 2.0 and Later

I trying out tutorial stuff. Now I am with https://docs.oracle.com/javafx/2/charts/bar-chart.htm the BarChart tutorial. I created a new project with name BarChartSample ( the name of the tutorial class ) and pasted the code from the tutorial into the created source file. It compiles and does what it should. But I see some notes:

Note: C:\Users\hsattm72\Documents\NetBeansProjects\JavaFXBarChart\src\barchartsample\BarChartSample.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

So I used the -Xlint:unchecked compiler option for seeing what is meaning of this. In Netbeans I found this under Project Properties -> Build -> Compiling at the bottom "Additional compiler options"

After a clean + build I saw a lot of warnings like:


warning: [unchecked] unchecked call to Data(X,Y) as a member of the raw type Data series1.getData().add(new XYChart.Data(austria, 25601.34));

  where X,Y are type-variables:

    X extends Object declared in class Data

    Y extends Object declared in class Data

In factthe number of warnings is around 30. That is a lot.

What is not perfect in the sample code? How can I avoid these warnings?

Thanks a lot in advance, Harald.

This discussion has been closed.