Uploaded image for project: 'Calcite'
  1. Calcite
  2. CALCITE-5120

UnregisteredDriver#connect should throw SQLException, not NullPointerException, if url is null

    XMLWordPrintableJSON

Details

    Description

      The documentation for java.sql.Driver#connect states that a SQLException should be thrown "if a database access error occurs or the url is null." However, UnregisteredDriver throws a NullPointerException instead.

      Steps to reproduce:

      new org.apache.calcite.avatica.remote.Driver().connect(null, new Properties());

      Expected result:

      A SQLException is thrown

      Actual result:

      A NullPointerException is thrown

      java.lang.NullPointerException
          at org.apache.calcite.avatica.UnregisteredDriver.acceptsURL(UnregisteredDriver.java:144)
          at org.apache.calcite.avatica.UnregisteredDriver.connect(UnregisteredDriver.java:130)

      Attachments

        Issue Links

          Activity

            People

              FrankZou Dan Zou
              freastro Gregory Hart
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 20m
                  2h 20m