[ https://jira.codehaus.org/browse/MPMD-173?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Dennis Lundberg updated MPMD-173: --------------------------------- Description: In our code, in a same file, we use a builder as follows: {code:java} public final class Test { private Test() {} public static final class Builder { public Test build() { return new Test(); } } } Test test = new Test.Builder().build(); {code} However, SonarQube raises the issue "Class cannot be instantiated and does not provide any static methods or fields" on such class. Could you please advise or fix the problem if it is a real issue? Thanks was: In our code, in a same file, we use a builder as follows: public final class Test { private Test() {} public static final class Builder { public Test build() { return new Test(); } } } Test test = new Test.Builder().build(); However, SonarQube raises the issue "Class cannot be instantiated and does not provide any static methods or fields" on such class. Could you please advise or fix the problem if it is a real issue? Thanks Can you please explain what this issue has to do with the Maven PMD Plugin? > The issue "Class cannot be instantiated and does not provide any static > methods or fields" should be avoided when a public static class is defined > -------------------------------------------------------------------------------------------------------------------------------------------------- > > Key: MPMD-173 > URL: https://jira.codehaus.org/browse/MPMD-173 > Project: Maven PMD Plugin > Issue Type: Improvement > Reporter: Zahi Karam > > In our code, in a same file, we use a builder as follows: > {code:java} > public final class Test { > private Test() {} > public static final class Builder { > public Test build() > { return new Test(); } > } > } > Test test = new Test.Builder().build(); > {code} > However, SonarQube raises the issue "Class cannot be instantiated and does > not provide any static methods or fields" on such class. > Could you please advise or fix the problem if it is a real issue? > Thanks -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira