directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject [02/18] directory-kerby git commit: Revert "Avoiding some NPEs"
Date Mon, 24 Jul 2017 11:50:43 GMT
Revert "Avoiding some NPEs"

This reverts commit 6bf7ddbcd4d31381fb1dff98eb6a2263ace94a65.


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

Branch: refs/heads/1.0.x-fixes
Commit: 6f69825d6efb74656e5421840dfaf44f193cd032
Parents: 6dd5b41
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Mon Jul 24 12:44:23 2017 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Mon Jul 24 12:44:23 2017 +0100

----------------------------------------------------------------------
 .../kerby/kerberos/kerb/gss/impl/GssUtil.java   | 27 ++++++++------------
 1 file changed, 11 insertions(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/6f69825d/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
----------------------------------------------------------------------
diff --git a/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
b/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
index 6b55ea9..372abcb 100644
--- a/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
+++ b/kerby-kerb/kerb-gssapi/src/main/java/org/apache/kerby/kerberos/kerb/gss/impl/GssUtil.java
@@ -261,26 +261,21 @@ public class GssUtil {
         boolean[] flags = ticketFlagsToBooleans(ticketFlags);
 
         Date authTime = new Date(encKdcRepPart.getAuthTime().getTime());
-        Date startTime = null;
-        if (encKdcRepPart.getStartTime() != null) {
-            startTime = new Date(encKdcRepPart.getStartTime().getTime());
-        }
+        Date startTime = new Date(encKdcRepPart.getStartTime().getTime());
         Date endTime = new Date(encKdcRepPart.getEndTime().getTime());
         Date renewTill = new Date(encKdcRepPart.getRenewTill().getTime());
 
         InetAddress[] clientAddresses = null;
-        if (encKdcRepPart.getCaddr() != null) {
-            List<HostAddress> hostAddresses = encKdcRepPart.getCaddr().getElements();
-            if (hostAddresses != null) {
-                int i = 0;
-                clientAddresses = new InetAddress[hostAddresses.size()];
-                for (HostAddress hostAddr : hostAddresses) {
-                    try {
-                        InetAddress iAddr = InetAddress.getByAddress(hostAddr.getAddress());
-                        clientAddresses[i++] = iAddr;
-                    } catch (UnknownHostException e) {
-                        throw new GSSException(GSSException.FAILURE, -1, "Bad client address");
-                    }
+        List<HostAddress> hostAddresses = encKdcRepPart.getCaddr().getElements();
+        if (hostAddresses != null) {
+            int i = 0;
+            clientAddresses = new InetAddress[hostAddresses.size()];
+            for (HostAddress hostAddr : hostAddresses) {
+                try {
+                    InetAddress iAddr = InetAddress.getByAddress(hostAddr.getAddress());
+                    clientAddresses[i++] = iAddr;
+                } catch (UnknownHostException e) {
+                    throw new GSSException(GSSException.FAILURE, -1, "Bad client address");
                 }
             }
         }


Mime
View raw message