aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorMatteo Mara <matteo.mara@sonarsource.com>2023-12-22 10:28:18 +0100
committersonartech <sonartech@sonarsource.com>2023-12-22 20:03:00 +0000
commita0a2140e3079d811a25c2487c55e36b728ab7c6e (patch)
treea45e6821c8c2be2962096172bd4d6ca1c6f4caf7 /sonar-core
parent565a389c07036f7e55496ff0b2002d9a75e450cf (diff)
downloadsonarqube-a0a2140e3079d811a25c2487c55e36b728ab7c6e.tar.gz
sonarqube-a0a2140e3079d811a25c2487c55e36b728ab7c6e.zip
Revert "SONAR-21195 Make DefaultLanguagesRepository more suitable for tests"
This reverts commit c7841606b3d4b469177a3426d4c5127b0ebb23cf.
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/platform/SpringComponentContainer.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/platform/SpringComponentContainer.java b/sonar-core/src/main/java/org/sonar/core/platform/SpringComponentContainer.java
index efbe563652a..6a7afd35c19 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/SpringComponentContainer.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/SpringComponentContainer.java
@@ -85,6 +85,15 @@ public class SpringComponentContainer implements StartableContainer {
add(propertyDefs);
}
+ //TODO: To be removed, added for moving on with the non matching LanguagesRepository beans
+ public void addIfMissing(Object object, Class<?> objectType) {
+ try {
+ getParentComponentByType(objectType);
+ } catch (IllegalStateException e) {
+ add(object);
+ }
+ }
+
/**
* Beans need to have a unique name, otherwise they'll override each other.
* The strategy is: