-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi I am facing this issue while using repair command #335
Comments
Hi @DnvSaiteja, and thanks for the bug report! My gut feeling is that this is caused by insufficient Windows support from our side. We don't yet fully support Windows, although that is in the works (#273). It could be something else though, it's hard to say without the files you're trying to repair.
Nevermind, I see that you actually put the file in the initial post! |
Are you using Windows? It looks like you are as If on Windows, try to change the paths like so: java -jar sorald\target\sorald-1.1-SNAPSHOT-jar-with-dependencies.jar repair --original-files-path sorald\src\test\resources\processor_test_files\2095_UnclosedResources\ZipFolder.java --rule-keys 2095 --workspace outputdir |
Hi, did anybody found a workaround for how to make sorald work for windows |
@DnvSaiteja Did you try the things I suggested with the paths? You appear to be supplying Unix-style paths (using There are circumstances where Sorald will fail on Windows, and this might be one of those. We are working on Windows support (#273), but it probably won't be ready for another couple of months as we currently have other tasks with higher priority at the moment. @khaes-kth Can you try to replicate this crash on your system? |
Hi @slarse I just remembered this issue. Sorry for being too late. I get the same error:
The command: Actually, that is the main issue I always face in Windows. That's why I added #273 |
@khaes-kth thanks for taking a look. This would then probably be fixed by fixing #166. I will get on that most likely next week as I've faced several difficult-to-debug bugs in the past week simply because of paths being represented by strings a little here and there. |
After executng above command, I am getting the below error
]
INFO Configured Java source version (sonar.java.source): 14
INFO JavaClasspath initialization
INFO JavaClasspath initialization (done) | time=36ms
INFO JavaTestClasspath initialization
INFO JavaTestClasspath initialization (done) | time=1ms
INFO Java Main Files AST scan
INFO 1 source files to be analyzed
INFO 1/1 source files have been analyzed
INFO Java Main Files AST scan (done) | time=2490ms
INFO Java Test Files AST scan
INFO 0 source files to be analyzed
INFO Java Test Files AST scan (done) | time=1ms
INFO Java Generated Files AST scan
INFO 0/0 source files have been analyzed
INFO 0 source files to be analyzed
INFO Java Generated Files AST scan (done) | time=0ms
INFO 0/0 source files have been analyzed
java.lang.IllegalArgumentException: 'other' is different type of Path
at java.base/sun.nio.fs.WindowsPath.relativize(WindowsPath.java:400)
at java.base/sun.nio.fs.WindowsPath.relativize(WindowsPath.java:42)
at sorald.event.models.WarningLocation.(WarningLocation.java:16)
at sorald.event.models.miner.MinedViolationEvent.(MinedViolationEvent.java:24)
at sorald.Repair.lambda$mineViolations$2(Repair.java:138)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at sorald.Repair.mineViolations(Repair.java:136)
at sorald.Repair.getRuleViolations(Repair.java:105)
at sorald.Repair.repair(Repair.java:88)
at sorald.cli.RepairCommand.call(RepairCommand.java:121)
at sorald.cli.RepairCommand.call(RepairCommand.java:27)
at picocli.CommandLine.executeUserObject(CommandLine.java:1933)
at picocli.CommandLine.access$1200(CommandLine.java:145)
at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2332)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2326)
at picocli.CommandLine$RunLast.handle(CommandLine.java:2291)
at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2159)
at picocli.CommandLine.execute(CommandLine.java:2058)
at sorald.Main.main(Main.java:7)
The text was updated successfully, but these errors were encountered: