PathResolver fails to handle 8.3 filename (short filename)

42 views
Skip to first unread message

alow...@gmail.com

unread,
Oct 27, 2017, 4:33:15 AM10/27/17
to SonarQube
Hi,

I've been trying to build the sonar-java project and on one laptop I didn't really have problems but when I tried on another I started getting weird NPE's in JavaSquidTest and another.
So far I think I've narrowed it down to the use of 8.3 filename because this happens: 
The PathResolver thinks the file path doesn't start with the base dir because of one having the short name and the other having the long name.
And thus it returns null there and eventually I get a NPE at SonarComponents#getCharset.
(The test I've debugged is JavaSquidTest, there was another one that faild but I forgot which and atm am not able to access the laptop on which it fails.
But I'm pretty sure that it has the same cause.)

I haven't looked into it too much and how/why it does this path resolving (or why one is the long name and the other is the short name to begin with).

So I'm not sure what the solution should be here, anyone got any ideas?

Tibor Blenessy

unread,
Oct 30, 2017, 6:04:26 AM10/30/17
to alow...@gmail.com, SonarQube
Hello,

short filenames are quite a mess on Windows, and there are some issues in our test framework with them, but they are quite difficult to reproduce and fix. The easiest way is to avoid having temporary directory within such path, you can do this either by setting java.io.tmpdir property on the command line or you can disable short part generation for the whole system - see microsoft how-to here .

Hope that helps, and do not hesitate to reach out again if you face some issues.

Regards

Tibor

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/c3fca6ed-e747-4599-bfdd-f188dde7d6db%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--

Tibor Blenessy | SonarSource

SonarJava Developer

https://sonarsource.com 

alow...@gmail.com

unread,
Dec 13, 2017, 8:04:29 AM12/13/17
to SonarQube
I'm sorry for not responding, I haven't been able to play around more with it.
Thanks for the reply, when I have some more time to try out building etc. Sonar I'll make sure to not have short file paths.

Regards,
Alowan

Op maandag 30 oktober 2017 11:04:26 UTC+1 schreef Tibor Blenessy:
Reply all
Reply to author
Forward
0 new messages