aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/sonar-squid-java-plugin/src/main
diff options
context:
space:
mode:
authorGodin <mandrikov@gmail.com>2010-11-26 22:47:03 +0000
committerGodin <mandrikov@gmail.com>2010-11-26 22:47:03 +0000
commita1f30abd291044698fb273803a1f7767631dd60a (patch)
tree6f1d51bf108a5baf5b452c07dc73b52845993703 /plugins/sonar-squid-java-plugin/src/main
parent3c72827ae0ab6c7ab95535df1b4ae611d31d6e3a (diff)
downloadsonarqube-a1f30abd291044698fb273803a1f7767631dd60a.tar.gz
sonarqube-a1f30abd291044698fb273803a1f7767631dd60a.zip
Fix violations reported on Nemo
Diffstat (limited to 'plugins/sonar-squid-java-plugin/src/main')
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/PublicApiVisitor.java5
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignaturePrinter.java5
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignatureScanner.java3
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignaturePrinter.java6
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignatureScanner.java2
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidConstants.java3
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPluginProperties.java5
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/PackagesBridge.java2
8 files changed, 20 insertions, 11 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/PublicApiVisitor.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/PublicApiVisitor.java
index add29bd7b06..9db70862ddd 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/PublicApiVisitor.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/ast/visitor/PublicApiVisitor.java
@@ -22,7 +22,6 @@ package org.sonar.java.ast.visitor;
import java.util.Arrays;
import java.util.List;
-import org.sonar.java.ast.check.UndocumentedApiCheck;
import org.sonar.squid.api.SourceCode;
import org.sonar.squid.measures.Metric;
@@ -91,14 +90,14 @@ public class PublicApiVisitor extends JavaAstVisitor {
}
/**
- * Also used by {@link UndocumentedApiCheck}
+ * Also used by {@link org.sonar.java.ast.check.UndocumentedApiCheck}
*/
public static boolean isDocumentedApi(DetailAST ast, FileContents fileContents) {
return fileContents.getJavadocBefore(ast.getLineNo()) != null;
}
/**
- * Also used by {@link UndocumentedApiCheck}
+ * Also used by {@link org.sonar.java.ast.check.UndocumentedApiCheck}
*/
public static boolean isPublicApi(DetailAST ast) {
return isPublic(ast) && !isStaticFinalVariable(ast) && !isMethodWithOverrideAnnotation(ast) && !isEmptyDefaultConstructor(ast);
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignaturePrinter.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignaturePrinter.java
index 9c81a795a0d..236bd6b61cc 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignaturePrinter.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignaturePrinter.java
@@ -19,7 +19,7 @@
*/
package org.sonar.java.signature;
-public class MethodSignaturePrinter {
+public final class MethodSignaturePrinter {
public static String print(MethodSignature methodSignature) {
StringBuilder builder = new StringBuilder();
@@ -32,4 +32,7 @@ public class MethodSignaturePrinter {
builder.append(ParameterSignaturePrinter.print(methodSignature.getReturnType()));
return builder.toString();
}
+
+ private MethodSignaturePrinter() {
+ }
}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignatureScanner.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignatureScanner.java
index f28405f5e8c..0aabea3f348 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignatureScanner.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/MethodSignatureScanner.java
@@ -21,7 +21,7 @@ package org.sonar.java.signature;
import java.util.List;
-public class MethodSignatureScanner {
+public final class MethodSignatureScanner {
private final String bytecodeMethodSignature;
@@ -43,4 +43,5 @@ public class MethodSignatureScanner {
rightBracketIndex));
return new MethodSignature(methodName, returnType, argumentTypes);
}
+
}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignaturePrinter.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignaturePrinter.java
index 0059564ff76..f5bb4e76bff 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignaturePrinter.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignaturePrinter.java
@@ -19,13 +19,12 @@
*/
package org.sonar.java.signature;
-public class ParameterSignaturePrinter {
+public final class ParameterSignaturePrinter {
private static final char ARRAY = '[';
public static String print(Parameter parameter) {
StringBuilder signature = new StringBuilder();
- ;
if (parameter.isArray()) {
signature.append(ARRAY);
}
@@ -36,4 +35,7 @@ public class ParameterSignaturePrinter {
}
return signature.toString();
}
+
+ private ParameterSignaturePrinter() {
+ }
}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignatureScanner.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignatureScanner.java
index a807db9bec7..8763b9bd464 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignatureScanner.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/java/signature/ParameterSignatureScanner.java
@@ -22,7 +22,7 @@ package org.sonar.java.signature;
import java.util.ArrayList;
import java.util.List;
-public class ParameterSignatureScanner {
+public final class ParameterSignatureScanner {
private final String signature;
private int index = 0;
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidConstants.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidConstants.java
index a3811378b8c..d06881f5a9e 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidConstants.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidConstants.java
@@ -7,4 +7,7 @@ public final class SquidConstants {
public static final String REPOSITORY_KEY = CoreProperties.SQUID_PLUGIN;
public static final String REPOSITORY_NAME = "Sonar";
+ private SquidConstants() {
+ }
+
}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPluginProperties.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPluginProperties.java
index 0579e7dfe4d..f087d55c748 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPluginProperties.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/SquidPluginProperties.java
@@ -19,7 +19,7 @@
*/
package org.sonar.plugins.squid;
-public class SquidPluginProperties {
+public final class SquidPluginProperties {
public static final String SQUID_ANALYSE_ACCESSORS_PROPERTY = "sonar.squid.analyse.property.accessors";
public static final boolean SQUID_ANALYSE_ACCESSORS_DEFAULT_VALUE = true;
@@ -27,4 +27,7 @@ public class SquidPluginProperties {
public static final String FIELDS_TO_EXCLUDE_FROM_LCOM4_COMPUTATION = "sonar.squid.fieldsToExcludeFromLcom4Computation";
public static final String FIELDS_TO_EXCLUDE_FROM_LCOM4_COMPUTATION_DEFAULT_VALUE = "LOG, logger";
+ private SquidPluginProperties() {
+ }
+
}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/PackagesBridge.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/PackagesBridge.java
index 8624ea0a1af..9c76901e838 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/PackagesBridge.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/bridges/PackagesBridge.java
@@ -19,11 +19,9 @@
*/
package org.sonar.plugins.squid.bridges;
-import org.sonar.api.batch.SensorContext;
import org.sonar.api.measures.CoreMetrics;
import org.sonar.api.resources.Project;
import org.sonar.api.resources.Resource;
-import org.sonar.squid.Squid;
import org.sonar.squid.api.SourcePackage;
import org.sonar.squid.api.SourceProject;
import org.sonar.squid.measures.Metric;