return detector;
return new DetectorToDetector2Adapter(detector);
		public Detector createDetector(BugReporter bugReporter) {			try {				Constructor<? extends Detector> constructor = detectorClass.getConstructor(constructorArgTypes);				Detector detector = constructor.newInstance(new Object[]{bugReporter});								// Backwards-compatibility: if the Detector has a setAnalysisContext()				// method, call it, passing the current AnalysisContext.  We do this				// because some released versions of FindBugs had a Detector				// interface which specified this method (and ensured it was called				// before the Detector was used to analyze any code).				if (setAnalysisContext != null) {					setAnalysisContext.invoke(detector, new Object[]{AnalysisContext.currentAnalysisContext()});				}								return detector;			} catch (Exception e) {				throw new RuntimeException("Could not instantiate Detector", e);			}		}