bugReporter.reportBug(new BugInstance("SBSC_USE_STRINGBUFFER_CONCATENATION", NORMAL_PRIORITY)
bugReporter.reportBug(new BugInstance(this, "SBSC_USE_STRINGBUFFER_CONCATENATION", NORMAL_PRIORITY)
	public void sawOpcode(int seen) {		if (reportedThisMethod) return;		int oldState = state;		if (DEBUG) System.out.println("Opcode: " + OPCODE_NAMES[seen]);		switch (state) {		case SEEN_NOTHING:			if ((seen == NEW)			        &&			        getClassConstantOperand().startsWith("java/lang/StringBu")) {				state = SEEN_NEW;				createPC = getPC();			}			break;		case SEEN_NEW:			if (DEBUG && seen == INVOKEVIRTUAL) {				System.out.println("Invoke virtual");				System.out.println("   " + getNameConstantOperand());				System.out.println("   " + getClassConstantOperand());				System.out.println("   " + getSigConstantOperand());			}			if (seen == INVOKEVIRTUAL			        && "append".equals(getNameConstantOperand())			        && getClassConstantOperand().startsWith("java/lang/StringBu")) {				if (DEBUG) System.out.println("Saw string being appended from register " + registerOnStack);				if (getSigConstantOperand().startsWith("(Ljava/lang/String;)")				        && registerOnStack >= 0) {					if (DEBUG)						System.out.println("Saw string being appended, source = " + registerOnStack);					state = SEEN_APPEND1;					stringSource = registerOnStack;				} else					reset();			}			break;		case SEEN_APPEND1:			if (storeIntoRegister(seen, stringSource))				reset();			else if (seen == INVOKEVIRTUAL			        && "append".equals(getNameConstantOperand())			        && getClassConstantOperand().startsWith("java/lang/StringBu")) {				state = SEEN_APPEND2;			}			break;		case SEEN_APPEND2:			if (storeIntoRegister(seen, stringSource))				reset();			else if (seen == INVOKEVIRTUAL			        && "toString".equals(getNameConstantOperand())			        && getClassConstantOperand().startsWith("java/lang/StringBu")) {				state = CONSTRUCTED_STRING_ON_STACK;			}			break;		case CONSTRUCTED_STRING_ON_STACK:			if (storeIntoRegister(seen, stringSource))				state = POSSIBLE_CASE;			else				reset();			break;		case POSSIBLE_CASE:			if (seen == GOTO			        && (getPC() - getBranchTarget()) < 300			        && getBranchTarget() < createPC) {				bugReporter.reportBug(new BugInstance("SBSC_USE_STRINGBUFFER_CONCATENATION", NORMAL_PRIORITY)				        .addClassAndMethod(this)				        .addSourceLine(this, createPC));				// System.out.println("SBSC spread: " + (getPC() - getBranchTarget()));				reset();				reportedThisMethod = true;			} else if ((seen == NEW)			        &&			        getClassConstantOperand().startsWith("java/lang/StringBu")) {				state = SEEN_NEW;				createPC = getPC();			}			break;		}		registerOnStack = -1;		switch (seen) {		case ALOAD_0:			registerOnStack = 0;			break;		case ALOAD_1:			registerOnStack = 1;			break;		case ALOAD_2:			registerOnStack = 2;			break;		case ALOAD_3:			registerOnStack = 3;			break;		case ALOAD:			registerOnStack = getRegisterOperand();			break;		}		if (DEBUG && state != oldState)			System.out.println("At PC " + getPC()			        + " changing from state " + oldState			        + " to state " + state			        + ", regOnStack = " + registerOnStack);	}