Fixed Sonar issue in MusicServiceException 10/73810/3
authorezhil <ezhrajam@in.ibm.com>
Wed, 28 Nov 2018 18:47:02 +0000 (00:17 +0530)
committerEzhilarasi R <ezhrajam@in.ibm.com>
Thu, 29 Nov 2018 17:05:16 +0000 (17:05 +0000)
Fixed Exception variable issue
Issue-ID: MUSIC-209
Change-Id: Ia8806059da0d7a281eff696f0c96675dac515ee0
Signed-off-by: ezhil <ezhrajam@in.ibm.com>
src/main/java/org/onap/music/exceptions/MusicServiceException.java

index 1f0264b..76e1f94 100644 (file)
@@ -4,6 +4,8 @@
  * ===================================================================
  *  Copyright (c) 2017 AT&T Intellectual Property
  * ===================================================================
+ *  Modifications Copyright (C) 2018 IBM.
+ * ===================================================================
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
  *  You may obtain a copy of the License at
@@ -41,8 +43,18 @@ public class MusicServiceException extends Exception {
         super(message);
 
     }
-
-
+  
+    public MusicServiceException(String message, int errorCode) {
+        super(message);
+        this.errorCode=errorCode;
+    }
+  
+    public MusicServiceException(String message, int errorCode, String errorMessage) {
+        super(message);
+        this.errorCode=errorCode;
+        this.errorMessage=errorMessage;
+    }
+  
     public MusicServiceException(Throwable cause) {
         super(cause);
 
@@ -60,24 +72,17 @@ public class MusicServiceException extends Exception {
         super(message, cause, enableSuppression, writableStackTrace);
 
     }
+    public void setErrorCode(int errorCode) {
+        this.errorCode=errorCode;
+    }
 
     public int getErrorCode() {
         return errorCode;
     }
-
-
-    public void setErrorCode(int errorCode) {
-        this.errorCode = errorCode;
+    public void setErrorMessage(String errorMessage) {
+        this.errorMessage=errorMessage;
     }
-
-
     public String getErrorMessage() {
         return errorMessage;
     }
-
-
-    public void setErrorMessage(String errorMessage) {
-        this.errorMessage = errorMessage;
-    }
-
 }