db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dag H. Wanvik (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (DERBY-5755) Minor cleanup of DataDictionaryImpl.getRoutineList()
Date Thu, 10 May 2012 15:52:53 GMT

    [ https://issues.apache.org/jira/browse/DERBY-5755?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13272433#comment-13272433
] 

Dag H. Wanvik commented on DERBY-5755:
--------------------------------------

Looks to me as if the calling code is checking against duplicates? Cf. PrivilegeNode ca line
105 which throws if mor ethan one routine returned. Wouldn't the new code mask this error
checking?
Cf also signature of getRoutineList: "Get the list of routines matching the schema and routine
name" having a plural "routines".
                
> Minor cleanup of DataDictionaryImpl.getRoutineList()
> ----------------------------------------------------
>
>                 Key: DERBY-5755
>                 URL: https://issues.apache.org/jira/browse/DERBY-5755
>             Project: Derby
>          Issue Type: Improvement
>          Components: SQL
>    Affects Versions: 10.9.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Trivial
>         Attachments: d5755-1a.diff
>
>
> I noticed two small possibilities for improvement in DataDictionaryImpl.getRoutineList()
when I worked on DERBY-5730:
> - The method always returns a list of one or zero items. Instead of creating an ArrayList,
it should use Collections.singletonList() and Collections.EMPTY_LIST, which are more memory-efficient.
> - It loops through the entire SYSFUN_FUNCTIONS array, even if the matching function is
found in the first cell of the array. It should break out of the loop once a match is found.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message