boolean isTrainingDetector = factory.isDetectorClassSubtypeOf(TrainingDetector.class) || (findBugs.emitTrainingOutput() && factory.getFullName().equals("edu.umd.cs.findbugs.detect.NoteCheckReturnValue")); if (isTrainingDetector != findBugs.emitTrainingOutput()) return false;
boolean isTrainingDetector = factory.isDetectorClassSubtypeOf(TrainingDetector.class); boolean isNonReportingDetector = factory.isDetectorClassSubtypeOf(NonReportingDetector.class); if (findBugs.emitTrainingOutput()) { return isTrainingDetector || isNonReportingDetector; }
	public static boolean isDetectorEnabled(IFindBugsEngine findBugs, DetectorFactory factory) {		if (!factory.getPlugin().isEnabled())			return false;				if (!findBugs.getUserPreferences().isDetectorEnabled(factory))			return false;				if (!factory.isEnabledForCurrentJRE())			return false;				// Slow first pass detectors are usually disabled, but may be explicitly enabled		if (!AnalysisContext.currentAnalysisContext().getBoolProperty(FindBugsAnalysisFeatures.INTERPROCEDURAL_ANALYSIS)				&& factory.isDetectorClassSubtypeOf(InterproceduralFirstPassDetector.class))			return false;		// Training detectors are enabled if, and only if, we are emitting training output		// XXX: grotesque hack for NoteCheckReturnValue. Need to fix for real.		boolean isTrainingDetector = factory.isDetectorClassSubtypeOf(TrainingDetector.class)			|| (findBugs.emitTrainingOutput() && factory.getFullName().equals("edu.umd.cs.findbugs.detect.NoteCheckReturnValue"));		if (isTrainingDetector != findBugs.emitTrainingOutput())			return false;				return true;	}