From 07a373a0bd88902e486aaa95644bf72721848a81 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Tue, 30 Jan 2024 13:51:11 +0100 Subject: [PATCH] [bulkTagging] removing checks while performing the substring action so that it will fire an Exception if the paramneters are wrongly set --- .../bipfinder/SparkAtomicActionScoreJob.java | 2 +- .../dhp/bulktag/actions/ExecSubstringAction.java | 12 +----------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java index 040c89782..76c8ec7fa 100644 --- a/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java +++ b/dhp-workflows/dhp-aggregation/src/main/java/eu/dnetlib/dhp/actionmanager/bipfinder/SparkAtomicActionScoreJob.java @@ -95,7 +95,7 @@ public class SparkAtomicActionScoreJob implements Serializable { return projectScores.map((MapFunction) bipProjectScores -> { Project project = new Project(); - project.setId(bipProjectScores.getProjectId()); + //project.setId(bipProjectScores.getProjectId()); project.setMeasures(bipProjectScores.toMeasures()); return project; }, Encoders.bean(Project.class)) diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/actions/ExecSubstringAction.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/actions/ExecSubstringAction.java index 0ada4ebfb..444e8b82d 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/actions/ExecSubstringAction.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/actions/ExecSubstringAction.java @@ -38,18 +38,8 @@ public class ExecSubstringAction implements Serializable { } public String execSubstring() { - int to = Integer.valueOf(this.to); - int from = Integer.valueOf(this.from); - if (to < from || from > this.value.length()) - return ""; - - if (from < 0) - from = 0; - if (to > this.value.length()) - to = this.value.length(); - - return this.value.substring(from, to); + return this.value.substring(Integer.valueOf(this.from), Integer.valueOf(this.to)); } }