[
https://issues.apache.org/jira/browse/DIRKRB-297?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14583527#comment-14583527
]
Lin Chen commented on DIRKRB-297:
---------------------------------
v2 is great! Some minor things:
1. In the codes below:
{code}
if (entries == null || entries.isEmpty()) {
resultSB.append("Principal " + principalName + " not found!");
} else {
if (option == null || option.equals("all")) {
........
}
{code}
We can write them as:
{code}
if (entries == null || entries.isEmpty()) {
resultSB.append("Principal " + principalName + " not found!");
return resultSB;
}
if (option == null || option.equals("all")) {
.......
{code}
The latter can simplify codes and reduce code nesting.
2. The codes below is repeated twice, may we can exact it in a function.
{code}
for (KeytabEntry entry : entries) {
if(entry.getKvno() == kvno) {
numDeleted++;
keytab.removeKeytabEntry(entry);
}
}
{code}
3. We can add more comments in codes. :)
> Implement command 'ktremove' in Kadmin
> --------------------------------------
>
> Key: DIRKRB-297
> URL: https://issues.apache.org/jira/browse/DIRKRB-297
> Project: Directory Kerberos
> Issue Type: New Feature
> Reporter: Wei Zhou
> Assignee: Wei Zhou
> Attachments: DIRKRB-297-V1.patch, DIRKRB-297-V2.patch
>
>
> Implement the function of removing KeytabEntry from Keytab through Kadmin
> tool.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)