changeset 11743:37b61c31e766

8141148: LDAP "follow" throws ClassCastException with Java 8 Reviewed-by: prappo, xuelei
author robm
date Wed, 13 Jul 2016 14:56:00 +0100
parents 59f5a29dd47e
children 1af2eacbc174 fab9a5842fad
files src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java src/share/classes/com/sun/jndi/ldap/LdapBindingEnumeration.java src/share/classes/com/sun/jndi/ldap/LdapNamingEnumeration.java src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java
diffstat 4 files changed, 9 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java	Wed Jul 13 15:21:08 2016 -0500
+++ b/src/share/classes/com/sun/jndi/ldap/AbstractLdapNamingEnumeration.java	Wed Jul 13 14:56:00 2016 +0100
@@ -300,7 +300,7 @@
         errEx = e;
     }
 
-    protected abstract AbstractLdapNamingEnumeration<T> getReferredResults(
+    protected abstract AbstractLdapNamingEnumeration<? extends NameClassPair> getReferredResults(
             LdapReferralContext refCtx) throws NamingException;
 
     /*
@@ -360,7 +360,7 @@
      * Merge the entries and/or referrals from the supplied enumeration
      * with those of the current enumeration.
      */
-    protected void update(AbstractLdapNamingEnumeration<T> ne) {
+    protected void update(AbstractLdapNamingEnumeration<? extends NameClassPair> ne) {
         // Cleanup previous context first
         homeCtx.decEnumCount();
 
--- a/src/share/classes/com/sun/jndi/ldap/LdapBindingEnumeration.java	Wed Jul 13 15:21:08 2016 -0500
+++ b/src/share/classes/com/sun/jndi/ldap/LdapBindingEnumeration.java	Wed Jul 13 14:56:00 2016 +0100
@@ -104,9 +104,9 @@
     }
 
     @Override
-    protected LdapBindingEnumeration getReferredResults(
+    protected AbstractLdapNamingEnumeration<? extends NameClassPair> getReferredResults(
             LdapReferralContext refCtx) throws NamingException{
         // repeat the original operation at the new context
-        return (LdapBindingEnumeration)refCtx.listBindings(listArg);
+        return (AbstractLdapNamingEnumeration<? extends NameClassPair>)refCtx.listBindings(listArg);
     }
 }
--- a/src/share/classes/com/sun/jndi/ldap/LdapNamingEnumeration.java	Wed Jul 13 15:21:08 2016 -0500
+++ b/src/share/classes/com/sun/jndi/ldap/LdapNamingEnumeration.java	Wed Jul 13 14:56:00 2016 +0100
@@ -72,9 +72,9 @@
     }
 
     @Override
-    protected LdapNamingEnumeration getReferredResults(
+    protected AbstractLdapNamingEnumeration<? extends NameClassPair> getReferredResults(
             LdapReferralContext refCtx) throws NamingException {
         // repeat the original operation at the new context
-        return (LdapNamingEnumeration)refCtx.list(listArg);
+        return (AbstractLdapNamingEnumeration<? extends NameClassPair>)refCtx.list(listArg);
     }
 }
--- a/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java	Wed Jul 13 15:21:08 2016 -0500
+++ b/src/share/classes/com/sun/jndi/ldap/LdapSearchEnumeration.java	Wed Jul 13 14:56:00 2016 +0100
@@ -199,15 +199,15 @@
     }
 
     @Override
-    protected LdapSearchEnumeration getReferredResults(
+    protected AbstractLdapNamingEnumeration<? extends NameClassPair> getReferredResults(
             LdapReferralContext refCtx) throws NamingException {
         // repeat the original operation at the new context
-        return (LdapSearchEnumeration)refCtx.search(
+        return (AbstractLdapNamingEnumeration<? extends NameClassPair>)refCtx.search(
                 searchArgs.name, searchArgs.filter, searchArgs.cons);
     }
 
     @Override
-    protected void update(AbstractLdapNamingEnumeration<SearchResult> ne) {
+    protected void update(AbstractLdapNamingEnumeration<? extends NameClassPair> ne) {
         super.update(ne);
 
         // Update search-specific variables