- 
                Notifications
    You must be signed in to change notification settings 
- Fork 7
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
PowerSystemDataModel/src/main/java/edu/ie3/datamodel/io/csv/BufferedCsvWriter.java
Lines 67 to 86 in 124d2fc
| /** | |
| * Actually persisting the provided entity field data | |
| * | |
| * @param entityFieldData a mapping of an entity instance fields to their values | |
| * @throws IOException If writing has failed | |
| * @throws SinkException If the data does not meet the pre-defined head line | |
| */ | |
| public synchronized void write(Map<String, String> entityFieldData) | |
| throws IOException, SinkException { | |
| /* Check against eligible head line elements */ | |
| if (entityFieldData.size() != headLineElements.length | |
| || !entityFieldData.keySet().containsAll(Arrays.asList(headLineElements))) | |
| throw new SinkException( | |
| "The provided data does not meet the pre-defined head line elements '" | |
| + String.join(",", headLineElements) | |
| + "'."); | |
| String[] entries = entityFieldData.values().toArray(new String[0]); | |
| writeOneLine(entries); | |
| } | 
Current implementation of write method exhibits wrong behavior. It assumes, that the map entries are given in the same order as the headline elements. However, this is not always the case and especially not the behavior, that one would expect. This possibly leads to data errors, where you can't spot a swapped column (because both are numerical and of same range).
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working