Skip to content

Do not report Java @Override annotations as “Moved without changes” #84

@jglick

Description

@jglick

Consider https://app.semanticdiff.com/gh/jenkinsci/jenkins/pull/9688/changes#cli/src/main/java/hudson/cli/CLI.java?ignore_comments=true as an example. (jenkinsci/jenkins#9688) In two places (as of this writing) there are entries in the diff which are highlighted with boxes

@Override

and called out as Moved without changes. This is silly because the annotation was clearly not “moved”, it is associated directly with the method declaration on the following line, and was written independently.

(In Java, this annotation serves a special purpose more akin to a modifier, which is how it is treated in C#. So it would logically belong on the same line as the rest of the method declaration. Yet typical Java formatting tools insist on placing every annotation on a separate line.)

It would be nice if the SemanticDiff module for Java syntax understood that an @Override annotation is not unique content that might have come from elsewhere, any more than a void keyword in a method return type was “copied” from some unrelated method in the original code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestgithubThis issue is about our GitHub App

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions