Salome HOME
Satisfy some PMD requirements.
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / StudyServiceImpl.java
index fa31d394a1fa8bc22954cbd1c6cedac4f908ec7e..5cd8631a3b3d80d1c697355d9158751c4ada02f0 100644 (file)
@@ -107,6 +107,10 @@ public class StudyServiceImpl implements StudyService {
         */
        public final static AppLogger LOG = AppLogger
                        .getLogger(StudyServiceImpl.class);
+       /**
+        * "studyId" parameter name.
+        */
+       public final static String PARAM_STUDY_ID = "studyId";
 
        /**
         * Injected index service.
@@ -1168,11 +1172,11 @@ public class StudyServiceImpl implements StudyService {
        public String getDescription(final Long studyId)
                        throws InvalidParameterException {
                if (studyId == null) {
-                       throw new InvalidParameterException("studyId", "null");
+                       throw new InvalidParameterException(PARAM_STUDY_ID, "null");
                }
                Study study = _studyDAO.get(studyId);
                if (study == null) {
-                       throw new InvalidParameterException("studyId", studyId.toString());
+                       throw new InvalidParameterException(PARAM_STUDY_ID, studyId.toString());
                }
                return study.getDescription();
        }
@@ -1187,11 +1191,11 @@ public class StudyServiceImpl implements StudyService {
        public void setDescription(final Long studyId, final String descriptionText)
                        throws InvalidParameterException {
                if (studyId == null) {
-                       throw new InvalidParameterException("studyId", "null");
+                       throw new InvalidParameterException(PARAM_STUDY_ID, "null");
                }
                Study study = _studyDAO.get(studyId);
                if (study == null) {
-                       throw new InvalidParameterException("studyId", studyId.toString());
+                       throw new InvalidParameterException(PARAM_STUDY_ID, studyId.toString());
                }
                study.setAttribute(new DescriptionAttribute(study, descriptionText));
        }
@@ -1206,12 +1210,12 @@ public class StudyServiceImpl implements StudyService {
        public boolean removeDescription(final Long studyId)
                        throws InvalidParameterException {
                if (studyId == null) {
-                       throw new InvalidParameterException("studyId", String
+                       throw new InvalidParameterException(PARAM_STUDY_ID, String
                                        .valueOf(studyId));
                }
                Study study = _studyDAO.get(studyId);
                if (study == null) {
-                       throw new InvalidParameterException("studyId", String
+                       throw new InvalidParameterException(PARAM_STUDY_ID, String
                                        .valueOf(studyId));
                }
                return study.removeAttribute(study