diff options
author | Matteo Mara <matteo.mara@sonarsource.com> | 2023-12-22 10:28:18 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2023-12-22 20:03:00 +0000 |
commit | a0a2140e3079d811a25c2487c55e36b728ab7c6e (patch) | |
tree | a45e6821c8c2be2962096172bd4d6ca1c6f4caf7 /sonar-core | |
parent | 565a389c07036f7e55496ff0b2002d9a75e450cf (diff) | |
download | sonarqube-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.java | 9 |
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: |