Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-10-18 18:04:17 +0000
committerMichael Keppler2018-10-18 18:04:17 +0000
commit88bb9c3ef10601e7820c3e1fc337994ea986d3cd (patch)
tree2595d13649d0c1f3103fe9025ba63a0fc597329c
parent319c8ef33f07ec09b34585c3e970fa9d01269676 (diff)
downloadegit-github-88bb9c3ef10601e7820c3e1fc337994ea986d3cd.tar.gz
egit-github-88bb9c3ef10601e7820c3e1fc337994ea986d3cd.tar.xz
egit-github-88bb9c3ef10601e7820c3e1fc337994ea986d3cd.zip
[releng] Fix all boxing/unboxing warnings
Make all type conversions with an Eclipse compiler warning explicit. Change-Id: I3eb1f57c1a556a17cc4dd15b58fa394ce641721c Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de>
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/DataService.java2
-rw-r--r--org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/PullRequestService.java2
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHubTaskDataHandler.java2
-rw-r--r--org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java11
-rwxr-xr-xorg.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java2
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java4
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentSorter.java3
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java2
-rw-r--r--org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java5
9 files changed, 20 insertions, 13 deletions
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/DataService.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/DataService.java
index 439b12ec..2be89508 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/DataService.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/DataService.java
@@ -332,7 +332,7 @@ public class DataService extends GitHubService {
Map<String, Object> params = new HashMap<>();
params.put("sha", object.getSha()); //$NON-NLS-1$
if (force)
- params.put("force", true); //$NON-NLS-1$
+ params.put("force", Boolean.TRUE); //$NON-NLS-1$
return client.post(uri.toString(), params, Reference.class);
}
diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/PullRequestService.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/PullRequestService.java
index 41f4b275..7c69150f 100644
--- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/PullRequestService.java
+++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/PullRequestService.java
@@ -271,7 +271,7 @@ public class PullRequestService extends GitHubService {
uri.append('/').append(id);
uri.append(SEGMENT_PULLS);
Map<String, Object> params = new HashMap<>();
- params.put("issue", issueId); //$NON-NLS-1$
+ params.put("issue", Integer.valueOf(issueId)); //$NON-NLS-1$
params.put("head", head); //$NON-NLS-1$
params.put("base", base); //$NON-NLS-1$
return client.post(uri.toString(), params, PullRequest.class);
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHubTaskDataHandler.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHubTaskDataHandler.java
index 95af829d..0ecbcaa6 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHubTaskDataHandler.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/GitHubTaskDataHandler.java
@@ -107,7 +107,7 @@ public abstract class GitHubTaskDataHandler extends AbstractTaskDataHandler {
commentMapper.setCreationDate(comment.getCreatedAt());
commentMapper.setText(comment.getBody());
commentMapper.setCommentId(comment.getUrl());
- commentMapper.setNumber(count);
+ commentMapper.setNumber(Integer.valueOf(count));
TaskAttribute attribute = parent
.createAttribute(TaskAttribute.PREFIX_COMMENT + count);
diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java
index f0f514e6..9f5c9824 100644
--- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java
+++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/gist/GistTaskDataHandler.java
@@ -140,9 +140,9 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler {
sizeCount += file.getSize();
TaskAttachmentMapper attachmentMapper = new TaskAttachmentMapper();
attachmentMapper.setFileName(file.getFilename());
- attachmentMapper.setReplaceExisting(true);
- attachmentMapper.setLength((long) file.getSize());
- attachmentMapper.setPatch(false);
+ attachmentMapper.setReplaceExisting(Boolean.TRUE);
+ attachmentMapper.setLength(Long.valueOf(file.getSize()));
+ attachmentMapper.setPatch(Boolean.FALSE);
attachmentMapper.setAuthor(reporterPerson);
attachmentMapper.setAttachmentId(file.getFilename());
TaskAttribute attribute = data.getRoot().createAttribute(
@@ -193,7 +193,8 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler {
}
if (files != 1)
summaryText.append(MessageFormat.format(
- Messages.GistTaskDataHandler_FilesMultiple, files));
+ Messages.GistTaskDataHandler_FilesMultiple,
+ Integer.valueOf(files)));
else
summaryText.append(Messages.GistTaskDataHandler_FilesSingle);
summaryText.append(',').append(' ').append(formatSize(size));
@@ -222,6 +223,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler {
* org.eclipse.mylyn.tasks.core.data.TaskData, java.util.Set,
* org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public RepositoryResponse postTaskData(TaskRepository repository,
TaskData taskData, Set<TaskAttribute> oldAttributes,
IProgressMonitor monitor) throws CoreException {
@@ -277,6 +279,7 @@ public class GistTaskDataHandler extends GitHubTaskDataHandler {
* org.eclipse.mylyn.tasks.core.ITaskMapping,
* org.eclipse.core.runtime.IProgressMonitor)
*/
+ @Override
public boolean initializeTaskData(TaskRepository repository, TaskData data,
ITaskMapping initializationData, IProgressMonitor monitor)
throws CoreException {
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
index adc06c6d..c0f02c3e 100755
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositoryImportWizard.java
@@ -105,7 +105,7 @@ public class RepositoryImportWizard extends Wizard implements IImportWizard {
.getRepositories();
String name = repositories.length != 1 ? MessageFormat.format(
Messages.RepositoryImportWizard_CloningRepositories,
- repositories.length)
+ Integer.valueOf(repositories.length))
: Messages.RepositoryImportWizard_CloningRepository;
Job job = new Job(name) {
@Override
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java
index 620bd4f5..bea5b4ad 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/RepositorySelectionWizardPage.java
@@ -346,7 +346,9 @@ public class RepositorySelectionWizardPage extends WizardPage {
private void updateSelectionLabel() {
selectedLabel.setText(MessageFormat.format(
Messages.RepositorySelectionWizardPage_LabelSelectionCount,
- tree.getCheckboxTreeViewer().getCheckedLeafCount(), repoCount));
+ Integer.valueOf(
+ tree.getCheckboxTreeViewer().getCheckedLeafCount()),
+ Integer.valueOf(repoCount)));
selectedLabel.getParent().layout(true, true);
validatePage();
}
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentSorter.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentSorter.java
index a1482bb2..a1c048ba 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentSorter.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentSorter.java
@@ -35,7 +35,8 @@ public class GistAttachmentSorter extends TableSorter {
case 0:
return CoreUtil.compare(attachment1.getFileName(), attachment2.getFileName());
case 1:
- return CoreUtil.compare(attachment1.getLength(), attachment2.getLength());
+ return CoreUtil.compare(Long.valueOf(attachment1.getLength()),
+ Long.valueOf(attachment2.getLength()));
case 2:
return CoreUtil.compare(attachment1.getAuthor().toString(), attachment2
.getAuthor().toString());
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java
index 32c6bbfa..aa64c1d2 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/gist/GistAttachmentTableLabelProvider.java
@@ -156,7 +156,7 @@ public class GistAttachmentTableLabelProvider extends ColumnLabelProvider {
case 1:
return attachment.getDescription();
case 2:
- Long length = attachment.getLength();
+ long length = attachment.getLength();
if (length < 0) {
return "-"; //$NON-NLS-1$
}
diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java
index 984df836..f4fedef9 100644
--- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java
+++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/CommitAttributePart.java
@@ -159,7 +159,8 @@ public class CommitAttributePart extends AbstractTaskEditorSection {
}
getSection().setText(
MessageFormat.format(
- Messages.CommitAttributePart_SectionCommits, size));
+ Messages.CommitAttributePart_SectionCommits,
+ Integer.valueOf(size)));
return displayArea;
}
@@ -237,7 +238,7 @@ public class CommitAttributePart extends AbstractTaskEditorSection {
}
private void fetchCommits(final Runnable postHandler) {
- IHandlerService handlerService = (IHandlerService) getTaskEditorPage()
+ IHandlerService handlerService = getTaskEditorPage()
.getEditorSite().getService(IHandlerService.class);
try {
IEvaluationContext context = TaskDataHandler.createContext(

Back to the top