--- a/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java Tue Apr 19 11:42:29 2016 -0700
+++ b/jdk/src/java.security.jgss/share/classes/sun/security/jgss/wrapper/GSSNameElement.java Thu Sep 17 18:41:05 2015 -0700
@@ -159,7 +159,9 @@
int atPos = krbName.lastIndexOf('@');
if (atPos != -1) {
String atRealm = krbName.substring(atPos);
- if (nameType.equals(GSSUtil.NT_GSS_KRB5_PRINCIPAL)
+ // getNativeNameType() can modify NT_GSS_KRB5_PRINCIPAL to null
+ if ((nameType == null
+ || nameType.equals(GSSUtil.NT_GSS_KRB5_PRINCIPAL))
&& new String(nameBytes).endsWith(atRealm)) {
// Created from Kerberos name with realm, no need to check
} else {