Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-336

The wrong overload of StandardException::newException() is used in some cases

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 10.1.2.1
    • 10.2.1.6
    • None
    • None
    • Any

    Description

      When looking at DERBY-128 it became clear that the wrong overload of StandardException::newException() was used when reporting
      SQLState.SERVICE_DIRECTORY_CREATE_ERROR. The message string only takes one parameter so only one additional parameter (other than Throwable) should be used:

      PersistentServiceImpl.java:676
      throw StandardException.newException(SQLState.SERVICE_DIRECTORY_CREATE_ERROR,
      serviceDirectory, null);
      // Calls StandardException.newException(String, Object, Object)
      // Should call StandardException.newException(String, Object)? Or StandardException.newException(String, Throwable, Object)? With the IOException as
      // Throwable?

      PersistentServiceImpl.java:692
      throw StandardException.newException(SQLState.SERVICE_DIRECTORY_CREATE_ERROR, name, t);
      // Calls StandardException.newException(String, Object, Object)
      // Should call StandardException.newException(String, Throwable, Object)?

      BaseDataFileFactory.java:279
      throw StandardException.newException( SQLState.SERVICE_DIRECTORY_CREATE_ERROR, dataDirectory, ioe);

      // Calls StandardException.newException(String, Object, Object)
      // Should call StandardException.newException(String, Throwable, Object)?

      Attachments

        1. derbyall_report.txt
          4 kB
          Dyre Tjeldvoll
        2. derby-336.stat
          0.9 kB
          Dyre Tjeldvoll
        3. derby-336.diff
          17 kB
          Dyre Tjeldvoll

        Issue Links

          Activity

            People

              dyret Dyre Tjeldvoll
              dyret Dyre Tjeldvoll
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: