You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Folke Behrens (JIRA)" <ji...@apache.org> on 2010/07/06 02:02:50 UTC

[jira] Created: (CASSANDRA-1252) @Override annotation on implementing methods

@Override annotation on implementing methods
--------------------------------------------

                 Key: CASSANDRA-1252
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1252
             Project: Cassandra
          Issue Type: Improvement
          Components: Core
            Reporter: Folke Behrens


The current [CodeStyle|http://wiki.apache.org/cassandra/CodeStyle] states that one should "avoid redundant @Override annotations when implementing abstract or interface methods." A rationale is not given.

The @Override annotation is not redundant. When putting it on implementing methods it helps detecting abstract methods of super-classes or interfaces that were removed. This is especially important when extending abstract classes or implementing interfaces from external libraries.

Please tag every overriding method with @Override and make compiler warnings errors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-1252) @Override annotation on implementing methods

Posted by "Folke Behrens (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885610#action_12885610 ] 

Folke Behrens commented on CASSANDRA-1252:
------------------------------------------

Dude, get a copy and read the entire Item 36. Yes, he writes that @Override is unnecessary for implementing methods because the compiler will warn you if signatures don't match but he also wrote an entire page about why it is still a good idea to do it anyway.

> @Override annotation on implementing methods
> --------------------------------------------
>
>                 Key: CASSANDRA-1252
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1252
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Folke Behrens
>
> The current [CodeStyle|http://wiki.apache.org/cassandra/CodeStyle] states that one should "avoid redundant @Override annotations when implementing abstract or interface methods." A rationale is not given.
> The @Override annotation is not redundant. When putting it on implementing methods it helps detecting abstract methods of super-classes or interfaces that were removed. This is especially important when extending abstract classes or implementing interfaces from external libraries.
> Please tag every overriding method with @Override and make compiler warnings errors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-1252) @Override annotation on implementing methods

Posted by "Folke Behrens (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885619#action_12885619 ] 

Folke Behrens commented on CASSANDRA-1252:
------------------------------------------

There's no such thing as "library code."

> @Override annotation on implementing methods
> --------------------------------------------
>
>                 Key: CASSANDRA-1252
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1252
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Folke Behrens
>
> The current [CodeStyle|http://wiki.apache.org/cassandra/CodeStyle] states that one should "avoid redundant @Override annotations when implementing abstract or interface methods." A rationale is not given.
> The @Override annotation is not redundant. When putting it on implementing methods it helps detecting abstract methods of super-classes or interfaces that were removed. This is especially important when extending abstract classes or implementing interfaces from external libraries.
> Please tag every overriding method with @Override and make compiler warnings errors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CASSANDRA-1252) @Override annotation on implementing methods

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12885615#action_12885615 ] 

Jonathan Ellis commented on CASSANDRA-1252:
-------------------------------------------

"Effective Java" is primarily aimed at library code.  You have to have enough independent thought to realize when the advice doesn't apply to other situations.

> @Override annotation on implementing methods
> --------------------------------------------
>
>                 Key: CASSANDRA-1252
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1252
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Folke Behrens
>
> The current [CodeStyle|http://wiki.apache.org/cassandra/CodeStyle] states that one should "avoid redundant @Override annotations when implementing abstract or interface methods." A rationale is not given.
> The @Override annotation is not redundant. When putting it on implementing methods it helps detecting abstract methods of super-classes or interfaces that were removed. This is especially important when extending abstract classes or implementing interfaces from external libraries.
> Please tag every overriding method with @Override and make compiler warnings errors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CASSANDRA-1252) @Override annotation on implementing methods

Posted by "Jonathan Ellis (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-1252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis resolved CASSANDRA-1252.
---------------------------------------

    Resolution: Not A Problem

Even Josh Bloch agrees that @Override is redundant when implementing abstract or interface methods.

> @Override annotation on implementing methods
> --------------------------------------------
>
>                 Key: CASSANDRA-1252
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-1252
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Folke Behrens
>
> The current [CodeStyle|http://wiki.apache.org/cassandra/CodeStyle] states that one should "avoid redundant @Override annotations when implementing abstract or interface methods." A rationale is not given.
> The @Override annotation is not redundant. When putting it on implementing methods it helps detecting abstract methods of super-classes or interfaces that were removed. This is especially important when extending abstract classes or implementing interfaces from external libraries.
> Please tag every overriding method with @Override and make compiler warnings errors.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.