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

Dave Brosius commented on DERBY-5143:
-------------------------------------

It seems to me like the entire NetConnection40.getTypeMap method can be 
removed, as the parent class always just returns an empty Map. In fact, 
Connection.getTypeMap, could just return a static field Map defined as

static final Map typeMap = Collections.unmodfiableSet(new HashSet());

> Remove unnecessary copying of the map in getTypeMap()
> -----------------------------------------------------
>
>                 Key: DERBY-5143
>                 URL: https://issues.apache.org/jira/browse/DERBY-5143
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC
>    Affects Versions: 10.8.0.0
>            Reporter: Knut Anders Hatlen
>            Assignee: Knut Anders Hatlen
>            Priority: Minor
>         Attachments: getTypeMap-warning.diff
>
>
> The JDBC 4.0 Connection classes implement getTypeMap() by calling 
> super.getTypeMap() and copying the resulting map. This is done to prevent an 
> unchecked compiler warning that we would see if we simply returned 
> super.getTypeMap() in this method. It would be cheaper and simpler to return 
> super.getTypeMap() and ignore the warning.

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

Reply via email to