From 2059b92df6d61b433e9c0d252e60c25d17056d7f Mon Sep 17 00:00:00 2001 From: Stephane Gamard Date: Tue, 1 Jul 2014 17:13:10 +0200 Subject: [PATCH] fix quality flaws --- .../sonar/server/activity/index/ActivityNormalizer.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sonar-server/src/main/java/org/sonar/server/activity/index/ActivityNormalizer.java b/sonar-server/src/main/java/org/sonar/server/activity/index/ActivityNormalizer.java index 96c2e6e7979..06c53600382 100644 --- a/sonar-server/src/main/java/org/sonar/server/activity/index/ActivityNormalizer.java +++ b/sonar-server/src/main/java/org/sonar/server/activity/index/ActivityNormalizer.java @@ -57,16 +57,16 @@ public class ActivityNormalizer extends BaseNormalizer { public static final IndexField DETAILS = addSearchable(IndexField.Type.OBJECT, "details"); public static final IndexField MESSAGE = addSearchable(IndexField.Type.STRING, "message"); - public static Set ALL_FIELDS = getAllFields(); + public static final Set ALL_FIELDS = getAllFields(); - private static Set getAllFields() { + private static final Set getAllFields() { Set fields = new HashSet(); for (Field classField : LogFields.class.getDeclaredFields()) { if (Modifier.isFinal(classField.getModifiers()) && Modifier.isStatic(classField.getModifiers())) { try { fields.add(IndexField.class.cast(classField.get(null))); } catch (IllegalAccessException e) { - e.printStackTrace(); + throw new IllegalStateException("Could not access Field '" + classField.getName() + "'"); } } } @@ -83,7 +83,7 @@ public class ActivityNormalizer extends BaseNormalizer { DbSession dbSession = db.openSession(false); List requests = new ArrayList(); try { - requests.addAll(normalize(db.activityDao().getNullableByKey(dbSession, activityKey))); + requests.addAll(normalize(db.activityDao().getByKey(dbSession, activityKey))); } finally { dbSession.close(); } -- 2.39.5