Bug #9859
Problem compiling Java code under windows
100%
History
#1 Updated by Tomasz Domin over 1 year ago
When trying to compile and run Java code under windows tests fail with a following error:
2025-03-31 12:57:06 INFO Harness Start
Cannot load file (bad content).
java.lang.IllegalArgumentException: Illegal character in path at index 13: string:///com\goldencode\harness\test\temporary\Temp0.java
at java.net.URI.create(URI.java:852)
at com.goldencode.compile.InMemorySourceCode.<init>(InMemorySourceCode.java:59)
at com.goldencode.compile.InMemoryCompiler.compile(InMemoryCompiler.java:66)
at com.goldencode.harness.test.TestFactory.loadRunCode(TestFactory.java:2401)
at com.goldencode.harness.test.TestFactory.processStepDefinition(TestFactory.java:1266)
The problem is badly constructed URI - when running on windows when converting from full class name to a path dots are replaced with file.separator which is backslash \ under windows. Like in:
super(URI.create("string:///" +
name.replaceAll("\\.", File.separator) +
Kind.CLASS.extension),
Kind.CLASS);
#2 Updated by Tomasz Domin over 1 year ago
- File 9859a.diff
added - Status changed from New to WIP
- % Done changed from 0 to 50
This is not correct for URI, where file separator is always slash /
Attached 9859a.diff patch for using only / when creating class or java source URI.
Works fine under windows.
#3 Updated by Tomasz Domin over 1 year ago
- Assignee set to Tomasz Domin
#4 Updated by Greg Shah over 1 year ago
Code Review 9859a.diff
The change is good.
#6 Updated by Tomasz Domin over 1 year ago
Greg Shah wrote:
Why Done of 50?
Not fully tested yet (testing under linux).
#7 Updated by Greg Shah over 1 year ago
We don't include testing in our % Done. The idea is that % Done refers to the functionality of the fix/feature. It is not a perfect mechanism, ideally we would be able to report 100% functionality but less than 100% for testing. But we have 1 number to use and we use it this way.
#8 Updated by Tomasz Domin over 1 year ago
- % Done changed from 50 to 100
Done development testing under Linux :)
#9 Updated by Tomasz Domin over 1 year ago
- Status changed from Internal Test to Review
- reviewer Constantin Asofiei, Greg Shah added
Please review once more (if needed).
#10 Updated by Greg Shah over 1 year ago
Are there changes from the diff posted in #9859-2? If not, no additional review is needed.
#11 Updated by Tomasz Domin over 1 year ago
- Status changed from Review to Internal Test
Greg Shah wrote:
Are there changes from the diff posted in #9859-2? If not, no additional review is needed.
No, there are no changes. I'd like to merge 9859a.diff directly to harness/trunk.
#12 Updated by Greg Shah over 1 year ago
- Status changed from Internal Test to Merge Pending
You can merge now.
#13 Updated by Tomasz Domin over 1 year ago
- Status changed from Merge Pending to Test
9859a.diff has been merged.
Committed revision 38.