From 781d1874f60a40cb260426084d2847b5b0c6840f Mon Sep 17 00:00:00 2001 From: Michael Keppler Date: Wed, 20 Nov 2019 14:03:34 +0100 Subject: Remove redundant type arguments Execute the "Remove redundant type arguments" cleanup on all egit-github projects. Also enable the save action in all project properties for future automated cleanups. Change-Id: Ice37fa348e34677aa24b6e856ef2c6e1a0b160dc Signed-off-by: Michael Keppler --- .../.settings/org.eclipse.jdt.ui.prefs | 2 +- .../src/org/eclipse/egit/github/core/tests/CommitServiceTest.java | 2 +- .../src/org/eclipse/egit/github/core/tests/DataServiceTest.java | 2 +- .../src/org/eclipse/egit/github/core/tests/GistServiceTest.java | 2 +- .../src/org/eclipse/egit/github/core/tests/GollumPayloadTest.java | 2 +- .../src/org/eclipse/egit/github/core/tests/IssueServiceTest.java | 8 ++++---- .../src/org/eclipse/egit/github/core/tests/LabelServiceTest.java | 4 ++-- .../eclipse/egit/github/core/tests/OrganizationServiceTest.java | 2 +- .../src/org/eclipse/egit/github/core/tests/PagedRequestTest.java | 2 +- .../src/org/eclipse/egit/github/core/tests/PushPayloadTest.java | 2 +- .../org/eclipse/egit/github/core/tests/RepositoryServiceTest.java | 4 ++-- .../src/org/eclipse/egit/github/core/tests/live/CommitTest.java | 2 +- .../src/org/eclipse/egit/github/core/tests/live/GistTest.java | 2 +- .../src/org/eclipse/egit/github/core/tests/live/IssueTest.java | 2 +- .../src/org/eclipse/egit/github/core/Issue.java | 2 +- .../src/org/eclipse/egit/github/core/service/GitHubService.java | 6 +++--- .../src/org/eclipse/mylyn/internal/github/core/QueryUtils.java | 2 +- .../mylyn/internal/github/core/issue/IssueTaskDataHandler.java | 6 +++--- org.eclipse.mylyn.github.tests/.settings/org.eclipse.jdt.ui.prefs | 1 + .../internal/github/ui/pr/PullRequestContextSynchronizer.java | 2 +- .../internal/github/ui/pr/PullRequestRepositoryQueryPage.java | 2 +- 21 files changed, 30 insertions(+), 29 deletions(-) diff --git a/org.eclipse.egit.github.core.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.egit.github.core.tests/.settings/org.eclipse.jdt.ui.prefs index 15fe0835..e15ef1dd 100644 --- a/org.eclipse.egit.github.core.tests/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.egit.github.core.tests/.settings/org.eclipse.jdt.ui.prefs @@ -37,7 +37,7 @@ sp_cleanup.qualify_static_method_accesses_with_declaring_class=false sp_cleanup.remove_private_constructors=true sp_cleanup.remove_redundant_modifiers=false sp_cleanup.remove_redundant_semicolons=false -sp_cleanup.remove_redundant_type_arguments=false +sp_cleanup.remove_redundant_type_arguments=true sp_cleanup.remove_trailing_whitespaces=true sp_cleanup.remove_trailing_whitespaces_all=true sp_cleanup.remove_trailing_whitespaces_ignore_empty=false diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitServiceTest.java index 4b0e0ed6..d733d6dd 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitServiceTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/CommitServiceTest.java @@ -582,7 +582,7 @@ public class CommitServiceTest { status.setState(CommitStatus.STATE_SUCCESS); status.setContext("context"); service.createStatus(repo, "123", status); - Map params = new HashMap(); + Map params = new HashMap<>(); params.put("description", status.getDescription()); params.put("target_url", status.getTargetUrl()); params.put("state", status.getState()); diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/DataServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/DataServiceTest.java index d2f5ccab..06e0a9a7 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/DataServiceTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/DataServiceTest.java @@ -173,7 +173,7 @@ public class DataServiceTest { public void createTree() throws IOException { service.createTree(repo, null); verify(client).post("/repos/o/n/git/trees", - new HashMap(), Tree.class); + new HashMap<>(), Tree.class); } /** diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java index b33cfc47..307b4dff 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GistServiceTest.java @@ -462,7 +462,7 @@ public class GistServiceTest { public void createCommentOK() throws IOException { gistService.createComment("1", "test_comment"); - Map params = new HashMap(1, 1); + Map params = new HashMap<>(1, 1); params.put(IssueService.FIELD_BODY, "test_comment"); verify(gitHubClient).post("/gists/1/comments", params, Comment.class); } diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GollumPayloadTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GollumPayloadTest.java index 49910fb4..5a9d4529 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GollumPayloadTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/GollumPayloadTest.java @@ -42,7 +42,7 @@ public class GollumPayloadTest { @Test public void updateFields() { GollumPayload payload = new GollumPayload(); - List pages = new ArrayList(); + List pages = new ArrayList<>(); pages.add(new GollumPage().setPageName("page")); assertEquals(pages, payload.setPages(pages).getPages()); } diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueServiceTest.java index d63cb29e..0efc15bd 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueServiceTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/IssueServiceTest.java @@ -481,7 +481,7 @@ public class IssueServiceTest { issue.setState("test_state"); issueService.editIssue("test_user", "test_repository", issue); - Map params = new HashMap(); + Map params = new HashMap<>(); params.put(IssueService.FIELD_TITLE, "test_title"); params.put(IssueService.FIELD_BODY, "test_body"); params.put(IssueService.FILTER_STATE, "test_state"); @@ -504,7 +504,7 @@ public class IssueServiceTest { RepositoryId id = new RepositoryId("tu", "tr"); issueService.editIssue(id, issue); - Map params = new HashMap(); + Map params = new HashMap<>(); params.put(IssueService.FIELD_TITLE, "test_title"); params.put(IssueService.FIELD_BODY, "test_body"); params.put(IssueService.FILTER_STATE, "test_state"); @@ -581,7 +581,7 @@ public class IssueServiceTest { issueService.createComment("test_user", "test_repository", 1, "test_comment"); - Map params = new HashMap(); + Map params = new HashMap<>(); params.put(IssueService.FIELD_BODY, "test_comment"); verify(gitHubClient).post( "/repos/test_user/test_repository/issues/1/comments", params, @@ -598,7 +598,7 @@ public class IssueServiceTest { RepositoryId id = new RepositoryId("tu", "tr"); issueService.createComment(id, 1, "test_comment"); - Map params = new HashMap(); + Map params = new HashMap<>(); params.put(IssueService.FIELD_BODY, "test_comment"); verify(gitHubClient).post("/repos/tu/tr/issues/1/comments", params, Comment.class); diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/LabelServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/LabelServiceTest.java index ee4b19a9..3f49b004 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/LabelServiceTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/LabelServiceTest.java @@ -189,7 +189,7 @@ public class LabelServiceTest { */ @Test public void setLabels() throws IOException { - List