diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-07 23:23:23 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-07 23:23:23 +0000 |
commit | 3cc63963cfd20176c605c27f023fb6e70db69b80 (patch) | |
tree | eed6fd559c6877052a4ef3ce2c0ebb845c41ea66 /sonar-plugin-api | |
parent | 0b9d0acd74b08a9076cd982684f0be8285c94251 (diff) | |
download | sonarqube-3cc63963cfd20176c605c27f023fb6e70db69b80.tar.gz sonarqube-3cc63963cfd20176c605c27f023fb6e70db69b80.zip |
SONAR-1549 The Sonar profile creation form doesn't allow to import checkstyle,pmd and Findbugs conf files when several langages are defined
SONAR-440 add warnings to checkstyle when importing configuration
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfilePrototype.java | 9 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/utils/ValidationMessages.java | 23 |
2 files changed, 24 insertions, 8 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfilePrototype.java b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfilePrototype.java index c4cc93cef93..979981a85b8 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfilePrototype.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/profiles/ProfilePrototype.java @@ -165,7 +165,14 @@ public final class ProfilePrototype { @Override public String toString() { - return new StringBuilder().append("[repository=").append(repositoryKey).append(",key=").append(key).append("]").toString(); + StringBuilder sb = new StringBuilder().append("[repository=").append(repositoryKey); + if (StringUtils.isNotBlank(key)) { + sb.append(",key=").append(key); + } + if (StringUtils.isNotBlank(configKey)) { + sb.append(",configKey=").append(configKey); + } + return sb.append("]").toString(); } } } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ValidationMessages.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ValidationMessages.java index bff9074bd12..4813f447fd3 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/ValidationMessages.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/ValidationMessages.java @@ -38,21 +38,22 @@ public final class ValidationMessages { public boolean hasErrors() { return !errors.isEmpty(); } + public List<Message> getErrors() { return errors; } + public ValidationMessages addError(String key, String label) { + errors.add(new Message(key, label)); + return this; + } + public List<Message> getWarnings() { return warnings; } - public List<Message> getInfos() { - return infos; - } - - public ValidationMessages addError(String key, String label) { - errors.add(new Message(key, label)); - return this; + public boolean hasWarnings() { + return !warnings.isEmpty(); } public ValidationMessages addWarning(String key, String label) { @@ -60,6 +61,14 @@ public final class ValidationMessages { return this; } + public List<Message> getInfos() { + return infos; + } + + public boolean hasInfos() { + return !infos.isEmpty(); + } + public ValidationMessages addInfo(String key, String label) { infos.add(new Message(key, label)); return this; |