diff options
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<String, String> params = new HashMap<String, String>(); + Map<String, String> 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<Object, Object>(), 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<String, String> params = new HashMap<String, String>(1, 1); + Map<String, String> 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<GollumPage> pages = new ArrayList<GollumPage>(); + List<GollumPage> 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<String, String> params = new HashMap<String, String>(); + Map<String, String> 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<String, String> params = new HashMap<String, String>(); + Map<String, String> 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<String, String> params = new HashMap<String, String>(); + Map<String, String> 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<String, String> params = new HashMap<String, String>(); + Map<String, String> 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<Label> labels = new LinkedList<Label>(); + List<Label> labels = new LinkedList<>(); labelService.setLabels("test_user", "test_repository", "1", labels); TypeToken<List<Label>> labelsToken = new TypeToken<List<Label>>() { }; @@ -206,7 +206,7 @@ public class LabelServiceTest { @Test public void setLabelsWithRepositoryId() throws IOException { RepositoryId repo = new RepositoryId("test_user", "test_repository"); - List<Label> labels = new LinkedList<Label>(); + List<Label> labels = new LinkedList<>(); labelService.setLabels(repo, "1", labels); TypeToken<List<Label>> labelsToken = new TypeToken<List<Label>>() { }; diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/OrganizationServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/OrganizationServiceTest.java index 4c163171..7011afad 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/OrganizationServiceTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/OrganizationServiceTest.java @@ -251,7 +251,7 @@ public class OrganizationServiceTest { private void testMembersByRole(RoleFilter roleFilter) throws IOException { service.getMembers("group", roleFilter); - HashMap<String, String> params = new HashMap<String, String>(); + HashMap<String, String> params = new HashMap<>(); params.put("role", roleFilter.toString()); GitHubRequest request = new GitHubRequest(); request.setParams(params); diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PagedRequestTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PagedRequestTest.java index d9409cb4..64177b41 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PagedRequestTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PagedRequestTest.java @@ -27,7 +27,7 @@ public class PagedRequestTest { */ @Test public void defaultState() { - PagedRequest<String> request = new PagedRequest<String>(); + PagedRequest<String> request = new PagedRequest<>(); assertTrue(request.getPage() > 0); assertTrue(request.getPageSize() > 0); } diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java index e914b51c..f266f2ab 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/PushPayloadTest.java @@ -60,7 +60,7 @@ public class PushPayloadTest { @Test public void updateFields() { PushPayload payload = new PushPayload(); - List<Commit> commits = new ArrayList<Commit>(); + List<Commit> commits = new ArrayList<>(); commits.add(new Commit().setSha("000")); assertEquals("head", payload.setHead("head").getHead()); assertEquals("ref", payload.setRef("ref").getRef()); diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java index e5c8fe2a..580e872c 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/RepositoryServiceTest.java @@ -139,7 +139,7 @@ public class RepositoryServiceTest { */ @Test public void editRepositoryWithFields() throws IOException { - Map<String, Object> fields = new HashMap<String, Object>(); + Map<String, Object> fields = new HashMap<>(); fields.put("has_issues", true); fields.put("homepage", "test://address"); service.editRepository("o", "n", fields); @@ -163,7 +163,7 @@ public class RepositoryServiceTest { */ @Test public void editRepositoryProviderWithFields() throws IOException { - Map<String, Object> fields = new HashMap<String, Object>(); + Map<String, Object> fields = new HashMap<>(); fields.put("has_issues", true); fields.put("homepage", "test://address"); service.editRepository(repo, fields); diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/CommitTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/CommitTest.java index 575a88b7..75194e88 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/CommitTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/CommitTest.java @@ -47,7 +47,7 @@ public class CommitTest extends LiveTest { CommitService service = new CommitService(client); RepositoryId repo = RepositoryId.create("defunkt", "mustache"); PageIterator<RepositoryCommit> commits = service.pageCommits(repo, 2); - Set<String> shas = new HashSet<String>(); + Set<String> shas = new HashSet<>(); int pages = 0; for (Collection<RepositoryCommit> page : commits) { assertNotNull(page); diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/GistTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/GistTest.java index 80594083..520a9a9a 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/GistTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/GistTest.java @@ -171,7 +171,7 @@ public class GistTest extends LiveTest { Collection<Gist> gists = pages.next(); assertNotNull(gists); assertTrue(gists.size() > 0); - Set<String> ids = new HashSet<String>(); + Set<String> ids = new HashSet<>(); for (Gist gist : gists) { assertNotNull(gist); assertNotNull(gist.getId()); diff --git a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/IssueTest.java b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/IssueTest.java index b55b0606..62a1ec96 100644 --- a/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/IssueTest.java +++ b/org.eclipse.egit.github.core.tests/src/org/eclipse/egit/github/core/tests/live/IssueTest.java @@ -145,7 +145,7 @@ public class IssueTest extends LiveTest { @Test public void testPaging() throws Exception { IssueService service = new IssueService(client); - Map<String, String> params = new HashMap<String, String>(); + Map<String, String> params = new HashMap<>(); params.put(IssueService.FILTER_STATE, IssueService.STATE_CLOSED); PageIterator<Issue> iterator = service.pageIssues("schacon", "showoff", params, 1); diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Issue.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Issue.java index 86cc00ba..2e11005c 100644 --- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Issue.java +++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/Issue.java @@ -157,7 +157,7 @@ public class Issue implements Serializable { * @return this issue */ public Issue setLabels(List<Label> labels) { - this.labels = labels != null ? new ArrayList<Label>(labels) : null; + this.labels = labels != null ? new ArrayList<>(labels) : null; return this; } diff --git a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GitHubService.java b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GitHubService.java index c86e31a8..90ff26fc 100644 --- a/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GitHubService.java +++ b/org.eclipse.egit.github.core/src/org/eclipse/egit/github/core/service/GitHubService.java @@ -146,7 +146,7 @@ public abstract class GitHubService { * @return request */ protected <V> PagedRequest<V> createPagedRequest(int start, int size) { - return new PagedRequest<V>(start, size); + return new PagedRequest<>(start, size); } /** @@ -157,7 +157,7 @@ public abstract class GitHubService { * @return iterator */ protected <V> PageIterator<V> createPageIterator(PagedRequest<V> request) { - return new PageIterator<V>(request, client); + return new PageIterator<>(request, client); } /** @@ -183,7 +183,7 @@ public abstract class GitHubService { * @throws IOException */ protected <V> List<V> getAll(PageIterator<V> iterator) throws IOException { - List<V> elements = new ArrayList<V>(); + List<V> elements = new ArrayList<>(); try { while (iterator.hasNext()) elements.addAll(iterator.next()); diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/QueryUtils.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/QueryUtils.java index d0984356..0a402656 100644 --- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/QueryUtils.java +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/QueryUtils.java @@ -68,7 +68,7 @@ public abstract class QueryUtils { if (attribute == null || attribute.length() == 0) return Collections.emptyList(); - List<String> attrs = new LinkedList<String>(); + List<String> attrs = new LinkedList<>(); String[] values = attribute.split(DELIMITER); for (String value : values) if (value.length() > 0) diff --git a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueTaskDataHandler.java b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueTaskDataHandler.java index 26b46587..bae1049c 100644 --- a/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueTaskDataHandler.java +++ b/org.eclipse.mylyn.github.core/src/org/eclipse/mylyn/internal/github/core/issue/IssueTaskDataHandler.java @@ -242,7 +242,7 @@ public class IssueTaskDataHandler extends GitHubTaskDataHandler { IssueAttribute attribute, List<Label> values) { TaskAttribute attr = createAttribute(data, attribute.getMetadata()); if (values != null) { - List<String> labels = new ArrayList<String>(values.size()); + List<String> labels = new ArrayList<>(values.size()); for (Label label : values) labels.add(label.getName()); data.getAttributeMapper().setValues(attr, labels); @@ -291,8 +291,8 @@ public class IssueTaskDataHandler extends GitHubTaskDataHandler { // Ignore } List<Label> currentLabels = connector.getLabels(repository); - List<Label> newLabels = new LinkedList<Label>(); - List<Label> labels = new LinkedList<Label>(); + List<Label> newLabels = new LinkedList<>(); + List<Label> labels = new LinkedList<>(); for (String value : labelsAttribute.getValues()) { Label label = new Label().setName(value); if (!currentLabels.contains(label)) diff --git a/org.eclipse.mylyn.github.tests/.settings/org.eclipse.jdt.ui.prefs b/org.eclipse.mylyn.github.tests/.settings/org.eclipse.jdt.ui.prefs index 7103be72..2971ea01 100644 --- a/org.eclipse.mylyn.github.tests/.settings/org.eclipse.jdt.ui.prefs +++ b/org.eclipse.mylyn.github.tests/.settings/org.eclipse.jdt.ui.prefs @@ -1,2 +1,3 @@ eclipse.preferences.version=1 org.eclipse.jdt.ui.text.custom_code_templates= +sp_cleanup.remove_redundant_type_arguments=true diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestContextSynchronizer.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestContextSynchronizer.java index 4729d617..2459de2c 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestContextSynchronizer.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestContextSynchronizer.java @@ -77,7 +77,7 @@ public class PullRequestContextSynchronizer extends TaskActivationAdapter { ObjectId.fromString(request.getHead().getSha())).getTree()); diffs.addTree(walk.parseCommit( ObjectId.fromString(request.getBase().getSha())).getTree()); - Set<IResource> resources = new HashSet<IResource>(); + Set<IResource> resources = new HashSet<>(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); String base = repository.getWorkTree().getAbsolutePath() + "/"; //$NON-NLS-1$ while (diffs.next()) { diff --git a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositoryQueryPage.java b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositoryQueryPage.java index 75e92ca9..9a0eb875 100644 --- a/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositoryQueryPage.java +++ b/org.eclipse.mylyn.github.ui/src/org/eclipse/mylyn/internal/github/ui/pr/PullRequestRepositoryQueryPage.java @@ -177,7 +177,7 @@ public class PullRequestRepositoryQueryPage extends GitHubRepositoryQueryPage { public void applyTo(IRepositoryQuery query) { query.setSummary(getQueryTitle()); - List<String> statuses = new LinkedList<String>(); + List<String> statuses = new LinkedList<>(); if (openButton.getSelection()) statuses.add(IssueService.STATE_OPEN); if (closedButton.getSelection()) |