Skip to content
This repository has been archived by the owner on Sep 9, 2024. It is now read-only.

Commit

Permalink
Refactored: Inlined constant condition
Browse files Browse the repository at this point in the history
* Moved static final variable above instance fields
  • Loading branch information
tommysdk committed Nov 19, 2018
1 parent 25f1996 commit ec00b37
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/main/java/se/diabol/jenkins/pipeline/domain/Change.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,14 @@

@ExportedBean(defaultVisibility = AbstractItem.VISIBILITY)
public class Change {

private static final Logger LOG = Logger.getLogger(Change.class.getName());

private final UserInfo author;
private final String message;
private final String commitId;
private final String changeLink;

private static final Logger LOG = Logger.getLogger(Change.class.getName());


public Change(UserInfo author, String message, String commitId, String changeLink) {
this.author = author;
this.message = message;
Expand Down Expand Up @@ -115,13 +115,9 @@ public static List<Change> getChanges(List<ChangeLogSet<? extends ChangeLogSet.E
for (ChangeLogSet<? extends ChangeLogSet.Entry> entries : changes) {
for (ChangeLogSet.Entry entry : entries) {
UserInfo user = UserInfo.getUser(entry.getAuthor());
String changeLink = null;
result.add(new Change(user, entry.getMsgAnnotated(), entry.getCommitId(), changeLink));
result.add(new Change(user, entry.getMsgAnnotated(), entry.getCommitId(), null));
}
}
return result;
}



}

0 comments on commit ec00b37

Please sign in to comment.