diff options
author | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-07-01 17:13:10 +0200 |
---|---|---|
committer | Stephane Gamard <stephane.gamard@searchbox.com> | 2014-07-01 17:52:22 +0200 |
commit | 2059b92df6d61b433e9c0d252e60c25d17056d7f (patch) | |
tree | 494caba99f79d206961f70a4993d506f85de4422 /sonar-server | |
parent | b34de6cbb17ae0f15c5ddc19573e0c8704ac564c (diff) | |
download | sonarqube-2059b92df6d61b433e9c0d252e60c25d17056d7f.tar.gz sonarqube-2059b92df6d61b433e9c0d252e60c25d17056d7f.zip |
fix quality flaws
Diffstat (limited to 'sonar-server')
-rw-r--r-- | sonar-server/src/main/java/org/sonar/server/activity/index/ActivityNormalizer.java | 8 |
1 files 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<ActivityDto, String> { public static final IndexField DETAILS = addSearchable(IndexField.Type.OBJECT, "details"); public static final IndexField MESSAGE = addSearchable(IndexField.Type.STRING, "message"); - public static Set<IndexField> ALL_FIELDS = getAllFields(); + public static final Set<IndexField> ALL_FIELDS = getAllFields(); - private static Set<IndexField> getAllFields() { + private static final Set<IndexField> getAllFields() { Set<IndexField> fields = new HashSet<IndexField>(); 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<ActivityDto, String> { DbSession dbSession = db.openSession(false); List<UpdateRequest> requests = new ArrayList<UpdateRequest>(); try { - requests.addAll(normalize(db.activityDao().getNullableByKey(dbSession, activityKey))); + requests.addAll(normalize(db.activityDao().getByKey(dbSession, activityKey))); } finally { dbSession.close(); } |