Uploaded image for project: 'eXo-JCR'
  1. eXo-JCR
  2. EXOJCR-1760

Fix the Blocker/Critical violations and the easiest Major ones raised by eXo Quality Level 1.2



      New rules have been added by "eXo Quality Level 1.2" which raised a lot of new violations, the goal of this task is to fix all the Blocker/Critical violations and the easiest Major ones.

      The violations of type Empty Catch Block should be fixed by adding a code of type:

      if (LOG.isTraceEnabled())
          LOG.trace("An exception occurred: " + e.getMessage());

      The violations of type Avoid Catching Throwable should be fixed by catching the corresponding exception instead or adding //NOSONAR if it is not possible

      The violations of type Proper Logger and Logger Is Not Static Final should be fixed only by making the logger private static final when it is possible or at worse protected static final, it also means that the name of the logger must be in capital letters to follow the naming convention about the static variables. Please note that I'm aware that some violations will be due to the fact that we don't use the name of the class as name of the logger, don't do anything for these violations or add //NOSONAR

      The violations of type Avoid Throwing Null Pointer Exception should be fixed most of the time by renaming NullPointerException with IllegalArgumentException

      The violations of type Illegal Throws should be fixed by removing RuntimeException from any method signature and replacing Throwable by Exception when it is possible

      The violations of type Correctness - Method throws alternative exception from catch block without history [fb-contrib] that are due to privileged blocks should be fixed simply by adding the tag //NOSONAR

      The violations of type Avoid Catching NPE should be fixed by checking the parameters

      The violations of type Use Correct Exception Logging should be fixed by replacing LOG.xxxx(ex) with LOG.xxxx("An exception occured: " + ex.getMessage()) or something like log.warn("getTitle failed: " + e) with log.warn("getTitle failed: " + e.getMessage())

      All other use cases or rules not described above should be ignored at least in the context of this task

        Gliffy Diagrams


            Issue Links



                • Assignee:
                  andrew.plotnikov Andrew Plotnikov
                  nfilotto Nicolas Filotto
                • Votes:
                  0 Vote for this issue
                  1 Start watching this issue


                  • Created:

                    Time Tracking

                    Original Estimate - 1 day, 4 hours Original Estimate - 1 day, 4 hours
                    1d 4h
                    Remaining Estimate - 0 minutes
                    Time Spent - 2 days, 6 hours
                    2d 6h