changed the way info is produced for the patch. If no interesting refereed info is present, the association result info is not produced

This commit is contained in:
Miriam Baglioni 2020-07-06 13:57:37 +02:00
parent a4f9052623
commit 8d1c12bd18
2 changed files with 13 additions and 12 deletions

View File

@ -140,21 +140,19 @@ public class SparkPatchRefereed implements Serializable {
// ri.getHostedby().equals(i.getHostedby()) && // ri.getHostedby().equals(i.getHostedby()) &&
// ri.getInstancetype().equals(i.getInstancetype()) && // ri.getInstancetype().equals(i.getInstancetype()) &&
equals(ri.getUrl(), i.getUrl())) { equals(ri.getUrl(), i.getUrl())) {
Optional<Qualifier> oRefereed = Optional.ofNullable(i.getRefereed()); // Optional<Qualifier> oRefereed = Optional.ofNullable(i.getRefereed());
if (!oRefereed.isPresent()) { // if (!oRefereed.isPresent()) {
if (ri.getRefereed().getClassid().equals("")) { // if (!(ri.getRefereed().getClassid().equals("") ||
i.setRefereed(Constants.DEFAULT_REFEREED); // ri.getRefereed().getClassid().equals(Constants.DEFAULT_REFEREED.getClassid()))) {
} else { i.setRefereed(ri.getRefereed());
i.setRefereed(ri.getRefereed());
}
}
return true; return true;
// }
} }
return false; return false;
} }
// TODO verify the reason of the NullPointerException fired at line 167 // TODO verify the reason of the NullPointerException fired at line 167
private static boolean equals(List<String> url, List<String> url1) { public static boolean equals(List<String> url, List<String> url1) {
try { try {
if (url == null && url1 == null) { if (url == null && url1 == null) {
return true; return true;

View File

@ -97,10 +97,13 @@ public class SparkPrepareResultInstanceList implements Serializable {
.map(instance -> { .map(instance -> {
Optional<Qualifier> oRefereed = Optional.ofNullable(instance.getRefereed()); Optional<Qualifier> oRefereed = Optional.ofNullable(instance.getRefereed());
if (oRefereed.isPresent()) { if (oRefereed.isPresent()) {
return instance; if (!(oRefereed.get().getClassid().equals(Constants.DEFAULT_REFEREED.getClassid()) ||
} else { oRefereed.get().getClassid().equals("UNKNOWN") ||
return null; oRefereed.get().getClassid().equals(""))) {
return instance;
}
} }
return null;
}) })
.filter(Objects::nonNull) .filter(Objects::nonNull)
.collect(Collectors.toList())) .collect(Collectors.toList()))