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 "Richard N. Hillegas (Jira)" <ji...@apache.org> on 2020/06/23 22:56:00 UTC

[jira] [Commented] (DERBY-7080) Code comment with issue numbers

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

Richard N. Hillegas commented on DERBY-7080:
--------------------------------------------

Thanks for doing this work. I'm afraid I don't know how to review what you've done. When I click on that link, I am taken to a page with a lot of activemq folders. Nothing comes up when I search the page for "derby". Where on that page should I look? Thanks.

> Code comment with issue numbers
> -------------------------------
>
>                 Key: DERBY-7080
>                 URL: https://issues.apache.org/jira/browse/DERBY-7080
>             Project: Derby
>          Issue Type: Improvement
>            Reporter: ackelcn
>            Priority: Major
>
> When I read the code of activemq, I find some comments with issue numbers. One of them comes from CreateViewNode.java.java:
> {code:java}
>  @Override @Override public void bindStatement() throws StandardException {
>    ...
>    if (queryExpression.getResultColumns().size() > Limits.DB2_MAX_COLUMNS_IN_VIEW)if (queryExpression.getResultColumns().size() > Limits.DB2_MAX_COLUMNS_IN_VIEW) { 
>       throw StandardException.newException(SQLState.LANG_TOO_MANY_COLUMNS_IN_TABLE_OR_VIEW, String.valueOf(queryExpression.getResultColumns().size()), getRelativeName(), String.valueOf(Limits.DB2_MAX_COLUMNS_IN_VIEW)); 
>     }
>     // for each column, stuff system.column 
>     // System columns should only include visible columns DERBY-4230
>     ColumnInfo[queryExpression.getResultColumns().visibleSize()];   
>     genColumnInfos(colInfos); 
> }{code}
> These comments are quite useful for other programmers and me to understand the code, but I notice that not all issue numbers are written in code comments. It can be already quite tedious to write them into commit messages :)
>  
> To handle the problem, I implemented a tool to automatically instrument issue numbers into code comments. I tried my tool on derby, and the instrumented version is [https://github.com/ackelcn/derbywithissuecommenthttps://github.com/ackelcn/activemqwithissuecomment|https://github.com/ackelcn/activemqwithissuecomment]
>  
> All my generated comments start from //IC, so it is easy to find them.
>  
> Would you please some feedbacks to my tool? Please feel free to merge my generated comments in your code, if you feel that some are useful.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)