From 7bedae690861e016b379cac6fec26b8d2b6bff52 Mon Sep 17 00:00:00 2001 From: Sven Fillinger Date: Tue, 27 Aug 2024 14:20:58 +0200 Subject: [PATCH] Last refactor --- .../java/life/qbic/datamanager/parser/xlsx/TSVParser.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/user-interface/src/main/java/life/qbic/datamanager/parser/xlsx/TSVParser.java b/user-interface/src/main/java/life/qbic/datamanager/parser/xlsx/TSVParser.java index ad7688eaa..1cb1f331c 100644 --- a/user-interface/src/main/java/life/qbic/datamanager/parser/xlsx/TSVParser.java +++ b/user-interface/src/main/java/life/qbic/datamanager/parser/xlsx/TSVParser.java @@ -87,13 +87,12 @@ public ParsingResult parse(InputStream inputStream) { } var values = content.subList(1, content.size()); - var iterator = values.iterator(); List rows = new ArrayList<>(); - while (iterator.hasNext()) { - var row = iterator.next().split(VALUE_SEPARATOR); + for (String row : values) { + var rowContent = row.split(VALUE_SEPARATOR); String[] rowData = new String[header.length]; for (Entry propertyEntry : propertyToIndex.entrySet()) { - rowData[propertyEntry.getValue()] = safeAccess(row, propertyEntry.getValue()).orElse(""); + rowData[propertyEntry.getValue()] = safeAccess(rowContent, propertyEntry.getValue()).orElse(""); } rows.add(new Row(Arrays.stream(rowData).toList())); }