Skip to content
Permalink
Browse files

[JENKINS-44891] Address code review comments

  • Loading branch information...
stephenc committed Jun 14, 2017
1 parent 9d15020 commit db4c72722f0af59f23463c3a74a399d7d720a2d3
@@ -151,7 +151,7 @@ protected SCMSource() {
* Note this is a <strong>one-shot</strong> setter. If {@link #getId()} is called first, then its value will stick,
* otherwise the first call to {@link #setId(String)} will stick.
*
* @param id the ID.
* @param id the ID, this is an opaque token expected to be unique within any one {@link SCMSourceOwner}.
* @see #hasId()
* @see #getId()
* @since 2.2.0
@@ -160,6 +160,8 @@ protected SCMSource() {
public final synchronized void setId(@CheckForNull String id) {
if (this.id == null) {
this.id = id;
} else if (!this.id.equals(id)) {
throw new IllegalStateException("The ID cannot be changed after it has been set.");
}
}

@@ -77,7 +77,6 @@

@DataBoundConstructor
public MockSCMSource(String controllerId, String repository, List<SCMSourceTrait> traits) {
super();
this.controllerId = controllerId;
this.repository = repository;
this.traits = new ArrayList<SCMSourceTrait>(traits);
@@ -88,7 +87,6 @@ public MockSCMSource(String controllerId, String repository, SCMSourceTrait... t
}

public MockSCMSource(MockSCMController controller, String repository, List<SCMSourceTrait> traits) {
super();
this.controllerId = controller.getId();
this.controller = controller;
this.repository = repository;
@@ -62,9 +62,7 @@ public MockSCMSource build() {
MockSCMSource source = controller == null
? new MockSCMSource(controllerId, repository, traits())
: new MockSCMSource(controller, repository, traits());
if (id != null) {
source.setId(id());
}
source.setId(id());
return source;
}
}

0 comments on commit db4c727

Please sign in to comment.
You can’t perform that action at this time.