Hi all, this is my first post here. After not doing any much Java for 15 years (mostly C and C#) I decided to revisit my old Java projects. I'm using OpenJDK 11.0.12 because Microsoft was kind enough to install this on my system without even telling or asking me. Ah well, it seems to work. Previously I used a JDK from Sun (before Oracle took over).
But upon compiling my old code I am getting tons of warnings about code using raw types like Vector, Stack, Hashtable etc. Despite generics being new to me the first few were easily fixed (I passionately hate warnings).
However the next one up is stumping me. I have this code (exception handling removed for clarity)
Class cls = Class.forName(className, false, classLoader); Method getComponentMethod = cls.getMethod("getComponent", (Class[])null);
and the compiler gives this warning about the second line:
chris\utilities\cMenu.java:875: warning: [unchecked] unchecked call to getMethod(String,Class<?>...) as a member of the raw type Class getComponentMethod = cls.getMethod("getComponent", Class[])null); ^
I vaguely feel what the compiler's point is, but I'm at a loss of how to fix this warning. A gentle nudge would be much appreciated.