Why is this an issue?
Creating an object for the sole purpose of calling
getClass on it is a waste of memory and cycles. Instead, simply use the class’s
Noncompliant code example
MyObject myOb = new MyObject(); // Noncompliant
Class c = myOb.getClass();
Class c = MyObject.class;