List of usage examples for java.lang StringIndexOutOfBoundsException addSuppressed
public final synchronized void addSuppressed(Throwable exception)
From source file:org.sonar.runner.impl.SaltedAesCryptor.java
public String decrpyt(String encText) throws Exception { Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); cipher.init(Cipher.DECRYPT_MODE, secretKeySpec, algorithmParameterSpec); byte[] bytes = Base64.decodeBase64(encText); byte[] nBytes; String decText = ""; String secretText = ""; String parsedText = ""; try {/*from w w w . jav a 2s . c o m*/ nBytes = cipher.doFinal(bytes); secretText = new String(nBytes, "UTF-8"); try { parsedText = secretText.substring(8); decText = parsedText; } catch (StringIndexOutOfBoundsException e) { decText = secretText; } catch (Exception e) { e.addSuppressed(new Exception("Error")); throw e; } } catch (IllegalBlockSizeException e) { Logs.info("Not encrypted security phrase"); decText = encText; } return decText; }