roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adityasha...@apache.org
Subject [roller] branch master updated: Fixed: sonarqube issue - Constructors of an 'abstract' class should not be declared 'public' Abstract classes should not have public constructors. Constructors of abstract classes can only be called in constructors of their subclasses. So there is no point in making them public. The protected modifier should be enough.
Date Tue, 05 Jan 2021 05:46:13 GMT
This is an automated email from the ASF dual-hosted git repository.

adityasharma pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/roller.git


The following commit(s) were added to refs/heads/master by this push:
     new 57535b8  Fixed: sonarqube issue - Constructors of an 'abstract' class should not
be declared 'public' Abstract classes should not have public constructors. Constructors of
abstract classes can only be called in constructors of their subclasses. So there is no point
in making them public. The protected modifier should be enough.
     new a5cabd3  Merge branch 'master' of https://github.com/apache/roller
57535b8 is described below

commit 57535b8d0120e1ebcf7d34615d79658490f8d8c4
Author: Aditya Sharma <adityasharma@apache.org>
AuthorDate: Tue Jan 5 11:14:56 2021 +0530

    Fixed: sonarqube issue - Constructors of an 'abstract' class should not be declared 'public'
    Abstract classes should not have public constructors. Constructors of abstract classes
can only be called in constructors of their subclasses. So there is no point in making them
public. The protected modifier should be enough.
---
 .../java/org/apache/roller/RollerException.java    | 48 +++++++++++-----------
 1 file changed, 24 insertions(+), 24 deletions(-)

diff --git a/app/src/main/java/org/apache/roller/RollerException.java b/app/src/main/java/org/apache/roller/RollerException.java
index 6ff0f33..7949d5f 100644
--- a/app/src/main/java/org/apache/roller/RollerException.java
+++ b/app/src/main/java/org/apache/roller/RollerException.java
@@ -26,49 +26,49 @@ import java.io.PrintWriter;
  * Base Roller exception class.
  */
 public abstract class RollerException extends Exception {
-    
+
     private final Throwable mRootCause;
-    
-    
+
+
     /**
      * Construct emtpy exception object.
      */
-    public RollerException() {
+    protected RollerException() {
         super();
         mRootCause = null;
     }
-    
-    
+
+
     /**
      * Construct RollerException with message string.
      * @param s Error message string.
      */
-    public RollerException(String s) {
+    protected RollerException(String s) {
         super(s);
         mRootCause = null;
     }
-    
-    
+
+
     /**
      * Construct RollerException, wrapping existing throwable.
      * @param s Error message
      * @param t Existing connection to wrap.
      */
-    public RollerException(String s, Throwable t) {
+    protected RollerException(String s, Throwable t) {
         super(s);
         mRootCause = t;
     }
-    
-    
+
+
     /**
      * Construct RollerException, wrapping existing throwable.
      * @param t Existing exception to be wrapped.
      */
-    public RollerException(Throwable t) {
+    protected RollerException(Throwable t) {
         mRootCause = t;
     }
-    
-    
+
+
     /**
      * Get root cause object, or null if none.
      * @return Root cause or null if none.
@@ -76,8 +76,8 @@ public abstract class RollerException extends Exception {
     public Throwable getRootCause() {
         return mRootCause;
     }
-    
-    
+
+
     /**
      * Get root cause message.
      * @return Root cause message.
@@ -94,8 +94,8 @@ public abstract class RollerException extends Exception {
         }
         return rcmessage;
     }
-    
-    
+
+
     /**
      * Print stack trace for exception and for root cause exception if there is one.
      * @see java.lang.Throwable#printStackTrace()
@@ -108,8 +108,8 @@ public abstract class RollerException extends Exception {
             mRootCause.printStackTrace();
         }
     }
-    
-    
+
+
     /**
      * Print stack trace for exception and for root cause exception if there is one.
      * @param s Stream to print to.
@@ -122,8 +122,8 @@ public abstract class RollerException extends Exception {
             mRootCause.printStackTrace(s);
         }
     }
-    
-    
+
+
     /**
      * Print stack trace for exception and for root cause exception if there is one.
      * @param s Writer to write to.
@@ -136,5 +136,5 @@ public abstract class RollerException extends Exception {
             mRootCause.printStackTrace(s);
         }
     }
-    
+
 }


Mime
View raw message