summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarsten Drossel2009-01-09 08:55:20 (EST)
committerCarsten Drossel2009-01-09 08:55:20 (EST)
commit4734f3d2566250e2d22e30af343421cb461668cb (patch)
treec53f26d3c8734e197df01b4635ce82f798574518
parentcee10d913987a6b86d27ab5c46e0e9015f4b2f7a (diff)
downloadorg.eclipse.riena-4734f3d2566250e2d22e30af343421cb461668cb.zip
org.eclipse.riena-4734f3d2566250e2d22e30af343421cb461668cb.tar.gz
org.eclipse.riena-4734f3d2566250e2d22e30af343421cb461668cb.tar.bz2
fixed warnings
-rw-r--r--org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authentication/loginmodule/SampleLoginModule.java19
-rw-r--r--org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authorizationservice/store/FilePermissionStore.java3
2 files changed, 3 insertions, 19 deletions
diff --git a/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authentication/loginmodule/SampleLoginModule.java b/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authentication/loginmodule/SampleLoginModule.java
index 2913c95..a583807 100644
--- a/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authentication/loginmodule/SampleLoginModule.java
+++ b/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authentication/loginmodule/SampleLoginModule.java
@@ -24,10 +24,9 @@ import javax.security.auth.callback.UnsupportedCallbackException;
import javax.security.auth.login.LoginException;
import javax.security.auth.spi.LoginModule;
+import org.eclipse.equinox.log.Logger;
import org.eclipse.riena.internal.security.simpleservices.Activator;
import org.eclipse.riena.security.common.authentication.SimplePrincipal;
-
-import org.eclipse.equinox.log.Logger;
import org.osgi.service.log.LogService;
/**
@@ -38,11 +37,6 @@ public class SampleLoginModule implements LoginModule {
private Subject subject;
private CallbackHandler callbackHandler;
- private Map<String, ?> sharedState;
- private Map<String, ?> options;
-
- // configurable option
- private boolean debug = false;
private String username;
private String password;
@@ -83,17 +77,12 @@ public class SampleLoginModule implements LoginModule {
Map<String, ?> options) {
this.subject = subject;
this.callbackHandler = callbackHandler;
- this.sharedState = sharedState;
- this.options = options;
try {
accounts = loadProperties((String) options.get("accounts.file")); //$NON-NLS-1$
} catch (IOException e) {
e.printStackTrace();
}
-
- // initialize any configured options
- debug = Boolean.valueOf((String) options.get("debug")); //$NON-NLS-1$
}
private Properties loadProperties(String path) throws IOException {
@@ -121,11 +110,7 @@ public class SampleLoginModule implements LoginModule {
username = ((NameCallback) callbacks[0]).getName();
password = new String(((PasswordCallback) callbacks[1]).getPassword());
String psw = (String) accounts.get(username);
- if (psw != null && psw.equals(password)) {
- return true;
- } else {
- return false;
- }
+ return psw != null && psw.equals(password);
// if (username != null && password != null) {
// if (username.equals("testuser") && password.equals("testpass")) { //$NON-NLS-1$ //$NON-NLS-2$
// return true;
diff --git a/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authorizationservice/store/FilePermissionStore.java b/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authorizationservice/store/FilePermissionStore.java
index 15f30d8..28288f7 100644
--- a/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authorizationservice/store/FilePermissionStore.java
+++ b/org.eclipse.riena.security.simpleservices/src/org/eclipse/riena/security/simpleservices/authorizationservice/store/FilePermissionStore.java
@@ -12,7 +12,6 @@ package org.eclipse.riena.security.simpleservices.authorizationservice.store;
import java.io.File;
import java.io.FileInputStream;
-import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
@@ -40,7 +39,7 @@ public class FilePermissionStore implements IPermissionStore {
private Document permissionTree;
- public FilePermissionStore(File permissionFile) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException {
+ public FilePermissionStore(File permissionFile) throws SAXException, IOException, ParserConfigurationException {
this(new FileInputStream(permissionFile));
}