I'm writing a simple program, using Sublime and javac to compile. When compiling I'm getting the notes:
Note: BasicSwing.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
I've isolated the piece of code responsible for this behavior:
private String[] foo = {"bar1", "bar2", "bar3"};
AFAIK this is the proper syntax to initialize and populate an array in one step.
Previous posts about this behavior point to ArrayList and how it has to be initialized. No mentions of more primitive types like String Arrays. They also point to generics errors in this context.
So basically it was an error that needed clarification where I called the Stringarray in a swing element.
private String[] foo = {"bar1", "bar2", "bar3"};
I previously had:
JComboBox jcb=new JComboBox(foo);
While it had to be
JComboBox<String> jcb = new JComboBox<>(foo);