No functional change, formatting while reviewing r1812049

Actually I'm unsure of how to present multiple expressions for autocloseables
in try blocks (here automatically done by my Eclipse formatter). This should be 
discussed with the community so we agreed on formatting rules to create an
official Eclipse formatter as being discussed at https://s.apache.org/0ptF

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813854 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jacques Le Roux
2017-10-31 08:15:00 +00:00
parent 5d4f865cd2
commit 6accef9785
2 changed files with 16 additions and 17 deletions
@@ -162,8 +162,8 @@ public class BlowFishCrypt {
byte[] key = generateKey();
if (testKey(key)) {
try ( FileOutputStream fos = new FileOutputStream(args[0]);
ObjectOutputStream os = new ObjectOutputStream(fos)) {
try (FileOutputStream fos = new FileOutputStream(args[0]);
ObjectOutputStream os = new ObjectOutputStream(fos)) {
String keyString = new String(key, StandardCharsets.UTF_8);
os.writeObject(keyString);
}
@@ -19,7 +19,6 @@
package org.apache.ofbiz.base.crypto;
import java.io.UnsupportedEncodingException;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
@@ -174,20 +173,20 @@ public class HashCrypt {
byte[] hash = Base64.encodeBase64(skf.generateSecret(spec).getEncoded());
String pbkdf2Type = null;
switch (hashType) {
case "PBKDF2WithHmacSHA1":
pbkdf2Type = PBKDF2_SHA1;
break;
case "PBKDF2WithHmacSHA256":
pbkdf2Type = PBKDF2_SHA256;
break;
case "PBKDF2WithHmacSHA384":
pbkdf2Type = PBKDF2_SHA384;
break;
case "PBKDF2WithHmacSHA512":
pbkdf2Type = PBKDF2_SHA512;
break;
default:
pbkdf2Type = PBKDF2_SHA1;
case "PBKDF2WithHmacSHA1":
pbkdf2Type = PBKDF2_SHA1;
break;
case "PBKDF2WithHmacSHA256":
pbkdf2Type = PBKDF2_SHA256;
break;
case "PBKDF2WithHmacSHA384":
pbkdf2Type = PBKDF2_SHA384;
break;
case "PBKDF2WithHmacSHA512":
pbkdf2Type = PBKDF2_SHA512;
break;
default:
pbkdf2Type = PBKDF2_SHA1;
}
StringBuilder sb = new StringBuilder();
sb.append("{").append(pbkdf2Type).append("}");