vadere-console.jar migrate sub-command fails because wrong files are converted
Summary
In the Vadere wiki, the steps are described to migrate ALL existing scenario files in the repo to the latest version. But, the migration fails on master branch with the following error message below:
Migration assistant tries to migrate the wrong file ./.git/logs/refs/remotes/origin/Koopman_scenario
14:33:14,145 INFO MigrationUtil:106 - migrate: ./.git/logs/refs/remotes/origin/Koopman_scenario 14:33:14,146 ERROR JsonMigrationAssistant:80 - Error converting File: Invalid numeric value: Leading zeroes not allowed at [Source: (String)"0000000000000000000000000000000000000000 1e0df029bb90df99476ec73f2eec8cc846e07fdc Benedikt Kleinmeier 1603455622 +0200 fetch --append origin: storing head"; line: 1, column: 2] 14:33:14,146 ERROR MigrationUtil:110 - Error in MigrationUtil stop: Could not read JsonFile or create Json representationInvalid numeric value: Leading zeroes not allowed at [Source: (String)"0000000000000000000000000000000000000000 1e0df029bb90df99476ec73f2eec8cc846e07fdc Benedikt Kleinmeier 1603455622 +0200 fetch --append origin: storing head"; line: 1, column: 2] Cannot start vadere-console: topographyError while processing MigrationTaskHandler in walkFileTree org.vadere.simulator.projects.migration.MigrationException: topographyError while processing MigrationTaskHandler in walkFileTree at org.vadere.simulator.projects.migration.incident.helper.MigrationUtil.migrateDirectoryTree(MigrationUtil.java:80) at org.vadere.simulator.entrypoints.cmd.commands.MigrationSubCommand.run(MigrationSubCommand.java:100) at org.vadere.simulator.entrypoints.cmd.VadereConsole.main(VadereConsole.java:40) Caused by: org.vadere.simulator.projects.migration.MigrationException: Could not read JsonFile or create Json representationInvalid numeric value: Leading zeroes not allowed at [Source: (String)"0000000000000000000000000000000000000000 1e0df029bb90df99476ec73f2eec8cc846e07fdc Benedikt Kleinmeier 1603455622 +0200 fetch --append origin: storing head"; line: 1, column: 2] at org.vadere.simulator.projects.migration.jsontranformation.JsonMigrationAssistant.migrateScenarioFile(JsonMigrationAssistant.java:81) at org.vadere.simulator.projects.migration.jsontranformation.JsonMigrationAssistant.migrateScenarioFile(JsonMigrationAssistant.java:133) at org.vadere.simulator.projects.migration.incident.helper.MigrationUtil.migrate(MigrationUtil.java:107) at org.vadere.simulator.projects.migration.incident.helper.MigrationUtil.lambda$migrateDirectoryTree$0(MigrationUtil.java:72) at org.vadere.simulator.projects.migration.incident.helper.MigrationUtil$1.visitFile(MigrationUtil.java:181) at org.vadere.simulator.projects.migration.incident.helper.MigrationUtil$1.visitFile(MigrationUtil.java:137) at java.base/java.nio.file.Files.walkFileTree(Files.java:2724) at java.base/java.nio.file.Files.walkFileTree(Files.java:2796) at org.vadere.simulator.projects.migration.incident.helper.MigrationUtil.migrateDirectoryTree(MigrationUtil.java:75)
What is the current bug behavior?
The migration assistant identified the file ./.git/logs/refs/remotes/origin/Koopman_scenario
as scenario file. Maybe, the regular expression .scenario
is used to search for scenario files. But, the leading dot (.
) matches any character (i.e., the underscore here) resulting in a wrong file list for the migration assistant.
What is the expected correct behavior?
The migration assistant shall search for literal dots in filenames to only identify files with extension .scenario
.