1
0
Fork 0

using actual result subclasses instead of their parent class

This commit is contained in:
Claudio Atzori 2020-12-14 14:40:54 +01:00
parent 152916890f
commit 7d325e2c57
2 changed files with 2 additions and 2 deletions

View File

@ -108,7 +108,7 @@ public class SparkResultToCommunityFromOrganizationJob {
.stream()
.map(con -> con.getId())
.collect(Collectors.toList());
Result res = new Result();
R res = (R) ret.getClass().newInstance();
res.setId(ret.getId());
List<Context> propagatedContexts = new ArrayList<>();
for (String cId : communitySet) {

View File

@ -130,7 +130,7 @@ public class SparkResultToCommunityThroughSemRelJob {
})
.filter(Objects::nonNull)
.collect(Collectors.toList());
Result r = new Result();
R r = (R) ret.getClass().newInstance();
r.setId(ret.getId());
r.setContext(contextList);
ret.mergeFrom(r);