diff options
Diffstat (limited to 'sonar-core')
3 files changed, 10 insertions, 2 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseUtils.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseUtils.java index 3833590a216..781f8691f84 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseUtils.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseUtils.java @@ -36,7 +36,7 @@ public final class DatabaseUtils { * This list is hardcoded because we didn't succeed in using java.sql.DatabaseMetaData#getTables() in the same way * for all the supported databases, particularly due to Oracle results. */ - public static final String[] TABLE_NAMES = { + static final String[] TABLE_NAMES = { "action_plans", "action_plans_reviews", "active_dashboards", diff --git a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java index 1d3b431a4e6..3f2d1bd38f0 100644 --- a/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java +++ b/sonar-core/src/main/java/org/sonar/core/persistence/DatabaseVersion.java @@ -53,7 +53,7 @@ public class DatabaseVersion implements BatchComponent, ServerComponent { return versions.get(versions.size() - 1); } return null; - } catch (Exception e) { + } catch (RuntimeException e) { // The table SCHEMA_MIGRATIONS does not exist. // Ignore this exception -> it will be created by Ruby on Rails migrations. return null; diff --git a/sonar-core/src/test/java/org/sonar/core/PicoUtilsTest.java b/sonar-core/src/test/java/org/sonar/core/PicoUtilsTest.java index 5789a23e24e..336a3706963 100644 --- a/sonar-core/src/test/java/org/sonar/core/PicoUtilsTest.java +++ b/sonar-core/src/test/java/org/sonar/core/PicoUtilsTest.java @@ -39,6 +39,14 @@ public class PicoUtilsTest { } @Test + public void shouldSanitizePicoLifecycleException_no_wrapper_message() { + Throwable th = PicoUtils.sanitize(new PicoLifecycleException(null, null, new IllegalStateException("msg"))); + + assertThat(th, Is.is(IllegalStateException.class)); + assertThat(th.getMessage(), Is.is("msg")); + } + + @Test public void shouldNotSanitizeOtherExceptions() { Throwable th = PicoUtils.sanitize(new IllegalArgumentException("foo")); |