Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#427 Alias property window dies when URL is malformed

2.3rc2
closed-fixed
Rob Manning
Core (461)
5
2006-09-23
2006-09-22
sgrantham
No

Low priority -- If the URL in a connection alias is
malformed (missing DB selection). Selecting properties
will result in a null pointer exception for the
properties dialogue.

Discussion

  • Rob Manning
    Rob Manning
    2006-09-23

    Logged In: YES
    user_id=1287991

    I can confirm this. Here's how:

    Modify an Alias say MySQL. Remove the database portion of
    the alias which is just after the host. Click the
    properties button and see the following exception:

    java.lang.NullPointerException
    at
    com.mysql.jdbc.NonRegisteringDriver.getPropertyInfo(NonRegisteringDriver.java:349)
    at
    net.sourceforge.squirrel_sql.client.gui.db.aliasproperties.DriverPropertiesController.<init>(DriverPropertiesController.java:70)
    at
    net.sourceforge.squirrel_sql.client.gui.db.aliasproperties.AliasPropertiesController.loadTabs(AliasPropertiesController.java:90)
    at
    net.sourceforge.squirrel_sql.client.gui.db.aliasproperties.AliasPropertiesController.<init>(AliasPropertiesController.java:83)
    at
    net.sourceforge.squirrel_sql.client.gui.db.aliasproperties.AliasPropertiesController.showAliasProperties(AliasPropertiesController.java:30)
    at
    net.sourceforge.squirrel_sql.client.mainframe.action.AliasPropertiesCommand.execute(AliasPropertiesCommand.java:22)
    at
    net.sourceforge.squirrel_sql.client.gui.db.AliasInternalFrame.showDriverPropertiesDialog(AliasInternalFrame.java:301)
    at
    net.sourceforge.squirrel_sql.client.gui.db.AliasInternalFrame.access$200(AliasInternalFrame.java:58)
    at
    net.sourceforge.squirrel_sql.client.gui.db.AliasInternalFrame$2.actionPerformed(AliasInternalFrame.java:405)
    at
    javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
    at
    javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
    at
    javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
    at
    javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
    at
    javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
    at java.awt.Component.processMouseEvent(Component.java:5488)
    at
    javax.swing.JComponent.processMouseEvent(JComponent.java:3126)
    at java.awt.Component.processEvent(Component.java:5253)
    at java.awt.Container.processEvent(Container.java:1966)
    at java.awt.Component.dispatchEventImpl(Component.java:3955)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at
    java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
    at
    java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
    at
    java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
    at java.awt.Container.dispatchEventImpl(Container.java:2010)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at
    net.sourceforge.squirrel_sql.client.Application$1.dispatchEvent(Application.java:168)
    at
    java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at
    java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at
    java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at
    java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

    Nice work, sgrantham!

    Rob

     
  • Rob Manning
    Rob Manning
    2006-09-23

    Logged In: YES
    user_id=1287991

    Actually, upon further review, it's not clear to me why
    the driver class (com.mysql.jdbc.NonRegisteringDriver)
    method getPropertyInfo should throw a NullPointerException
    for a url argument that is slightly malformed (missing
    database id). What I can do is ask the driver if it
    accepts the malformed url before attempting to call
    getPropertyInfo() on it. That seems to help because then
    the user will get a message saying that the URL is invalid
    so that they can fix it, instead of merely showing a
    useless NPE. I'll look into submitting a bug report with
    MySQL to get the NPE fixed.

    It's now fixed in CVS. It will be in the next snapshot
    (tomorrow).

    Rob

     
  • Rob Manning
    Rob Manning
    2006-09-23

    • labels: 336290 --> Core
    • status: open --> closed-fixed
     
  • Rob Manning
    Rob Manning
    2006-09-23

    Logged In: YES
    user_id=1287991

    I filed a bug with MySQL Connector/J folks as the bug appears
    in version 5.0.3 of the driver as well. The bug is
    22628 and is documented here:

    http://bugs.mysql.com/bug.php?id=22628

    Rob