Derby
  1. Derby
  2. DERBY-2548

NullPointerException through client/am/EncryptionManager

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Trivial Trivial
    • Resolution: Won't Fix
    • Affects Version/s: 10.3.1.4
    • Fix Version/s: None
    • Component/s: Network Client
    • Labels:
      None

      Description

      Encountered a NullPointerException that doesn't make it to the enduser / application while debugging test jdbcapi/DataSourceTest in one of my eclipse workspaces:

      org/apache/derby/client/am/EncryptionManager; constructor:
      public EncryptionManager(Agent agent) :
      throw new SqlException(agent_.logWriter_,
      agent_ was null....

        Issue Links

          Activity

          Hide
          Abhilash T.G added a comment -

          Removed all the variables and added comments

          Attaching a fix

          do evaluate and send comoments.

          Show
          Abhilash T.G added a comment - Removed all the variables and added comments Attaching a fix do evaluate and send comoments.
          Hide
          Myrna van Lunteren added a comment -

          The attached patch appears to be for DERBY-1400?
          Or am I missing something?

          Show
          Myrna van Lunteren added a comment - The attached patch appears to be for DERBY-1400 ? Or am I missing something?
          Hide
          Dyre Tjeldvoll added a comment -

          Removing patch flag, since the attached patch appears to be for a different issue.

          Show
          Dyre Tjeldvoll added a comment - Removing patch flag, since the attached patch appears to be for a different issue.
          Hide
          Kathey Marsden added a comment -

          Unassigning since we haven't heard from the owner in some time. Please reassign yourself if you are still interested in pursuing the issue.

          Show
          Kathey Marsden added a comment - Unassigning since we haven't heard from the owner in some time. Please reassign yourself if you are still interested in pursuing the issue.
          Hide
          Knut Anders Hatlen added a comment -

          I don't think this NPE is supposed to be returned to the application. ClientBaseDataSource calls EncryptionManager's constructor just to check if it fails, and expects that it fails on some platforms. Since the NPE is thrown by the error handler in EncryptionManager, adding a null check to prevent the NPE will only have the effect that an am.SqlException is thrown instead, and that exception will also be (intentionally) swallowed by ClientBaseDataSource. The NPE is only thrown when the constructor is called this way, and agent is null because ClientBaseDataSource does not have an Agent object to use in a static context.

          Since this issue doesn't cause any user-visible problems and there hasn't been any interest in fixing it since it was logged three years ago, I propose we close it as "Won't Fix".

          Show
          Knut Anders Hatlen added a comment - I don't think this NPE is supposed to be returned to the application. ClientBaseDataSource calls EncryptionManager's constructor just to check if it fails, and expects that it fails on some platforms. Since the NPE is thrown by the error handler in EncryptionManager, adding a null check to prevent the NPE will only have the effect that an am.SqlException is thrown instead, and that exception will also be (intentionally) swallowed by ClientBaseDataSource. The NPE is only thrown when the constructor is called this way, and agent is null because ClientBaseDataSource does not have an Agent object to use in a static context. Since this issue doesn't cause any user-visible problems and there hasn't been any interest in fixing it since it was logged three years ago, I propose we close it as "Won't Fix".
          Hide
          Myrna van Lunteren added a comment -

          Thanks for the analysis, Knut Anders. Won't fix makes sense.

          Show
          Myrna van Lunteren added a comment - Thanks for the analysis, Knut Anders. Won't fix makes sense.

            People

            • Assignee:
              Unassigned
              Reporter:
              Myrna van Lunteren
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development