lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
944 stars 385 forks source link

Cast raw class type to parameterized class #413

Closed ihilt closed 1 year ago

ihilt commented 1 year ago

Resolves the warnings:

lcm/spy/Spy.java:198: warning: [unchecked] unchecked call to getConstructor(Class<?>...) as a member of the raw type Class
                        Constructor c = cls.getConstructor(new Class[0]);
                                                          ^
  where T is a type-variable:
    T extends Object declared in class Class
lcm/spy/Spy.java:370: warning: [unchecked] unchecked call to getConstructor(Class<?>...) as a member of the raw type Class
                o = cd.cls.getConstructor(DataInput.class).newInstance(dins);
                                         ^
  where T is a type-variable:
    T extends Object declared in class Class
nosracd commented 1 year ago

Confusingly, I merged this PR into master but it didn't automatically close. Closing manually...