directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [6/6] directory-kerby git commit: [DIRKRB-326]-Fix CheckStyle Problems. Contributed by Yaning.
Date Thu, 09 Jul 2015 02:50:31 GMT
[DIRKRB-326]-Fix CheckStyle Problems. Contributed by Yaning.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/1d312c9f
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/1d312c9f
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/1d312c9f

Branch: refs/heads/master
Commit: 1d312c9f6c5300fe647cacfa970d704c4798a670
Parents: cff4581
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Thu Jul 9 10:55:35 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Thu Jul 9 10:55:35 2015 +0800

----------------------------------------------------------------------
 .../org/apache/kerby/asn1/Asn1InputBuffer.java  |   2 +-
 .../org/apache/kerby/asn1/EncodingOption.java   |   4 +-
 .../apache/kerby/asn1/LimitedByteBuffer.java    |   4 +-
 .../kerby/asn1/type/AbstractAsn1Type.java       |  36 +-
 .../apache/kerby/asn1/type/Asn1BitString.java   |   5 +-
 .../apache/kerby/asn1/type/Asn1BmpString.java   |   9 +-
 .../org/apache/kerby/asn1/type/Asn1Boolean.java |   4 +-
 .../org/apache/kerby/asn1/type/Asn1Choice.java  |  15 +-
 .../apache/kerby/asn1/type/Asn1Collection.java  |   4 +-
 .../kerby/asn1/type/Asn1CollectionOf.java       |   5 +-
 .../kerby/asn1/type/Asn1CollectionType.java     |   8 +-
 .../kerby/asn1/type/Asn1GeneralString.java      |   3 +-
 .../kerby/asn1/type/Asn1GeneralizedTime.java    |   8 +-
 .../apache/kerby/asn1/type/Asn1IA5String.java   |   3 +-
 .../org/apache/kerby/asn1/type/Asn1Integer.java |   3 +-
 .../org/apache/kerby/asn1/type/Asn1Item.java    |  13 +-
 .../kerby/asn1/type/Asn1NumericsString.java     |   3 +-
 .../kerby/asn1/type/Asn1ObjectIdentifier.java   |   4 +-
 .../apache/kerby/asn1/type/Asn1OctetString.java |   3 +-
 .../kerby/asn1/type/Asn1PrintableString.java    |   3 +-
 .../apache/kerby/asn1/type/Asn1Sequence.java    |   3 +-
 .../apache/kerby/asn1/type/Asn1SequenceOf.java  |   3 +-
 .../org/apache/kerby/asn1/type/Asn1Set.java     |   3 +-
 .../org/apache/kerby/asn1/type/Asn1SetOf.java   |   3 +-
 .../org/apache/kerby/asn1/type/Asn1Simple.java  |   8 +-
 .../org/apache/kerby/asn1/type/Asn1String.java  |  46 ++-
 .../apache/kerby/asn1/type/Asn1T61String.java   |   3 +-
 .../kerby/asn1/type/Asn1T61Utf8String.java      |   3 +-
 .../org/apache/kerby/asn1/type/Asn1Tagging.java |  15 +-
 .../kerby/asn1/type/Asn1UniversalString.java    |   3 +-
 .../org/apache/kerby/asn1/type/Asn1UtcTime.java |   3 +-
 .../apache/kerby/asn1/type/Asn1Utf8String.java  |   3 +-
 .../kerby/asn1/type/Asn1VisibleString.java      |   3 +-
 .../org/apache/kerby/asn1/PersonnelRecord.java  |  12 +-
 .../apache/kerby/asn1/TestTaggingEncoding.java  |   8 +-
 .../test/java/org/apache/kerby/asn1/Util.java   |  20 +-
 .../identitybackend/JsonIdentityBackend.java    |  11 +-
 .../typeAdapter/KerberosTimeAdapter.java        |   8 +-
 .../typeAdapter/PrincipalNameAdapter.java       |   8 +-
 .../kerb/identity/backend/JsonBackendTest.java  |   2 -
 .../identitybackend/LdapIdentityBackend.java    |  36 +-
 .../identitybackend/LdapIdentityGetHelper.java  |   4 +-
 .../AbstractLdapIdentityBackendTest.java        |   4 +-
 .../backend/LdapIdentityBackendTest.java        |   2 +-
 .../org/apache/kerby/KrbIdentitySerializer.java |  28 +-
 .../java/org/apache/kerby/MavibotBackend.java   |  34 +-
 .../apache/kerby/KrbIdentitySerializerTest.java |  26 +-
 .../org/apache/kerby/MavibotBackendTest.java    |  18 +-
 .../kerberos/kdc/identitybackend/ZKConfKey.java |   3 +-
 .../kerberos/kdc/identitybackend/ZKUtil.java    |  10 +-
 .../ZookeeperIdentityBackend.java               |  16 +-
 .../identity/backend/ZookeeperBackendTest.java  |   3 -
 .../kdc/AbstractLdapBackendKdcTest.java         |  12 +-
 .../kerby/kerberos/kdc/LdapBackendKdcTest.java  |   2 +-
 .../kerberos/kdc/WithTokenKdcTestBase.java      |   2 +-
 .../kerby/kerberos/kdc/KerbyKdcServer.java      |   6 +-
 .../kerberos/kdc/impl/NettyKdcNetwork.java      |   6 +-
 .../kdc/impl/NettyKdcUdpServerHandler.java      |   6 +-
 .../kerb/integration/test/gss/GssAppClient.java |  26 +-
 .../kerb/integration/test/gss/GssAppServer.java |  29 +-
 .../kerby/kerberos/kerb/admin/AdminHelper.java  |   8 +-
 .../kerby/kerberos/kerb/admin/Kadmin.java       |  28 +-
 .../kerby/kerberos/kerb/admin/KadminOption.java |   5 +-
 .../kerby/kerberos/kerb/client/ClientUtil.java  |  10 +-
 .../kerby/kerberos/kerb/client/KrbClient.java   |   6 +-
 .../kerberos/kerb/client/KrbConfigKey.java      |  20 +-
 .../kerby/kerberos/kerb/client/KrbHandler.java  |   4 +-
 .../kerby/kerberos/kerb/client/KrbOption.java   |   4 +-
 .../client/impl/AbstractInternalKrbClient.java  |  15 +-
 .../kerb/client/preauth/PreauthContext.java     |   2 +-
 .../kerb/client/preauth/PreauthHandler.java     |   4 +-
 .../client/preauth/pkinit/PkinitPreauth.java    |  23 +-
 .../kerb/client/preauth/token/TokenPreauth.java |   4 +-
 .../kerb/client/request/ArmoredRequest.java     |   2 +-
 .../kerberos/kerb/client/request/AsRequest.java |   6 +-
 .../client/request/AsRequestWithKeytab.java     |   2 +-
 .../kerb/client/request/KdcRequest.java         |   2 +-
 .../kerberos/kerb/common/KrbErrorUtil.java      |  19 +-
 .../kerberos/kerb/transport/KdcNetwork.java     |   6 +-
 .../kerb/transport/KrbTcpTransport.java         |   2 +-
 .../kerb/transport/KrbUdpTransport.java         |   2 +-
 .../kerberos/kerb/codec/TestAsReqCodec.java     |   7 +-
 .../kerby/kerberos/kerb/spec/KerberosTime.java  |  12 +-
 .../kerberos/kerb/spec/base/HostAddress.java    |   6 +-
 .../kerby/kerberos/kerb/spec/base/KeyUsage.java |   3 +-
 .../kerby/kerberos/kerb/spec/base/KrbFlags.java |   4 +-
 .../kerby/kerberos/kerb/spec/base/KrbToken.java |   2 +-
 .../kerberos/kerb/spec/base/PrincipalName.java  |   2 +-
 .../kerby/kerberos/kerb/spec/base/SamType.java  |   5 +-
 .../kerberos/kerb/spec/kdc/KdcReqBody.java      |   5 +-
 .../kerb/spec/ticket/EncTicketPart.java         |   5 +-
 .../kerberos/kerb/spec/ticket/TicketFlag.java   |   2 +-
 .../kerb/spec/x509/AlgorithmIdentifier.java     |   7 +-
 .../kerberos/kerb/crypto/CheckSumHandler.java   |  17 +-
 .../kerberos/kerb/crypto/EncryptionHandler.java |  26 +-
 .../kerb/crypto/cksum/CmacKcCheckSum.java       |   4 +-
 .../crypto/cksum/ConfounderedDesCheckSum.java   |   4 +-
 .../kerb/crypto/cksum/HmacKcCheckSum.java       |   4 +-
 .../kerb/crypto/cksum/HmacMd5Rc4CheckSum.java   |   4 +-
 .../kerberos/kerb/crypto/cksum/KcCheckSum.java  |   6 +-
 .../kerb/crypto/cksum/Md5HmacRc4CheckSum.java   |   4 +-
 .../kerb/crypto/enc/Camellia256CtsCmacEnc.java  |   3 +-
 .../kerberos/kerb/crypto/enc/DesCbcEnc.java     |   2 +-
 .../kerberos/kerb/crypto/enc/KeKiCmacEnc.java   |   3 +-
 .../kerby/kerberos/kerb/crypto/enc/KeKiEnc.java |  26 +-
 .../kerberos/kerb/crypto/enc/Rc4HmacEnc.java    |   2 +-
 .../kerb/crypto/enc/provider/AesProvider.java   |   4 +-
 .../kerb/crypto/enc/provider/DesProvider.java   |   3 +-
 .../kerberos/kerb/crypto/fast/FastUtil.java     |   5 +-
 .../kerb/crypto/key/AbstractKeyMaker.java       |   2 +-
 .../kerberos/kerb/crypto/key/AesKeyMaker.java   |   4 +-
 .../kerb/crypto/key/CamelliaKeyMaker.java       |  20 +-
 .../kerberos/kerb/crypto/key/Des3KeyMaker.java  |  22 +-
 .../kerberos/kerb/crypto/key/DesKeyMaker.java   |  20 +-
 .../kerberos/kerb/crypto/key/DkKeyMaker.java    |  14 +-
 .../kerberos/kerb/crypto/key/Rc4KeyMaker.java   |   6 +-
 .../kerb/crypto/random/NativeRandom.java        |   8 +-
 .../kerberos/kerb/crypto/util/BytesUtil.java    |   4 +-
 .../kerberos/kerb/crypto/util/CamelliaKey.java  | 155 ++++----
 .../kerby/kerberos/kerb/crypto/util/Cmac.java   |  42 +--
 .../kerby/kerberos/kerb/crypto/util/Des.java    |  32 +-
 .../kerby/kerberos/kerb/crypto/util/Hmac.java   |   4 +-
 .../kerby/kerberos/kerb/crypto/util/Md4.java    | 104 ++---
 .../kerby/kerberos/kerb/crypto/util/Nfold.java  |  16 +-
 .../kerby/kerberos/kerb/crypto/util/Pbkdf.java  |   4 +-
 .../kerberos/kerb/crypto/CamelliaEncTest.java   |   5 +-
 .../kerberos/kerb/crypto/CheckSumTest.java      |  15 +-
 .../kerberos/kerb/crypto/CheckSumsTest.java     |   6 +-
 .../kerby/kerberos/kerb/crypto/CmacTest.java    |  31 +-
 .../kerby/kerberos/kerb/crypto/Crc32Test.java   |   6 +-
 .../kerberos/kerb/crypto/DecryptionTest.java    | 378 +++++++++----------
 .../kerberos/kerb/crypto/FastUtilTest.java      |   8 +-
 .../kerberos/kerb/crypto/KeyDeriveTest.java     |  80 ++--
 .../kerby/kerberos/kerb/crypto/PrfTest.java     |   5 +-
 .../kerberos/kerb/crypto/String2keyTest.java    |  88 ++---
 .../kerb/identity/backend/BackendTest.java      |   1 -
 .../kerberos/kerb/identity/KrbIdentity.java     |  19 +-
 .../backend/AbstractIdentityBackend.java        |  10 +-
 .../identity/backend/MemoryIdentityBackend.java |   8 +-
 .../kerberos/kerb/server/GssInteropTest.java    |   7 +-
 .../kerby/kerberos/kerb/server/KdcTestBase.java |   2 +-
 .../kerberos/kerb/server/KdcConfigKey.java      |   4 +-
 .../kerby/kerberos/kerb/server/KdcHandler.java  |   4 +-
 .../kerberos/kerb/server/KdcServerOption.java   |   3 +-
 .../kerby/kerberos/kerb/server/KdcUtil.java     |   2 +-
 .../kerb/server/impl/DefaultKdcHandler.java     |   4 +-
 .../server/preauth/builtin/EncTsPreauth.java    |   2 +-
 .../kerb/server/preauth/token/TokenPreauth.java |   7 +-
 .../kerb/server/replay/CacheService.java        |   3 +-
 .../server/replay/ReplayCheckServiceImpl.java   |   3 +-
 .../kerberos/kerb/server/request/AsRequest.java |  19 +-
 .../kerb/server/request/KdcRequest.java         |  17 +-
 .../server/request/ServiceTickertIssuer.java    |   4 +-
 .../kerb/server/request/TgsRequest.java         |  23 +-
 .../kerb/server/request/TickertIssuer.java      |  13 +-
 .../kerberos/kerb/server/SimpleKdcTest.java     |   8 +-
 .../kerby/kerberos/kerb/client/JaasKrbUtil.java |   2 +-
 .../kerby/kerberos/kerb/client/Krb5Conf.java    |   4 +-
 .../kerby/kerberos/kerb/KrbInputStream.java     |   3 +-
 .../kerby/kerberos/kerb/KrbOutputStream.java    |   3 +-
 .../kerb/ccache/CredCacheInputStream.java       |  10 +-
 .../kerb/ccache/CredCacheOutputStream.java      |  10 +-
 .../kerberos/kerb/ccache/CredentialCache.java   |   9 +-
 .../kerby/kerberos/kerb/keytab/Keytab.java      |  14 +-
 .../kerby/kerberos/kerb/keytab/KeytabEntry.java |   3 +-
 .../kerberos/kerb/keytab/KeytabInputStream.java |   3 +-
 .../kerb/keytab/KeytabOutputStream.java         |   3 +-
 .../kerberos/kerb/util/EncryptionTest.java      |  12 +-
 .../kerby/kerberos/kerb/util/KeysTest.java      |   2 +-
 .../provider/token/JwtTokenDecoder.java         |  12 +-
 .../provider/token/JwtTokenEncoder.java         |   2 +-
 .../kerberos/provider/token/TokenTest.java      |  14 +-
 .../kerby/kerberos/tool/kinit/KinitOption.java  |   3 +-
 .../kerby/kerberos/tool/kinit/KinitTool.java    |  76 ++--
 .../kerby/kerberos/tool/klist/KlistOption.java  |  11 +-
 .../kerby/kerberos/tool/klist/KlistTool.java    |  60 +--
 .../kerby/kerberos/tool/token/TokenCache.java   |  15 +-
 .../kerby/kerberos/tool/token/TokenInit.java    |   4 +-
 .../kerby/kerberos/tool/kadmin/KadminTool.java  | 123 +++---
 .../kerby/kerberos/tool/kadmin/ToolUtil.java    |   6 +-
 .../kadmin/command/AddPrincipalCommand.java     |  50 +--
 .../kadmin/command/ChangePasswordCommand.java   |  20 +-
 .../kadmin/command/DeletePrincipalCommand.java  |  16 +-
 .../kadmin/command/GetPrincipalCommand.java     |  17 +-
 .../tool/kadmin/command/KeytabAddCommand.java   |   6 +-
 .../kadmin/command/KeytabRemoveCommand.java     |  15 +-
 .../kadmin/command/ModifyPrincipalCommand.java  |  17 +-
 .../kadmin/command/RenamePrincipalCommand.java  |   8 +-
 .../main/java/org/apache/kerby/config/Conf.java |  13 +-
 .../org/apache/kerby/config/ConfigImpl.java     |   9 +-
 .../java/org/apache/kerby/config/Resource.java  |   2 +-
 .../apache/kerby/config/XmlConfigLoader.java    |  16 +-
 .../org/apache/kerby/config/ConfigImplTest.java |   2 +-
 .../org/apache/kerby/config/IniConfigTest.java  |   6 +-
 .../main/java/org/apache/kerby/KOptions.java    |  18 +-
 .../main/java/org/apache/kerby/util/Base64.java |   6 +-
 .../java/org/apache/kerby/util/HexUtil.java     |   4 +-
 .../main/java/org/apache/kerby/util/IOUtil.java |  11 +-
 .../java/org/apache/kerby/util/NetworkUtil.java |   2 +-
 .../main/java/org/apache/kerby/util/OSUtil.java |   2 +-
 .../java/org/apache/kerby/util/SysUtil.java     |   2 +-
 .../main/java/org/apache/kerby/util/Utf8.java   |   2 +-
 pom.xml                                         |   2 -
 203 files changed, 1523 insertions(+), 1300 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java
index 985bd7e..1cda697 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/Asn1InputBuffer.java
@@ -65,7 +65,7 @@ public class Asn1InputBuffer {
      * @throws IOException
      */
     public Asn1Type read() throws IOException {
-        if (! limitedBuffer.available()) {
+        if (!limitedBuffer.available()) {
             return null;
         }
         Asn1Item one = AbstractAsn1Type.decodeOne(limitedBuffer);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/EncodingOption.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/EncodingOption.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/EncodingOption.java
index d40dcc7..8205d45 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/EncodingOption.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/EncodingOption.java
@@ -88,7 +88,7 @@ public class EncodingOption {
      * @return true if it's constructed, false otherwise
      */
     public boolean isConstructed() {
-        return ! isPrimitive;
+        return !isPrimitive;
     }
 
     /**
@@ -148,7 +148,7 @@ public class EncodingOption {
      * @return true if using EXPLICIT, false otherwise
      */
     public boolean isExplicit() {
-        return ! isImplicit;
+        return !isImplicit;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/LimitedByteBuffer.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/LimitedByteBuffer.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/LimitedByteBuffer.java
index ed5332b..2cb04ef 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/LimitedByteBuffer.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/LimitedByteBuffer.java
@@ -53,8 +53,8 @@ public class LimitedByteBuffer {
     }
 
     public boolean available() {
-        return byteBuffer.hasRemaining() &&
-                byteBuffer.position() - startOffset < limit;
+        return byteBuffer.hasRemaining()
+                && byteBuffer.position() - startOffset < limit;
     }
 
     public long hasRead() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/AbstractAsn1Type.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/AbstractAsn1Type.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/AbstractAsn1Type.java
index 7ccfa18..fe98c53 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/AbstractAsn1Type.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/AbstractAsn1Type.java
@@ -216,14 +216,14 @@ public abstract class AbstractAsn1Type<T> implements Asn1Type {
 
     public void decode(int tagFlags, int tagNo,
                        LimitedByteBuffer content) throws IOException {
-        if (this.tagClass != TagClass.UNKNOWN && this.tagClass !=
-                TagClass.fromTagFlags(tagFlags)) {
-            throw new IOException("Unexpected tagFlags " + tagFlags +
-                    ", expecting " + this.tagClass);
+        if (this.tagClass != TagClass.UNKNOWN && this.tagClass
+                != TagClass.fromTagFlags(tagFlags)) {
+            throw new IOException("Unexpected tagFlags " + tagFlags
+                    + ", expecting " + this.tagClass);
         }
         if (this.tagNo != -1 && this.tagNo != tagNo) {
-            throw new IOException("Unexpected tagNo " + tagNo + ", " +
-                    "expecting " + this.tagNo);
+            throw new IOException("Unexpected tagNo " + tagNo + ", "
+                    + "expecting " + this.tagNo);
         }
 
         this.tagClass = TagClass.fromTagFlags(tagFlags);
@@ -237,10 +237,10 @@ public abstract class AbstractAsn1Type<T> implements Asn1Type {
 
     protected int taggedEncodingLength(TaggingOption taggingOption) {
         int taggingTagNo = taggingOption.getTagNo();
-        int taggingBodyLen = taggingOption.isImplicit() ? encodingBodyLength() :
-                encodingLength();
-        int taggingEncodingLen = lengthOfTagLength(taggingTagNo) +
-                lengthOfBodyLength(taggingBodyLen) + taggingBodyLen;
+        int taggingBodyLen = taggingOption.isImplicit() ? encodingBodyLength()
+                : encodingLength();
+        int taggingEncodingLen = lengthOfTagLength(taggingTagNo)
+                + lengthOfBodyLength(taggingBodyLen) + taggingBodyLen;
         return taggingEncodingLen;
     }
 
@@ -255,8 +255,8 @@ public abstract class AbstractAsn1Type<T> implements Asn1Type {
     public void taggedEncode(ByteBuffer buffer, TaggingOption taggingOption) {
         int taggingTagFlags = taggingOption.tagFlags(isConstructed());
         encodeTag(buffer, taggingTagFlags, taggingOption.getTagNo());
-        int taggingBodyLen = taggingOption.isImplicit() ? encodingBodyLength() :
-                encodingLength();
+        int taggingBodyLen = taggingOption.isImplicit() ? encodingBodyLength()
+                : encodingLength();
         encodeLength(buffer, taggingBodyLen);
         if (taggingOption.isImplicit()) {
             encodeBody(buffer);
@@ -293,12 +293,12 @@ public abstract class AbstractAsn1Type<T> implements Asn1Type {
                                 TaggingOption taggingOption) throws IOException {
         int expectedTaggingTagFlags = taggingOption.tagFlags(isConstructed());
         if (expectedTaggingTagFlags != taggingTagFlags) {
-            throw new IOException("Unexpected tag flags " + taggingTagFlags +
-                    ", expecting " + expectedTaggingTagFlags);
+            throw new IOException("Unexpected tag flags " + taggingTagFlags
+                    + ", expecting " + expectedTaggingTagFlags);
         }
         if (taggingOption.getTagNo() != taggingTagNo) {
-            throw new IOException("Unexpected tagNo " + taggingTagNo + ", " +
-                    "expecting " + taggingOption.getTagNo());
+            throw new IOException("Unexpected tagNo " + taggingTagNo + ", "
+                    + "expecting " + taggingOption.getTagNo());
         }
 
         if (taggingOption.isImplicit()) {
@@ -379,10 +379,10 @@ public abstract class AbstractAsn1Type<T> implements Asn1Type {
                 byte[] tmpBytes = new byte[5]; // 5 * 7 > 32
                 int iPut = tmpBytes.length;
 
-                tmpBytes[--iPut] = (byte)(tagNo & 0x7f);
+                tmpBytes[--iPut] = (byte) (tagNo & 0x7f);
                 do {
                     tagNo >>= 7;
-                    tmpBytes[--iPut] = (byte)(tagNo & 0x7f | 0x80);
+                    tmpBytes[--iPut] = (byte) (tagNo & 0x7f | 0x80);
                 } while (tagNo > 127);
 
                 buffer.put(tmpBytes, iPut, tmpBytes.length - iPut);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BitString.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BitString.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BitString.java
index 1aa0232..7d26be3 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BitString.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BitString.java
@@ -23,8 +23,7 @@ import org.apache.kerby.asn1.UniversalTag;
 
 import java.io.IOException;
 
-public class Asn1BitString extends Asn1Simple<byte[]>
-{
+public class Asn1BitString extends Asn1Simple<byte[]> {
     private int padding;
 
     public Asn1BitString() {
@@ -56,7 +55,7 @@ public class Asn1BitString extends Asn1Simple<byte[]>
     @Override
     protected void toBytes() {
         byte[] bytes = new byte[encodingBodyLength()];
-        bytes[0] = (byte)padding;
+        bytes[0] = (byte) padding;
         System.arraycopy(getValue(), 0, bytes, 1, bytes.length - 1);
         setBytes(bytes);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BmpString.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BmpString.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BmpString.java
index aa59ed4..0d3fbfe 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BmpString.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1BmpString.java
@@ -25,8 +25,7 @@ import org.apache.kerby.asn1.UniversalTag;
 
 import java.io.IOException;
 
-public class Asn1BmpString extends Asn1Simple<String>
-{
+public class Asn1BmpString extends Asn1Simple<String> {
     public Asn1BmpString() {
         super(null);
     }
@@ -47,8 +46,8 @@ public class Asn1BmpString extends Asn1Simple<String>
         
         for (int i = 0; i != len; i++) {
             char c = strValue.charAt(i);
-            bytes[2 * i] = (byte)(c >> 8);
-            bytes[2 * i + 1] = (byte)c;
+            bytes[2 * i] = (byte) (c >> 8);
+            bytes[2 * i + 1] = (byte) c;
         }
         setBytes(bytes);
     }
@@ -57,7 +56,7 @@ public class Asn1BmpString extends Asn1Simple<String>
         byte[] bytes = getBytes();
         char[] chars = new char[bytes.length / 2];
         for (int i = 0; i != chars.length; i++) {
-            chars[i] = (char)((bytes[2 * i] << 8) | (bytes[2 * i + 1] & 0xff));
+            chars[i] = (char) ((bytes[2 * i] << 8) | (bytes[2 * i + 1] & 0xff));
         }
         setValue(new String(chars));
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Boolean.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Boolean.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Boolean.java
index 33ab327..3fc70c2 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Boolean.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Boolean.java
@@ -28,8 +28,8 @@ import java.io.IOException;
  * ASN1 Boolean type
  */
 public class Asn1Boolean extends Asn1Simple<Boolean> {
-    private static final byte[] TRUE_BYTE = new byte[] { (byte)0xff };
-    private static final byte[] FALSE_BYTE = new byte[] { (byte)0x00 };
+    private static final byte[] TRUE_BYTE = new byte[] {(byte) 0xff};
+    private static final byte[] FALSE_BYTE = new byte[] {(byte) 0x00};
 
     public static final Asn1Boolean TRUE = new Asn1Boolean(true);
     public static final Asn1Boolean FALSE = new Asn1Boolean(false);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Choice.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Choice.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Choice.java
index 7c65e7c..d0b17ac 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Choice.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Choice.java
@@ -19,7 +19,10 @@
  */
 package org.apache.kerby.asn1.type;
 
-import org.apache.kerby.asn1.*;
+import org.apache.kerby.asn1.LimitedByteBuffer;
+import org.apache.kerby.asn1.TagClass;
+import org.apache.kerby.asn1.TaggingOption;
+import org.apache.kerby.asn1.UniversalTag;
 
 import java.io.IOException;
 import java.nio.ByteBuffer;
@@ -86,8 +89,8 @@ public class Asn1Choice extends AbstractAsn1Type<Asn1Type> {
                 }
             } else {
                 initField(i);
-                if (fields[i].tagFlags() == item.tagFlags() &&
-                        fields[i].tagNo() == item.tagNo()) {
+                if (fields[i].tagFlags() == item.tagFlags()
+                        && fields[i].tagNo() == item.tagNo()) {
                     foundPos = i;
                     break;
                 } else {
@@ -100,7 +103,7 @@ public class Asn1Choice extends AbstractAsn1Type<Asn1Type> {
                     + item.tagFlags() + ", " + item.tagNo() + ")");
         }
 
-        if (! item.isFullyDecoded()) {
+        if (!item.isFullyDecoded()) {
             AbstractAsn1Type<?> fieldValue = (AbstractAsn1Type<?>) fields[foundPos];
             if (item.isContextSpecific()) {
                 item.decodeValueWith(fieldValue, fieldInfos[foundPos].getTaggingOption());
@@ -125,7 +128,9 @@ public class Asn1Choice extends AbstractAsn1Type<Asn1Type> {
 
     protected <T extends Asn1Type> T getFieldAs(int index, Class<T> t) {
         Asn1Type value = fields[index];
-        if (value == null) return null;
+        if (value == null) {
+            return null;
+        }
         return (T) value;
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Collection.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Collection.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Collection.java
index 158cd02..4eaee19 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Collection.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Collection.java
@@ -110,14 +110,14 @@ public class Asn1Collection extends AbstractAsn1Type<List<Asn1Item>> {
     }
 
     public static Asn1Type createCollection(int tagNo) {
-        if (! isCollection(tagNo)) {
+        if (!isCollection(tagNo)) {
             throw new IllegalArgumentException("Not collection type, tag: " + tagNo);
         }
         return createCollection(UniversalTag.fromValue(tagNo));
     }
 
     public static Asn1Type createCollection(UniversalTag tagNo) {
-        if (! isCollection(tagNo)) {
+        if (!isCollection(tagNo)) {
             throw new IllegalArgumentException("Not collection type, tag: " + tagNo);
         }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionOf.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionOf.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionOf.java
index 5a8709f..76ed6f5 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionOf.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionOf.java
@@ -74,7 +74,7 @@ public abstract class Asn1CollectionOf<T extends Asn1Type> extends Asn1Collectio
         Class<T> eleType = getElementType();
         if (value instanceof Asn1Item) {
             super.addItem(value);
-        } else if (! eleType.isInstance(value)) {
+        } else if (!eleType.isInstance(value)) {
             throw new RuntimeException("Unexpected element type " + value.getClass().getCanonicalName());
         } else {
             addElement((T) value);
@@ -82,7 +82,8 @@ public abstract class Asn1CollectionOf<T extends Asn1Type> extends Asn1Collectio
     }
 
     protected Class<T> getElementType() {
-        Class<T> elementType = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
+        Class<T> elementType = (Class<T>) ((ParameterizedType)
+                getClass().getGenericSuperclass()).getActualTypeArguments()[0];
         return elementType;
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java
index 7e09268..521b661 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1CollectionType.java
@@ -90,12 +90,12 @@ public abstract class Asn1CollectionType extends AbstractAsn1Type<Asn1Collection
             foundPos = -1;
             for (int i = lastPos + 1; i < fieldInfos.length; ++i) {
                 if (item.isContextSpecific()) {
-                    if(fieldInfos[i].getTagNo() == item.tagNo()) {
+                    if (fieldInfos[i].getTagNo() == item.tagNo()) {
                         foundPos = i;
                         break;
                     }
-                } else if (fields[i].tagFlags() == item.tagFlags() &&
-                        fields[i].tagNo() == item.tagNo()) {
+                } else if (fields[i].tagFlags() == item.tagFlags()
+                        && fields[i].tagNo() == item.tagNo()) {
                     foundPos = i;
                     break;
                 }
@@ -105,7 +105,7 @@ public abstract class Asn1CollectionType extends AbstractAsn1Type<Asn1Collection
                         + item.tagFlags() + ", " + item.tagNo() + ")");
             }
 
-            if (! item.isFullyDecoded()) {
+            if (!item.isFullyDecoded()) {
                 AbstractAsn1Type<?> fieldValue = (AbstractAsn1Type<?>) fields[foundPos];
                 if (item.isContextSpecific()) {
                     item.decodeValueWith(fieldValue, fieldInfos[foundPos].getTaggingOption());

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralString.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralString.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralString.java
index 19c6d40..aae244d 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralString.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralString.java
@@ -21,8 +21,7 @@ package org.apache.kerby.asn1.type;
 
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1GeneralString extends Asn1String
-{
+public class Asn1GeneralString extends Asn1String {
     public Asn1GeneralString() {
         super(UniversalTag.GENERAL_STRING);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralizedTime.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralizedTime.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralizedTime.java
index 020a7b4..712356e 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralizedTime.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1GeneralizedTime.java
@@ -95,8 +95,8 @@ public class Asn1GeneralizedTime extends Asn1Simple<Date> {
         int iPos = dateStr.indexOf('.');
         if (iPos > 0) {
             if (iPos != 14) {
-                throw new IllegalArgumentException("Bad generalized time string, " +
-                        "with improper milli seconds " + dateStr);
+                throw new IllegalArgumentException("Bad generalized time string, "
+                        + "with improper milli seconds " + dateStr);
             }
 
             char chr;
@@ -123,8 +123,8 @@ public class Asn1GeneralizedTime extends Asn1Simple<Date> {
             iPos = dateStr.indexOf('-');
         }
         if (iPos > 0 && iPos != dateStr.length() - 5) {
-            throw new IllegalArgumentException("Bad generalized time string, " +
-                    "with improper timezone part " + dateStr);
+            throw new IllegalArgumentException("Bad generalized time string, "
+                    + "with improper timezone part " + dateStr);
         }
 
         if (iPos > 0) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1IA5String.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1IA5String.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1IA5String.java
index 6f73c9f..b7a60d1 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1IA5String.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1IA5String.java
@@ -21,8 +21,7 @@ package org.apache.kerby.asn1.type;
 
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1IA5String extends Asn1String
-{
+public class Asn1IA5String extends Asn1String {
     public Asn1IA5String() {
         super(UniversalTag.IA5_STRING);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Integer.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Integer.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Integer.java
index 76b4222..f5b0509 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Integer.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Integer.java
@@ -24,8 +24,7 @@ import org.apache.kerby.asn1.UniversalTag;
 import java.io.IOException;
 import java.math.BigInteger;
 
-public class Asn1Integer extends Asn1Simple<BigInteger>
-{
+public class Asn1Integer extends Asn1Simple<BigInteger> {
     public Asn1Integer() {
         this((BigInteger) null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Item.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Item.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Item.java
index 1249c20..74ef10a 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Item.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Item.java
@@ -38,8 +38,7 @@ import java.nio.ByteBuffer;
  * to decode it fully. Or if you have already derived the value holder or the holder type, you can use decodeValueWith
  * or decodeValueAs with your holder or hodler type.
  */
-public class Asn1Item extends AbstractAsn1Type<Asn1Type>
-{
+public class Asn1Item extends AbstractAsn1Type<Asn1Type> {
     private LimitedByteBuffer bodyContent;
 
     public Asn1Item(Asn1Type value) {
@@ -89,7 +88,7 @@ public class Asn1Item extends AbstractAsn1Type<Asn1Type>
         if (getValue() != null) {
             return;
         }
-        if (! isSimple()) {
+        if (!isSimple()) {
             throw new IllegalArgumentException("Attempting to decode non-simple value as simple");
         }
 
@@ -101,7 +100,7 @@ public class Asn1Item extends AbstractAsn1Type<Asn1Type>
         if (getValue() != null) {
             return;
         }
-        if (! isCollection()) {
+        if (!isCollection()) {
             throw new IllegalArgumentException("Attempting to decode non-collection value as collection");
         }
 
@@ -125,7 +124,7 @@ public class Asn1Item extends AbstractAsn1Type<Asn1Type>
     }
 
     public void decodeValueAsImplicitTagged(int originalTag, int originalTagNo) throws IOException {
-        if (! isTagged()) {
+        if (!isTagged()) {
             throw new IllegalArgumentException("Attempting to decode non-tagged value using tagging way");
         }
         Asn1Item taggedValue = new Asn1Item(originalTag, originalTagNo, getBodyContent());
@@ -133,7 +132,7 @@ public class Asn1Item extends AbstractAsn1Type<Asn1Type>
     }
 
     public void decodeValueAsExplicitTagged() throws IOException {
-        if (! isTagged()) {
+        if (!isTagged()) {
             throw new IllegalArgumentException("Attempting to decode non-tagged value using tagging way");
         }
         Asn1Item taggedValue = decodeOne(getBodyContent());
@@ -150,7 +149,7 @@ public class Asn1Item extends AbstractAsn1Type<Asn1Type>
     }
 
     public void decodeValueWith(Asn1Type value, TaggingOption taggingOption) throws IOException {
-        if (! isTagged()) {
+        if (!isTagged()) {
             throw new IllegalArgumentException("Attempting to decode non-tagged value using tagging way");
         }
         ((AbstractAsn1Type<?>) value).taggedDecode(tagFlags(), tagNo(), getBodyContent(), taggingOption);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1NumericsString.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1NumericsString.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1NumericsString.java
index 1c315d4..3ef4ae1 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1NumericsString.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1NumericsString.java
@@ -21,8 +21,7 @@ package org.apache.kerby.asn1.type;
 
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1NumericsString extends Asn1String
-{
+public class Asn1NumericsString extends Asn1String {
     public Asn1NumericsString() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1ObjectIdentifier.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1ObjectIdentifier.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1ObjectIdentifier.java
index 0cec9c2..9c4a9f7 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1ObjectIdentifier.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1ObjectIdentifier.java
@@ -151,14 +151,14 @@ public class Asn1ObjectIdentifier extends Asn1Simple<String> {
         int bitLen = value.bitLength();
 
         if (bitLen < 8) {
-            return new byte[] { value.byteValue() };
+            return new byte[] {value.byteValue()};
         }
 
         int len = (bitLen + 6) / 7;
         byte[] bytes = new byte[len];
         BigInteger tmpValue = value;
         for (int i = len - 1; i >= 0; i--) {
-            bytes[i] = (byte)((tmpValue.byteValue() & 0x7f) | 0x80);
+            bytes[i] = (byte) ((tmpValue.byteValue() & 0x7f) | 0x80);
             tmpValue = tmpValue.shiftRight(7);
         }
         bytes[len - 1] &= 0x7f;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1OctetString.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1OctetString.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1OctetString.java
index 72510a3..72d5c70 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1OctetString.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1OctetString.java
@@ -24,8 +24,7 @@ import org.apache.kerby.asn1.UniversalTag;
 
 import java.io.IOException;
 
-public class Asn1OctetString extends Asn1Simple<byte[]>
-{
+public class Asn1OctetString extends Asn1Simple<byte[]> {
     public Asn1OctetString() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1PrintableString.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1PrintableString.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1PrintableString.java
index 78fdb10..0401757 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1PrintableString.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1PrintableString.java
@@ -21,8 +21,7 @@ package org.apache.kerby.asn1.type;
 
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1PrintableString extends Asn1String
-{
+public class Asn1PrintableString extends Asn1String {
     public Asn1PrintableString() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Sequence.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Sequence.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Sequence.java
index b9e374c..2e483d2 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Sequence.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Sequence.java
@@ -22,8 +22,7 @@ package org.apache.kerby.asn1.type;
 import org.apache.kerby.asn1.TagClass;
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1Sequence extends Asn1Collection
-{
+public class Asn1Sequence extends Asn1Collection {
     public Asn1Sequence() {
         super(TagClass.UNIVERSAL, UniversalTag.SEQUENCE.getValue());
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SequenceOf.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SequenceOf.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SequenceOf.java
index e4d46a6..5dc69e0 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SequenceOf.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SequenceOf.java
@@ -22,8 +22,7 @@ package org.apache.kerby.asn1.type;
 import org.apache.kerby.asn1.TagClass;
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1SequenceOf<T extends Asn1Type> extends Asn1CollectionOf<T>
-{
+public class Asn1SequenceOf<T extends Asn1Type> extends Asn1CollectionOf<T> {
     public Asn1SequenceOf() {
         super(TagClass.UNIVERSAL, UniversalTag.SEQUENCE_OF.getValue());
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Set.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Set.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Set.java
index 3407e8c..500c6f1 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Set.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Set.java
@@ -22,8 +22,7 @@ package org.apache.kerby.asn1.type;
 import org.apache.kerby.asn1.TagClass;
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1Set extends Asn1Collection
-{
+public class Asn1Set extends Asn1Collection {
     public Asn1Set() {
         super(TagClass.UNIVERSAL, UniversalTag.SET.getValue());
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SetOf.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SetOf.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SetOf.java
index f91e241..2838538 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SetOf.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1SetOf.java
@@ -22,8 +22,7 @@ package org.apache.kerby.asn1.type;
 import org.apache.kerby.asn1.TagClass;
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1SetOf<T extends Asn1Type> extends Asn1CollectionOf<T>
-{
+public class Asn1SetOf<T extends Asn1Type> extends Asn1CollectionOf<T> {
     public Asn1SetOf() {
         super(TagClass.UNIVERSAL, UniversalTag.SET_OF.getValue());
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Simple.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Simple.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Simple.java
index 66c542b..8a7a2af 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Simple.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Simple.java
@@ -106,9 +106,9 @@ public abstract class Asn1Simple<T> extends AbstractAsn1Type<T> {
         return false;
     }
 
-    protected void toValue() throws IOException {}
+    protected void toValue() throws IOException { }
 
-    protected void toBytes() {}
+    protected void toBytes() { }
 
     public static boolean isSimple(int tagNo) {
         return isSimple(UniversalTag.fromValue(tagNo));
@@ -146,7 +146,7 @@ public abstract class Asn1Simple<T> extends AbstractAsn1Type<T> {
      * @return
      */
     public static Asn1Type createSimple(int tagNo) {
-        if (! isSimple(tagNo)) {
+        if (!isSimple(tagNo)) {
             throw new IllegalArgumentException("Not simple type, tag: " + tagNo);
         }
         return createSimple(UniversalTag.fromValue(tagNo));
@@ -158,7 +158,7 @@ public abstract class Asn1Simple<T> extends AbstractAsn1Type<T> {
      * @return
      */
     public static Asn1Type createSimple(UniversalTag tagNo) {
-        if (! isSimple(tagNo)) {
+        if (!isSimple(tagNo)) {
             throw new IllegalArgumentException("Not simple type, tag: " + tagNo);
         }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java
index f056555..91c6d19 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1String.java
@@ -28,8 +28,7 @@ import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
 
-public abstract class Asn1String extends Asn1Simple<String>
-{
+public abstract class Asn1String extends Asn1Simple<String> {
     public Asn1String(UniversalTag tagNo) {
         super(tagNo, null);
     }
@@ -84,25 +83,26 @@ public abstract class Asn1String extends Asn1Simple<String>
             char ch;
 
             if ((bytes[i] & 0xf0) == 0xf0) {
-                int codePoint = ((bytes[i] & 0x03) << 18) | ((bytes[i+1] & 0x3F) << 12) | ((bytes[i+2] & 0x3F) << 6) | (bytes[i+3] & 0x3F);
-                int U = codePoint - 0x10000;
-                char W1 = (char)(0xD800 | (U >> 10));
-                char W2 = (char)(0xDC00 | (U & 0x3FF));
-                cs[length++] = W1;
-                ch = W2;
+                int codePoint = ((bytes[i] & 0x03) << 18) | ((bytes[i + 1] & 0x3F) << 12)
+                        | ((bytes[i + 2] & 0x3F) << 6) | (bytes[i + 3] & 0x3F);
+                int u = codePoint - 0x10000;
+                char w1 = (char) (0xD800 | (u >> 10));
+                char w2 = (char) (0xDC00 | (u & 0x3FF));
+                cs[length++] = w1;
+                ch = w2;
                 i += 4;
             } else if ((bytes[i] & 0xe0) == 0xe0) {
-                ch = (char)(((bytes[i] & 0x0f) << 12)
+                ch = (char) (((bytes[i] & 0x0f) << 12)
                         | ((bytes[i + 1] & 0x3f) << 6) | (bytes[i + 2] & 0x3f));
                 i += 3;
             } else if ((bytes[i] & 0xd0) == 0xd0) {
-                ch = (char)(((bytes[i] & 0x1f) << 6) | (bytes[i + 1] & 0x3f));
+                ch = (char) (((bytes[i] & 0x1f) << 6) | (bytes[i + 1] & 0x3f));
                 i += 2;
             } else if ((bytes[i] & 0xc0) == 0xc0) {
-                ch = (char)(((bytes[i] & 0x1f) << 6) | (bytes[i + 1] & 0x3f));
+                ch = (char) (((bytes[i] & 0x1f) << 6) | (bytes[i + 1] & 0x3f));
                 i += 2;
             } else {
-                ch = (char)(bytes[i] & 0xff);
+                ch = (char) (bytes[i] & 0xff);
                 i += 1;
             }
 
@@ -140,23 +140,21 @@ public abstract class Asn1String extends Asn1Simple<String>
             } else if (ch < 0x0800) {
                 sOut.write(0xc0 | (ch >> 6));
                 sOut.write(0x80 | (ch & 0x3f));
-            }
-            // surrogate pair
-            else if (ch >= 0xD800 && ch <= 0xDFFF) {
+            } else if (ch >= 0xD800 && ch <= 0xDFFF) {
                 // in error - can only happen, if the Java String class has a
                 // bug.
                 if (i + 1 >= c.length) {
                     throw new IllegalStateException("invalid UTF-16 codepoint");
                 }
-                char W1 = ch;
+                char w1 = ch;
                 ch = c[++i];
-                char W2 = ch;
+                char w2 = ch;
                 // in error - can only happen, if the Java String class has a
                 // bug.
-                if (W1 > 0xDBFF) {
+                if (w1 > 0xDBFF) {
                     throw new IllegalStateException("invalid UTF-16 codepoint");
                 }
-                int codePoint = ((W1 & 0x03FF) << 10) | (W2 & 0x03FF) + 0x10000;
+                int codePoint = ((w1 & 0x03FF) << 10) | (w2 & 0x03FF) + 0x10000;
                 sOut.write(0xf0 | (codePoint >> 18));
                 sOut.write(0x80 | ((codePoint >> 12) & 0x3F));
                 sOut.write(0x80 | ((codePoint >> 6) & 0x3F));
@@ -185,7 +183,7 @@ public abstract class Asn1String extends Asn1Simple<String>
             char ch = chars[i];
             if ('a' <= ch && 'z' >= ch) {
                 changed = true;
-                chars[i] = (char)(ch - 'a' + 'A');
+                chars[i] = (char) (ch - 'a' + 'A');
             }
         }
 
@@ -210,7 +208,7 @@ public abstract class Asn1String extends Asn1Simple<String>
             char ch = chars[i];
             if ('A' <= ch && 'Z' >= ch) {
                 changed = true;
-                chars[i] = (char)(ch - 'A' + 'a');
+                chars[i] = (char) (ch - 'A' + 'a');
             }
         }
 
@@ -225,7 +223,7 @@ public abstract class Asn1String extends Asn1Simple<String>
         byte[] bytes = new byte[chars.length];
 
         for (int i = 0; i != bytes.length; i++) {
-            bytes[i] = (byte)chars[i];
+            bytes[i] = (byte) chars[i];
         }
 
         return bytes;
@@ -237,7 +235,7 @@ public abstract class Asn1String extends Asn1Simple<String>
         for (int i = 0; i != bytes.length; i++) {
             char ch = string.charAt(i);
 
-            bytes[i] = (byte)ch;
+            bytes[i] = (byte) ch;
         }
 
         return bytes;
@@ -263,7 +261,7 @@ public abstract class Asn1String extends Asn1Simple<String>
         char[] chars = new char[bytes.length];
 
         for (int i = 0; i != chars.length; i++) {
-            chars[i] = (char)(bytes[i] & 0xff);
+            chars[i] = (char) (bytes[i] & 0xff);
         }
 
         return chars;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61String.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61String.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61String.java
index 2b8e92b..d00eb11 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61String.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61String.java
@@ -21,8 +21,7 @@ package org.apache.kerby.asn1.type;
 
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1T61String extends Asn1String
-{
+public class Asn1T61String extends Asn1String {
     public Asn1T61String() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61Utf8String.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61Utf8String.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61Utf8String.java
index 5e0d9da..9f75aee 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61Utf8String.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1T61Utf8String.java
@@ -23,8 +23,7 @@ import org.apache.kerby.asn1.UniversalTag;
 
 import java.nio.charset.StandardCharsets;
 
-public class Asn1T61Utf8String extends Asn1String
-{
+public class Asn1T61Utf8String extends Asn1String {
     public Asn1T61Utf8String() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Tagging.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Tagging.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Tagging.java
index 63c9f53..d9c0d28 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Tagging.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Tagging.java
@@ -51,8 +51,8 @@ public class Asn1Tagging<T extends Asn1Type> extends AbstractAsn1Type<T> {
         } else if (getEncodingOption().isImplicit()) {
             return value.encodingBodyLength();
         } else {
-            throw new RuntimeException("Invalid decoding option, " +
-                    "only allowing explicit/implicit");
+            throw new RuntimeException("Invalid decoding option, "
+                    + "only allowing explicit/implicit");
         }
     }
 
@@ -75,8 +75,8 @@ public class Asn1Tagging<T extends Asn1Type> extends AbstractAsn1Type<T> {
         } else if (getEncodingOption().isImplicit()) {
             value.encodeBody(buffer);
         } else {
-            throw new RuntimeException("Invalid decoding option, " +
-                    "only allowing explicit/implicit");
+            throw new RuntimeException("Invalid decoding option, "
+                    + "only allowing explicit/implicit");
         }
     }
 
@@ -88,13 +88,14 @@ public class Asn1Tagging<T extends Asn1Type> extends AbstractAsn1Type<T> {
         } else if (getEncodingOption().isImplicit()) {
             value.decodeBody(content);
         } else {
-            throw new RuntimeException("Invalid decoding option, " +
-                    "only allowing explicit/implicit");
+            throw new RuntimeException("Invalid decoding option, "
+                    + "only allowing explicit/implicit");
         }
     }
 
     private void initValue() {
-        Class<? extends Asn1Type> valueType = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
+        Class<? extends Asn1Type> valueType = (Class<T>) ((ParameterizedType)
+                getClass().getGenericSuperclass()).getActualTypeArguments()[0];
         AbstractAsn1Type<?> value = null;
         try {
             value = (AbstractAsn1Type<?>) valueType.newInstance();

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UniversalString.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UniversalString.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UniversalString.java
index 104c707..32b08f3 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UniversalString.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UniversalString.java
@@ -21,8 +21,7 @@ package org.apache.kerby.asn1.type;
 
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1UniversalString extends Asn1String
-{
+public class Asn1UniversalString extends Asn1String {
     public Asn1UniversalString() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UtcTime.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UtcTime.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UtcTime.java
index 220e7c2..2d0e884 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UtcTime.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1UtcTime.java
@@ -28,8 +28,7 @@ import java.text.SimpleDateFormat;
 import java.util.Date;
 import java.util.SimpleTimeZone;
 
-public class Asn1UtcTime extends Asn1Simple<Date>
-{
+public class Asn1UtcTime extends Asn1Simple<Date> {
     public Asn1UtcTime() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Utf8String.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Utf8String.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Utf8String.java
index bfa2c57..a92f145 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Utf8String.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1Utf8String.java
@@ -24,8 +24,7 @@ import org.apache.kerby.asn1.UniversalTag;
 import java.io.IOException;
 import java.nio.charset.StandardCharsets;
 
-public class Asn1Utf8String extends Asn1String
-{
+public class Asn1Utf8String extends Asn1String {
     public Asn1Utf8String() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1VisibleString.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1VisibleString.java b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1VisibleString.java
index c4e0f16..608d2ad 100644
--- a/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1VisibleString.java
+++ b/kerby-asn1/src/main/java/org/apache/kerby/asn1/type/Asn1VisibleString.java
@@ -21,8 +21,7 @@ package org.apache.kerby.asn1.type;
 
 import org.apache.kerby.asn1.UniversalTag;
 
-public class Asn1VisibleString extends Asn1String
-{
+public class Asn1VisibleString extends Asn1String {
     public Asn1VisibleString() {
         this(null);
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/test/java/org/apache/kerby/asn1/PersonnelRecord.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/test/java/org/apache/kerby/asn1/PersonnelRecord.java b/kerby-asn1/src/test/java/org/apache/kerby/asn1/PersonnelRecord.java
index b05a22b..a5c10f8 100644
--- a/kerby-asn1/src/test/java/org/apache/kerby/asn1/PersonnelRecord.java
+++ b/kerby-asn1/src/test/java/org/apache/kerby/asn1/PersonnelRecord.java
@@ -19,7 +19,15 @@
  */
 package org.apache.kerby.asn1;
 
-import org.apache.kerby.asn1.type.*;
+
+import org.apache.kerby.asn1.type.Asn1FieldInfo;
+import org.apache.kerby.asn1.type.Asn1Integer;
+import org.apache.kerby.asn1.type.Asn1SequenceOf;
+import org.apache.kerby.asn1.type.Asn1SetType;
+import org.apache.kerby.asn1.type.Asn1Tagging;
+import org.apache.kerby.asn1.type.Asn1VisibleString;
+import org.apache.kerby.asn1.type.TaggingSequence;
+import org.apache.kerby.asn1.type.TaggingSet;
 
 /**
  * Ref. X.690-0207(http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf),
@@ -29,7 +37,7 @@ public class PersonnelRecord extends TaggingSet {
     private static final int NAME = 0;
     private static final int TITLE = 1;
     private static final int NUMBER = 2;
-    private static final int DATEOFHIRE= 3;
+    private static final int DATEOFHIRE = 3;
     private static final int NAMEOFSPOUSE = 4;
     private static final int CHILDREN = 5;
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/test/java/org/apache/kerby/asn1/TestTaggingEncoding.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/test/java/org/apache/kerby/asn1/TestTaggingEncoding.java b/kerby-asn1/src/test/java/org/apache/kerby/asn1/TestTaggingEncoding.java
index 8c5d1bb..e62727a 100644
--- a/kerby-asn1/src/test/java/org/apache/kerby/asn1/TestTaggingEncoding.java
+++ b/kerby-asn1/src/test/java/org/apache/kerby/asn1/TestTaggingEncoding.java
@@ -173,13 +173,13 @@ public class TestTaggingEncoding {
 
         assertThat(aType1.encode()).isEqualTo(TYPE1_EXPECTED_BYTES);
         assertThat(TYPE2_EXPECTED_BYTES)
-                .isEqualTo(aType1.taggedEncode(TaggingOption.newImplicitAppSpecific(3)));// for Type2
+                .isEqualTo(aType1.taggedEncode(TaggingOption.newImplicitAppSpecific(3))); // for Type2
         assertThat(TYPE3_EXPECTED_BYTES)
-                .isEqualTo(aType2.taggedEncode(TaggingOption.newExplicitContextSpecific(2)));// for Type3
+                .isEqualTo(aType2.taggedEncode(TaggingOption.newExplicitContextSpecific(2))); // for Type3
         assertThat(TYPE4_EXPECTED_BYTES)
-                .isEqualTo(aType3.taggedEncode(TaggingOption.newImplicitAppSpecific(7)));// for Type4
+                .isEqualTo(aType3.taggedEncode(TaggingOption.newImplicitAppSpecific(7))); // for Type4
         assertThat(TYPE5_EXPECTED_BYTES)
-                .isEqualTo(aType2.taggedEncode(TaggingOption.newImplicitContextSpecific(2)));// for Type5
+                .isEqualTo(aType2.taggedEncode(TaggingOption.newImplicitContextSpecific(2))); // for Type5
     }
 
     @Test

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-asn1/src/test/java/org/apache/kerby/asn1/Util.java
----------------------------------------------------------------------
diff --git a/kerby-asn1/src/test/java/org/apache/kerby/asn1/Util.java b/kerby-asn1/src/test/java/org/apache/kerby/asn1/Util.java
index ad237fa..679a23b 100644
--- a/kerby-asn1/src/test/java/org/apache/kerby/asn1/Util.java
+++ b/kerby-asn1/src/test/java/org/apache/kerby/asn1/Util.java
@@ -35,7 +35,7 @@ public class Util {
         char[] hexChars = new char[len];
         hexChars[0] = '0';
         hexChars[1] = 'x';
-        for ( int j = 0; j < bytes.length; j++ ) {
+        for (int j = 0; j < bytes.length; j++) {
             int v = bytes[j] & 0xFF;
             hexChars[j * 3 + 2] = HEX_CHARS[v >>> 4];
             hexChars[j * 3 + 3] = HEX_CHARS[v & 0x0F];
@@ -60,18 +60,18 @@ public class Util {
             throw new IllegalArgumentException("Invalid hex string to convert : length below 4");
         }
         
-        if (( hexStr[0] != '0') || ((hexStr[1] != 'x') && (hexStr[1] != 'X'))) {
+        if ((hexStr[0] != '0') || ((hexStr[1] != 'x') && (hexStr[1] != 'X'))) {
             throw new IllegalArgumentException("Invalid hex string to convert : not starting with '0x'");
         }
         
-        byte[] bytes = new byte[(hexStr.length - 1)/3];
+        byte[] bytes = new byte[(hexStr.length - 1) / 3];
         int pos = 0; 
         boolean high = false;
         boolean prefix = true;
         
         for (char c : hexStr) {
             if (prefix) {
-                if ((c == 'x') || (c=='X')) {
+                if ((c == 'x') || (c == 'X')) {
                     prefix = false;
                 }
                 
@@ -101,9 +101,9 @@ public class Util {
                 case '8':
                 case '9':
                     if (high) {
-                        bytes[pos] += (byte)(c - '0');
+                        bytes[pos] += (byte) (c - '0');
                     } else {
-                        bytes[pos] = (byte)((c - '0') << 4);
+                        bytes[pos] = (byte) ((c - '0') << 4);
                     }
                     
                     high = !high;
@@ -116,9 +116,9 @@ public class Util {
                 case 'e' :
                 case 'f' :
                     if (high) {
-                        bytes[pos] += (byte)(c - 'a' + 10);
+                        bytes[pos] += (byte) (c - 'a' + 10);
                     } else {
-                        bytes[pos] = (byte)((c - 'a' + 10) << 4);
+                        bytes[pos] = (byte) ((c - 'a' + 10) << 4);
                     }
 
                     high = !high;
@@ -131,9 +131,9 @@ public class Util {
                 case 'E' :
                 case 'F' :
                     if (high) {
-                        bytes[pos] += (byte)(c - 'A' + 10);
+                        bytes[pos] += (byte) (c - 'A' + 10);
                     } else {
-                        bytes[pos] = (byte)((c - 'A' + 10) << 4);
+                        bytes[pos] = (byte) ((c - 'A' + 10) << 4);
                     }
 
                     high = !high;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
----------------------------------------------------------------------
diff --git a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
index 291756b..f412feb 100644
--- a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
+++ b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/JsonIdentityBackend.java
@@ -1,4 +1,4 @@
-/**
+package org.apache.kerby.kerberos.kdc.identitybackend; /**
  *  Licensed to the Apache Software Foundation (ASF) under one
  *  or more contributor license agreements.  See the NOTICE file
  *  distributed with this work for additional information
@@ -17,7 +17,6 @@
  *  under the License. 
  *
  */
-package org.apache.kerby.kerberos.kdc.identitybackend;
 
 import com.google.gson.Gson;
 import com.google.gson.GsonBuilder;
@@ -36,7 +35,11 @@ import org.apache.kerby.util.IOUtil;
 
 import java.io.File;
 import java.io.IOException;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
 
 /**
  * A Json file based backend implementation.
@@ -84,7 +87,7 @@ public class JsonIdentityBackend extends AbstractIdentityBackend {
         }
 
         jsonKdbFile = new File(jsonFile);
-        if (! jsonKdbFile.exists()) {
+        if (!jsonKdbFile.exists()) {
             try {
                 jsonKdbFile.createNewFile();
             } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/KerberosTimeAdapter.java
----------------------------------------------------------------------
diff --git a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/KerberosTimeAdapter.java b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/KerberosTimeAdapter.java
index b4f6a85..45207c7 100644
--- a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/KerberosTimeAdapter.java
+++ b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/KerberosTimeAdapter.java
@@ -19,7 +19,13 @@
  */
 package org.apache.kerby.kerberos.kdc.identitybackend.typeAdapter;
 
-import com.google.gson.*;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
 import org.apache.kerby.kerberos.kerb.spec.KerberosTime;
 
 import java.lang.reflect.Type;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/PrincipalNameAdapter.java
----------------------------------------------------------------------
diff --git a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/PrincipalNameAdapter.java b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/PrincipalNameAdapter.java
index 869cc59..d9d61a4 100644
--- a/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/PrincipalNameAdapter.java
+++ b/kerby-backend/json-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/typeAdapter/PrincipalNameAdapter.java
@@ -19,7 +19,13 @@
  */
 package org.apache.kerby.kerberos.kdc.identitybackend.typeAdapter;
 
-import com.google.gson.*;
+import com.google.gson.JsonDeserializationContext;
+import com.google.gson.JsonDeserializer;
+import com.google.gson.JsonElement;
+import com.google.gson.JsonParseException;
+import com.google.gson.JsonPrimitive;
+import com.google.gson.JsonSerializationContext;
+import com.google.gson.JsonSerializer;
 import org.apache.kerby.kerberos.kerb.spec.base.PrincipalName;
 
 import java.lang.reflect.Type;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/json-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/JsonBackendTest.java
----------------------------------------------------------------------
diff --git a/kerby-backend/json-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/JsonBackendTest.java b/kerby-backend/json-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/JsonBackendTest.java
index 5981d51..8a974dc 100644
--- a/kerby-backend/json-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/JsonBackendTest.java
+++ b/kerby-backend/json-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/JsonBackendTest.java
@@ -25,7 +25,6 @@ import org.apache.kerby.kerberos.kdc.identitybackend.JsonIdentityBackend;
 import org.apache.kerby.kerberos.kerb.KrbException;
 import org.junit.AfterClass;
 import org.junit.BeforeClass;
-import org.junit.Test;
 
 import java.io.File;
 
@@ -43,7 +42,6 @@ public class JsonBackendTest extends BackendTestBase {
 
         Config backendConfig = new Conf();
         backendConfig.setString(JsonIdentityBackend.JSON_IDENTITY_BACKEND_FILE, jsonBackendFileString);
-
         backend = new JsonIdentityBackend(backendConfig);
         backend.initialize();
     }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
----------------------------------------------------------------------
diff --git a/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java b/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
index 0c55080..4fbf57d 100644
--- a/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
+++ b/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityBackend.java
@@ -143,7 +143,7 @@ public class LdapIdentityBackend extends AbstractIdentityBackend {
     /**
      * An inner class, used to encapsulate key information
      */
-    class KeysInfo{
+    class KeysInfo {
         private String[] etypes;
         private byte[][] keys;
         private String[] kvnos;
@@ -190,20 +190,20 @@ public class LdapIdentityBackend extends AbstractIdentityBackend {
             entry.add("objectClass", "top", "person", "inetOrgPerson",
                     "krb5principal", "krb5kdcentry");
             entry.add("cn", names[0]);
-            entry.add( "sn", names[0]);
+            entry.add("sn", names[0]);
             entry.add(KerberosAttribute.KRB5_KEY_AT, keysInfo.getKeys());
-            entry.add( "krb5EncryptionType", keysInfo.getEtypes());
-            entry.add( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, principalName);
-            entry.add( KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT,
+            entry.add("krb5EncryptionType", keysInfo.getEtypes());
+            entry.add(KerberosAttribute.KRB5_PRINCIPAL_NAME_AT, principalName);
+            entry.add(KerberosAttribute.KRB5_KEY_VERSION_NUMBER_AT,
                     identity.getKeyVersion() + "");
-            entry.add( "krb5KDCFlags", "" + identity.getKdcFlags());
-            entry.add( KerberosAttribute.KRB5_ACCOUNT_DISABLED_AT, "" +
-                    identity.isDisabled());
-            entry.add( "createTimestamp",
+            entry.add("krb5KDCFlags", "" + identity.getKdcFlags());
+            entry.add(KerberosAttribute.KRB5_ACCOUNT_DISABLED_AT, ""
+                    + identity.isDisabled());
+            entry.add("createTimestamp",
                     toGeneralizedTime(identity.getCreatedTime()));
-            entry.add(KerberosAttribute.KRB5_ACCOUNT_LOCKEDOUT_AT, "" +
-                    identity.isLocked());
-            entry.add( KerberosAttribute.KRB5_ACCOUNT_EXPIRATION_TIME_AT,
+            entry.add(KerberosAttribute.KRB5_ACCOUNT_LOCKEDOUT_AT, ""
+                    + identity.isLocked());
+            entry.add(KerberosAttribute.KRB5_ACCOUNT_EXPIRATION_TIME_AT,
                     toGeneralizedTime(identity.getExpireTime()));
             connection.add(entry);
         } catch (LdapInvalidDnException e) {
@@ -265,11 +265,11 @@ public class LdapIdentityBackend extends AbstractIdentityBackend {
                     identity.getPrincipalName());
             modifyRequest.replace(KerberosAttribute.KRB5_ACCOUNT_EXPIRATION_TIME_AT,
                     toGeneralizedTime(identity.getExpireTime()));
-            modifyRequest.replace(KerberosAttribute.KRB5_ACCOUNT_DISABLED_AT, "" +
-                    identity.isDisabled());
+            modifyRequest.replace(KerberosAttribute.KRB5_ACCOUNT_DISABLED_AT, ""
+                    + identity.isDisabled());
             modifyRequest.replace("krb5KDCFlags", "" + identity.getKdcFlags());
-            modifyRequest.replace(KerberosAttribute.KRB5_ACCOUNT_LOCKEDOUT_AT, "" +
-                    identity.isLocked());
+            modifyRequest.replace(KerberosAttribute.KRB5_ACCOUNT_LOCKEDOUT_AT, ""
+                    + identity.isLocked());
             connection.modify(modifyRequest);
         } catch (LdapException e) {
             throw new KrbException("Failed to update identity", e);
@@ -295,7 +295,7 @@ public class LdapIdentityBackend extends AbstractIdentityBackend {
      * Used to convert a dn of String to a Dn object
      * @param principalName The principal name to be convert.
      * @return
-     * @throws LdapInvalidDnException if a remote exception occurs.
+     * @throws org.apache.directory.api.ldap.model.exception.LdapInvalidDnException if a remote exception occurs.
      */
     private Dn toDn(String principalName) throws LdapInvalidDnException {
         String[] names = principalName.split("@");
@@ -326,7 +326,7 @@ public class LdapIdentityBackend extends AbstractIdentityBackend {
         EntryCursor cursor;
         Entry entry;
         try {
-            cursor = connection.search( getConfig().getString("base_dn"), 
+            cursor = connection.search(getConfig().getString("base_dn"), 
                     "(objectclass=*)", SearchScope.ONELEVEL, KerberosAttribute.KRB5_PRINCIPAL_NAME_AT);
             if (cursor == null) {
                 return null;

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityGetHelper.java
----------------------------------------------------------------------
diff --git a/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityGetHelper.java b/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityGetHelper.java
index d8b83b4..a5b22dc 100644
--- a/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityGetHelper.java
+++ b/kerby-backend/ldap-backend/src/main/java/org/apache/kerby/kerberos/kdc/identitybackend/LdapIdentityGetHelper.java
@@ -54,9 +54,9 @@ public class LdapIdentityGetHelper {
 
     public List<EncryptionKey> getKeys() throws IOException {
         Iterator<Value<?>> iterator1 = entry.get(KerberosAttribute.KRB5_KEY_AT).iterator();
-        List<EncryptionKey> keys= new ArrayList<>();
+        List<EncryptionKey> keys = new ArrayList<>();
         while (iterator1.hasNext()) {
-            byte[] encryKey= iterator1.next().getBytes();
+            byte[] encryKey = iterator1.next().getBytes();
             EncryptionKey key = new EncryptionKey();
             key.decode(encryKey);
             key.setKvno(1); // TODO: kvno should be correctly stored and retrieved

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractLdapIdentityBackendTest.java
----------------------------------------------------------------------
diff --git a/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractLdapIdentityBackendTest.java b/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractLdapIdentityBackendTest.java
index 0ceb963..e65d506 100644
--- a/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractLdapIdentityBackendTest.java
+++ b/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/AbstractLdapIdentityBackendTest.java
@@ -39,7 +39,7 @@ public abstract class AbstractLdapIdentityBackendTest extends  BackendTest {
         return service;
     }
 
-    public static void setService( DirectoryService service ) {
+    public static void setService(DirectoryService service) {
         AbstractLdapIdentityBackendTest.service = service;
     }
 
@@ -47,7 +47,7 @@ public abstract class AbstractLdapIdentityBackendTest extends  BackendTest {
         return ldapServer;
     }
 
-    public static void setLdapServer( LdapServer ldapServer ) {
+    public static void setLdapServer(LdapServer ldapServer) {
         AbstractLdapIdentityBackendTest.ldapServer = ldapServer;
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
----------------------------------------------------------------------
diff --git a/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java b/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
index 83ca85a..d19bd51 100644
--- a/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
+++ b/kerby-backend/ldap-backend/src/test/java/org/apache/kerby/kerberos/kerb/identity/backend/LdapIdentityBackendTest.java
@@ -63,7 +63,7 @@ public class LdapIdentityBackendTest extends AbstractLdapIdentityBackendTest {
     @Before
     public void setUp() throws Exception {
         Conf config = new Conf();
-        config.setString( "host", "localhost" );
+        config.setString("host", "localhost");
         config.setInt("port", getLdapServer().getPort());
         config.setString("admin_dn", ADMIN_DN);
         config.setString("admin_pw", ADMIN_PW);

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/1d312c9f/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/KrbIdentitySerializer.java
----------------------------------------------------------------------
diff --git a/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/KrbIdentitySerializer.java b/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/KrbIdentitySerializer.java
index b63c9a4..22766ec 100644
--- a/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/KrbIdentitySerializer.java
+++ b/kerby-backend/mavibot-backend/src/main/java/org/apache/kerby/KrbIdentitySerializer.java
@@ -19,12 +19,6 @@
  */
 package org.apache.kerby;
 
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.nio.ByteBuffer;
-import java.util.Comparator;
-import java.util.Map;
-
 import org.apache.directory.mavibot.btree.serializer.BufferHandler;
 import org.apache.directory.mavibot.btree.serializer.ElementSerializer;
 import org.apache.directory.mavibot.btree.serializer.IntSerializer;
@@ -35,6 +29,12 @@ import org.apache.kerby.kerberos.kerb.spec.KerberosTime;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionKey;
 import org.apache.kerby.kerberos.kerb.spec.base.EncryptionType;
 
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.util.Comparator;
+import java.util.Map;
+
 /**
  * Serializer for KrbIdentity.
  *
@@ -64,11 +64,11 @@ public class KrbIdentitySerializer implements ElementSerializer<KrbIdentity> {
             // mask for disabled and lock flags
             byte mask = 0;
             
-            if(entry.isDisabled()) {
+            if (entry.isDisabled()) {
                 mask |= 1 << 1;
             }
 
-            if(entry.isLocked()) {
+            if (entry.isLocked()) {
                 mask |= 1 << 2;
             }
             
@@ -84,7 +84,7 @@ public class KrbIdentitySerializer implements ElementSerializer<KrbIdentity> {
             // num keys
             out.write(IntSerializer.serialize(keys.size()));
             
-            for(EncryptionKey ek : keys.values()) {
+            for (EncryptionKey ek : keys.values()) {
                 int type = ek.getKeyType().getValue();
                 out.write(IntSerializer.serialize(type));
                 byte[] data = ek.getKeyData();
@@ -93,8 +93,7 @@ public class KrbIdentitySerializer implements ElementSerializer<KrbIdentity> {
             }
             
             return out.toByteArray();
-        }
-        catch(Exception e) {
+        } catch (Exception e) {
             throw new IllegalStateException("Failed to serialize the identity " + entry);
         }
     }
@@ -121,11 +120,11 @@ public class KrbIdentitySerializer implements ElementSerializer<KrbIdentity> {
         
         byte mask = buffer.get();
         
-        if((mask & 2) != 0) {
+        if ((mask & 2) != 0) {
             id.setDisabled(true);
         }
         
-        if((mask & 4) != 0) {
+        if ((mask & 4) != 0) {
             id.setLocked(true);
         }
         
@@ -137,7 +136,7 @@ public class KrbIdentitySerializer implements ElementSerializer<KrbIdentity> {
 
         int numKeys = IntSerializer.INSTANCE.deserialize(buffer);
         
-        for(int i=0; i<numKeys; i++) {
+        for (int i = 0; i < numKeys; i++) {
             int keyType = IntSerializer.INSTANCE.deserialize(buffer);
             int keyLen = IntSerializer.INSTANCE.deserialize(buffer);
             
@@ -178,5 +177,4 @@ public class KrbIdentitySerializer implements ElementSerializer<KrbIdentity> {
     public Class<?> getType() {
         return KrbIdentity.class;
     }
-
 }


Mime
View raw message