#fixed code
                             protected void setIV(byte[] iv, boolean isEncrypt) {
		if (_ivLength == 0) {
			return;
		}
		CipherParameters cipherParameters = null;

		if (isEncrypt) {
			cipherParameters = getCipherParameters(iv);
			try {
				encCipher = getCipher(isEncrypt);
			} catch (InvalidAlgorithmParameterException e) {
				logger.info(e.toString());
			}
			encCipher.init(isEncrypt, cipherParameters);
		} else {
			_decryptIV = new byte[_ivLength];
			System.arraycopy(iv, 0, _decryptIV, 0, _ivLength);
			cipherParameters = getCipherParameters(iv);
			try {
				decCipher = getCipher(isEncrypt);
			} catch (InvalidAlgorithmParameterException e) {
				logger.info(e.toString());
			}
			decCipher.init(isEncrypt, cipherParameters);
		}
	}
#vulnerable code 
                             protected void setIV(byte[] iv, boolean isEncrypt) {
		if (_ivLength == 0) {
			return;
		}

		if (isEncrypt) {
			try {
				_encryptIV = new byte[_ivLength];
				System.arraycopy(iv, 0, _encryptIV, 0, _ivLength);
				encCipher = getCipher(isEncrypt);
				ParametersWithIV parameterIV = new ParametersWithIV(
						new KeyParameter(_key.getEncoded()), _encryptIV);
				encCipher.init(isEncrypt, parameterIV);
			} catch (InvalidAlgorithmParameterException e) {
				logger.info(e.toString());
			}
		} else {
			try {
				_decryptIV = new byte[_ivLength];
				System.arraycopy(iv, 0, _decryptIV, 0, _ivLength);
				decCipher = getCipher(isEncrypt);
				ParametersWithIV parameterIV = new ParametersWithIV(
						new KeyParameter(_key.getEncoded()), _decryptIV);
				decCipher.init(isEncrypt, parameterIV);
			} catch (InvalidAlgorithmParameterException e) {
				logger.info(e.toString());
			}
		}
	} 
                            #location 8 
                            #vulnerability type THREAD_SAFETY_VIOLATION