in java-samples/src/main/java/com/jetbrains/inspections/Inspections.java [72:84]
private Event getEvent(Class<? extends Event> eventClass) throws Exception {
Event event;
try {
event = eventClass.getConstructor().newInstance();
} catch (Exception e) {
throw new Exception("The argument event class"
+ eventClass.getClass()
.getName() // will always print java.lang.Class, not actual event class
+ " could not be instantiated with a default constructor",
e);
}
return event;
}