forked from D-Net/dnet-hadoop
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:
parent
a4f9052623
commit
8d1c12bd18
|
@ -140,21 +140,19 @@ public class SparkPatchRefereed implements Serializable {
|
|||
// ri.getHostedby().equals(i.getHostedby()) &&
|
||||
// ri.getInstancetype().equals(i.getInstancetype()) &&
|
||||
equals(ri.getUrl(), i.getUrl())) {
|
||||
Optional<Qualifier> oRefereed = Optional.ofNullable(i.getRefereed());
|
||||
if (!oRefereed.isPresent()) {
|
||||
if (ri.getRefereed().getClassid().equals("")) {
|
||||
i.setRefereed(Constants.DEFAULT_REFEREED);
|
||||
} else {
|
||||
i.setRefereed(ri.getRefereed());
|
||||
}
|
||||
}
|
||||
// Optional<Qualifier> oRefereed = Optional.ofNullable(i.getRefereed());
|
||||
// if (!oRefereed.isPresent()) {
|
||||
// if (!(ri.getRefereed().getClassid().equals("") ||
|
||||
// ri.getRefereed().getClassid().equals(Constants.DEFAULT_REFEREED.getClassid()))) {
|
||||
i.setRefereed(ri.getRefereed());
|
||||
return true;
|
||||
// }
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// 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 {
|
||||
if (url == null && url1 == null) {
|
||||
return true;
|
||||
|
|
|
@ -97,10 +97,13 @@ public class SparkPrepareResultInstanceList implements Serializable {
|
|||
.map(instance -> {
|
||||
Optional<Qualifier> oRefereed = Optional.ofNullable(instance.getRefereed());
|
||||
if (oRefereed.isPresent()) {
|
||||
return instance;
|
||||
} else {
|
||||
return null;
|
||||
if (!(oRefereed.get().getClassid().equals(Constants.DEFAULT_REFEREED.getClassid()) ||
|
||||
oRefereed.get().getClassid().equals("UNKNOWN") ||
|
||||
oRefereed.get().getClassid().equals(""))) {
|
||||
return instance;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
})
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList()))
|
||||
|
|
Loading…
Reference in New Issue