aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-java-api
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-01-24 19:06:38 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-01-24 19:25:01 +0100
commit878cec92f8e39fd46628a83bba970293129de710 (patch)
tree8234845025634f6e8d589fc1ef5df79f4bb4fe12 /sonar-java-api
parenteb9462d6002daf7f01f8fe627b4517c065bdb5af (diff)
downloadsonarqube-878cec92f8e39fd46628a83bba970293129de710.tar.gz
sonarqube-878cec92f8e39fd46628a83bba970293129de710.zip
SONAR-791 When the source directory is not exactly the java package root, Sonar should stop the analysis
Diffstat (limited to 'sonar-java-api')
-rw-r--r--sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java11
-rw-r--r--sonar-java-api/src/main/java/org/sonar/java/api/JavaMethod.java12
-rw-r--r--sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java11
3 files changed, 22 insertions, 12 deletions
diff --git a/sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java b/sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java
index 0e2bc281479..563879e23bb 100644
--- a/sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java
+++ b/sonar-java-api/src/main/java/org/sonar/java/api/JavaClass.java
@@ -20,16 +20,15 @@
package org.sonar.java.api;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.resources.Java;
-import org.sonar.api.resources.Language;
-import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.resources.Resource;
+import org.sonar.api.resources.*;
/**
* @since 2.6
*/
public final class JavaClass extends Resource {
+ public static final String SCOPE = Scopes.TYPE;
+ public static final String QUALIFIER = Qualifiers.CLASS;
public static final int UNKNOWN_LINE = -1;
private int fromLine = UNKNOWN_LINE;
@@ -87,12 +86,12 @@ public final class JavaClass extends Resource {
@Override
public String getScope() {
- return null;
+ return SCOPE;
}
@Override
public String getQualifier() {
- return Qualifiers.CLASS;
+ return QUALIFIER;
}
@Override
diff --git a/sonar-java-api/src/main/java/org/sonar/java/api/JavaMethod.java b/sonar-java-api/src/main/java/org/sonar/java/api/JavaMethod.java
index 6cf02551be6..743b3fa4069 100644
--- a/sonar-java-api/src/main/java/org/sonar/java/api/JavaMethod.java
+++ b/sonar-java-api/src/main/java/org/sonar/java/api/JavaMethod.java
@@ -20,16 +20,16 @@
package org.sonar.java.api;
import org.apache.commons.lang.StringUtils;
-import org.sonar.api.resources.Java;
-import org.sonar.api.resources.Language;
-import org.sonar.api.resources.Qualifiers;
-import org.sonar.api.resources.Resource;
+import org.sonar.api.resources.*;
/**
* @since 2.6
*/
public final class JavaMethod extends Resource {
+ public static final String SCOPE = Scopes.BLOCK_UNIT;
+ public static final String QUALIFIER = Qualifiers.METHOD;
+
public static final int UNKNOWN_LINE = -1;
private static final String CLASS_SEPARATOR = "#";
@@ -88,12 +88,12 @@ public final class JavaMethod extends Resource {
@Override
public String getScope() {
- return null;
+ return SCOPE;
}
@Override
public String getQualifier() {
- return Qualifiers.METHOD;
+ return QUALIFIER;
}
@Override
diff --git a/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java b/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
index a1925501b5d..dad567cc1e3 100644
--- a/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
+++ b/sonar-java-api/src/main/java/org/sonar/java/api/JavaUtils.java
@@ -25,6 +25,17 @@ public final class JavaUtils {
public static final String PACKAGE_SEPARATOR = ".";
+ /**
+ * All sensors executed after this barrier are sure that all Java resources are indexed.
+ */
+ public static final String BARRIER_BEFORE_SQUID = "BEFORE_SQUID";
+
+ /**
+ * Sensors executed before this barrier must not rely on index. No Java resources are indexed.
+ * Value is 'squid' in order to be backward-compatible with Sensor.FLAG_SQUID_ANALYSIS.
+ */
+ public static final String BARRIER_AFTER_SQUID = "squid";
+
private JavaUtils() {
// only static methods
}