[jira] [Commented] (AMQ-7503) Comment code with issue numbers

2020-06-24 Thread Timothy A. Bish (Jira)


[ 
https://issues.apache.org/jira/browse/AMQ-7503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17143844#comment-17143844
 ] 

Timothy A. Bish commented on AMQ-7503:
--

Versioning software makes littering the code with random issue comments 
unnecessary.  If you want to track the history of the code you can review that 
via the git history tooling usually easily accessible in your IDE. 

> Comment code with issue numbers
> ---
>
> Key: AMQ-7503
> URL: https://issues.apache.org/jira/browse/AMQ-7503
> Project: ActiveMQ
>  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 TopicSubscription.java:
> {code:java}
> public void add(MessageReference node) throws Exception {
>...
>while (active) {
> while (matched.isFull()) {
> if (getContext().getStopping().get()) {
> LOG.warn("{}: stopped waiting for space in 
> pendingMessage cursor for: {}", toString(), node.getMessageId());
>
> getSubscriptionStatistics().getEnqueues().decrement();
> return;
> }
> if (!warnedAboutWait) {
> LOG.info("{}: Pending message cursor [{}] is 
> full, temp usag ({}%) or memory usage ({}%) limit reached, blocking message 
> add() pending the release of resources.",
> new Object[]{
> toString(),
> matched,
> 
> matched.getSystemUsage().getTempUsage().getPercentUsage(),
> 
> matched.getSystemUsage().getMemoryUsage().getPercentUsage()
> });
> warnedAboutWait = true;
> }
> matchedListMutex.wait(20);
> }
> // Temporary storage could be full - so just try to 
> add the message
> // see 
> https://issues.apache.org/activemq/browse/AMQ-2475
> if (matched.tryAddMessageLast(node, 10)) {
> break;
> }
> }{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/activemq] 
>  
> 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)


[jira] [Commented] (AMQ-7503) Comment code with issue numbers

2020-06-23 Thread ackelcn (Jira)


[ 
https://issues.apache.org/jira/browse/AMQ-7503?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17143513#comment-17143513
 ] 

ackelcn commented on AMQ-7503:
--

[https://github.com/apache/activemq/pull/547] I created a pull request to 
highlight my added comments.

> Comment code with issue numbers
> ---
>
> Key: AMQ-7503
> URL: https://issues.apache.org/jira/browse/AMQ-7503
> Project: ActiveMQ
>  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 TopicSubscription.java:
> {code:java}
> public void add(MessageReference node) throws Exception {
>...
>while (active) {
> while (matched.isFull()) {
> if (getContext().getStopping().get()) {
> LOG.warn("{}: stopped waiting for space in 
> pendingMessage cursor for: {}", toString(), node.getMessageId());
>
> getSubscriptionStatistics().getEnqueues().decrement();
> return;
> }
> if (!warnedAboutWait) {
> LOG.info("{}: Pending message cursor [{}] is 
> full, temp usag ({}%) or memory usage ({}%) limit reached, blocking message 
> add() pending the release of resources.",
> new Object[]{
> toString(),
> matched,
> 
> matched.getSystemUsage().getTempUsage().getPercentUsage(),
> 
> matched.getSystemUsage().getMemoryUsage().getPercentUsage()
> });
> warnedAboutWait = true;
> }
> matchedListMutex.wait(20);
> }
> // Temporary storage could be full - so just try to 
> add the message
> // see 
> https://issues.apache.org/activemq/browse/AMQ-2475
> if (matched.tryAddMessageLast(node, 10)) {
> break;
> }
> }{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/activemq] 
>  
> 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)