libspring-security-2.0-java (2.0.5.RELEASE-1) 01_fix_compilation.diff

Summary

 dist/spring-security-core/org/springframework/security/ldap/DefaultInitialDirContextFactory.java           |    4 ++++
 dist/spring-security-core/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java |    4 ++++
 2 files changed, 8 insertions(+)

    
download this patch

Patch contents

Author: Miguel Landaeta <miguel@miguel.cc>
Subject: fix compilation errors with a abstract class not implementing some methods

This patch is included because javac emitted errors like these with those classes:

org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java:121: org.springframework.security.providers.ldap.authenticator.BindAuthenticator.BindWithSpecificDnContextSource is not abstract and does not override abstract method getContext(java.lang.String,java.lang.String) in org.springframework.ldap.core.ContextSource
    private class BindWithSpecificDnContextSource implements ContextSource {
            ^
org/springframework/security/ldap/DefaultInitialDirContextFactory.java:74: org.springframework.security.ldap.DefaultInitialDirContextFactory is not abstract and does not override abstract method getContext(java.lang.String,java.lang.String) in org.springframework.ldap.core.ContextSource
public class DefaultInitialDirContextFactory implements InitialDirContextFactory,
       ^

Spring Security 2.0 was developed using Spring LDAP 1.2 and that version didn't
included getContext method in its abstract class org.springframework.ldap.core.ContextSource.

diff --git a/dist/spring-security-core/org/springframework/security/ldap/DefaultInitialDirContextFactory.java b/dist/spring-security-core/org/springframework/security/ldap/DefaultInitialDirContextFactory.java
index 4edb2fb..7a2c7b3 100644
--- a/dist/spring-security-core/org/springframework/security/ldap/DefaultInitialDirContextFactory.java
+++ b/dist/spring-security-core/org/springframework/security/ldap/DefaultInitialDirContextFactory.java
@@ -354,6 +354,10 @@ public class DefaultInitialDirContextFactory implements InitialDirContextFactory
         return newInitialDirContext(userDn, (String) credentials);
     }
 
+    public DirContext getContext(String principal, String credentials) {
+        throw new UnsupportedOperationException("DirContext");
+    }
+
     public DistinguishedName getBaseLdapPath() {
         return new DistinguishedName(rootDn);
     }
diff --git a/dist/spring-security-core/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java b/dist/spring-security-core/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java
index 927d627..fa2ae11 100644
--- a/dist/spring-security-core/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java
+++ b/dist/spring-security-core/org/springframework/security/providers/ldap/authenticator/BindAuthenticator.java
@@ -137,6 +137,10 @@ public class BindAuthenticator extends AbstractLdapAuthenticator {
         public DirContext getReadWriteContext() throws DataAccessException {
             return getReadOnlyContext();
         }
+
+        public DirContext getContext(String principal, String credentials) {
+            throw new UnsupportedOperationException("DirContext");
+        }
     }
 
 }