Skip to content
This repository has been archived by the owner on Apr 6, 2022. It is now read-only.

Commit

Permalink
[JENKINS-12822] [JENKINS-12801] Added support for columns in warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhafner committed Feb 20, 2012
1 parent 882207b commit 5123f0e
Showing 1 changed file with 25 additions and 0 deletions.
Expand Up @@ -64,6 +64,10 @@ public abstract class AbstractAnnotation implements FileAnnotation, Serializable
private String origin;
/** Relative path of this duplication. @since 1.10 */
private String pathName;
/** Column start of primary line range of warning. @since 1.38 */
private int primaryColumnStart;
/** Column end of primary line range of warning. @since 1.38 */
private int primaryColumnEnd;

/**
* Creates a new instance of <code>AbstractAnnotation</code>.
Expand Down Expand Up @@ -138,6 +142,19 @@ public AbstractAnnotation(final AbstractAnnotation copy) {
packageName = copy.getPackageName();
}

/**
* Sets the column position of this warning.
*
* @param columnStart
* starting column
* @param columnEnd
* ending column
*/
public void setColumnPosition(final int columnStart, final int columnEnd) {
primaryColumnStart = columnStart;
primaryColumnEnd = columnEnd;
}

/** {@inheritDoc} */
public String getLinkName() {
if (hasPackageName()) {
Expand Down Expand Up @@ -331,6 +348,8 @@ public int hashCode() {
result = prime * result + ((moduleName == null) ? 0 : moduleName.hashCode());
result = prime * result + ((packageName == null) ? 0 : packageName.hashCode());
result = prime * result + primaryLineNumber;
result = prime * result + primaryColumnStart;
result = prime * result + primaryColumnEnd;
result = prime * result + ((priority == null) ? 0 : priority.hashCode());
result = prime * result + ((type == null) ? 0 : type.hashCode());
return result;
Expand Down Expand Up @@ -400,6 +419,12 @@ else if (!packageName.equals(other.packageName)) {
if (primaryLineNumber != other.primaryLineNumber) {
return false;
}
if (primaryColumnStart != other.primaryColumnStart) {
return false;
}
if (primaryColumnEnd != other.primaryColumnEnd) {
return false;
}
if (priority == null) {
if (other.priority != null) {
return false;
Expand Down

0 comments on commit 5123f0e

Please sign in to comment.