aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2012-09-28 11:23:39 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2012-09-28 11:24:33 +0200
commit67f0a5eb565ecefbcd5d0ed836012bbb61196bea (patch)
tree174a62f624bfa3ce3df64a2c472541954ebab4b0 /sonar-plugin-api
parent8cd5a9d5523f1efa5f0ff3cfa6d196590f856845 (diff)
downloadsonarqube-67f0a5eb565ecefbcd5d0ed836012bbb61196bea.tar.gz
sonarqube-67f0a5eb565ecefbcd5d0ed836012bbb61196bea.zip
SONAR-2602 persist project language before execution of extensions
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java42
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java2
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java2
3 files changed, 25 insertions, 21 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java
index 6191be4c9a7..b4731d84746 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/ResourceModel.java
@@ -283,37 +283,37 @@ public class ResourceModel extends BaseIdentifiable implements Cloneable {
}
ResourceModel other = (ResourceModel) obj;
return new EqualsBuilder()
- .append(key, other.key)
- .append(enabled, other.enabled)
- .append(rootId, other.rootId)
- .isEquals();
+ .append(key, other.key)
+ .append(enabled, other.enabled)
+ .append(rootId, other.rootId)
+ .isEquals();
}
@Override
public int hashCode() {
return new HashCodeBuilder(17, 37)
- .append(key)
- .append(enabled)
- .append(rootId)
- .toHashCode();
+ .append(key)
+ .append(enabled)
+ .append(rootId)
+ .toHashCode();
}
@Override
public String toString() {
return new ToStringBuilder(this)
- .append("id", getId())
- .append("key", key)
- .append("scope", scope)
- .append("qualifier", qualifier)
- .append("name", name)
- .append("longName", longName)
- .append("lang", languageKey)
- .append("enabled", enabled)
- .append("rootId", rootId)
- .append("copyResourceId", copyResourceId)
- .append("personId", personId)
- .append("createdAt", createdAt)
- .toString();
+ .append("id", getId())
+ .append("key", key)
+ .append("scope", scope)
+ .append("qualifier", qualifier)
+ .append("name", name)
+ .append("longName", longName)
+ .append("lang", languageKey)
+ .append("enabled", enabled)
+ .append("rootId", rootId)
+ .append("copyResourceId", copyResourceId)
+ .append("personId", personId)
+ .append("createdAt", createdAt)
+ .toString();
}
@Override
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
index 44d46dd036b..9b484c0afcc 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Language.java
@@ -21,12 +21,14 @@ package org.sonar.api.resources;
import org.sonar.api.BatchExtension;
import org.sonar.api.ServerExtension;
+import org.sonar.api.batch.InstantiationStrategy;
/**
* The extension point to define a new language
*
* @since 1.10
*/
+@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public interface Language extends BatchExtension, ServerExtension {
/**
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
index 03b531d9d94..01fbc5ddedc 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/resources/Languages.java
@@ -28,12 +28,14 @@ import com.google.common.collect.Maps;
import org.apache.commons.lang.ArrayUtils;
import org.sonar.api.BatchComponent;
import org.sonar.api.ServerComponent;
+import org.sonar.api.batch.InstantiationStrategy;
/**
* A class to store the list of languages
*
* @since 1.10
*/
+@InstantiationStrategy(InstantiationStrategy.PER_BATCH)
public class Languages implements BatchComponent, ServerComponent {
private final Map<String, Language> map = Maps.newHashMap();