FULL PRODUCT VERSION :
java version "1.5.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]
A DESCRIPTION OF THE PROBLEM :
Code that used to compile just fine when using the JAAS API no longer compile giving me the following error:
DummyLoginModule.java:17: abstract method initialize(javax.security.auth.Subject,javax.security.auth.callback.CallbackHandler,java.util.Map<java.lang.String,?>,java.util.Map<java.lang.String,?>) in javax.security.auth.spi.LoginModule cannot be accessed directly
super.initialize(subject, callbackHandler, sharedState, options);
DummyLoginModule is a subclass of an AbstractLoginModule I created with one abstract method called doAuthenticate. The DummyLoginModule class overrides initialize() method of the parent class and also makes a call to super.initialize() which is where the compile error happens.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
The following two classes compiled just fine under 1.4.2_05..but no longer compile under 1.5.. just try to compile the two classes under 1.5
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I was expecting the code to compile without any modifications between 1.4 and 1.5.. or am I wrong?
ACTUAL -
When trying to compile from the command line I get the following error:
Where %JAVA_HOME% is pointing to my JDK1.5.0
C:\Documents and Settings\tmulle\IdeaProjects\AbstractTest\src>"%JAVA_HOME%\bin\javac.exe" *.java -Xlint -d ..\classes
DummyLoginModule.java:17: abstract method initialize(javax.security.auth.Subject,javax.security.auth.callback.CallbackHandler,java.util.Map<java.lang.String,?>,java.util.Map<java.lang.String,?>) in ja
vax.security.auth.spi.LoginModule cannot be accessed directly
super.initialize(subject, callbackHandler, sharedState, options);
^
DummyLoginModule.java:17: warning: [unchecked] unchecked conversion
found : java.util.Map
required: java.util.Map<java.lang.String,?>
super.initialize(subject, callbackHandler, sharedState, options);
^
DummyLoginModule.java:17: warning: [unchecked] unchecked conversion
found : java.util.Map
required: java.util.Map<java.lang.String,?>
super.initialize(subject, callbackHandler, sharedState, options);
^
1 error
2 warnings
REPRODUCIBILITY :
This bug can be reproduced always.
---------- BEGIN SOURCE ----------
import javax.security.auth.spi.LoginModule;
import javax.security.auth.Subject;
import javax.security.auth.login.LoginException;
import javax.security.auth.callback.CallbackHandler;
import java.util.Map;
/**
* Simple abstract parent class
*/
public abstract class AbstractLoginModule implements LoginModule {
protected Subject subject;
protected CallbackHandler callbackHandler;
protected Map sharedState;
protected Map options;
protected abstract boolean doAuthenticate(String user, String password) throws LoginException;
public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) {
this.subject = subject;
this.callbackHandler = callbackHandler;
this.sharedState = sharedState;
this.options = options;
}
public boolean login() throws LoginException {
return false;
}
public boolean commit() throws LoginException {
return false;
}
public boolean abort() throws LoginException {
return false;
}
public boolean logout() throws LoginException {
return false;
}
}
// DummyLoginModule class
import javax.security.auth.login.LoginException;
import javax.security.auth.Subject;
import javax.security.auth.callback.CallbackHandler;
import java.util.Map;
/**
* Simple subclass of AbstractLoginModule that overrides initialize
* and implements doAuthenticate
*/
public class DummyLoginModule extends AbstractLoginModule {
public void initialize(Subject subject, CallbackHandler callbackHandler, Map sharedState, Map options) {
// THIS LINE WILL NOT COMPILE UNDER 1.5
super.initialize(subject, callbackHandler, sharedState, options);
}
protected boolean doAuthenticate(String user, String password) throws LoginException {
return false;
}
}
---------- END SOURCE ----------
Release Regression From : 1.4.2_05
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
###@###.### 10/13/04 10:47 GMT