SonarQube Java
  1. SonarQube Java
  2. SONARJAVA-248

Public methods should throw at most one checked exception

    Details

    • Type: New Feature New Feature
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.4
    • Component/s: Rules
    • Labels:
      None
    • Number of attachments :
      0

      Activity

      Hide
      Dinesh Bolkensteyn added a comment -

      Done

      Show
      Dinesh Bolkensteyn added a comment - Done
      Hide
      Freddy Mallet added a comment -

      The implementation is not stable:

      Caused by: java.lang.NullPointerException
      	at org.sonar.java.checks.ThrowsSeveralCheckedExceptionCheck.isOverriden(ThrowsSeveralCheckedExceptionCheck.java:77)
      	at org.sonar.java.checks.ThrowsSeveralCheckedExceptionCheck.visitMethod(ThrowsSeveralCheckedExceptionCheck.java:49)
      	at org.sonar.java.bytecode.BytecodeVisitorNotifier.callVisitMethod(BytecodeVisitorNotifier.java:68)
      	at org.sonar.java.bytecode.BytecodeVisitorNotifier.callVisitMethodAndFieldAndEdge(BytecodeVisitorNotifier.java:49)
      	at org.sonar.java.bytecode.BytecodeVisitorNotifier.notifyVisitors(BytecodeVisitorNotifier.java:42)
      	at org.sonar.java.bytecode.BytecodeScanner.notifyBytecodeVisitors(BytecodeScanner.java:84)
      
      
      Show
      Freddy Mallet added a comment - The implementation is not stable: Caused by: java.lang.NullPointerException at org.sonar.java.checks.ThrowsSeveralCheckedExceptionCheck.isOverriden(ThrowsSeveralCheckedExceptionCheck.java:77) at org.sonar.java.checks.ThrowsSeveralCheckedExceptionCheck.visitMethod(ThrowsSeveralCheckedExceptionCheck.java:49) at org.sonar.java.bytecode.BytecodeVisitorNotifier.callVisitMethod(BytecodeVisitorNotifier.java:68) at org.sonar.java.bytecode.BytecodeVisitorNotifier.callVisitMethodAndFieldAndEdge(BytecodeVisitorNotifier.java:49) at org.sonar.java.bytecode.BytecodeVisitorNotifier.notifyVisitors(BytecodeVisitorNotifier.java:42) at org.sonar.java.bytecode.BytecodeScanner.notifyBytecodeVisitors(BytecodeScanner.java:84)
      Hide
      Freddy Mallet added a comment -

      Moreover, could you update the description by appending the following sentence:

      "Throwing several checked exceptions is allowed when overriding a method doing the same thing."

      Show
      Freddy Mallet added a comment - Moreover, could you update the description by appending the following sentence: "Throwing several checked exceptions is allowed when overriding a method doing the same thing."
      Hide
      Dinesh Bolkensteyn added a comment -

      Done

      Show
      Dinesh Bolkensteyn added a comment - Done
      Hide
      Freddy Mallet added a comment -

      Manually tested !

      Show
      Freddy Mallet added a comment - Manually tested !

        People

        • Assignee:
          Dinesh Bolkensteyn
          Reporter:
          Freddy Mallet
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: