-
Notifications
You must be signed in to change notification settings - Fork 363
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
CxxIssuesReportSensor: use realPath as part of path normalization #1653
Conversation
I have tested your changes to some projects and it works perfektly. Works no matter how I write the folder name now e.g. "Sources", "sources" or "SouRcEs". As I expect it under Windows. Thank you very much! |
@ivangalkin I like the solution. Question is if there is a big performance impact? Think not all users need it?
Think we have two CI systems with Travis and AppVeyor on Linux and Windows. We can test it by adding an integration test. |
* introduce the fallback for the lookup of `InputFile`s: try it with the Path::realPath() resolves SonarOpenCommunity#1651
@guwirth I came to the conclusion, that using the real path ( I like the idea to use it in |
@ivangalkin yes makes sense. Do you like to write a test or should I merge it as it is? |
@@ -145,8 +145,8 @@ private InputFile getInputFileTryRealPath(SensorContext sensorContext, String pa | |||
realPath = absolutePath.toRealPath(LinkOption.NOFOLLOW_LINKS); | |||
} catch (IOException e) { | |||
if (LOG.isDebugEnabled()) { | |||
LOG.debug("Unable to get the real path: module {}, baseDir {}, path {}", sensorContext.module().key(), | |||
sensorContext.fileSystem().baseDir(), path); | |||
LOG.debug("Unable to get the real path: module '{}', baseDir '{}', path '{}', excepiton '{}'", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here is an spelling error in 'excepiton'
* if the given path cannot be found in module we searched after the "real" path * shortcut: no need to perform the second search i the "real" path is equal to the given one * this shortcut should save a bit of run-time for the file-systems, which are case-sensitive (e.g. for the mainstream linux)
@rudolfgrauberger thx W.r.t. the performance: I've added a shortcut in order to skip the secondary lookup if it doesn't make sense anymore: f2d41b9. We skip a call into the Plugin-API, so it should safe some run-time. No measurements were made, tho. |
InputFile
s: if generic lookup was not successful, try it with thePath::realPath()
resolves #1651
@rudolfgrauberger could you please test the snapshot on your local setup?
@guwirth how do we suppose to test things like that?
This change is