summaryrefslogtreecommitdiffstats
path: root/auth/auth-core/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'auth/auth-core/src/main')
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/local/AbsData.java6
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java12
-rw-r--r--auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java2
3 files changed, 15 insertions, 5 deletions
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/AbsData.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/AbsData.java
index d9f7ac96..17edae42 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/local/AbsData.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/local/AbsData.java
@@ -26,6 +26,7 @@ import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.util.Iterator;
+import java.util.NoSuchElementException;
import org.onap.aaf.auth.env.AuthzTrans;
import org.onap.aaf.auth.local.DataFile.Token;
@@ -87,7 +88,7 @@ public abstract class AbsData implements Iterable<String> {
try {
Thread.sleep(200);
} catch (InterruptedException e) {
- break;
+ Thread.currentThread().interrupt();
}
begin = System.currentTimeMillis();
}
@@ -188,6 +189,9 @@ public abstract class AbsData implements Iterable<String> {
@Override
public String next() {
+ if(!hasNext()) {
+ throw new NoSuchElementException();
+ }
reuse.reset();
int rec = tii.next();
reuse.pos(rec);
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
index 36efb5dc..d12345a9 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/org/OrganizationFactory.java
@@ -79,10 +79,16 @@ public class OrganizationFactory {
if(orgClass == null) {
env.warn().log("There is no Organization." + orgNS + " property");
} else {
- for(Organization o : orgs.values()) {
- if(orgClass.equals(o.getClass().getName())) {
- org = o;
+ try {
+ Class<?> orgCls = Class.forName(orgClass);
+ for(Organization o : orgs.values()) {
+ if(o.getClass().isAssignableFrom(orgCls)) {
+ org = o;
+ }
}
+ } catch (ClassNotFoundException e1) {
+ env.error().log(e1, orgClass + " is not on the Classpath.");
+ throw new OrganizationException(e1);
}
if(org==null) {
try {
diff --git a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java
index 7bb276a2..07b67bb0 100644
--- a/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java
+++ b/auth/auth-core/src/main/java/org/onap/aaf/auth/rserv/CachingFileAccess.java
@@ -486,7 +486,7 @@ public class CachingFileAccess<TRANS extends Trans> extends HttpCode<TRANS, Void
}
public String toString() {
- return data.toString();
+ return Arrays.toString(data);
}
public void write(Writer writer) throws IOException {