directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject [3/5] directory-kerby git commit: Get rid of MyEnum in all the kerb-core classes, and a few in pkix.
Date Thu, 24 Dec 2015 12:49:00 GMT
Get rid of MyEnum in all the kerb-core classes, and a few in pkix.

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

Branch: refs/heads/master
Commit: 6385f83bd089b1dfe5b24365f3e4d2128c67b508
Parents: 2bb3a58
Author: Emmanuel L├ęcharny <elecharny@symas.com>
Authored: Thu Dec 24 13:47:10 2015 +0100
Committer: Emmanuel L├ęcharny <elecharny@symas.com>
Committed: Thu Dec 24 13:47:10 2015 +0100

----------------------------------------------------------------------
 .../org/apache/kerby/asn1/PersonnelRecord.java  | 76 +++++++++---------
 .../kerby/kerberos/kerb/type/ad/AdToken.java    | 10 +--
 .../kerb/type/ad/AuthorizationDataEntry.java    | 16 ++--
 .../kerby/kerberos/kerb/type/ap/ApRep.java      | 14 ++--
 .../kerby/kerberos/kerb/type/ap/ApReq.java      | 26 +++---
 .../kerberos/kerb/type/ap/Authenticator.java    | 58 +++++++-------
 .../kerberos/kerb/type/ap/EncAPRepPart.java     | 28 +++----
 .../kerby/kerberos/kerb/type/base/CheckSum.java | 20 +++--
 .../kerberos/kerb/type/base/EncryptedData.java  | 26 +++---
 .../kerberos/kerb/type/base/EncryptionKey.java  | 20 +++--
 .../kerb/type/base/EtypeInfo2Entry.java         | 22 +++--
 .../kerberos/kerb/type/base/EtypeInfoEntry.java | 16 ++--
 .../kerberos/kerb/type/base/HostAddress.java    | 22 +++--
 .../kerby/kerberos/kerb/type/base/KrbError.java | 74 +++++++++--------
 .../kerberos/kerb/type/base/KrbMessage.java     | 10 +--
 .../kerby/kerberos/kerb/type/base/KrbToken.java | 24 +++---
 .../kerberos/kerb/type/base/LastReqEntry.java   | 16 ++--
 .../kerberos/kerb/type/base/PrincipalName.java  | 24 +++---
 .../kerb/type/base/TransitedEncoding.java       | 16 ++--
 .../kerberos/kerb/type/fast/KrbFastArmor.java   | 16 ++--
 .../kerb/type/fast/KrbFastArmoredRep.java       | 10 +--
 .../kerb/type/fast/KrbFastArmoredReq.java       | 22 +++--
 .../kerb/type/fast/KrbFastFinished.java         | 22 +++--
 .../kerberos/kerb/type/fast/KrbFastReq.java     | 22 +++--
 .../kerb/type/fast/KrbFastResponse.java         | 28 +++----
 .../kerberos/kerb/type/fast/PaAuthnEntry.java   | 22 +++--
 .../kerberos/kerb/type/fast/PaFxFastReply.java  | 10 +--
 .../kerb/type/fast/PaFxFastRequest.java         | 10 +--
 .../kerberos/kerb/type/kdc/EncKdcRepPart.java   | 76 +++++++++---------
 .../kerby/kerberos/kerb/type/kdc/KdcRep.java    | 38 +++++----
 .../kerby/kerberos/kerb/type/kdc/KdcReq.java    | 20 +++--
 .../kerberos/kerb/type/kdc/KdcReqBody.java      | 84 ++++++++++----------
 .../kerb/type/pa/PaAuthenticationSetElem.java   | 22 +++--
 .../kerberos/kerb/type/pa/PaDataEntry.java      | 16 ++--
 .../kerby/kerberos/kerb/type/pa/PaEncTsEnc.java | 16 ++--
 .../kerberos/kerb/type/pa/otp/OtpTokenInfo.java | 21 +++--
 .../kerb/type/pa/otp/PaOtpChallenge.java        | 14 ++--
 .../kerberos/kerb/type/pa/pkinit/AuthPack.java  | 34 ++++----
 .../kerberos/kerb/type/pa/pkinit/DHRepInfo.java | 22 +++--
 .../pa/pkinit/ExternalPrincipalIdentifier.java  | 22 +++--
 .../kerb/type/pa/pkinit/KdcDHKeyInfo.java       | 22 +++--
 .../kerb/type/pa/pkinit/Krb5PrincipalName.java  | 16 ++--
 .../kerberos/kerb/type/pa/pkinit/PaPkAsRep.java | 16 ++--
 .../kerberos/kerb/type/pa/pkinit/PaPkAsReq.java | 22 +++--
 .../kerb/type/pa/pkinit/PkAuthenticator.java    | 28 +++----
 .../kerb/type/pa/pkinit/ReplyKeyPack.java       | 16 ++--
 .../kerb/type/pa/token/PaTokenChallenge.java    |  6 +-
 .../kerb/type/pa/token/PaTokenRequest.java      | 17 ++--
 .../kerberos/kerb/type/pa/token/TokenInfo.java  | 16 ++--
 .../kerb/type/ticket/EncTicketPart.java         | 70 ++++++++--------
 .../kerby/kerberos/kerb/type/ticket/Ticket.java | 28 +++----
 .../kerby/x500/type/AttributeTypeAndValue.java  | 16 ++--
 .../java/org/apache/kerby/x500/type/Name.java   | 10 +--
 53 files changed, 620 insertions(+), 728 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/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 a518a9c..f5c287a 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
@@ -27,16 +27,12 @@ import org.apache.kerby.asn1.type.Asn1TaggingSequence;
 import org.apache.kerby.asn1.type.Asn1TaggingSet;
 import org.apache.kerby.asn1.type.Asn1VisibleString;
 
-import static org.apache.kerby.asn1.PersonnelRecord.ChildInformation.MyEnum.*;
-import static org.apache.kerby.asn1.PersonnelRecord.MyEnum.*;
-import static org.apache.kerby.asn1.PersonnelRecord.Name.MyEnum.*;
-
 /**
  * Ref. X.690-0207(http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf),
  * Annex A, A.1 ASN.1 description of the record structure
  */
 public class PersonnelRecord extends Asn1TaggingSet {
-    protected enum MyEnum implements EnumType {
+    protected enum PersonnelRecordField implements EnumType {
         NAME,
         TITLE,
         NUMBER,
@@ -56,12 +52,12 @@ public class PersonnelRecord extends Asn1TaggingSet {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(NAME, -1, Name.class),
-            new ExplicitField(TITLE, 0, Asn1VisibleString.class),
-            new ExplicitField(NUMBER, -1, EmployeeNumber.class),
-            new ExplicitField(DATE_OF_HIRE, 1, Date.class),
-            new ExplicitField(NAME_OF_SPOUSE, 2, Name.class),
-            new ImplicitField(CHILDREN, 3, Children.class)
+            new ExplicitField(PersonnelRecordField.NAME, -1, Name.class),
+            new ExplicitField(PersonnelRecordField.TITLE, 0, Asn1VisibleString.class),
+            new ExplicitField(PersonnelRecordField.NUMBER, -1, EmployeeNumber.class),
+            new ExplicitField(PersonnelRecordField.DATE_OF_HIRE, 1, Date.class),
+            new ExplicitField(PersonnelRecordField.NAME_OF_SPOUSE, 2, Name.class),
+            new ImplicitField(PersonnelRecordField.CHILDREN, 3, Children.class)
     };
 
     public PersonnelRecord() {
@@ -69,51 +65,51 @@ public class PersonnelRecord extends Asn1TaggingSet {
     }
 
     public void setName(Name name) {
-        setFieldAs(NAME, name);
+        setFieldAs(PersonnelRecordField.NAME, name);
     }
 
     public Name getName() {
-        return getFieldAs(NAME, Name.class);
+        return getFieldAs(PersonnelRecordField.NAME, Name.class);
     }
 
     public void setTitle(String title) {
-        setFieldAs(TITLE, new Asn1VisibleString(title));
+        setFieldAs(PersonnelRecordField.TITLE, new Asn1VisibleString(title));
     }
 
     public String getTitle() {
-        return getFieldAsString(TITLE);
+        return getFieldAsString(PersonnelRecordField.TITLE);
     }
 
     public void setEmployeeNumber(EmployeeNumber employeeNumber) {
-        setFieldAs(NUMBER, employeeNumber);
+        setFieldAs(PersonnelRecordField.NUMBER, employeeNumber);
     }
 
     public EmployeeNumber getEmployeeNumber() {
-        return getFieldAs(NUMBER, EmployeeNumber.class);
+        return getFieldAs(PersonnelRecordField.NUMBER, EmployeeNumber.class);
     }
 
     public void setDateOfHire(Date dateOfHire) {
-        setFieldAs(DATE_OF_HIRE, dateOfHire);
+        setFieldAs(PersonnelRecordField.DATE_OF_HIRE, dateOfHire);
     }
 
     public Date getDateOfHire() {
-        return getFieldAs(DATE_OF_HIRE, Date.class);
+        return getFieldAs(PersonnelRecordField.DATE_OF_HIRE, Date.class);
     }
 
     public void setNameOfSpouse(Name spouse) {
-        setFieldAs(NAME_OF_SPOUSE, spouse);
+        setFieldAs(PersonnelRecordField.NAME_OF_SPOUSE, spouse);
     }
 
     public Name getNameOfSpouse() {
-        return getFieldAs(NAME_OF_SPOUSE, Name.class);
+        return getFieldAs(PersonnelRecordField.NAME_OF_SPOUSE, Name.class);
     }
 
     public void setChildren(Children children) {
-        setFieldAs(CHILDREN, children);
+        setFieldAs(PersonnelRecordField.CHILDREN, children);
     }
 
     public Children getChildren() {
-        return getFieldAs(CHILDREN, Children.class);
+        return getFieldAs(PersonnelRecordField.CHILDREN, Children.class);
     }
 
     public static class Children extends Asn1SequenceOf<ChildInformation> {
@@ -130,7 +126,7 @@ public class PersonnelRecord extends Asn1TaggingSet {
     }
 
     public static class ChildInformation extends Asn1SetType {
-        protected enum MyEnum implements EnumType {
+        protected enum ChildInformationField implements EnumType {
             CHILD_NAME,
             DATE_OF_BIRTH;
 
@@ -146,8 +142,8 @@ public class PersonnelRecord extends Asn1TaggingSet {
         }
 
         static Asn1FieldInfo[] tags = new Asn1FieldInfo[] {
-                new ExplicitField(CHILD_NAME, -1, Name.class),
-                new ExplicitField(DATE_OF_BIRTH, 0, Date.class)
+                new ExplicitField(ChildInformationField.CHILD_NAME, -1, Name.class),
+                new ExplicitField(ChildInformationField.DATE_OF_BIRTH, 0, Date.class)
         };
 
         public ChildInformation() {
@@ -155,25 +151,25 @@ public class PersonnelRecord extends Asn1TaggingSet {
         }
 
         public void setName(Name name) {
-            setFieldAs(CHILD_NAME, name);
+            setFieldAs(ChildInformationField.CHILD_NAME, name);
         }
 
         public Name getName() {
-            return getFieldAs(CHILD_NAME, Name.class);
+            return getFieldAs(ChildInformationField.CHILD_NAME, Name.class);
         }
 
         public void setDateOfBirth(Date date) {
-            setFieldAs(DATE_OF_BIRTH, date);
+            setFieldAs(ChildInformationField.DATE_OF_BIRTH, date);
         }
 
         public Date getDateOfBirth() {
-            return getFieldAs(DATE_OF_BIRTH, Date.class);
+            return getFieldAs(ChildInformationField.DATE_OF_BIRTH, Date.class);
         }
     }
 
     public static class Name extends Asn1TaggingSequence {
 
-        protected enum MyEnum implements EnumType {
+        protected enum NameField implements EnumType {
             GIVENNAME,
             INITIAL,
             FAMILYNAME;
@@ -190,9 +186,9 @@ public class PersonnelRecord extends Asn1TaggingSet {
         }
 
         static Asn1FieldInfo[] tags = new Asn1FieldInfo[] {
-                new ExplicitField(GIVENNAME, -1, Asn1VisibleString.class),
-                new ExplicitField(INITIAL, -1, Asn1VisibleString.class),
-                new ExplicitField(FAMILYNAME, -1, Asn1VisibleString.class)
+                new ExplicitField(NameField.GIVENNAME, -1, Asn1VisibleString.class),
+                new ExplicitField(NameField.INITIAL, -1, Asn1VisibleString.class),
+                new ExplicitField(NameField.FAMILYNAME, -1, Asn1VisibleString.class)
         };
 
         public Name() {
@@ -207,27 +203,27 @@ public class PersonnelRecord extends Asn1TaggingSet {
         }
 
         public void setGivenName(String givenName) {
-            setFieldAs(GIVENNAME, new Asn1VisibleString(givenName));
+            setFieldAs(NameField.GIVENNAME, new Asn1VisibleString(givenName));
         }
 
         public String getGivenName() {
-            return getFieldAsString(GIVENNAME);
+            return getFieldAsString(NameField.GIVENNAME);
         }
 
         public void setInitial(String initial) {
-            setFieldAs(INITIAL, new Asn1VisibleString(initial));
+            setFieldAs(NameField.INITIAL, new Asn1VisibleString(initial));
         }
 
         public String getInitial() {
-            return getFieldAsString(INITIAL);
+            return getFieldAsString(NameField.INITIAL);
         }
 
         public void setFamilyName(String familyName) {
-            setFieldAs(FAMILYNAME, new Asn1VisibleString(familyName));
+            setFieldAs(NameField.FAMILYNAME, new Asn1VisibleString(familyName));
         }
 
         public String getFamilyName() {
-            return getFieldAsString(FAMILYNAME);
+            return getFieldAsString(NameField.FAMILYNAME);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AdToken.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AdToken.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AdToken.java
index fb8973d..dbd7ff5 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AdToken.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AdToken.java
@@ -25,15 +25,13 @@ import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.KrbToken;
 
-import static org.apache.kerby.kerberos.kerb.type.ad.AdToken.MyEnum.*;
-
 /**
  AD-TOKEN ::= SEQUENCE {
     token     [0]  OCTET STRING,
  }
 */
 public class AdToken extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum AdTokenField implements EnumType {
         TOKEN;
 
         @Override
@@ -48,7 +46,7 @@ public class AdToken extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(TOKEN, KrbToken.class)
+            new ExplicitField(AdTokenField.TOKEN, KrbToken.class)
     };
 
     public AdToken() {
@@ -56,11 +54,11 @@ public class AdToken extends KrbSequenceType {
     }
 
     public KrbToken getToken() {
-        return getFieldAs(TOKEN, KrbToken.class);
+        return getFieldAs(AdTokenField.TOKEN, KrbToken.class);
     }
 
     public void setToken(KrbToken token) {
-        setFieldAs(TOKEN, token);
+        setFieldAs(AdTokenField.TOKEN, token);
     }
 
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AuthorizationDataEntry.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AuthorizationDataEntry.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AuthorizationDataEntry.java
index a4b7f4e..8a1cfb3 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AuthorizationDataEntry.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ad/AuthorizationDataEntry.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.ad.AuthorizationDataEntry.MyEnum.*;
-
 /**
  AuthorizationData       ::= SEQUENCE OF SEQUENCE {
  ad-type         [0] Int32,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.ad.AuthorizationDataEntry.MyEn
  }
  */
 public class AuthorizationDataEntry extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum AuthorizationDataEntryField implements EnumType {
         AD_TYPE,
         AD_DATA;
 
@@ -51,8 +49,8 @@ public class AuthorizationDataEntry extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(AD_TYPE, 0, Asn1Integer.class),
-            new ExplicitField(AD_DATA, 1, Asn1OctetString.class)
+            new ExplicitField(AuthorizationDataEntryField.AD_TYPE, Asn1Integer.class),
+            new ExplicitField(AuthorizationDataEntryField.AD_DATA, Asn1OctetString.class)
     };
 
     public AuthorizationDataEntry() {
@@ -60,19 +58,19 @@ public class AuthorizationDataEntry extends KrbSequenceType {
     }
 
     public AuthorizationType getAuthzType() {
-        Integer value = getFieldAsInteger(AD_TYPE);
+        Integer value = getFieldAsInteger(AuthorizationDataEntryField.AD_TYPE);
         return AuthorizationType.fromValue(value);
     }
 
     public void setAuthzType(AuthorizationType authzType) {
-        setFieldAsInt(AD_TYPE, authzType.getValue());
+        setFieldAsInt(AuthorizationDataEntryField.AD_TYPE, authzType.getValue());
     }
 
     public byte[] getAuthzData() {
-        return getFieldAsOctets(AD_DATA);
+        return getFieldAsOctets(AuthorizationDataEntryField.AD_DATA);
     }
 
     public void setAuthzData(byte[] authzData) {
-        setFieldAsOctets(AD_DATA, authzData);
+        setFieldAsOctets(AuthorizationDataEntryField.AD_DATA, authzData);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApRep.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApRep.java
index 3094ce9..9d9728e 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApRep.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApRep.java
@@ -27,8 +27,6 @@ import org.apache.kerby.kerberos.kerb.type.base.EncryptedData;
 import org.apache.kerby.kerberos.kerb.type.base.KrbMessage;
 import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
 
-import static org.apache.kerby.kerberos.kerb.type.ap.ApRep.MyEnum.*;
-
 /**
  AP-REP          ::= [APPLICATION 15] SEQUENCE {
  pvno            [0] INTEGER (5),
@@ -37,7 +35,7 @@ import static org.apache.kerby.kerberos.kerb.type.ap.ApRep.MyEnum.*;
  }
  */
 public class ApRep extends KrbMessage {
-    protected enum MyEnum implements EnumType {
+    protected enum ApRepField implements EnumType {
         PVNO,
         MSG_TYPE,
         ENC_PART;
@@ -54,9 +52,9 @@ public class ApRep extends KrbMessage {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PVNO, 0, Asn1Integer.class),
-            new ExplicitField(MSG_TYPE, 1, Asn1Integer.class),
-            new ExplicitField(ENC_PART, 2, EncryptedData.class)
+            new ExplicitField(ApRepField.PVNO, Asn1Integer.class),
+            new ExplicitField(ApRepField.MSG_TYPE, Asn1Integer.class),
+            new ExplicitField(ApRepField.ENC_PART, EncryptedData.class)
     };
 
     public ApRep() {
@@ -74,10 +72,10 @@ public class ApRep extends KrbMessage {
     }
 
     public EncryptedData getEncryptedEncPart() {
-        return getFieldAs(ENC_PART, EncryptedData.class);
+        return getFieldAs(ApRepField.ENC_PART, EncryptedData.class);
     }
 
     public void setEncryptedEncPart(EncryptedData encryptedEncPart) {
-        setFieldAs(ENC_PART, encryptedEncPart);
+        setFieldAs(ApRepField.ENC_PART, encryptedEncPart);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApReq.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApReq.java
index a977720..df31e9a 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApReq.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/ApReq.java
@@ -28,8 +28,6 @@ import org.apache.kerby.kerberos.kerb.type.base.KrbMessage;
 import org.apache.kerby.kerberos.kerb.type.base.KrbMessageType;
 import org.apache.kerby.kerberos.kerb.type.ticket.Ticket;
 
-import static org.apache.kerby.kerberos.kerb.type.ap.ApReq.MyEnum.*;
-
 /**
  AP-REQ          ::= [APPLICATION 14] SEQUENCE {
  pvno            [0] INTEGER (5),
@@ -40,7 +38,7 @@ import static org.apache.kerby.kerberos.kerb.type.ap.ApReq.MyEnum.*;
  }
  */
 public class ApReq extends KrbMessage {
-    protected enum MyEnum implements EnumType {
+    protected enum ApReqField implements EnumType {
         PVNO,
         MSG_TYPE,
         AP_OPTIONS,
@@ -59,11 +57,11 @@ public class ApReq extends KrbMessage {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PVNO, Asn1Integer.class),
-            new ExplicitField(MSG_TYPE, Asn1Integer.class),
-            new ExplicitField(AP_OPTIONS, ApOptions.class),
-            new ExplicitField(TICKET, Ticket.class),
-            new ExplicitField(AUTHENTICATOR, EncryptedData.class)
+            new ExplicitField(ApReqField.PVNO, Asn1Integer.class),
+            new ExplicitField(ApReqField.MSG_TYPE, Asn1Integer.class),
+            new ExplicitField(ApReqField.AP_OPTIONS, ApOptions.class),
+            new ExplicitField(ApReqField.TICKET, Ticket.class),
+            new ExplicitField(ApReqField.AUTHENTICATOR, EncryptedData.class)
     };
 
     private Authenticator authenticator;
@@ -73,19 +71,19 @@ public class ApReq extends KrbMessage {
     }
 
     public ApOptions getApOptions() {
-        return getFieldAs(AP_OPTIONS, ApOptions.class);
+        return getFieldAs(ApReqField.AP_OPTIONS, ApOptions.class);
     }
 
     public void setApOptions(ApOptions apOptions) {
-        setFieldAs(AP_OPTIONS, apOptions);
+        setFieldAs(ApReqField.AP_OPTIONS, apOptions);
     }
 
     public Ticket getTicket() {
-        return getFieldAs(TICKET, Ticket.class);
+        return getFieldAs(ApReqField.TICKET, Ticket.class);
     }
 
     public void setTicket(Ticket ticket) {
-        setFieldAs(TICKET, ticket);
+        setFieldAs(ApReqField.TICKET, ticket);
     }
 
     public Authenticator getAuthenticator() {
@@ -97,11 +95,11 @@ public class ApReq extends KrbMessage {
     }
 
     public EncryptedData getEncryptedAuthenticator() {
-        return getFieldAs(AUTHENTICATOR, EncryptedData.class);
+        return getFieldAs(ApReqField.AUTHENTICATOR, EncryptedData.class);
     }
 
     public void setEncryptedAuthenticator(EncryptedData encryptedAuthenticator) {
-        setFieldAs(AUTHENTICATOR, encryptedAuthenticator);
+        setFieldAs(ApReqField.AUTHENTICATOR, encryptedAuthenticator);
     }
 }
 

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
index 907c94c..19b1ff2 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/Authenticator.java
@@ -31,8 +31,6 @@ import org.apache.kerby.kerberos.kerb.type.base.CheckSum;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptionKey;
 import org.apache.kerby.kerberos.kerb.type.base.PrincipalName;
 
-import static org.apache.kerby.kerberos.kerb.type.ap.Authenticator.MyEnum.*;
-
 /**
  Authenticator   ::= [APPLICATION 2] SEQUENCE  {
  authenticator-vno       [0] INTEGER (5),
@@ -49,7 +47,7 @@ import static org.apache.kerby.kerberos.kerb.type.ap.Authenticator.MyEnum.*;
 public class Authenticator extends KrbAppSequenceType {
     public static final int TAG = 2;
 
-    protected enum MyEnum implements EnumType {
+    protected enum AuthenticatorField implements EnumType {
         AUTHENTICATOR_VNO,
         CREALM,
         CNAME,
@@ -72,15 +70,15 @@ public class Authenticator extends KrbAppSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(AUTHENTICATOR_VNO, 0, Asn1Integer.class),
-            new ExplicitField(CREALM, 1, KerberosString.class),
-            new ExplicitField(CNAME, 2, PrincipalName.class),
-            new ExplicitField(CKSUM, 3, CheckSum.class),
-            new ExplicitField(CUSEC, 4, Asn1Integer.class),
-            new ExplicitField(CTIME, 5, KerberosTime.class),
-            new ExplicitField(SUBKEY, 6, EncryptionKey.class),
-            new ExplicitField(SEQ_NUMBER, 7, Asn1Integer.class),
-            new ExplicitField(AUTHORIZATION_DATA, 8, AuthorizationData.class)
+            new ExplicitField(AuthenticatorField.AUTHENTICATOR_VNO, Asn1Integer.class),
+            new ExplicitField(AuthenticatorField.CREALM, KerberosString.class),
+            new ExplicitField(AuthenticatorField.CNAME, PrincipalName.class),
+            new ExplicitField(AuthenticatorField.CKSUM, CheckSum.class),
+            new ExplicitField(AuthenticatorField.CUSEC, Asn1Integer.class),
+            new ExplicitField(AuthenticatorField.CTIME, KerberosTime.class),
+            new ExplicitField(AuthenticatorField.SUBKEY, EncryptionKey.class),
+            new ExplicitField(AuthenticatorField.SEQ_NUMBER, Asn1Integer.class),
+            new ExplicitField(AuthenticatorField.AUTHORIZATION_DATA, AuthorizationData.class)
     };
 
     public Authenticator() {
@@ -88,74 +86,74 @@ public class Authenticator extends KrbAppSequenceType {
     }
 
     public int getAuthenticatorVno() {
-        return getFieldAsInt(AUTHENTICATOR_VNO);
+        return getFieldAsInt(AuthenticatorField.AUTHENTICATOR_VNO);
     }
 
     public void setAuthenticatorVno(int authenticatorVno) {
-        setFieldAsInt(AUTHENTICATOR_VNO, authenticatorVno);
+        setFieldAsInt(AuthenticatorField.AUTHENTICATOR_VNO, authenticatorVno);
     }
 
     public String getCrealm() {
-        return getFieldAsString(CREALM);
+        return getFieldAsString(AuthenticatorField.CREALM);
     }
 
     public void setCrealm(String crealm) {
-        setFieldAsString(CREALM, crealm);
+        setFieldAsString(AuthenticatorField.CREALM, crealm);
     }
 
     public PrincipalName getCname() {
-        return getFieldAs(CNAME, PrincipalName.class);
+        return getFieldAs(AuthenticatorField.CNAME, PrincipalName.class);
     }
 
     public void setCname(PrincipalName cname) {
-        setFieldAs(CNAME, cname);
+        setFieldAs(AuthenticatorField.CNAME, cname);
     }
 
     public CheckSum getCksum() {
-        return getFieldAs(CKSUM, CheckSum.class);
+        return getFieldAs(AuthenticatorField.CKSUM, CheckSum.class);
     }
 
     public void setCksum(CheckSum cksum) {
-        setFieldAs(CKSUM, cksum);
+        setFieldAs(AuthenticatorField.CKSUM, cksum);
     }
 
     public int getCusec() {
-        return getFieldAsInt(CUSEC);
+        return getFieldAsInt(AuthenticatorField.CUSEC);
     }
 
     public void setCusec(int cusec) {
-        setFieldAsInt(CUSEC, cusec);
+        setFieldAsInt(AuthenticatorField.CUSEC, cusec);
     }
 
     public KerberosTime getCtime() {
-        return getFieldAsTime(CTIME);
+        return getFieldAsTime(AuthenticatorField.CTIME);
     }
 
     public void setCtime(KerberosTime ctime) {
-        setFieldAs(CTIME, ctime);
+        setFieldAs(AuthenticatorField.CTIME, ctime);
     }
 
     public EncryptionKey getSubKey() {
-        return getFieldAs(SUBKEY, EncryptionKey.class);
+        return getFieldAs(AuthenticatorField.SUBKEY, EncryptionKey.class);
     }
 
     public void setSubKey(EncryptionKey subKey) {
-        setFieldAs(SUBKEY, subKey);
+        setFieldAs(AuthenticatorField.SUBKEY, subKey);
     }
 
     public int getSeqNumber() {
-        return getFieldAsInt(SEQ_NUMBER);
+        return getFieldAsInt(AuthenticatorField.SEQ_NUMBER);
     }
 
     public void setSeqNumber(Integer seqNumber) {
-        setFieldAsInt(SEQ_NUMBER, seqNumber);
+        setFieldAsInt(AuthenticatorField.SEQ_NUMBER, seqNumber);
     }
 
     public AuthorizationData getAuthorizationData() {
-        return getFieldAs(AUTHORIZATION_DATA, AuthorizationData.class);
+        return getFieldAs(AuthenticatorField.AUTHORIZATION_DATA, AuthorizationData.class);
     }
 
     public void setAuthorizationData(AuthorizationData authorizationData) {
-        setFieldAs(AUTHORIZATION_DATA, authorizationData);
+        setFieldAs(AuthenticatorField.AUTHORIZATION_DATA, authorizationData);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/EncAPRepPart.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/EncAPRepPart.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/EncAPRepPart.java
index 2c26726..f3c518d 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/EncAPRepPart.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/ap/EncAPRepPart.java
@@ -27,8 +27,6 @@ import org.apache.kerby.kerberos.kerb.type.KerberosTime;
 import org.apache.kerby.kerberos.kerb.type.KrbAppSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptionKey;
 
-import static org.apache.kerby.kerberos.kerb.type.ap.EncAPRepPart.MyEnum.*;
-
 /**
  EncAPRepPart    ::= [APPLICATION 27] SEQUENCE {
  ctime           [0] KerberosTime,
@@ -40,7 +38,7 @@ import static org.apache.kerby.kerberos.kerb.type.ap.EncAPRepPart.MyEnum.*;
 public class EncAPRepPart extends KrbAppSequenceType {
     public static final int TAG = 27;
 
-    protected enum MyEnum implements EnumType {
+    protected enum EncAPRepPartField implements EnumType {
         CTIME,
         CUSEC,
         SUBKEY,
@@ -58,10 +56,10 @@ public class EncAPRepPart extends KrbAppSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(CTIME, 0, KerberosTime.class),
-            new ExplicitField(CUSEC, 1, Asn1Integer.class),
-            new ExplicitField(SUBKEY, 2, EncryptionKey.class),
-            new ExplicitField(SEQ_NUMBER, 3, Asn1Integer.class)
+            new ExplicitField(EncAPRepPartField.CTIME, KerberosTime.class),
+            new ExplicitField(EncAPRepPartField.CUSEC, Asn1Integer.class),
+            new ExplicitField(EncAPRepPartField.SUBKEY, EncryptionKey.class),
+            new ExplicitField(EncAPRepPartField.SEQ_NUMBER, Asn1Integer.class)
     };
 
     public EncAPRepPart() {
@@ -69,34 +67,34 @@ public class EncAPRepPart extends KrbAppSequenceType {
     }
 
     public KerberosTime getCtime() {
-        return getFieldAsTime(CTIME);
+        return getFieldAsTime(EncAPRepPartField.CTIME);
     }
 
     public void setCtime(KerberosTime ctime) {
-        setFieldAs(CTIME, ctime);
+        setFieldAs(EncAPRepPartField.CTIME, ctime);
     }
 
     public int getCusec() {
-        return getFieldAsInt(CUSEC);
+        return getFieldAsInt(EncAPRepPartField.CUSEC);
     }
 
     public void setCusec(int cusec) {
-        setFieldAsInt(CUSEC, cusec);
+        setFieldAsInt(EncAPRepPartField.CUSEC, cusec);
     }
 
     public EncryptionKey getSubkey() {
-        return getFieldAs(SUBKEY, EncryptionKey.class);
+        return getFieldAs(EncAPRepPartField.SUBKEY, EncryptionKey.class);
     }
 
     public void setSubkey(EncryptionKey subkey) {
-        setFieldAs(SUBKEY, subkey);
+        setFieldAs(EncAPRepPartField.SUBKEY, subkey);
     }
 
     public int getSeqNumber() {
-        return getFieldAsInt(SEQ_NUMBER);
+        return getFieldAsInt(EncAPRepPartField.SEQ_NUMBER);
     }
 
     public void setSeqNumber(Integer seqNumber) {
-        setFieldAsInt(SEQ_NUMBER, seqNumber);
+        setFieldAsInt(EncAPRepPartField.SEQ_NUMBER, seqNumber);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/CheckSum.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/CheckSum.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/CheckSum.java
index 3399f0b..c46e206 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/CheckSum.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/CheckSum.java
@@ -19,6 +19,8 @@
  */
 package org.apache.kerby.kerberos.kerb.type.base;
 
+import java.util.Arrays;
+
 import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
@@ -26,10 +28,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import java.util.Arrays;
-
-import static org.apache.kerby.kerberos.kerb.type.base.CheckSum.MyEnum.*;
-
 /**
  Checksum        ::= SEQUENCE {
  cksumtype       [0] Int32,
@@ -37,7 +35,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.CheckSum.MyEnum.*;
  }
  */
 public class CheckSum extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum CheckSumField implements EnumType {
         CKSUM_TYPE,
         CHECK_SUM;
 
@@ -53,8 +51,8 @@ public class CheckSum extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-        new ExplicitField(CKSUM_TYPE, 0, Asn1Integer.class),
-        new ExplicitField(CHECK_SUM, 1, Asn1OctetString.class)
+        new ExplicitField(CheckSumField.CKSUM_TYPE, Asn1Integer.class),
+        new ExplicitField(CheckSumField.CHECK_SUM, Asn1OctetString.class)
     };
 
     public CheckSum() {
@@ -73,20 +71,20 @@ public class CheckSum extends KrbSequenceType {
     }
 
     public CheckSumType getCksumtype() {
-        Integer value = getFieldAsInteger(CKSUM_TYPE);
+        Integer value = getFieldAsInteger(CheckSumField.CKSUM_TYPE);
         return CheckSumType.fromValue(value);
     }
 
     public void setCksumtype(CheckSumType cksumtype) {
-        setFieldAsInt(CKSUM_TYPE, cksumtype.getValue());
+        setFieldAsInt(CheckSumField.CKSUM_TYPE, cksumtype.getValue());
     }
 
     public byte[] getChecksum() {
-        return getFieldAsOctets(CHECK_SUM);
+        return getFieldAsOctets(CheckSumField.CHECK_SUM);
     }
 
     public void setChecksum(byte[] checksum) {
-        setFieldAsOctets(CHECK_SUM, checksum);
+        setFieldAsOctets(CheckSumField.CHECK_SUM, checksum);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptedData.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptedData.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptedData.java
index d184ee2..b10dae3 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptedData.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptedData.java
@@ -19,6 +19,8 @@
  */
 package org.apache.kerby.kerberos.kerb.type.base;
 
+import java.util.Arrays;
+
 import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
@@ -26,10 +28,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import java.util.Arrays;
-
-import static org.apache.kerby.kerberos.kerb.type.base.EncryptedData.MyEnum.*;
-
 /**
  EncryptedData   ::= SEQUENCE {
  etype   [0] Int32 -- EncryptionType --,
@@ -38,7 +36,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.EncryptedData.MyEnum.*;
  }
  */
 public class EncryptedData extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum EncryptedDataField implements EnumType {
         ETYPE,
         KVNO,
         CIPHER;
@@ -55,9 +53,9 @@ public class EncryptedData extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ETYPE, 0, Asn1Integer.class),
-            new ExplicitField(KVNO, 1, Asn1Integer.class),
-            new ExplicitField(CIPHER, 2, Asn1OctetString.class)
+            new ExplicitField(EncryptedDataField.ETYPE, Asn1Integer.class),
+            new ExplicitField(EncryptedDataField.KVNO, Asn1Integer.class),
+            new ExplicitField(EncryptedDataField.CIPHER, Asn1OctetString.class)
     };
 
     public EncryptedData() {
@@ -65,16 +63,16 @@ public class EncryptedData extends KrbSequenceType {
     }
 
     public EncryptionType getEType() {
-        Integer value = getFieldAsInteger(ETYPE);
+        Integer value = getFieldAsInteger(EncryptedDataField.ETYPE);
         return EncryptionType.fromValue(value);
     }
 
     public void setEType(EncryptionType eType) {
-        setFieldAsInt(ETYPE, eType.getValue());
+        setFieldAsInt(EncryptedDataField.ETYPE, eType.getValue());
     }
 
     public int getKvno() {
-        Integer value = getFieldAsInteger(KVNO);
+        Integer value = getFieldAsInteger(EncryptedDataField.KVNO);
         if (value != null) {
             return value.intValue();
         }
@@ -82,15 +80,15 @@ public class EncryptedData extends KrbSequenceType {
     }
 
     public void setKvno(int kvno) {
-        setFieldAsInt(KVNO, kvno);
+        setFieldAsInt(EncryptedDataField.KVNO, kvno);
     }
 
     public byte[] getCipher() {
-        return getFieldAsOctets(CIPHER);
+        return getFieldAsOctets(EncryptedDataField.CIPHER);
     }
 
     public void setCipher(byte[] cipher) {
-        setFieldAsOctets(CIPHER, cipher);
+        setFieldAsOctets(EncryptedDataField.CIPHER, cipher);
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptionKey.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptionKey.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptionKey.java
index fab1db0..be0e104 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptionKey.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EncryptionKey.java
@@ -19,6 +19,8 @@
  */
 package org.apache.kerby.kerberos.kerb.type.base;
 
+import java.util.Arrays;
+
 import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
@@ -26,10 +28,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import java.util.Arrays;
-
-import static org.apache.kerby.kerberos.kerb.type.base.EncryptionKey.MyEnum.*;
-
 /**
  EncryptionKey   ::= SEQUENCE {
  keytype         [0] Int32 -- actually encryption type --,
@@ -37,7 +35,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.EncryptionKey.MyEnum.*;
  }
  */
 public class EncryptionKey extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum EncryptionKeyField implements EnumType {
         KEY_TYPE,
         KEY_VALUE;
 
@@ -55,8 +53,8 @@ public class EncryptionKey extends KrbSequenceType {
     private int kvno = -1;
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(KEY_TYPE, 0, Asn1Integer.class),
-            new ExplicitField(KEY_VALUE, 1, Asn1OctetString.class)
+            new ExplicitField(EncryptionKeyField.KEY_TYPE, Asn1Integer.class),
+            new ExplicitField(EncryptionKeyField.KEY_VALUE, Asn1OctetString.class)
     };
 
     public EncryptionKey() {
@@ -83,20 +81,20 @@ public class EncryptionKey extends KrbSequenceType {
     }
 
     public EncryptionType getKeyType() {
-        Integer value = getFieldAsInteger(KEY_TYPE);
+        Integer value = getFieldAsInteger(EncryptionKeyField.KEY_TYPE);
         return EncryptionType.fromValue(value);
     }
 
     public void setKeyType(EncryptionType keyType) {
-        setFieldAsInt(KEY_TYPE, keyType.getValue());
+        setFieldAsInt(EncryptionKeyField.KEY_TYPE, keyType.getValue());
     }
 
     public byte[] getKeyData() {
-        return getFieldAsOctets(KEY_VALUE);
+        return getFieldAsOctets(EncryptionKeyField.KEY_VALUE);
     }
 
     public void setKeyData(byte[] keyData) {
-        setFieldAsOctets(KEY_VALUE, keyData);
+        setFieldAsOctets(EncryptionKeyField.KEY_VALUE, keyData);
     }
 
     public void setKvno(int kvno) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfo2Entry.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfo2Entry.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfo2Entry.java
index 93cf1b9..1a030c2 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfo2Entry.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfo2Entry.java
@@ -27,8 +27,6 @@ import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KerberosString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.base.EtypeInfo2Entry.MyEnum.*;
-
 /**
  ETYPE-INFO2-ENTRY       ::= SEQUENCE {
  etype           [0] Int32,
@@ -37,7 +35,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.EtypeInfo2Entry.MyEnum.*;
  }
  */
 public class EtypeInfo2Entry extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum EtypeInfo2EntryField implements EnumType {
         ETYPE,
         SALT,
         S2KPARAMS;
@@ -54,9 +52,9 @@ public class EtypeInfo2Entry extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ETYPE, 0, Asn1Integer.class),
-            new ExplicitField(SALT, 1, KerberosString.class),
-            new ExplicitField(S2KPARAMS, 2, Asn1OctetString.class)
+            new ExplicitField(EtypeInfo2EntryField.ETYPE, Asn1Integer.class),
+            new ExplicitField(EtypeInfo2EntryField.SALT, KerberosString.class),
+            new ExplicitField(EtypeInfo2EntryField.S2KPARAMS, Asn1OctetString.class)
     };
 
     public EtypeInfo2Entry() {
@@ -64,26 +62,26 @@ public class EtypeInfo2Entry extends KrbSequenceType {
     }
 
     public EncryptionType getEtype() {
-        return EncryptionType.fromValue(getFieldAsInt(ETYPE));
+        return EncryptionType.fromValue(getFieldAsInt(EtypeInfo2EntryField.ETYPE));
     }
 
     public void setEtype(EncryptionType etype) {
-        setField(ETYPE, etype);
+        setField(EtypeInfo2EntryField.ETYPE, etype);
     }
 
     public String getSalt() {
-        return getFieldAsString(SALT);
+        return getFieldAsString(EtypeInfo2EntryField.SALT);
     }
 
     public void setSalt(String salt) {
-        setFieldAsString(SALT, salt);
+        setFieldAsString(EtypeInfo2EntryField.SALT, salt);
     }
 
     public byte[] getS2kParams() {
-        return getFieldAsOctets(S2KPARAMS);
+        return getFieldAsOctets(EtypeInfo2EntryField.S2KPARAMS);
     }
 
     public void setS2kParams(byte[] s2kParams) {
-        setFieldAsOctets(S2KPARAMS, s2kParams);
+        setFieldAsOctets(EtypeInfo2EntryField.S2KPARAMS, s2kParams);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfoEntry.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfoEntry.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfoEntry.java
index d14b668..be7f833 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfoEntry.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/EtypeInfoEntry.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.base.EtypeInfoEntry.MyEnum.*;
-
 /**
  ETYPE-INFO-ENTRY        ::= SEQUENCE {
  etype           [0] Int32,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.EtypeInfoEntry.MyEnum.*;
  }
  */
 public class EtypeInfoEntry extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum EtypeInfoEntryField implements EnumType {
         ETYPE,
         SALT;
 
@@ -51,8 +49,8 @@ public class EtypeInfoEntry extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ETYPE, 0, Asn1Integer.class),
-            new ExplicitField(SALT, 1, Asn1OctetString.class)
+            new ExplicitField(EtypeInfoEntryField.ETYPE, Asn1Integer.class),
+            new ExplicitField(EtypeInfoEntryField.SALT, Asn1OctetString.class)
     };
 
     public EtypeInfoEntry() {
@@ -60,18 +58,18 @@ public class EtypeInfoEntry extends KrbSequenceType {
     }
 
     public EncryptionType getEtype() {
-        return EncryptionType.fromValue(getFieldAsInt(ETYPE));
+        return EncryptionType.fromValue(getFieldAsInt(EtypeInfoEntryField.ETYPE));
     }
 
     public void setEtype(EncryptionType etype) {
-        setField(ETYPE, etype);
+        setField(EtypeInfoEntryField.ETYPE, etype);
     }
 
     public byte[] getSalt() {
-        return getFieldAsOctets(SALT);
+        return getFieldAsOctets(EtypeInfoEntryField.SALT);
     }
 
     public void setSalt(byte[] salt) {
-        setFieldAsOctets(SALT, salt);
+        setFieldAsOctets(EtypeInfoEntryField.SALT, salt);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/HostAddress.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/HostAddress.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/HostAddress.java
index 0907ddf..603b776 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/HostAddress.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/HostAddress.java
@@ -19,6 +19,9 @@
  */
 package org.apache.kerby.kerberos.kerb.type.base;
 
+import java.net.InetAddress;
+import java.util.Arrays;
+
 import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
@@ -26,11 +29,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import java.net.InetAddress;
-import java.util.Arrays;
-
-import static org.apache.kerby.kerberos.kerb.type.base.HostAddress.MyEnum.*;
-
 /*
 HostAddress     ::= SEQUENCE  {
         addr-type       [0] Int32,
@@ -38,7 +36,7 @@ HostAddress     ::= SEQUENCE  {
 }
  */
 public class HostAddress extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum HostAddressField implements EnumType {
         ADDR_TYPE,
         ADDRESS;
 
@@ -54,8 +52,8 @@ public class HostAddress extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ADDR_TYPE, 0, Asn1Integer.class),
-            new ExplicitField(ADDRESS, 1, Asn1OctetString.class)
+            new ExplicitField(HostAddressField.ADDR_TYPE, 0, Asn1Integer.class),
+            new ExplicitField(HostAddressField.ADDRESS, 1, Asn1OctetString.class)
     };
 
     public HostAddress() {
@@ -70,20 +68,20 @@ public class HostAddress extends KrbSequenceType {
     }
 
     public HostAddrType getAddrType() {
-        Integer value = getFieldAsInteger(ADDR_TYPE);
+        Integer value = getFieldAsInteger(HostAddressField.ADDR_TYPE);
         return HostAddrType.fromValue(value);
     }
 
     public void setAddrType(HostAddrType addrType) {
-        setField(ADDR_TYPE, addrType);
+        setField(HostAddressField.ADDR_TYPE, addrType);
     }
 
     public byte[] getAddress() {
-        return getFieldAsOctets(ADDRESS);
+        return getFieldAsOctets(HostAddressField.ADDRESS);
     }
 
     public void setAddress(byte[] address) {
-        setFieldAsOctets(ADDRESS, address);
+        setFieldAsOctets(HostAddressField.ADDRESS, address);
     }
 
     public boolean equalsWith(InetAddress address) {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbError.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbError.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbError.java
index 8cb363b..9e272d5 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbError.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbError.java
@@ -28,8 +28,6 @@ import org.apache.kerby.kerberos.kerb.KrbErrorCode;
 import org.apache.kerby.kerberos.kerb.type.KerberosString;
 import org.apache.kerby.kerberos.kerb.type.KerberosTime;
 
-import static org.apache.kerby.kerberos.kerb.type.base.KrbError.MyEnum.*;
-
 /**
  KRB-ERROR       ::= [APPLICATION 30] SEQUENCE {
      pvno            [0] INTEGER (5),
@@ -48,7 +46,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.KrbError.MyEnum.*;
  }
  */
 public class KrbError extends KrbMessage {
-    protected enum MyEnum implements EnumType {
+    protected enum KrbErrorField implements EnumType {
         PVNO,
         MSG_TYPE,
         CTIME,
@@ -75,19 +73,19 @@ public class KrbError extends KrbMessage {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PVNO, Asn1Integer.class),
-            new ExplicitField(MSG_TYPE, Asn1Integer.class),
-            new ExplicitField(CTIME, KerberosTime.class),
-            new ExplicitField(CUSEC, Asn1Integer.class),
-            new ExplicitField(STIME, KerberosTime.class),
-            new ExplicitField(SUSEC, Asn1Integer.class),
-            new ExplicitField(ERROR_CODE, Asn1Integer.class),
-            new ExplicitField(CREALM, KerberosString.class),
-            new ExplicitField(CNAME, PrincipalName.class),
-            new ExplicitField(REALM, KerberosString.class),
-            new ExplicitField(SNAME, PrincipalName.class),
-            new ExplicitField(ETEXT, KerberosString.class),
-            new ExplicitField(EDATA, Asn1OctetString.class)
+            new ExplicitField(KrbErrorField.PVNO, Asn1Integer.class),
+            new ExplicitField(KrbErrorField.MSG_TYPE, Asn1Integer.class),
+            new ExplicitField(KrbErrorField.CTIME, KerberosTime.class),
+            new ExplicitField(KrbErrorField.CUSEC, Asn1Integer.class),
+            new ExplicitField(KrbErrorField.STIME, KerberosTime.class),
+            new ExplicitField(KrbErrorField.SUSEC, Asn1Integer.class),
+            new ExplicitField(KrbErrorField.ERROR_CODE, Asn1Integer.class),
+            new ExplicitField(KrbErrorField.CREALM, KerberosString.class),
+            new ExplicitField(KrbErrorField.CNAME, PrincipalName.class),
+            new ExplicitField(KrbErrorField.REALM, KerberosString.class),
+            new ExplicitField(KrbErrorField.SNAME, PrincipalName.class),
+            new ExplicitField(KrbErrorField.ETEXT, KerberosString.class),
+            new ExplicitField(KrbErrorField.EDATA, Asn1OctetString.class)
     };
 
     public KrbError() {
@@ -95,90 +93,90 @@ public class KrbError extends KrbMessage {
     }
 
     public KerberosTime getCtime() {
-        return getFieldAs(CTIME, KerberosTime.class);
+        return getFieldAs(KrbErrorField.CTIME, KerberosTime.class);
     }
 
     public void setCtime(KerberosTime ctime) {
-        setFieldAs(CTIME, ctime);
+        setFieldAs(KrbErrorField.CTIME, ctime);
     }
 
     public int getCusec() {
-        return getFieldAsInt(CUSEC);
+        return getFieldAsInt(KrbErrorField.CUSEC);
     }
 
     public void setCusec(int cusec) {
-        setFieldAsInt(CUSEC, cusec);
+        setFieldAsInt(KrbErrorField.CUSEC, cusec);
     }
 
     public KerberosTime getStime() {
-        return getFieldAs(STIME, KerberosTime.class);
+        return getFieldAs(KrbErrorField.STIME, KerberosTime.class);
     }
 
     public void setStime(KerberosTime stime) {
-        setFieldAs(STIME, stime);
+        setFieldAs(KrbErrorField.STIME, stime);
     }
 
     public int getSusec() {
-        return getFieldAsInt(SUSEC);
+        return getFieldAsInt(KrbErrorField.SUSEC);
     }
 
     public void setSusec(int susec) {
-        setFieldAsInt(SUSEC, susec);
+        setFieldAsInt(KrbErrorField.SUSEC, susec);
     }
 
     public KrbErrorCode getErrorCode() {
-        return KrbErrorCode.fromValue(getFieldAsInt(ERROR_CODE));
+        return KrbErrorCode.fromValue(getFieldAsInt(KrbErrorField.ERROR_CODE));
     }
 
     public void setErrorCode(KrbErrorCode errorCode) {
-        setField(ERROR_CODE, errorCode);
+        setField(KrbErrorField.ERROR_CODE, errorCode);
     }
 
     public String getCrealm() {
-        return getFieldAsString(CREALM);
+        return getFieldAsString(KrbErrorField.CREALM);
     }
 
     public void setCrealm(String realm) {
-        setFieldAs(CREALM, new KerberosString(realm));
+        setFieldAs(KrbErrorField.CREALM, new KerberosString(realm));
     }
 
     public PrincipalName getCname() {
-        return getFieldAs(CNAME, PrincipalName.class);
+        return getFieldAs(KrbErrorField.CNAME, PrincipalName.class);
     }
 
     public void setCname(PrincipalName sname) {
-        setFieldAs(CNAME, sname);
+        setFieldAs(KrbErrorField.CNAME, sname);
     }
 
     public PrincipalName getSname() {
-        return getFieldAs(SNAME, PrincipalName.class);
+        return getFieldAs(KrbErrorField.SNAME, PrincipalName.class);
     }
 
     public void setSname(PrincipalName sname) {
-        setFieldAs(SNAME, sname);
+        setFieldAs(KrbErrorField.SNAME, sname);
     }
 
     public String getRealm() {
-        return getFieldAsString(REALM);
+        return getFieldAsString(KrbErrorField.REALM);
     }
 
     public void setRealm(String realm) {
-        setFieldAs(REALM, new KerberosString(realm));
+        setFieldAs(KrbErrorField.REALM, new KerberosString(realm));
     }
 
     public String getEtext() {
-        return getFieldAsString(ETEXT);
+        return getFieldAsString(KrbErrorField.ETEXT);
     }
 
     public void setEtext(String realm) {
-        setFieldAs(ETEXT, new KerberosString(realm));
+        setFieldAs(KrbErrorField.ETEXT, new KerberosString(realm));
     }
 
     public byte[] getEdata() {
-        return getFieldAsOctetBytes(EDATA);
+        return getFieldAsOctetBytes(KrbErrorField.EDATA);
     }
 
     public void setEdata(byte[] edata) {
-        setFieldAsOctetBytes(EDATA, edata);
+        setFieldAsOctetBytes(KrbErrorField.EDATA, edata);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
index d449f9b..6efcc82 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbMessage.java
@@ -24,10 +24,8 @@ import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.kerberos.kerb.KrbConstant;
 import org.apache.kerby.kerberos.kerb.type.KrbAppSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.base.KrbMessage.MyEnum.*;
-
 public abstract class KrbMessage extends KrbAppSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KrbMessageField implements EnumType {
         PVNO,
         MSG_TYPE;
 
@@ -55,15 +53,15 @@ public abstract class KrbMessage extends KrbAppSequenceType {
     }
 
     protected void setPvno(int pvno) {
-        setFieldAsInt(PVNO, pvno);
+        setFieldAsInt(KrbMessageField.PVNO, pvno);
     }
 
     public KrbMessageType getMsgType() {
-        Integer value = getFieldAsInteger(MSG_TYPE);
+        Integer value = getFieldAsInteger(KrbMessageField.MSG_TYPE);
         return KrbMessageType.fromValue(value);
     }
 
     public void setMsgType(KrbMessageType msgType) {
-        setFieldAsInt(MSG_TYPE, msgType.getValue());
+        setFieldAsInt(KrbMessageField.MSG_TYPE, msgType.getValue());
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbToken.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbToken.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbToken.java
index 30ea00d..597d531 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbToken.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/KrbToken.java
@@ -19,6 +19,10 @@
  */
 package org.apache.kerby.kerberos.kerb.type.base;
 
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
+
 import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
@@ -31,12 +35,6 @@ import org.apache.kerby.kerberos.kerb.provider.TokenDecoder;
 import org.apache.kerby.kerberos.kerb.provider.TokenEncoder;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
-import static org.apache.kerby.kerberos.kerb.type.base.KrbToken.MyEnum.*;
-
 /**
  * KRB-TOKEN_VALUE ::= SEQUENCE {
  * token-format [0] INTEGER,
@@ -47,7 +45,7 @@ public class KrbToken extends KrbSequenceType implements AuthToken {
     private static TokenEncoder tokenEncoder;
     private static TokenDecoder tokenDecoder;
 
-    protected enum MyEnum implements EnumType {
+    protected enum KrbTokenField implements EnumType {
         TOKEN_FORMAT,
         TOKEN_VALUE;
 
@@ -65,8 +63,8 @@ public class KrbToken extends KrbSequenceType implements AuthToken {
     private AuthToken innerToken = null;
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[]{
-            new ExplicitField(TOKEN_FORMAT, 0, Asn1Integer.class),
-            new ExplicitField(TOKEN_VALUE, 1, Asn1OctetString.class)
+            new ExplicitField(KrbTokenField.TOKEN_FORMAT, Asn1Integer.class),
+            new ExplicitField(KrbTokenField.TOKEN_VALUE, Asn1OctetString.class)
     };
 
 
@@ -155,7 +153,7 @@ public class KrbToken extends KrbSequenceType implements AuthToken {
      * @return The token format
      */
     public TokenFormat getTokenFormat() {
-        Integer value = getFieldAsInteger(TOKEN_FORMAT);
+        Integer value = getFieldAsInteger(KrbTokenField.TOKEN_FORMAT);
         return TokenFormat.fromValue(value);
     }
 
@@ -164,7 +162,7 @@ public class KrbToken extends KrbSequenceType implements AuthToken {
      * @param tokenFormat The token format
      */
     public void setTokenFormat(TokenFormat tokenFormat) {
-        setFieldAsInt(TOKEN_FORMAT, tokenFormat.getValue());
+        setFieldAsInt(KrbTokenField.TOKEN_FORMAT, tokenFormat.getValue());
     }
 
     /**
@@ -172,7 +170,7 @@ public class KrbToken extends KrbSequenceType implements AuthToken {
      * @return The token value
      */
     public byte[] getTokenValue() {
-        return getFieldAsOctets(TOKEN_VALUE);
+        return getFieldAsOctets(KrbTokenField.TOKEN_VALUE);
     }
 
     /**
@@ -180,7 +178,7 @@ public class KrbToken extends KrbSequenceType implements AuthToken {
      * @param tokenValue The token value
      */
     public void setTokenValue(byte[] tokenValue) {
-        setFieldAsOctets(TOKEN_VALUE, tokenValue);
+        setFieldAsOctets(KrbTokenField.TOKEN_VALUE, tokenValue);
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/LastReqEntry.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/LastReqEntry.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/LastReqEntry.java
index 300622a..1442216 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/LastReqEntry.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/LastReqEntry.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.kerberos.kerb.type.KerberosTime;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.base.LastReqEntry.MyEnum.*;
-
 /**
  LastReq         ::=     SEQUENCE OF SEQUENCE {
  lr-type         [0] Int32,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.LastReqEntry.MyEnum.*;
  }
  */
 public class LastReqEntry extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum LastReqEntryField implements EnumType {
         LR_TYPE,
         LR_VALUE;
 
@@ -51,8 +49,8 @@ public class LastReqEntry extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(LR_TYPE, 0, Asn1Integer.class),
-            new ExplicitField(LR_VALUE, 1, KerberosTime.class)
+            new ExplicitField(LastReqEntryField.LR_TYPE, Asn1Integer.class),
+            new ExplicitField(LastReqEntryField.LR_VALUE, KerberosTime.class)
     };
 
     public LastReqEntry() {
@@ -60,19 +58,19 @@ public class LastReqEntry extends KrbSequenceType {
     }
 
     public LastReqType getLrType() {
-        Integer value = getFieldAsInteger(LR_TYPE);
+        Integer value = getFieldAsInteger(LastReqEntryField.LR_TYPE);
         return LastReqType.fromValue(value);
     }
 
     public void setLrType(LastReqType lrType) {
-        setFieldAsInt(LR_TYPE, lrType.getValue());
+        setFieldAsInt(LastReqEntryField.LR_TYPE, lrType.getValue());
     }
 
     public KerberosTime getLrValue() {
-        return getFieldAs(LR_VALUE, KerberosTime.class);
+        return getFieldAs(LastReqEntryField.LR_VALUE, KerberosTime.class);
     }
 
     public void setLrValue(KerberosTime lrValue) {
-        setFieldAs(LR_VALUE, lrValue);
+        setFieldAs(LastReqEntryField.LR_VALUE, lrValue);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/PrincipalName.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/PrincipalName.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/PrincipalName.java
index 0b12261..9823e76 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/PrincipalName.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/PrincipalName.java
@@ -19,6 +19,10 @@
  */
 package org.apache.kerby.kerberos.kerb.type.base;
 
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.kerby.asn1.Asn1FieldInfo;
 import org.apache.kerby.asn1.EnumType;
 import org.apache.kerby.asn1.ExplicitField;
@@ -26,12 +30,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.kerberos.kerb.type.KerberosStrings;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import static org.apache.kerby.kerberos.kerb.type.base.PrincipalName.MyEnum.*;
-
 /**
  PrincipalName   ::= SEQUENCE {
  name-type       [0] Int32,
@@ -39,7 +37,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.PrincipalName.MyEnum.*;
  }
  */
 public class PrincipalName extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum PrincipalNameField implements EnumType {
         NAME_TYPE,
         NAME_STRING;
 
@@ -55,8 +53,8 @@ public class PrincipalName extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(NAME_TYPE, Asn1Integer.class),
-            new ExplicitField(NAME_STRING, KerberosStrings.class)
+            new ExplicitField(PrincipalNameField.NAME_TYPE, Asn1Integer.class),
+            new ExplicitField(PrincipalNameField.NAME_STRING, KerberosStrings.class)
     };
     private String realm;
 
@@ -115,16 +113,16 @@ public class PrincipalName extends KrbSequenceType {
     }
 
     public NameType getNameType() {
-        Integer value = getFieldAsInteger(NAME_TYPE);
+        Integer value = getFieldAsInteger(PrincipalNameField.NAME_TYPE);
         return NameType.fromValue(value);
     }
 
     public void setNameType(NameType nameType) {
-        setFieldAsInt(NAME_TYPE, nameType.getValue());
+        setFieldAsInt(PrincipalNameField.NAME_TYPE, nameType.getValue());
     }
 
     public List<String> getNameStrings() {
-        KerberosStrings krbStrings = getFieldAs(NAME_STRING, KerberosStrings.class);
+        KerberosStrings krbStrings = getFieldAs(PrincipalNameField.NAME_STRING, KerberosStrings.class);
         if (krbStrings != null) {
             return krbStrings.getAsStrings();
         }
@@ -132,7 +130,7 @@ public class PrincipalName extends KrbSequenceType {
     }
 
     public void setNameStrings(List<String> nameStrings) {
-        setFieldAs(NAME_STRING, new KerberosStrings(nameStrings));
+        setFieldAs(PrincipalNameField.NAME_STRING, new KerberosStrings(nameStrings));
     }
 
     public String getRealm() {

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/TransitedEncoding.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/TransitedEncoding.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/TransitedEncoding.java
index aee5f4f..a25e2ef 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/TransitedEncoding.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/base/TransitedEncoding.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.base.TransitedEncoding.MyEnum.*;;
-
 /**
  TransitedEncoding       ::= SEQUENCE {
  tr-type         [0] Int32 -- must be registered --,
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.base.TransitedEncoding.MyEnum.
  }
  */
 public class TransitedEncoding extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum TransitedEncodingField implements EnumType {
         TR_TYPE,
         CONTENTS;
 
@@ -51,8 +49,8 @@ public class TransitedEncoding extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(TR_TYPE, 0, Asn1Integer.class),
-            new ExplicitField(CONTENTS, 1, Asn1OctetString.class)
+            new ExplicitField(TransitedEncodingField.TR_TYPE, Asn1Integer.class),
+            new ExplicitField(TransitedEncodingField.CONTENTS, Asn1OctetString.class)
     };
 
     public TransitedEncoding() {
@@ -60,19 +58,19 @@ public class TransitedEncoding extends KrbSequenceType {
     }
 
     public TransitedEncodingType getTrType() {
-        Integer value = getFieldAsInteger(TR_TYPE);
+        Integer value = getFieldAsInteger(TransitedEncodingField.TR_TYPE);
         return TransitedEncodingType.fromValue(value);
     }
 
     public void setTrType(TransitedEncodingType trType) {
-        setField(TR_TYPE, trType);
+        setField(TransitedEncodingField.TR_TYPE, trType);
     }
 
     public byte[] getContents() {
-        return getFieldAsOctets(CONTENTS);
+        return getFieldAsOctets(TransitedEncodingField.CONTENTS);
     }
 
     public void setContents(byte[] contents) {
-        setFieldAsOctets(CONTENTS, contents);
+        setFieldAsOctets(TransitedEncodingField.CONTENTS, contents);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmor.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmor.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmor.java
index c09646a..538859d 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmor.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmor.java
@@ -26,8 +26,6 @@ import org.apache.kerby.asn1.type.Asn1Integer;
 import org.apache.kerby.asn1.type.Asn1OctetString;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastArmor.MyEnum.*;
-
 /**
  KrbFastArmor ::= SEQUENCE {
      armor-type   [0] Int32,
@@ -37,7 +35,7 @@ import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastArmor.MyEnum.*;
  }
  */
 public class KrbFastArmor extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KrbFastArmorField implements EnumType {
         ARMOR_TYPE,
         ARMOR_VALUE;
 
@@ -53,8 +51,8 @@ public class KrbFastArmor extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ARMOR_TYPE, Asn1Integer.class),
-            new ExplicitField(ARMOR_VALUE, Asn1OctetString.class)
+            new ExplicitField(KrbFastArmorField.ARMOR_TYPE, Asn1Integer.class),
+            new ExplicitField(KrbFastArmorField.ARMOR_VALUE, Asn1OctetString.class)
     };
 
     public KrbFastArmor() {
@@ -62,19 +60,19 @@ public class KrbFastArmor extends KrbSequenceType {
     }
 
     public ArmorType getArmorType() {
-        Integer value = getFieldAsInteger(ARMOR_TYPE);
+        Integer value = getFieldAsInteger(KrbFastArmorField.ARMOR_TYPE);
         return ArmorType.fromValue(value);
     }
 
     public void setArmorType(ArmorType armorType) {
-        setFieldAsInt(ARMOR_TYPE, armorType.getValue());
+        setFieldAsInt(KrbFastArmorField.ARMOR_TYPE, armorType.getValue());
     }
 
     public byte[] getArmorValue() {
-        return getFieldAsOctets(ARMOR_VALUE);
+        return getFieldAsOctets(KrbFastArmorField.ARMOR_VALUE);
     }
 
     public void setArmorValue(byte[] armorValue) {
-        setFieldAsOctets(ARMOR_VALUE, armorValue);
+        setFieldAsOctets(KrbFastArmorField.ARMOR_VALUE, armorValue);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredRep.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredRep.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredRep.java
index 98bb1c3..e7ebf6c 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredRep.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredRep.java
@@ -25,8 +25,6 @@ import org.apache.kerby.asn1.ExplicitField;
 import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptedData;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastArmoredRep.MyEnum.*;
-
 /**
  KrbFastArmoredRep ::= SEQUENCE {
     enc-fast-rep      [0] EncryptedData, -- KrbFastResponse --
@@ -35,7 +33,7 @@ import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastArmoredRep.MyEnum.
  }
  */
 public class KrbFastArmoredRep extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KrbFastArmoredRepField implements EnumType {
         ENC_FAST_REP;
 
         @Override
@@ -51,7 +49,7 @@ public class KrbFastArmoredRep extends KrbSequenceType {
 
     //private
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ENC_FAST_REP, EncryptedData.class)
+            new ExplicitField(KrbFastArmoredRepField.ENC_FAST_REP, EncryptedData.class)
     };
 
     public KrbFastArmoredRep() {
@@ -59,10 +57,10 @@ public class KrbFastArmoredRep extends KrbSequenceType {
     }
 
     public EncryptedData getEncFastRep() {
-        return getFieldAs(ENC_FAST_REP, EncryptedData.class);
+        return getFieldAs(KrbFastArmoredRepField.ENC_FAST_REP, EncryptedData.class);
     }
 
     public void setEncFastRep(EncryptedData encFastRep) {
-        setFieldAs(ENC_FAST_REP, encFastRep);
+        setFieldAs(KrbFastArmoredRepField.ENC_FAST_REP, encFastRep);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredReq.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredReq.java
index d9f80b0..b4c2fa6 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredReq.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastArmoredReq.java
@@ -26,8 +26,6 @@ import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.CheckSum;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptedData;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastArmoredReq.MyEnum.*;
-
 /**
  KrbFastArmoredReq ::= SEQUENCE {
      armor        [0] KrbFastArmor OPTIONAL,
@@ -49,7 +47,7 @@ import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastArmoredReq.MyEnum.
  }
  */
 public class KrbFastArmoredReq extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KrbFastArmoredReqField implements EnumType {
         ARMOR,
         REQ_CHECKSUM,
         ENC_FAST_REQ;
@@ -68,9 +66,9 @@ public class KrbFastArmoredReq extends KrbSequenceType {
     private KrbFastReq fastReq;
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(ARMOR, KrbFastArmor.class),
-            new ExplicitField(REQ_CHECKSUM, CheckSum.class),
-            new ExplicitField(ENC_FAST_REQ, EncryptedData.class),
+            new ExplicitField(KrbFastArmoredReqField.ARMOR, KrbFastArmor.class),
+            new ExplicitField(KrbFastArmoredReqField.REQ_CHECKSUM, CheckSum.class),
+            new ExplicitField(KrbFastArmoredReqField.ENC_FAST_REQ, EncryptedData.class),
     };
 
     public KrbFastArmoredReq() {
@@ -78,19 +76,19 @@ public class KrbFastArmoredReq extends KrbSequenceType {
     }
 
     public KrbFastArmor getArmor() {
-        return getFieldAs(ARMOR, KrbFastArmor.class);
+        return getFieldAs(KrbFastArmoredReqField.ARMOR, KrbFastArmor.class);
     }
 
     public void setArmor(KrbFastArmor armor) {
-        setFieldAs(ARMOR, armor);
+        setFieldAs(KrbFastArmoredReqField.ARMOR, armor);
     }
 
     public CheckSum getReqChecksum() {
-        return getFieldAs(REQ_CHECKSUM, CheckSum.class);
+        return getFieldAs(KrbFastArmoredReqField.REQ_CHECKSUM, CheckSum.class);
     }
 
     public void setReqChecksum(CheckSum checkSum) {
-        setFieldAs(REQ_CHECKSUM, checkSum);
+        setFieldAs(KrbFastArmoredReqField.REQ_CHECKSUM, checkSum);
     }
 
     public KrbFastReq getFastReq() {
@@ -102,10 +100,10 @@ public class KrbFastArmoredReq extends KrbSequenceType {
     }
 
     public EncryptedData getEncryptedFastReq() {
-        return getFieldAs(ENC_FAST_REQ, EncryptedData.class);
+        return getFieldAs(KrbFastArmoredReqField.ENC_FAST_REQ, EncryptedData.class);
     }
 
     public void setEncryptedFastReq(EncryptedData encFastReq) {
-        setFieldAs(ENC_FAST_REQ, encFastReq);
+        setFieldAs(KrbFastArmoredReqField.ENC_FAST_REQ, encFastReq);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastFinished.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastFinished.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastFinished.java
index 0370c6e..f92b474 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastFinished.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastFinished.java
@@ -27,8 +27,6 @@ import org.apache.kerby.kerberos.kerb.type.base.CheckSum;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptedData;
 import org.apache.kerby.kerberos.kerb.type.pa.PaData;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastFinished.MyEnum.*;
-
 /**
  KrbFastFinished ::= SEQUENCE {
      timestamp       [0] KerberosTime,
@@ -46,7 +44,7 @@ import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastFinished.MyEnum.*;
  }
  */
 public class KrbFastFinished extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KrbFastFinishedField implements EnumType {
         FAST_OPTIONS,
         PADATA,
         REQ_BODY;
@@ -63,9 +61,9 @@ public class KrbFastFinished extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(FAST_OPTIONS, KrbFastArmor.class),
-            new ExplicitField(PADATA, PaData.class),
-            new ExplicitField(REQ_BODY, EncryptedData.class),
+            new ExplicitField(KrbFastFinishedField.FAST_OPTIONS, KrbFastArmor.class),
+            new ExplicitField(KrbFastFinishedField.PADATA, PaData.class),
+            new ExplicitField(KrbFastFinishedField.REQ_BODY, EncryptedData.class),
     };
 
     public KrbFastFinished() {
@@ -73,26 +71,26 @@ public class KrbFastFinished extends KrbSequenceType {
     }
 
     public KrbFastArmor getArmor() {
-        return getFieldAs(FAST_OPTIONS, KrbFastArmor.class);
+        return getFieldAs(KrbFastFinishedField.FAST_OPTIONS, KrbFastArmor.class);
     }
 
     public void setArmor(KrbFastArmor armor) {
-        setFieldAs(FAST_OPTIONS, armor);
+        setFieldAs(KrbFastFinishedField.FAST_OPTIONS, armor);
     }
 
     public CheckSum getReqChecksum() {
-        return getFieldAs(PADATA, CheckSum.class);
+        return getFieldAs(KrbFastFinishedField.PADATA, CheckSum.class);
     }
 
     public void setReqChecksum(CheckSum checkSum) {
-        setFieldAs(PADATA, checkSum);
+        setFieldAs(KrbFastFinishedField.PADATA, checkSum);
     }
 
     public EncryptedData getEncFastReq() {
-        return getFieldAs(REQ_BODY, EncryptedData.class);
+        return getFieldAs(KrbFastFinishedField.REQ_BODY, EncryptedData.class);
     }
 
     public void setEncFastReq(EncryptedData encFastReq) {
-        setFieldAs(REQ_BODY, encFastReq);
+        setFieldAs(KrbFastFinishedField.REQ_BODY, encFastReq);
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastReq.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastReq.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastReq.java
index 3e92473..475baff 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastReq.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastReq.java
@@ -26,8 +26,6 @@ import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.kdc.KdcReqBody;
 import org.apache.kerby.kerberos.kerb.type.pa.PaData;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastReq.MyEnum.*;
-
 /**
  KrbFastReq ::= SEQUENCE {
      fast-options [0] FastOptions,
@@ -42,7 +40,7 @@ import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastReq.MyEnum.*;
  }
  */
 public class KrbFastReq extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KrbFastReqField implements EnumType {
         FAST_OPTIONS,
         PADATA,
         REQ_BODY;
@@ -59,9 +57,9 @@ public class KrbFastReq extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(FAST_OPTIONS, FastOptions.class),
-            new ExplicitField(PADATA, PaData.class),
-            new ExplicitField(REQ_BODY, KdcReqBody.class),
+            new ExplicitField(KrbFastReqField.FAST_OPTIONS, FastOptions.class),
+            new ExplicitField(KrbFastReqField.PADATA, PaData.class),
+            new ExplicitField(KrbFastReqField.REQ_BODY, KdcReqBody.class),
     };
 
     public KrbFastReq() {
@@ -69,26 +67,26 @@ public class KrbFastReq extends KrbSequenceType {
     }
 
     public FastOptions getFastOptions() {
-        return getFieldAs(FAST_OPTIONS, FastOptions.class);
+        return getFieldAs(KrbFastReqField.FAST_OPTIONS, FastOptions.class);
     }
 
     public void setFastOptions(FastOptions fastOptions) {
-        setFieldAs(FAST_OPTIONS, fastOptions);
+        setFieldAs(KrbFastReqField.FAST_OPTIONS, fastOptions);
     }
 
     public PaData getPaData() {
-        return getFieldAs(PADATA, PaData.class);
+        return getFieldAs(KrbFastReqField.PADATA, PaData.class);
     }
 
     public void setPaData(PaData paData) {
-        setFieldAs(PADATA, paData);
+        setFieldAs(KrbFastReqField.PADATA, paData);
     }
 
     public KdcReqBody getKdcReqBody() {
-        return getFieldAs(REQ_BODY, KdcReqBody.class);
+        return getFieldAs(KrbFastReqField.REQ_BODY, KdcReqBody.class);
     }
 
     public void setKdcReqBody(KdcReqBody kdcReqBody) {
-        setFieldAs(REQ_BODY, kdcReqBody);
+        setFieldAs(KrbFastReqField.REQ_BODY, kdcReqBody);
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6385f83b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastResponse.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastResponse.java b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastResponse.java
index 5701cec..6b73134 100644
--- a/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastResponse.java
+++ b/kerby-kerb/kerb-core/src/main/java/org/apache/kerby/kerberos/kerb/type/fast/KrbFastResponse.java
@@ -27,8 +27,6 @@ import org.apache.kerby.kerberos.kerb.type.KrbSequenceType;
 import org.apache.kerby.kerberos.kerb.type.base.EncryptionKey;
 import org.apache.kerby.kerberos.kerb.type.pa.PaData;
 
-import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastResponse.MyEnum.*;
-
 /**
  KrbFastResponse ::= SEQUENCE {
      padata         [0] SEQUENCE OF PA-DATA,
@@ -44,7 +42,7 @@ import static org.apache.kerby.kerberos.kerb.type.fast.KrbFastResponse.MyEnum.*;
  }
  */
 public class KrbFastResponse extends KrbSequenceType {
-    protected enum MyEnum implements EnumType {
+    protected enum KrbFastResponseField implements EnumType {
         PADATA,
         STRENGTHEN_KEY,
         FINISHED,
@@ -62,10 +60,10 @@ public class KrbFastResponse extends KrbSequenceType {
     }
 
     static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
-            new ExplicitField(PADATA, PaData.class),
-            new ExplicitField(STRENGTHEN_KEY, EncryptionKey.class),
-            new ExplicitField(FINISHED, KrbFastFinished.class),
-            new ExplicitField(NONCE, Asn1Integer.class)
+            new ExplicitField(KrbFastResponseField.PADATA, PaData.class),
+            new ExplicitField(KrbFastResponseField.STRENGTHEN_KEY, EncryptionKey.class),
+            new ExplicitField(KrbFastResponseField.FINISHED, KrbFastFinished.class),
+            new ExplicitField(KrbFastResponseField.NONCE, Asn1Integer.class)
     };
 
     public KrbFastResponse() {
@@ -73,34 +71,34 @@ public class KrbFastResponse extends KrbSequenceType {
     }
 
     public PaData getPaData() {
-        return getFieldAs(PADATA, PaData.class);
+        return getFieldAs(KrbFastResponseField.PADATA, PaData.class);
     }
 
     public void setPaData(PaData paData) {
-        setFieldAs(PADATA, paData);
+        setFieldAs(KrbFastResponseField.PADATA, paData);
     }
 
     public EncryptionKey getStrengthenKey() {
-        return getFieldAs(STRENGTHEN_KEY, EncryptionKey.class);
+        return getFieldAs(KrbFastResponseField.STRENGTHEN_KEY, EncryptionKey.class);
     }
 
     public void setStrengthenKey(EncryptionKey strengthenKey) {
-        setFieldAs(STRENGTHEN_KEY, strengthenKey);
+        setFieldAs(KrbFastResponseField.STRENGTHEN_KEY, strengthenKey);
     }
 
     public KrbFastFinished getFastFinished() {
-        return getFieldAs(FINISHED, KrbFastFinished.class);
+        return getFieldAs(KrbFastResponseField.FINISHED, KrbFastFinished.class);
     }
 
     public void setFastFinished(KrbFastFinished fastFinished) {
-        setFieldAs(FINISHED, fastFinished);
+        setFieldAs(KrbFastResponseField.FINISHED, fastFinished);
     }
 
     public int getNonce() {
-        return getFieldAsInt(NONCE);
+        return getFieldAsInt(KrbFastResponseField.NONCE);
     }
 
     public void setNonce(int nonce) {
-        setFieldAsInt(NONCE, nonce);
+        setFieldAsInt(KrbFastResponseField.NONCE, nonce);
     }
 }


Mime
View raw message