diff options
author | Tomasz Zarna | 2017-06-20 07:22:33 +0000 |
---|---|---|
committer | Tomasz Zarna | 2017-06-20 20:36:57 +0000 |
commit | 048146c2d1a7cd74aa62d0aa22fe237792d20980 (patch) | |
tree | cace15c17d2c4fe5f88770fb804585e0a612868f | |
parent | 1e8a786ff25a28f060f9188d933df0b80ad0bfba (diff) | |
download | org.eclipse.mylyn.reviews-048146c2d1a7cd74aa62d0aa22fe237792d20980.tar.gz org.eclipse.mylyn.reviews-048146c2d1a7cd74aa62d0aa22fe237792d20980.tar.xz org.eclipse.mylyn.reviews-048146c2d1a7cd74aa62d0aa22fe237792d20980.zip |
remove unnecessary code from various o.e.mylyn.reviews project
Change-Id: I32407323f2250dc048867a4469f51a3db2bd8ab1
11 files changed, 39 insertions, 58 deletions
diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java index dbf09f111..b35ad1c20 100644 --- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java +++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/GerritConnector.java @@ -312,7 +312,6 @@ public class GerritConnector extends ReviewsConnector { } } - @SuppressWarnings("restriction") @Override public void updateTaskFromTaskData(TaskRepository taskRepository, ITask task, TaskData taskData) { Date oldModificationDate = task.getModificationDate(); diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java index 97e753076..5169108f5 100644 --- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java +++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritClient.java @@ -611,8 +611,7 @@ public abstract class GerritClient extends ReviewsClient { //Try to remove the reviewer from the change try { //Currently using a string to return as the only response from the gerrit api will be an http status - String result = restClient.executeDeleteRestRequest(uri, new ReviewerInput(reviewerId), String.class, null, - monitor); + restClient.executeDeleteRestRequest(uri, new ReviewerInput(reviewerId), String.class, null, monitor); } catch (GerritHttpException e) { if (e.getResponseCode() == HttpStatus.SC_NOT_FOUND) { reviewerResult.addError(new ReviewerResult.Error(null, reviewerId)); diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java index 436e10e72..acb2b7d40 100644 --- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java +++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/GerritHttpClient.java @@ -55,7 +55,7 @@ import com.google.gson.reflect.TypeToken; /** * Abstract class that handles the http communications with the Gerrit server. - * + * * @author Daniel Olsson, ST Ericsson * @author Thomas Westling * @author Steffen Pingel @@ -136,7 +136,6 @@ public class GerritHttpClient { this.errorHandler = handler; } - @SuppressWarnings("null") @Override public HttpMethodBase createMethod() throws IOException { HttpMethodBase method = null; @@ -257,7 +256,7 @@ public class GerritHttpClient { /** * Send a JSON request to the Gerrit server. - * + * * @return The JSON response * @throws GerritException */ @@ -276,8 +275,8 @@ public class GerritHttpClient { return restRequest(HttpMethod.POST, serviceUri, input, resultType, handler, monitor); } - public <T> T getRestRequest(final String serviceUri, Type resultType, IProgressMonitor monitor) throws IOException, - GerritException { + public <T> T getRestRequest(final String serviceUri, Type resultType, IProgressMonitor monitor) + throws IOException, GerritException { return restRequest(HttpMethod.GET, serviceUri, null, resultType, null, monitor); } @@ -295,8 +294,8 @@ public class GerritHttpClient { return restRequest(HttpMethod.DELETE, serviceUri, input, resultType, handler, monitor); } - private <T> T restRequest(final HttpMethod httpMethod, final String serviceUri, final Object input, - Type resultType, ErrorHandler handler, IProgressMonitor monitor) throws IOException, GerritException { + private <T> T restRequest(final HttpMethod httpMethod, final String serviceUri, final Object input, Type resultType, + ErrorHandler handler, IProgressMonitor monitor) throws IOException, GerritException { Assert.isNotNull(httpMethod, "HTTP Method must be not null."); //$NON-NLS-1$ Assert.isNotNull(serviceUri, "REST Service URI must be not null."); //$NON-NLS-1$ Assert.isNotNull(resultType, "Output type must be not null."); //$NON-NLS-1$ @@ -476,8 +475,8 @@ public class GerritHttpClient { return null; } - private int authenticateOpenIdService(String openIdProvider, IProgressMonitor monitor) throws IOException, - GerritException { + private int authenticateOpenIdService(String openIdProvider, IProgressMonitor monitor) + throws IOException, GerritException { JSonSupport json = new JSonSupport(); List<Object> args = new ArrayList<Object>(2); @@ -641,8 +640,8 @@ public class GerritHttpClient { return HttpStatus.SC_NOT_FOUND; } - int authenticateForm(AuthenticationCredentials credentials, IProgressMonitor monitor) throws IOException, - GerritException { + int authenticateForm(AuthenticationCredentials credentials, IProgressMonitor monitor) + throws IOException, GerritException { // try standard basic/digest/ntlm authentication first String repositoryUrl = getUrl(); AuthScope authScope = new AuthScope(WebUtil.getHost(repositoryUrl), WebUtil.getPort(repositoryUrl), null, diff --git a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/data/GerritPerson.java b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/data/GerritPerson.java index 562004986..bfe11050d 100644 --- a/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/data/GerritPerson.java +++ b/org.eclipse.mylyn.gerrit.core/src/org/eclipse/mylyn/internal/gerrit/core/client/data/GerritPerson.java @@ -18,8 +18,6 @@ public class GerritPerson { private String name; - private String _account_id; - public String getName() { return name; } diff --git a/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java b/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java index 5fcdddca2..3659ab305 100644 --- a/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java +++ b/org.eclipse.mylyn.gerrit.ui/src/org/eclipse/mylyn/internal/gerrit/ui/GerritReviewBehavior.java @@ -97,17 +97,14 @@ public class GerritReviewBehavior extends ReviewBehavior { @Override public IStatus discardComment(IReviewItem item, IComment comment, IProgressMonitor monitor) { - short side = RIGHT_SIDE; String id = item.getId(); if (id.startsWith(BASE)) { // base revision id = id.substring(BASE.length()); - side = LEFT_SIDE; } Patch.Key key = Patch.Key.parse(id); for (ILocation location : comment.getLocations()) { if (location instanceof ILineLocation) { - ILineLocation lineLocation = (ILineLocation) location; DiscardDraftRequest request = new DiscardDraftRequest(key, comment.getId()); request.setMessage(comment.getDescription()); diff --git a/org.eclipse.mylyn.reviews.ui.tests/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialogTest.java b/org.eclipse.mylyn.reviews.ui.tests/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialogTest.java index 09d82e58b..2fe57135b 100644 --- a/org.eclipse.mylyn.reviews.ui.tests/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialogTest.java +++ b/org.eclipse.mylyn.reviews.ui.tests/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentPopupDialogTest.java @@ -26,8 +26,6 @@ import java.util.Arrays; import java.util.Date; import java.util.List; -import junit.framework.TestCase; - import org.apache.commons.lang.StringUtils; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.Platform; @@ -66,9 +64,9 @@ import org.mockito.ArgumentMatcher; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -public class CommentPopupDialogTest extends TestCase { +import junit.framework.TestCase; - private static final int MAX_WIDTH = 500; +public class CommentPopupDialogTest extends TestCase { private final static String USER_ID = "1"; @@ -265,7 +263,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Tests that the comment popup displays comments with accurate information - * + * * @throws Exception */ @Test @@ -281,7 +279,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Tests that the comment editor UI displays accurate information for comment threads with drafts - * + * * @throws Exception */ @Test @@ -296,7 +294,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Tests that the comment editor UI displays accurate information for comment threads with no drafts - * + * * @throws Exception */ @Test @@ -308,7 +306,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Tests submitting a new draft using the save button - * + * * @throws Exception */ @Test @@ -321,7 +319,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Tests submitting a draft edit using the save button - * + * * @throws Exception */ @Test @@ -334,7 +332,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Tests submitting a new draft with the discard/done button - * + * * @throws Exception */ @Test @@ -347,7 +345,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Tests discarding a draft with the discard/done button - * + * * @throws Exception */ @Test @@ -359,7 +357,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Tests cancel the comment editor with the cancel button - * + * * @throws Exception */ @Test @@ -476,7 +474,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Returns a comment from the dialog depending on the ordering from the top of the comment list - * + * * @param commentNumber * the number of comments from the top of the comment list (counting starts at 1) * @return a comment from the UI @@ -490,7 +488,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Creates a comment dialog with one comment (a submitted comment) - * + * * @return the text of that submitted comment */ private Text editOneComment() { @@ -516,7 +514,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Adds a {@link CommentPopupDialog} - * + * * @param x * the number of comments that will be added to the dialog * @param isCommentNavigator @@ -539,7 +537,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Adds comments to a comment dialog (note that every even numbered comment is a draft) - * + * * @param x * the number of comments that will be created * @return the created list of {@link CommentAnnotation} @@ -548,15 +546,15 @@ public class CommentPopupDialogTest extends TestCase { List<CommentAnnotation> annotations = new ArrayList<CommentAnnotation>(); for (int i = 1; i <= x; i++) { boolean isDraft = i % 2 == 0; - annotations.add(createAnnotation(createComment("Test Comment " + i, new Date(i), Integer.toString(i), - isDraft))); + annotations.add( + createAnnotation(createComment("Test Comment " + i, new Date(i), Integer.toString(i), isDraft))); } return annotations; } /** * Creates a {@link CommentAnnotation} for a provided comment - * + * * @param comment * the provided comment * @return the created {@link CommentAnnotation} @@ -567,7 +565,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Creates a {@link IComment} with the provided parameters - * + * * @param text * the text content of the comment * @param date @@ -592,7 +590,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Creates a {@link ILocation} for the comment dialog - * + * * @return the created {@link ILocation} */ private ILocation createLocation() { @@ -603,7 +601,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Creates a {@link IUser} for the comment dialog - * + * * @return the created {@link IUser} */ private IUser createUser() { @@ -616,7 +614,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Ensures that the {@link Control} has only 1 {@link Listener} - * + * * @param c * the {@link Control} that is checked */ @@ -638,7 +636,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Asserts the UI for the provided {@link Section} - * + * * @param s * the {@link Section} that will be checked * @param commentContent @@ -692,7 +690,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Traverses the {@link Control} to find mouse listeners - * + * * @param c * the {@link Control} that will be traversed * @return the number of listeners for the provided {@link Control} and its children @@ -713,7 +711,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Asserts that the UI elements are properly created - * + * * @param isDraft * true if the comment is a draft edit, false if the comment is a new draft */ @@ -741,7 +739,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Asserts a save/discard action and determines if comments are correctly formated to be sent - * + * * @param button * the button that will be pressed to invoke the action * @param description @@ -779,7 +777,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Simulates a button press - * + * * @param b * the button that is being pressed */ @@ -790,7 +788,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Ensures that only one comment editor will be editable for the same item and line - * + * * @param isCommentNavigator * true if the tested comment is from the next/previous comment button, false if it is from a hover input */ @@ -811,7 +809,7 @@ public class CommentPopupDialogTest extends TestCase { /** * Adds a comment editor to the popup (note that if the comment provided is not a draft, you will be editing the * last draft in that comment thread) - * + * * @param popup * the comment dialog popup that will be edited * @param comment diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentAnnotationHover.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentAnnotationHover.java index 799f39c43..80b3613ed 100644 --- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentAnnotationHover.java +++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/annotations/CommentAnnotationHover.java @@ -227,7 +227,6 @@ public class CommentAnnotationHover implements IAnnotationHover, IAnnotationHove return (annotation != null && !annotations.contains(annotation)); } - @SuppressWarnings("unchecked") private List<CommentAnnotation> getAnnotationsForLine(ISourceViewer viewer, int line) { IAnnotationModel model = getAnnotationModel(viewer); if (model == null) { diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareAnnotationSupport.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareAnnotationSupport.java index 5d2eb276a..ed87f467e 100644 --- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareAnnotationSupport.java +++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/compare/ReviewCompareAnnotationSupport.java @@ -382,7 +382,6 @@ public class ReviewCompareAnnotationSupport { widget.setRedraw(true); } - @SuppressWarnings("unchecked") private List<CommentAnnotation> getAnnotationsForLine(SourceViewer viewer, int offset) { IAnnotationModel model = viewer.getAnnotationModel(); if (model == null) { diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java index ff1847e45..d30567be2 100644 --- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java +++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/parts/TaskEditorReviewsPart.java @@ -59,7 +59,6 @@ public class TaskEditorReviewsPart extends AbstractTaskEditorPart { this.labelProvider = labelProvider; } - @SuppressWarnings("unchecked") @Override public int compare(TableViewer viewer, Object e1, Object e2, int columnIndex) { int cat1 = category(e1); diff --git a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/ruler/CommentAnnotationRulerHover.java b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/ruler/CommentAnnotationRulerHover.java index 1b006d3aa..9ede32659 100644 --- a/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/ruler/CommentAnnotationRulerHover.java +++ b/org.eclipse.mylyn.reviews.ui/src/org/eclipse/mylyn/internal/reviews/ui/editors/ruler/CommentAnnotationRulerHover.java @@ -201,7 +201,6 @@ public class CommentAnnotationRulerHover return (annotation != null && !annotations.contains(annotation)); } - @SuppressWarnings("unchecked") private List<CommentAnnotation> getCommentAnnotationsForLine(ISourceViewer viewer, int line) { IAnnotationModel model = getAnnotationModel(viewer); if (model == null) { diff --git a/tbr/org.eclipse.mylyn.versions.context.ui/src/org/eclipse/mylyn/versions/tasks/context/ImportAsContextAction.java b/tbr/org.eclipse.mylyn.versions.context.ui/src/org/eclipse/mylyn/versions/tasks/context/ImportAsContextAction.java index 68ea94c6c..6ee0f5781 100644 --- a/tbr/org.eclipse.mylyn.versions.context.ui/src/org/eclipse/mylyn/versions/tasks/context/ImportAsContextAction.java +++ b/tbr/org.eclipse.mylyn.versions.context.ui/src/org/eclipse/mylyn/versions/tasks/context/ImportAsContextAction.java @@ -54,11 +54,6 @@ public class ImportAsContextAction extends Action implements || c.getChangeType() == ChangeType.REPLACED; } - private String formatSourceHandleString(Change c) { - return c.getTarget().getProjectName() - + c.getTarget().getProjectRelativePath(); - } - public void runWithEvent(Event event) { run(); } |