Skip to content

Commit

Permalink
no need to check for issue.getLineNumber() != null
Browse files Browse the repository at this point in the history
  • Loading branch information
LorenzoBettini committed Jan 12, 2024
1 parent b3d8e0a commit 66bfdb2
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,12 @@ protected void setMarkerAttributes(Issue issue, IResource resource, IMarker mark
// Do this in one single setAttributes() call, as each set of an attribute is a workspace operation
Map<String, Object> attributes = new HashMap<>(16);

if (issue.getLineNumber() != null) {
attributes.put(IMarker.LINE_NUMBER, issue.getLineNumber());
}
attributes.put(Issue.CODE_KEY, issue.getCode());
attributes.put(IMarker.SEVERITY, getSeverity(issue));
attributes.put(IMarker.CHAR_START, issue.getOffset());
if(issue.getOffset() != null && issue.getLength() != null)
attributes.put(IMarker.CHAR_END, issue.getOffset()+issue.getLength());
attributes.put(IMarker.LINE_NUMBER, issue.getLineNumber());
attributes.put(Issue.COLUMN_KEY, issue.getColumn());
attributes.put(IMarker.MESSAGE, issue.getMessage());

Expand Down

0 comments on commit 66bfdb2

Please sign in to comment.