private Detector makeDetector(Class c) { try { if (!Detector.class.isAssignableFrom(c)) throw new IllegalStateException(c + " is not a Detector"); Constructor constructor = c.getConstructor(constructorArgTypes); return (Detector) constructor.newInstance( new Object[] {bugReporter}); } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e.toString()); } }
private Detector makeDetector(DetectorFactory factory) { return factory.create(bugReporter); }
  private Detector makeDetector(Class c) {	try {	if (!Detector.class.isAssignableFrom(c))		throw new IllegalStateException(c + " is not a Detector");	Constructor constructor = c.getConstructor(constructorArgTypes);	return (Detector) constructor.newInstance(				new Object[] {bugReporter});	} catch (Exception e) {		e.printStackTrace();		throw new RuntimeException(e.toString());		}	}