Commons Dbcp
  1. Commons Dbcp
  2. DBCP-392

Remove Occurrences of Multiple Statements on One Line

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.3.1, 1.4.1, 1.5.1, 2.0
    • Labels:
      None

      Description

      The DelegatingConnection class has many methods that are one-liners, but it's actually multiple statements. When debugging, it can make it appear as if the code is being executed twice (it did to me) at first glance. If it's multiple statements, we should use multiple lines of code.

        Activity

        Hide
        Steve Westwood added a comment -

        Agreed - the layout for these methods is inconsistent with others in the class, it does make debugging awkward plus clarity is lost. The issue I believe applies to the following methods:

        • public void clearWarnings() throws SQLException
        • public void commit() throws SQLException
        • public String getCatalog() throws SQLException
        • public int getTransactionIsolation() throws SQLException
        • public Map<String,Class<?>> getTypeMap() throws SQLException
        • public SQLWarning getWarnings() throws SQLException
        • public String nativeSQL(String sql) throws SQLException
        • public void rollback() throws SQLException
        • public void setTransactionIsolation(int level) throws SQLException
        • public void setTypeMap(Map<String,Class<?>> map) throws SQLException
        • public int getHoldability() throws SQLException
        • public void setHoldability(int holdability) throws SQLException
        • public java.sql.Savepoint setSavepoint() throws SQLException
        • public java.sql.Savepoint setSavepoint(String name) throws SQLException
        • public void rollback(java.sql.Savepoint savepoint) throws SQLException
        • public void releaseSavepoint(java.sql.Savepoint savepoint) throws SQLException
        Show
        Steve Westwood added a comment - Agreed - the layout for these methods is inconsistent with others in the class, it does make debugging awkward plus clarity is lost. The issue I believe applies to the following methods: public void clearWarnings() throws SQLException public void commit() throws SQLException public String getCatalog() throws SQLException public int getTransactionIsolation() throws SQLException public Map<String,Class<?>> getTypeMap() throws SQLException public SQLWarning getWarnings() throws SQLException public String nativeSQL(String sql) throws SQLException public void rollback() throws SQLException public void setTransactionIsolation(int level) throws SQLException public void setTypeMap(Map<String,Class<?>> map) throws SQLException public int getHoldability() throws SQLException public void setHoldability(int holdability) throws SQLException public java.sql.Savepoint setSavepoint() throws SQLException public java.sql.Savepoint setSavepoint(String name) throws SQLException public void rollback(java.sql.Savepoint savepoint) throws SQLException public void releaseSavepoint(java.sql.Savepoint savepoint) throws SQLException

          People

          • Assignee:
            Unassigned
            Reporter:
            James Carman
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development