aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-batch
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-04-27 17:05:35 +0200
committerDavid Gageot <david@gageot.net>2012-04-27 17:05:35 +0200
commitb150482f1f4ea43bc42b324994d1d1e852de6320 (patch)
tree4638118d9a32405ad844c127f38e381d9ef37ae8 /sonar-batch
parent328e826a6a151128783ee7a3939e206202c6a990 (diff)
downloadsonarqube-b150482f1f4ea43bc42b324994d1d1e852de6320.tar.gz
sonarqube-b150482f1f4ea43bc42b324994d1d1e852de6320.zip
Code cleaning : Add @Override annotations
Diffstat (limited to 'sonar-batch')
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java6
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/ServerMetadata.java4
-rw-r--r--sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java23
3 files changed, 33 insertions, 0 deletions
diff --git a/sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java b/sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java
index 2e2c83a6204..0ee2dbfe033 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/DefaultProjectFileSystem2.java
@@ -66,10 +66,12 @@ public class DefaultProjectFileSystem2 extends DefaultProjectFileSystem {
this(project, languages, def, pom, new FileFilter[0]);
}
+ @Override
public File getBasedir() {
return def.getBaseDir();
}
+ @Override
public File getBuildDir() {
if (pom != null) {
return resolvePath(pom.getBuild().getDirectory());
@@ -79,6 +81,7 @@ public class DefaultProjectFileSystem2 extends DefaultProjectFileSystem {
}
}
+ @Override
public File getBuildOutputDir() {
if (pom != null) {
return resolvePath(pom.getBuild().getOutputDirectory());
@@ -101,6 +104,7 @@ public class DefaultProjectFileSystem2 extends DefaultProjectFileSystem {
/**
* @deprecated since 2.6, because should be immutable
*/
+ @Override
@Deprecated
public DefaultProjectFileSystem addSourceDir(File dir) {
if (dir == null) {
@@ -125,6 +129,7 @@ public class DefaultProjectFileSystem2 extends DefaultProjectFileSystem {
/**
* @deprecated since 2.6, because should be immutable
*/
+ @Override
@Deprecated
public DefaultProjectFileSystem addTestDir(File dir) {
if (dir == null) {
@@ -140,6 +145,7 @@ public class DefaultProjectFileSystem2 extends DefaultProjectFileSystem {
/**
* TODO Godin: seems that used only by Cobertura and Clover
*/
+ @Override
public File getReportOutputDir() {
if (pom != null) {
return resolvePath(pom.getReporting().getOutputDirectory());
diff --git a/sonar-batch/src/main/java/org/sonar/batch/ServerMetadata.java b/sonar-batch/src/main/java/org/sonar/batch/ServerMetadata.java
index 29bd61449f5..853c308b467 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/ServerMetadata.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/ServerMetadata.java
@@ -37,14 +37,17 @@ public class ServerMetadata extends Server {
this.settings = settings;
}
+ @Override
public String getId() {
return settings.getString(CoreProperties.SERVER_ID);
}
+ @Override
public String getVersion() {
return settings.getString(CoreProperties.SERVER_VERSION);
}
+ @Override
public Date getStartedAt() {
String dateString = settings.getString(CoreProperties.SERVER_STARTTIME);
if (dateString != null) {
@@ -58,6 +61,7 @@ public class ServerMetadata extends Server {
return null;
}
+ @Override
public String getURL() {
return StringUtils.removeEnd(StringUtils.defaultIfBlank(settings.getString("sonar.host.url"), "http://localhost:9000"), "/");
}
diff --git a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
index fdcc3c70610..783bffb6ad9 100644
--- a/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
+++ b/sonar-batch/src/main/java/org/sonar/batch/index/DefaultIndex.java
@@ -95,6 +95,7 @@ public class DefaultIndex extends SonarIndex {
}
}
+ @Override
public Project getProject() {
return currentProject;
}
@@ -134,6 +135,7 @@ public class DefaultIndex extends SonarIndex {
lock.unlock();
}
+ @Override
public Measure getMeasure(Resource resource, Metric metric) {
Bucket bucket = buckets.get(resource);
if (bucket != null) {
@@ -145,6 +147,7 @@ public class DefaultIndex extends SonarIndex {
return null;
}
+ @Override
public <M> M getMeasures(Resource resource, MeasuresFilter<M> filter) {
Bucket bucket = buckets.get(resource);
if (bucket != null) {
@@ -157,6 +160,7 @@ public class DefaultIndex extends SonarIndex {
/**
* the measure is updated if it's already registered.
*/
+ @Override
public Measure addMeasure(Resource resource, Measure measure) {
Bucket bucket = checkIndexed(resource);
if (bucket != null && !bucket.isExcluded()) {
@@ -182,6 +186,7 @@ public class DefaultIndex extends SonarIndex {
//
//
+ @Override
public Dependency addDependency(Dependency dependency) {
Dependency existingDep = getEdge(dependency.getFrom(), dependency.getTo());
if (existingDep != null) {
@@ -230,6 +235,7 @@ public class DefaultIndex extends SonarIndex {
incomingDeps.put(dependency.getFrom(), dependency);
}
+ @Override
public Set<Dependency> getDependencies() {
return dependencies;
}
@@ -287,6 +293,7 @@ public class DefaultIndex extends SonarIndex {
/**
* {@inheritDoc}
*/
+ @Override
public List<Violation> getViolations(ViolationQuery violationQuery) {
Resource resource = violationQuery.getResource();
if (resource == null) {
@@ -308,6 +315,7 @@ public class DefaultIndex extends SonarIndex {
return filteredViolations;
}
+ @Override
public void addViolation(Violation violation, boolean force) {
Resource resource = violation.getResource();
if (resource == null) {
@@ -362,10 +370,12 @@ public class DefaultIndex extends SonarIndex {
//
//
+ @Override
public void addLink(ProjectLink link) {
persistence.saveLink(currentProject, link);
}
+ @Override
public void deleteLink(String key) {
persistence.deleteLink(currentProject, key);
}
@@ -378,15 +388,18 @@ public class DefaultIndex extends SonarIndex {
//
//
+ @Override
public List<Event> getEvents(Resource resource) {
// currently events are not cached in memory
return persistence.getEvents(resource);
}
+ @Override
public void deleteEvent(Event event) {
persistence.deleteEvent(event);
}
+ @Override
public Event addEvent(Resource resource, String name, String description, String category, Date date) {
Event event = new Event(name, description, category);
event.setDate(date);
@@ -396,6 +409,7 @@ public class DefaultIndex extends SonarIndex {
return null;
}
+ @Override
public void setSource(Resource reference, String source) {
Bucket bucket = checkIndexed(reference);
if (bucket != null && !bucket.isExcluded()) {
@@ -403,6 +417,7 @@ public class DefaultIndex extends SonarIndex {
}
}
+ @Override
public String getSource(Resource resource) {
return persistence.getSource(resource);
}
@@ -410,11 +425,13 @@ public class DefaultIndex extends SonarIndex {
/**
* Does nothing if the resource is already registered.
*/
+ @Override
public Resource addResource(Resource resource) {
Bucket bucket = doIndex(resource);
return bucket != null ? bucket.getResource() : null;
}
+ @Override
public <R extends Resource> R getResource(R reference) {
Bucket bucket = buckets.get(reference);
if (bucket != null) {
@@ -442,6 +459,7 @@ public class DefaultIndex extends SonarIndex {
return excluded;
}
+ @Override
public List<Resource> getChildren(Resource resource) {
return getChildren(resource, false);
}
@@ -459,6 +477,7 @@ public class DefaultIndex extends SonarIndex {
return children;
}
+ @Override
public Resource getParent(Resource resource) {
Bucket bucket = getBucket(resource, false);
if (bucket != null && bucket.getParent() != null) {
@@ -467,6 +486,7 @@ public class DefaultIndex extends SonarIndex {
return null;
}
+ @Override
public boolean index(Resource resource) {
Bucket bucket = doIndex(resource);
return bucket != null && !bucket.isExcluded();
@@ -479,6 +499,7 @@ public class DefaultIndex extends SonarIndex {
return doIndex(resource, resource.getParent());
}
+ @Override
public boolean index(Resource resource, Resource parentReference) {
Bucket bucket = doIndex(resource, parentReference);
return bucket != null && !bucket.isExcluded();
@@ -541,11 +562,13 @@ public class DefaultIndex extends SonarIndex {
return bucket;
}
+ @Override
public boolean isExcluded(Resource reference) {
Bucket bucket = getBucket(reference, true);
return bucket != null && bucket.isExcluded();
}
+ @Override
public boolean isIndexed(Resource reference, boolean acceptExcluded) {
return getBucket(reference, acceptExcluded) != null;
}