CAMEL-8497 Fixed bunch of CS errors
Project: http://git-wip-us.apache.org/repos/asf/camel/repo Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/63f327d4 Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/63f327d4 Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/63f327d4 Branch: refs/heads/master Commit: 63f327d489407b5c672c103b5ddde48486b2ea67 Parents: c458f53 Author: Willem Jiang <willem.ji...@gmail.com> Authored: Thu Mar 19 14:54:44 2015 +0800 Committer: Willem Jiang <willem.ji...@gmail.com> Committed: Thu Mar 19 14:54:44 2015 +0800 ---------------------------------------------------------------------- .../github/producer/GetCommitFileProducer.java | 14 +++++++------- .../github/producer/PullRequestFilesProducer.java | 2 +- .../github/producer/PullRequestStateProducer.java | 4 ++-- .../github/producer/PullRequestFilesProducerTest.java | 4 ++-- .../github/producer/PullRequestStateProducerTest.java | 4 ++-- .../component/github/services/MockCommitService.java | 4 ++-- .../github/services/MockPullRequestService.java | 7 +++---- 7 files changed, 19 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/camel/blob/63f327d4/components/camel-github/src/main/java/org/apache/camel/component/github/producer/GetCommitFileProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-github/src/main/java/org/apache/camel/component/github/producer/GetCommitFileProducer.java b/components/camel-github/src/main/java/org/apache/camel/component/github/producer/GetCommitFileProducer.java index 92375b9..04dd6bd 100644 --- a/components/camel-github/src/main/java/org/apache/camel/component/github/producer/GetCommitFileProducer.java +++ b/components/camel-github/src/main/java/org/apache/camel/component/github/producer/GetCommitFileProducer.java @@ -35,7 +35,7 @@ public class GetCommitFileProducer extends AbstractGitHubProducer { private DataService dataService; - private String encoding=Blob.ENCODING_UTF8; + private String encoding = Blob.ENCODING_UTF8; public GetCommitFileProducer(GitHubEndpoint endpoint) throws Exception { super(endpoint); @@ -55,22 +55,22 @@ public class GetCommitFileProducer extends AbstractGitHubProducer { if (!encoding.equalsIgnoreCase(Blob.ENCODING_BASE64) && !encoding.equalsIgnoreCase(Blob.ENCODING_UTF8)) { - throw new IllegalArgumentException("Unknown encoding '"+encoding+"'"); + throw new IllegalArgumentException("Unknown encoding '" + encoding + "'"); } } } public void process(Exchange exchange) throws Exception { - CommitFile file=exchange.getIn().getBody(CommitFile.class); + CommitFile file = exchange.getIn().getBody(CommitFile.class); - Blob response=dataService.getBlob(getRepository(), file.getSha()); + Blob response = dataService.getBlob(getRepository(), file.getSha()); - String text=response.getContent(); + String text = response.getContent(); // By default, if blob encoding is base64 then we convert to UTF-8. If // base64 encoding is required, then must be explicitly requested - if (response.getEncoding().equals(Blob.ENCODING_BASE64) && - encoding != null && encoding.equalsIgnoreCase(Blob.ENCODING_UTF8)) { + if (response.getEncoding().equals(Blob.ENCODING_BASE64) + && encoding != null && encoding.equalsIgnoreCase(Blob.ENCODING_UTF8)) { text = new String(Base64.decodeBase64(text)); } http://git-wip-us.apache.org/repos/asf/camel/blob/63f327d4/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestFilesProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestFilesProducer.java b/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestFilesProducer.java index f69bd3f..a44a0c5 100644 --- a/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestFilesProducer.java +++ b/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestFilesProducer.java @@ -51,7 +51,7 @@ public class PullRequestFilesProducer extends AbstractGitHubProducer { public void process(Exchange exchange) throws Exception { Integer pullRequestNumber = exchange.getIn().getHeader("GitHubPullRequest", Integer.class); - java.util.List<CommitFile> response=pullRequestService.getFiles(getRepository(), pullRequestNumber); + java.util.List<CommitFile> response = pullRequestService.getFiles(getRepository(), pullRequestNumber); // copy the header of in message to the out message exchange.getOut().copyFrom(exchange.getIn()); http://git-wip-us.apache.org/repos/asf/camel/blob/63f327d4/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestStateProducer.java ---------------------------------------------------------------------- diff --git a/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestStateProducer.java b/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestStateProducer.java index b9218b6..ab84fd1 100644 --- a/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestStateProducer.java +++ b/components/camel-github/src/main/java/org/apache/camel/component/github/producer/PullRequestStateProducer.java @@ -59,7 +59,7 @@ public class PullRequestStateProducer extends AbstractGitHubProducer { String pullRequestNumberSHA = exchange.getIn().getHeader("GitHubPullRequestHeadCommitSHA", String.class); String text = exchange.getIn().getBody(String.class); - CommitStatus status=new CommitStatus(); + CommitStatus status = new CommitStatus(); if (state != null) { status.setState(state); @@ -73,7 +73,7 @@ public class PullRequestStateProducer extends AbstractGitHubProducer { status.setDescription(text); } - CommitStatus response=commitService.createStatus(getRepository(), pullRequestNumberSHA, status); + CommitStatus response = commitService.createStatus(getRepository(), pullRequestNumberSHA, status); // copy the header of in message to the out message exchange.getOut().copyFrom(exchange.getIn()); http://git-wip-us.apache.org/repos/asf/camel/blob/63f327d4/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestFilesProducerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestFilesProducerTest.java b/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestFilesProducerTest.java index d975532..fc4e97d 100644 --- a/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestFilesProducerTest.java +++ b/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestFilesProducerTest.java @@ -59,10 +59,10 @@ public class PullRequestFilesProducerTest extends GitHubComponentTestBase { PullRequest pullRequest = pullRequestService.addPullRequest("testPullRequestFilesProducer"); latestPullRequestNumber = pullRequest.getNumber(); - CommitFile file=new CommitFile(); + CommitFile file = new CommitFile(); file.setFilename("testfile"); - List<CommitFile> commitFiles=new ArrayList<CommitFile>(); + List<CommitFile> commitFiles = new ArrayList<CommitFile>(); commitFiles.add(file); pullRequestService.setFiles(latestPullRequestNumber, commitFiles); http://git-wip-us.apache.org/repos/asf/camel/blob/63f327d4/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestStateProducerTest.java ---------------------------------------------------------------------- diff --git a/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestStateProducerTest.java b/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestStateProducerTest.java index 1aabe95..c6a6a93 100644 --- a/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestStateProducerTest.java +++ b/components/camel-github/src/test/java/org/apache/camel/component/github/producer/PullRequestStateProducerTest.java @@ -60,7 +60,7 @@ public class PullRequestStateProducerTest extends GitHubComponentTestBase { Exchange exchange = stateProducerEndpoint.createExchange(); String text = "Message sent at " + new Date(); exchange.getIn().setBody(text); - Exchange response=template.send(stateProducerEndpoint, exchange); + Exchange response = template.send(stateProducerEndpoint, exchange); assertNotNull(response.getOut().getBody()); @@ -68,7 +68,7 @@ public class PullRequestStateProducerTest extends GitHubComponentTestBase { fail("Expecting CommitStatus"); } - CommitStatus status=response.getOut().getBody(CommitStatus.class); + CommitStatus status = response.getOut().getBody(CommitStatus.class); // Check status set on commit service if (commitService.getCommitStatus(commitsha) != status) { http://git-wip-us.apache.org/repos/asf/camel/blob/63f327d4/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockCommitService.java ---------------------------------------------------------------------- diff --git a/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockCommitService.java b/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockCommitService.java index 4759170..c3f8f51 100644 --- a/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockCommitService.java +++ b/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockCommitService.java @@ -36,7 +36,7 @@ public class MockCommitService extends CommitService { private List<RepositoryCommit> commitsList = new ArrayList<RepositoryCommit>(); private AtomicLong fakeSha = new AtomicLong(System.currentTimeMillis()); - private Map<String,CommitStatus> commitStatus = new HashMap<String,CommitStatus>(); + private Map<String, CommitStatus> commitStatus = new HashMap<String, CommitStatus>(); public synchronized RepositoryCommit addRepositoryCommit() { User author = new User(); @@ -68,7 +68,7 @@ public class MockCommitService extends CommitService { } public String getNextSha() { - return (fakeSha.incrementAndGet()+""); + return fakeSha.incrementAndGet() + ""; } public CommitStatus getCommitStatus(String sha) { http://git-wip-us.apache.org/repos/asf/camel/blob/63f327d4/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockPullRequestService.java ---------------------------------------------------------------------- diff --git a/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockPullRequestService.java b/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockPullRequestService.java index 2619c8b..09a7d63 100755 --- a/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockPullRequestService.java +++ b/components/camel-github/src/test/java/org/apache/camel/component/github/services/MockPullRequestService.java @@ -40,7 +40,7 @@ public class MockPullRequestService extends PullRequestService { private AtomicInteger pullRequestNumber = new AtomicInteger(101); private AtomicInteger commentId = new AtomicInteger(500); private Map<Long, List<CommitComment>> allComments = new HashMap<Long, List<CommitComment>>(); - private Map<Integer,List<CommitFile>> files = new HashMap<Integer,List<CommitFile>>(); + private Map<Integer, List<CommitFile>> files = new HashMap<Integer, List<CommitFile>>(); public List<CommitComment> getComments(IRepositoryIdProvider repository, int pullRequestId) { Long id = new Long(pullRequestId); @@ -131,8 +131,7 @@ public class MockPullRequestService extends PullRequestService { } @Override - public List<CommitFile> getFiles(IRepositoryIdProvider repository, int id) - throws IOException { - return (files.get(id)); + public List<CommitFile> getFiles(IRepositoryIdProvider repository, int id) throws IOException { + return files.get(id); } }