aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-plugin-api/src
diff options
context:
space:
mode:
authorSimon Brandhof <simon.brandhof@gmail.com>2013-08-16 10:54:22 +0200
committerSimon Brandhof <simon.brandhof@gmail.com>2013-08-16 10:54:22 +0200
commit5db787d457fdf31c73322d9dad0b8dc726ddb2d1 (patch)
treec7a8fd734ec8f3c58a00a2e4ebfe0385f1d952ec /sonar-plugin-api/src
parentdb19e222c5c7b9564ab13e096faa03cf69772701 (diff)
downloadsonarqube-5db787d457fdf31c73322d9dad0b8dc726ddb2d1.tar.gz
sonarqube-5db787d457fdf31c73322d9dad0b8dc726ddb2d1.zip
SONAR-4475 Revert commit 3554f0dddf that makes tests fail
Diffstat (limited to 'sonar-plugin-api/src')
-rw-r--r--sonar-plugin-api/src/main/java/org/sonar/api/utils/MessageException.java26
-rw-r--r--sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java14
2 files changed, 0 insertions, 40 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/utils/MessageException.java b/sonar-plugin-api/src/main/java/org/sonar/api/utils/MessageException.java
index 7a703557b5a..25290dac9b2 100644
--- a/sonar-plugin-api/src/main/java/org/sonar/api/utils/MessageException.java
+++ b/sonar-plugin-api/src/main/java/org/sonar/api/utils/MessageException.java
@@ -19,14 +19,6 @@
*/
package org.sonar.api.utils;
-import javax.annotation.CheckForNull;
-import javax.annotation.Nullable;
-
-import java.util.Collection;
-import java.util.Collections;
-
-import static com.google.common.collect.Lists.newArrayList;
-
/**
* Runtime exception for "functional" errors. It aims to be displayed to end-users, without any technical information
* like stack traces.
@@ -35,19 +27,10 @@ import static com.google.common.collect.Lists.newArrayList;
*/
public class MessageException extends RuntimeException {
- private String l10nKey;
- private Collection<Object> l10nParams;
-
public MessageException(String s) {
super(s);
}
- public MessageException(@Nullable String message, @Nullable String l10nKey, @Nullable Object[] l10nParams) {
- super(message);
- this.l10nKey = l10nKey;
- this.l10nParams = l10nParams == null ? Collections.emptyList() : Collections.unmodifiableCollection(newArrayList(l10nParams));
- }
-
/**
* Does not fill in the stack trace
*
@@ -63,14 +46,5 @@ public class MessageException extends RuntimeException {
return getMessage();
}
- @CheckForNull
- public String l10nKey() {
- return l10nKey;
- }
-
- @CheckForNull
- public Collection<Object> l10nParams() {
- return l10nParams;
- }
}
diff --git a/sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java b/sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java
index f036069412f..0b734416e94 100644
--- a/sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java
+++ b/sonar-plugin-api/src/test/java/org/sonar/api/utils/MessageExceptionTest.java
@@ -47,18 +47,4 @@ public class MessageExceptionTest {
assertThat(writer.toString()).isEqualTo(message + System.getProperty("line.separator"));
}
}
-
- @Test
- public void should_create_exception_with_status_and_l10n_message_with_param(){
- MessageException exception = new MessageException(null, "key", new String[]{"value"});
- assertThat(exception.l10nKey()).isEqualTo("key");
- assertThat(exception.l10nParams()).containsOnly("value");
- }
-
- @Test
- public void should_create_exception_with_status_and_l10n_message_without_param(){
- MessageException exception = new MessageException(null, "key", null);
- assertThat(exception.l10nKey()).isEqualTo("key");
- assertThat(exception.l10nParams()).isEmpty();
- }
}