#vulnerable code 
                             public SM2 setMode(SM2Engine.Mode mode) {
		this.mode = mode;
		if (null != this.engine) {
			this.engine = null;
		}
		return this;
	} 
                            #location 3 
                            #vulnerability type THREAD_SAFETY_VIOLATION
#fixed code
                             public SM2 setMode(SM2Engine.Mode mode) {
		this.mode = mode;
		this.engine = null;
		return this;
	}