You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Dave Brosius (JIRA)" <ji...@apache.org> on 2011/03/01 07:09:36 UTC

[jira] Created: (DERBY-5076) [patch] move instanceof check up above where casts occur

[patch] move instanceof check up above where casts occur
--------------------------------------------------------

                 Key: DERBY-5076
                 URL: https://issues.apache.org/jira/browse/DERBY-5076
             Project: Derby
          Issue Type: Improvement
          Components: Network Client
    Affects Versions: 10.7.1.1
            Reporter: Dave Brosius
            Priority: Trivial
             Fix For: 10.8.0.0
         Attachments: move_instanceof_check.diff

code does an instanceof check on Diagnosable much after multiple casts to Diagnosable occurs above it.

Move the instanceof check up before the first cast, so that it does some good.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Resolved: (DERBY-5076) [patch] move instanceof check up above where casts occur

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen resolved DERBY-5076.
---------------------------------------

          Resolution: Fixed
            Assignee: Dave Brosius
    Issue & fix info:   (was: [Patch Available])

All the regression tests ran cleanly.

Committed revision 1075842.

> [patch] move instanceof check up above where casts occur
> --------------------------------------------------------
>
>                 Key: DERBY-5076
>                 URL: https://issues.apache.org/jira/browse/DERBY-5076
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>    Affects Versions: 10.7.1.1
>            Reporter: Dave Brosius
>            Assignee: Dave Brosius
>            Priority: Trivial
>             Fix For: 10.8.0.0
>
>         Attachments: move_instanceof_check.diff, unnecessary_casts.diff
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> code does an instanceof check on Diagnosable much after multiple casts to Diagnosable occurs above it.
> Move the instanceof check up before the first cast, so that it does some good.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Closed: (DERBY-5076) [patch] move instanceof check up above where casts occur

Posted by "Dave Brosius (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Dave Brosius closed DERBY-5076.
-------------------------------


> [patch] move instanceof check up above where casts occur
> --------------------------------------------------------
>
>                 Key: DERBY-5076
>                 URL: https://issues.apache.org/jira/browse/DERBY-5076
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>    Affects Versions: 10.7.1.1
>            Reporter: Dave Brosius
>            Assignee: Dave Brosius
>            Priority: Trivial
>             Fix For: 10.8.0.0
>
>         Attachments: move_instanceof_check.diff, unnecessary_casts.diff
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> code does an instanceof check on Diagnosable much after multiple casts to Diagnosable occurs above it.
> Move the instanceof check up before the first cast, so that it does some good.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (DERBY-5076) [patch] move instanceof check up above where casts occur

Posted by "Knut Anders Hatlen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-5076?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Knut Anders Hatlen updated DERBY-5076:
--------------------------------------

    Attachment: unnecessary_casts.diff

Thanks, Dave!

It looks to me that the casts are unnecessary in the first place, since the declared type client.am.SqlException implements the Diagnosable interface. Uploading an updated patch that removes the casts and the instanceof check.

Running regression tests.

> [patch] move instanceof check up above where casts occur
> --------------------------------------------------------
>
>                 Key: DERBY-5076
>                 URL: https://issues.apache.org/jira/browse/DERBY-5076
>             Project: Derby
>          Issue Type: Improvement
>          Components: Network Client
>    Affects Versions: 10.7.1.1
>            Reporter: Dave Brosius
>            Priority: Trivial
>             Fix For: 10.8.0.0
>
>         Attachments: move_instanceof_check.diff, unnecessary_casts.diff
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> code does an instanceof check on Diagnosable much after multiple casts to Diagnosable occurs above it.
> Move the instanceof check up before the first cast, so that it does some good.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira