Skip to content
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

Use java.nio.file.path instead of org.apache.commons.io.FilenameUtils #621

Closed
guwirth opened this issue Aug 31, 2015 · 4 comments
Closed

Comments

@guwirth
Copy link
Collaborator

guwirth commented Aug 31, 2015

@Bertk: Yes, we should use more Java 7 methods and replace this Strings class with Path class. I also feel we should remove dependency to org.apache.commons.io.FilenameUtils in CxxReportSensor.java and use java.nio.file.path.
https://docs.oracle.com/javase/tutorial/essential/io/pathOps.html
https://docs.oracle.com/javase/8/docs/api/java/nio/file/Path.html

@guwirth
Copy link
Collaborator Author

guwirth commented Aug 31, 2015

@Bertk: What is the advantage?

@Bertk
Copy link
Contributor

Bertk commented Oct 19, 2015

Currently we use strings for paths and file names. Java 7 has a rich feature set for file&path and especially the relativize method (http://docs.oracle.com/javase/7/docs/api/java/nio/file/Path.html#relativize(java.nio.file.Path) which is helpful for the sensors. I expect some cleaner code and we should use nio methods or SQ InputFile in org.sonar.plugins.cxx.utils.

I also want to investigate a problem with CppCheck sensor which did not create issues for sources in sub-folders.

@jmecosta
Copy link
Member

jmecosta commented Dec 6, 2015

#683 should use nio lib

@guwirth guwirth added this to the subsequent release milestone Oct 17, 2016
@guwirth guwirth removed this from the 0.9.8 milestone Aug 24, 2017
@Bertk Bertk closed this as completed Nov 7, 2017
@guwirth
Copy link
Collaborator Author

guwirth commented Nov 7, 2017

@Bertk why did you close this? I still found some places where org.apache.commons.io.FileUtils is in use?

https://github.com/SonarOpenCommunity/sonar-cxx/search?utf8=%E2%9C%93&q=org.apache.commons.io.FileUtils&type=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants