[ 
https://issues.apache.org/jira/browse/DIRKRB-515?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15073377#comment-15073377
 ] 

YanYan commented on DIRKRB-515:
-------------------------------

Thanks for your precisely review! 
However, I double checked the part you mentioned above:
{code}
static Asn1FieldInfo[] fieldInfos = new Asn1FieldInfo[] {
            new Asn1FieldInfo(CertificateChoicesField.CERTIFICATE, 
Certificate.class),
            new ImplicitField(CertificateChoicesField.EXTENDED_CERTIFICATE, 0, 
ExtendedCertificate.class),
            new ImplicitField(CertificateChoicesField.V1_ATTR_CERT, 1, 
AttributeCertificateV1.class),
            new ImplicitField(CertificateChoicesField.V2_ATTR_CERT, 2, 
AttributeCertificateV2.class),
            new ImplicitField(CertificateChoicesField.OTHER, 3, 
OtherCertificateFormat.class),
};
{code}
The case when the second parameter can be omitted is when {{tagNo == 
index.getValue()}}. According to the enum definition:
{code}
protected enum CertificateChoicesField implements EnumType {
        CERTIFICATE,
        EXTENDED_CERTIFICATE,
        V1_ATTR_CERT,
        V2_ATTR_CERT,
        OTHER;
}
{code}
{{EXTENDED_CERTIFICATE}} has a value of {{1}}, not {{0}}. So as 
{{V1_ATTR_CERT}}, {{V2_ATTR_CERT}}, {{OTHER}}.
Therefore, I suggest that we do not get rid of the 0, 1, ...

> Rename enum type in kerby-pkix/cms.type
> ---------------------------------------
>
>                 Key: DIRKRB-515
>                 URL: https://issues.apache.org/jira/browse/DIRKRB-515
>             Project: Directory Kerberos
>          Issue Type: Improvement
>            Reporter: YanYan
>            Assignee: YanYan
>         Attachments: DIRKRB-515-v1.patch
>
>
> Currently enum types in classes in kerby-pkix/cms.type are all named 
> {{MyEnum}}, which lacks more than readability. Renaming them and changing the 
> corresponding usages are necessary, and will involve nearly hundreds of 
> classes.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to