aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schneider (Jira)" <>
Subject [jira] [Commented] (ARIES-1988) Code comment with issue numbers
Date Wed, 24 Jun 2020 05:24:00 GMT


Christian Schneider commented on ARIES-1988:

I think this is a very bad idea. Github can already provide this functionality. Adding the
comments in the code just lets them rot from there on. For every code change you then have
to carefully move / remove add comments. Typically people are too afraid of removing them
so they simply would pile up.

> Code comment with issue numbers
> -------------------------------
>                 Key: ARIES-1988
>                 URL:
>             Project: Aries
>          Issue Type: Improvement
>            Reporter: ackelcn
>            Priority: Major
> When I read the code of aries, I find some comments with issue numbers. One of them comes
> {code:java}
> public AbstractServiceRegistryContext(BundleContext callerContext, Hashtable<?, ?>
environment) {
>    ...
>    env.putAll((Map<? extends String, ? extends Object>) environment);
>         // ARIES-397:, If the caller has provided a BundleContext
>         // in the hashtable, use this in preference to callerContext
>         if (augmenterInvoker == null && callerContext != null) {
>             ServiceReference augmenterSR = callerContext.getServiceReference(AugmenterInvoker.class.getName());
>             if (augmenterSR != null) augmenterInvoker = (AugmenterInvoker) callerContext.getService(augmenterSR);
>         }
> }{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 [] 
> [ |]
> 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

View raw message