[jira] [Commented] (CASSANDRA-15895) Code comment with issue number

2020-06-25 Thread Benedict Elliott Smith (Jira)


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

Benedict Elliott Smith commented on CASSANDRA-15895:


If this were inserting useful comments near where critical bugs were fixed, 
that could be valuable - or simply auditing those bug fixes above a certain 
complexity level and reporting the ones that have no such comment, so we could 
add them (and so they would survive refactors).  But I agree with Brandon that, 
as it stands, this seems inferior to git annotate, and pollutes the codebase.

> Code comment with issue number
> --
>
> Key: CASSANDRA-15895
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15895
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: ackelcn
>Priority: Normal
>
> When I read the code of cassandra, I find some comments with issue numbers. 
> One of them comes from JavaDriverClient.java:
> {code:java}
> public JavaDriverClient(StressSettings settings, String host, int port, 
> EncryptionOptions encryptionOptions){
>...
>//Always allow enough pending requests so every thread can have a request 
> pending
> //See https://issues.apache.org/jira/browse/CASSANDRA-7217
> int requestsPerConnection = (maxThreadCount / connectionsPerHost) + 
> connectionsPerHost;
> maxPendingPerConnection = settings.mode.maxPendingPerConnection == null ? 
> Math.max(128, requestsPerConnection ) : settings.mode.maxPendingPerConnection;
> }{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 activemq, and the instrumented 
> version is [https://github.com/ackelcn/cassandra] 
>  
> To avoid confusion, if there is already an issue number in code comments, my 
> tool ignored the issue number. 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)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15895) Code comment with issue number

2020-06-24 Thread Brandon Williams (Jira)


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

Brandon Williams commented on CASSANDRA-15895:
--

On one hand, this seems pretty cool, but can't `git blame` handle this without 
invasive comments?

> Code comment with issue number
> --
>
> Key: CASSANDRA-15895
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15895
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: ackelcn
>Priority: Normal
>
> When I read the code of cassandra, I find some comments with issue numbers. 
> One of them comes from JavaDriverClient.java:
> {code:java}
> public JavaDriverClient(StressSettings settings, String host, int port, 
> EncryptionOptions encryptionOptions){
>...
>//Always allow enough pending requests so every thread can have a request 
> pending
> //See https://issues.apache.org/jira/browse/CASSANDRA-7217
> int requestsPerConnection = (maxThreadCount / connectionsPerHost) + 
> connectionsPerHost;
> maxPendingPerConnection = settings.mode.maxPendingPerConnection == null ? 
> Math.max(128, requestsPerConnection ) : settings.mode.maxPendingPerConnection;
> }{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 activemq, and the instrumented 
> version is [https://github.com/ackelcn/cassandra] 
>  
> To avoid confusion, if there is already an issue number in code comments, my 
> tool ignored the issue number. 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)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org



[jira] [Commented] (CASSANDRA-15895) Code comment with issue number

2020-06-23 Thread ackelcn (Jira)


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

ackelcn commented on CASSANDRA-15895:
-

I forked cassandra, and rerun my tool. This pull request highlights the new 
comments.

https://github.com/apache/cassandra/pull/650

> Code comment with issue number
> --
>
> Key: CASSANDRA-15895
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15895
> Project: Cassandra
>  Issue Type: Improvement
>Reporter: ackelcn
>Priority: Normal
>
> When I read the code of cassandra, I find some comments with issue numbers. 
> One of them comes from JavaDriverClient.java:
> {code:java}
> public JavaDriverClient(StressSettings settings, String host, int port, 
> EncryptionOptions encryptionOptions){
>...
>//Always allow enough pending requests so every thread can have a request 
> pending
> //See https://issues.apache.org/jira/browse/CASSANDRA-7217
> int requestsPerConnection = (maxThreadCount / connectionsPerHost) + 
> connectionsPerHost;
> maxPendingPerConnection = settings.mode.maxPendingPerConnection == null ? 
> Math.max(128, requestsPerConnection ) : settings.mode.maxPendingPerConnection;
> }{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 activemq, and the instrumented 
> version is [https://github.com/ackelcn/cassandra] 
>  
> To avoid confusion, if there is already an issue number in code comments, my 
> tool ignored the issue number. 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)

-
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org