Duplicate file names

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Duplicate file names

Yavuz Battalgazi
Hi,



I'm trying to analyze a large project containing duplicate java files.



but getting the error below;







---



Exception in thread "main" org.sonar.runner.RunnerException:

org.sonar.api.utils



.SonarException: Unable to read and import the source file : 'xxx.java'

with the charset : 'UTF-8'.



---







I've Sonar 3.4.1 installed.



Is a there a workaround to overcome this problem?



Because it is a common issue to have the same file names in diffrerent

directories in that project. (I do not want to rename the files manualy

every time I import from Nexus or etc.)







http://jira.codehaus.org/browse/SONAR-2444







In that record, there is a comment



---



Freddy Mallet added a comment - 02/Apr/12 9:01 AM







Perhaps we could support a new "sonar.supportSourceFileDuplications"

parameter to fix this issue.



---



is it applied or how can I solve this problem in some way ?







Sincerely,


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: Duplicate file names

Freddy Mallet
Hi Yavuz,

Your email is really badly formatted and almost unreadable. Which version of Sonar are you using ?

Thanks

-----
Sonar for Continuous Inspection


On Tue, May 7, 2013 at 10:05 AM, Yavuz Battalgazi <[hidden email]> wrote:
Hi,



I'm trying to analyze a large project containing duplicate java files.



but getting the error below;







---



Exception in thread "main" org.sonar.runner.RunnerException:

org.sonar.api.utils



.SonarException: Unable to read and import the source file : 'xxx.java'

with the charset : 'UTF-8'.



---







I've Sonar 3.4.1 installed.



Is a there a workaround to overcome this problem?



Because it is a common issue to have the same file names in diffrerent

directories in that project. (I do not want to rename the files manualy

every time I import from Nexus or etc.)







http://jira.codehaus.org/browse/SONAR-2444







In that record, there is a comment



---



Freddy Mallet added a comment - 02/Apr/12 9:01 AM







Perhaps we could support a new "sonar.supportSourceFileDuplications"

parameter to fix this issue.



---



is it applied or how can I solve this problem in some way ?







Sincerely,


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: Duplicate file names

jbelbute
In reply to this post by Yavuz Battalgazi
This is really a much bigger problem than java.  I have the problem with C++ and also with PL/SQL as well as java.  It is actually quite legitimate to have dupes as long as they are fully qualified.  I can give a lot of examples of where there are legitimate examples that are not at all violations but the pattern I often see in our code is that rather than using the file names to identify the type of file, that is contained in the directory structure.   I see that the jira issue referenced has been closed for some time and was wondering whether it can be reopened or a new one created to cover a more broader application of the duplication issue
Reply | Threaded
Open this post in threaded view
|

Re: Duplicate file names

Freddy Mallet
Hello,

Perhaps there is a misunderstanding :

This is really a much bigger problem than java.  I have the problem with C++
and also with PL/SQL as well as java.  It is actually quite legitimate to
have dupes as long as they are fully qualified.

Indeed if all duplicated files are fully qualified (from a root source directory) Sonar doesn't complain. Sonar only complains when the relative path to the files are the same in two different source directories. 

Kind regards

 
 I can give a lot of
examples of where there are legitimate examples that are not at all
violations but the pattern I often see in our code is that rather than using
the file names to identify the type of file, that is contained in the
directory structure.   I see that the jira issue referenced has been closed
for some time and was wondering whether it can be reopened or a new one
created to cover a more broader application of the duplication issue



--
View this message in context: http://sonar.15.x6.nabble.com/Duplicate-file-names-tp5012229p5012606.html
Sent from the Sonar user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email