Skip to content

Commit 2e79bb3

Browse files
committed
Fix checkstyle issues
1 parent 1d82ff9 commit 2e79bb3

File tree

5 files changed

+8
-41
lines changed

5 files changed

+8
-41
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>org.jenkins-ci.plugins</groupId>
77
<artifactId>plugin</artifactId>
8-
<version>4.86</version>
8+
<version>4.88</version>
99
<relativePath />
1010
</parent>
1111

src/main/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketSCMSource.java

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@
8888
import java.util.logging.Logger;
8989
import jenkins.authentication.tokens.api.AuthenticationTokens;
9090
import jenkins.model.Jenkins;
91-
import jenkins.plugins.git.AbstractGitSCMSource.SCMRevisionImpl;
9291
import jenkins.plugins.git.traits.GitBrowserSCMSourceTrait;
9392
import jenkins.scm.api.SCMHead;
9493
import jenkins.scm.api.SCMHeadCategory;
@@ -999,44 +998,14 @@ private BitbucketCommit findPRDestinationCommit(BitbucketPullRequest pr, TaskLis
999998

1000999
@Override
10011000
public SCM build(SCMHead head, SCMRevision revision) {
1002-
BitbucketRepositoryType type;
1003-
if (head instanceof PullRequestSCMHead) {
1004-
type = ((PullRequestSCMHead) head).getRepositoryType();
1005-
} else if (head instanceof BranchSCMHead) {
1006-
type = ((BranchSCMHead) head).getRepositoryType();
1007-
} else if (head instanceof BitbucketTagSCMHead) {
1008-
type = ((BitbucketTagSCMHead) head).getRepositoryType();
1009-
} else {
1010-
throw new IllegalArgumentException("Either PullRequestSCMHead, BitbucketTagSCMHead or BranchSCMHead required as parameter");
1011-
}
1012-
if (type == null) {
1013-
if (revision instanceof SCMRevisionImpl) {
1014-
type = BitbucketRepositoryType.GIT;
1015-
} else {
1016-
try {
1017-
type = getRepositoryType();
1018-
} catch (IOException | InterruptedException e) {
1019-
type = BitbucketRepositoryType.GIT;
1020-
LOGGER.log(Level.SEVERE,
1021-
"Could not determine repository type of " + getRepoOwner() + "/" + getRepository()
1022-
+ " on " + getServerUrl() + " for " + getOwner() + " assuming " + type, e);
1023-
}
1024-
}
1025-
}
1026-
assert type != null;
10271001
initCloneLinks();
10281002

1029-
switch (type) {
1030-
case GIT:
1031-
default:
1032-
BitbucketAuthenticator authenticator = authenticator();
1033-
return new BitbucketGitSCMBuilder(this, head, revision, null)
1034-
.withExtension(authenticator == null ? null : new GitClientAuthenticatorExtension(authenticator.getCredentialsForScm()))
1035-
.withCloneLinks(primaryCloneLinks, mirrorCloneLinks)
1036-
.withTraits(traits)
1037-
.build();
1038-
1039-
}
1003+
BitbucketAuthenticator authenticator = authenticator();
1004+
return new BitbucketGitSCMBuilder(this, head, revision, null)
1005+
.withExtension(authenticator == null ? null : new GitClientAuthenticatorExtension(authenticator.getCredentialsForScm()))
1006+
.withCloneLinks(primaryCloneLinks, mirrorCloneLinks)
1007+
.withTraits(traits)
1008+
.build();
10401009
}
10411010

10421011
private void setPrimaryCloneLinks(List<BitbucketHref> links) {

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/BitbucketBuildStatusNotificationsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@
3232
import com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketCloudEndpoint;
3333
import com.cloudbees.jenkins.plugins.bitbucket.filesystem.BitbucketSCMFile;
3434
import hudson.model.Action;
35+
import hudson.model.Descriptor.FormException;
3536
import hudson.model.FreeStyleBuild;
3637
import hudson.model.FreeStyleProject;
3738
import hudson.model.Result;
3839
import hudson.model.TaskListener;
39-
import hudson.model.Descriptor.FormException;
4040
import java.io.ByteArrayInputStream;
4141
import java.io.IOException;
4242
import java.net.URL;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/Security2033Test.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import hudson.security.ACLContext;
1212
import hudson.util.FormValidation;
1313
import hudson.util.ListBoxModel;
14-
import java.io.IOException;
1514
import java.net.HttpURLConnection;
1615
import jenkins.model.Jenkins;
1716
import org.hamcrest.CoreMatchers;

src/test/java/com/cloudbees/jenkins/plugins/bitbucket/endpoints/AbstractBitbucketEndpointDescriptorTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import com.cloudbees.plugins.credentials.impl.UsernamePasswordCredentialsImpl;
3333
import com.damnhandy.uri.template.UriTemplate;
3434
import edu.umd.cs.findbugs.annotations.NonNull;
35-
import hudson.model.Descriptor.FormException;
3635
import hudson.util.ListBoxModel;
3736
import java.util.Collections;
3837
import java.util.List;

0 commit comments

Comments
 (0)