public void visit(JavaClass obj) { try { setUpAnnotation = null; tearDownAnnotation = null; validClass = false; validMethod = false; sawSetUp = false; sawTearDown = false; JavaClass[] superClasses = obj.getSuperClasses(); for (int i = 0; i < superClasses.length; i++) { JavaClass sc = superClasses[i]; if (sc.getClassName().equals("junit.framework.TestCase")) { validClass = true; super.visit(obj); break; } } } catch (ClassNotFoundException cnfe) { bugReporter.reportMissingClass(cnfe); }
public void visit(Method obj) { if (!validClass) return; validMethod = false; methodName = obj.getName(); if (methodName.equals("setUp") || methodName.equals("tearDown")) { if (methodName.equals("setUp")) setUpAnnotation = MethodAnnotation.fromVisitedMethod(this); else if (methodName.equals("tearDown")) tearDownAnnotation = MethodAnnotation.fromVisitedMethod(this); validMethod = true; state = SEEN_NOTHING; super.visit(obj); } else if (methodName.equals("suite") && !obj.isStatic()) bugReporter.reportBug(new BugInstance("IJU_SUITE_NOT_STATIC", NORMAL_PRIORITY) .addClass(this) .addMethod(MethodAnnotation.fromVisitedMethod(this)));
	public void visit(JavaClass obj) {		try {			setUpAnnotation = null;			tearDownAnnotation = null;			validClass = false;			validMethod = false;			sawSetUp = false;			sawTearDown = false;			JavaClass[] superClasses = obj.getSuperClasses();			for (int i = 0; i < superClasses.length; i++) {				JavaClass sc = superClasses[i];				if (sc.getClassName().equals("junit.framework.TestCase")) {					validClass = true;					super.visit(obj);					break;				}			}		} catch (ClassNotFoundException cnfe) {			bugReporter.reportMissingClass(cnfe);		}	}