diff --git a/src/main/java/fr/igred/omero/annotations/TableWrapper.java b/src/main/java/fr/igred/omero/annotations/TableWrapper.java index e3126118..a445f64b 100644 --- a/src/main/java/fr/igred/omero/annotations/TableWrapper.java +++ b/src/main/java/fr/igred/omero/annotations/TableWrapper.java @@ -385,7 +385,9 @@ private static ROIData[] createROIColumn(ResultsTable results, Map id2roi = rois.stream().collect(toMap(ROIWrapper::getId, GenericObjectWrapper::asDataObject)); Map name2roi = rois.stream() .filter(r -> !r.getName().isEmpty()) - .collect(toMap(ROIWrapper::getName, GenericObjectWrapper::asDataObject)); + .collect(toMap(ROIWrapper::getName, + GenericObjectWrapper::asDataObject, + (x1, x2) -> x1)); Map label2roi = ijRois.stream() .map(r -> new SimpleEntry<>(r.getProperty(roiProperty), diff --git a/src/test/java/fr/igred/omero/annotations/ImageJTableTest.java b/src/test/java/fr/igred/omero/annotations/ImageJTableTest.java index 4504f5df..e689aacd 100644 --- a/src/test/java/fr/igred/omero/annotations/ImageJTableTest.java +++ b/src/test/java/fr/igred/omero/annotations/ImageJTableTest.java @@ -500,7 +500,9 @@ void testCreateTableWithROINamesFromIJResults2() throws Exception { ROIWrapper roi2 = new ROIWrapper(); roi1.setImage(image); + roi1.setName("ROI"); roi2.setImage(image); + roi2.setName("ROI"); final int max = 14; for (int i = 10; i < max; i++) {