kieker-monitoring / kieker

Kieker's main repository
Apache License 2.0
70 stars 41 forks source link

[KIEKER-499] Checkstyle config: Enum comments #722

Open rju opened 2 weeks ago

rju commented 2 weeks ago

JIRA Issue: https://kieker-monitoring.atlassian.net/browse/KIEKER-499 Original Reporter: nils-christian


Is it necessary to add a javadoc comment for each enum? For example:

/**
     * An enumeration used to describe the state of an {@link AnalysisController}.
     * 
     * @author Jan Waller
     */
    public static enum STATE {
        /**
         * The controller has been initialized and is ready to be configured.
         */
        READY,
        /**
         * The analysis is currently running.
         */
        RUNNING,
        /**
         * The controller has been terminated without errors.
         */
        TERMINATED,
        /**
         * The analysis failed.
         */
        FAILED,
    }

In my opinion it makes the code harder to read than necessary. Under normal circumstances the names of the enums should be enough.

Checklist:

JIRA Comments:

557058:9e328f65-6e51-4aca-812b-82e63a91a0ae (JIRA username) added a comment on Fri, 15 Mar 2013 14:09:33

In my opinion this is a text-book example of well-documented code (i.e, I appreciate JavaDoc for each enum value --- at least for public ones that are part of the interface)

557058:629db7ce-5cef-419f-82f8-3dcdebf76471 (JIRA username) added a comment on Fri, 15 Mar 2013 14:13:32

Replying to [avh|comment:1]:
> In my opinion this is a text-book example of well-documented code (i.e, I appreciate JavaDoc for each enum value --- at least for public ones that are part of the interface)

Yes, but aren't the names of the states a little bit obvious? Is it necessary to comment those?

rju commented 2 weeks ago

author André van Hoorn -- Fri, 15 Mar 2013 14:09:33 +0100

In my opinion this is a text-book example of well-documented code (i.e, I appreciate JavaDoc for each enum value --- at least for public ones that are part of the interface)

rju commented 2 weeks ago

author nils-christian -- Fri, 15 Mar 2013 14:13:32 +0100

Replying to [avh|comment:1]:
> In my opinion this is a text-book example of well-documented code (i.e, I appreciate JavaDoc for each enum value --- at least for public ones that are part of the interface)

Yes, but aren't the names of the states a little bit obvious? Is it necessary to comment those?