forked from D-Net/dnet-hadoop
using actual result subclasses instead of their parent class
This commit is contained in:
parent
152916890f
commit
7d325e2c57
|
@ -108,7 +108,7 @@ public class SparkResultToCommunityFromOrganizationJob {
|
||||||
.stream()
|
.stream()
|
||||||
.map(con -> con.getId())
|
.map(con -> con.getId())
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
Result res = new Result();
|
R res = (R) ret.getClass().newInstance();
|
||||||
res.setId(ret.getId());
|
res.setId(ret.getId());
|
||||||
List<Context> propagatedContexts = new ArrayList<>();
|
List<Context> propagatedContexts = new ArrayList<>();
|
||||||
for (String cId : communitySet) {
|
for (String cId : communitySet) {
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class SparkResultToCommunityThroughSemRelJob {
|
||||||
})
|
})
|
||||||
.filter(Objects::nonNull)
|
.filter(Objects::nonNull)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
Result r = new Result();
|
R r = (R) ret.getClass().newInstance();
|
||||||
r.setId(ret.getId());
|
r.setId(ret.getId());
|
||||||
r.setContext(contextList);
|
r.setContext(contextList);
|
||||||
ret.mergeFrom(r);
|
ret.mergeFrom(r);
|
||||||
|
|
Loading…
Reference in New Issue