Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[JENKINS-12822] [JENKINS-12801] Added support for columns in warnings.
  • Loading branch information
uhafner committed Feb 20, 2012
1 parent 882207b commit 5123f0efb7b7b2d9bb26c7970c4e2bd83791746a
Showing with 25 additions and 0 deletions.
  1. +25 −0 src/main/java/hudson/plugins/analysis/util/model/AbstractAnnotation.java
@@ -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>.
@@ -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()) {
@@ -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;
@@ -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;

0 comments on commit 5123f0e

Please sign in to comment.