Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrank Becker2013-01-30 13:09:14 -0500
committerGerrit Code Review @ Eclipse.org2013-04-24 15:01:49 -0400
commitd4790d2b871b85fc4bc19c2bffab7ff5b7598c3b (patch)
treed4f9f2ef529333b3ead7a9f6aba2b7c85ef06912
parent7627c6238dbfbc112cfd78c02c41979d3a70c699 (diff)
downloadorg.eclipse.mylyn.tasks-d4790d2b871b85fc4bc19c2bffab7ff5b7598c3b.tar.gz
org.eclipse.mylyn.tasks-d4790d2b871b85fc4bc19c2bffab7ff5b7598c3b.tar.xz
org.eclipse.mylyn.tasks-d4790d2b871b85fc4bc19c2bffab7ff5b7598c3b.zip
399302: reduce the number of warnings for all Tasks plugins
Change-Id: I1d847f36aa28feae51a8b71b048d6111fa155df5 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=399302
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java10
-rw-r--r--org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java8
-rw-r--r--org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java1
-rw-r--r--org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultSupportHandler.java2
-rw-r--r--org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/bugs/SupportHandlerManagerTest.java16
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracSslCertificateException.java2
-rw-r--r--org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java4
7 files changed, 20 insertions, 23 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
index ddd34110e..48023040f 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/CustomTransitionManager.java
@@ -102,10 +102,11 @@ public class CustomTransitionManager implements Serializable {
return isValid();
}
+ BufferedReader br = null;
try {
- BufferedReader br = new BufferedReader(new FileReader(file));
String s;
boolean checkOptions = true;
+ br = new BufferedReader(new FileReader(file));
while ((s = br.readLine()) != null && isValid()) {
if (s.equals("<transitions>")) { //$NON-NLS-1$
@@ -125,6 +126,13 @@ public class CustomTransitionManager implements Serializable {
setValid(false);
throw new CoreException(new Status(IStatus.ERROR, BugzillaCorePlugin.ID_PLUGIN, 1,
"Error parsing transition description file.\n\n" + e.getMessage(), e)); //$NON-NLS-1$
+ } finally {
+ if (br != null) {
+ try {
+ br.close();
+ } catch (IOException e) {
+ }
+ }
}
return valid;
diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
index d36957602..af2d235a7 100644
--- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
+++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/internal/bugzilla/core/service/BugzillaXmlRpcClient.java
@@ -129,8 +129,6 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
public static final String XML_RESPONSE_BUGS = "bugs"; //$NON-NLS-1$
- private static final String Date = null;
-
/*
* Fields
*
@@ -860,7 +858,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
attachmentMapper.setPatch(is_patch.equals("1")); //$NON-NLS-1$
attachmentMapper.applyTo(attachmentAttribute);
- addFlags(taskData, attachment.get("flags"), attachmentAttribute);
+ addFlags(taskData, attachment.get("flags"), attachmentAttribute); //$NON-NLS-1$
}
}
}
@@ -888,7 +886,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
idAttribute.setValue(commentID.toString());
if (useIsPrivate) {
TaskAttribute isprivateAttribute = description.createAttribute(IBugzillaConstants.BUGZILLA_DESCRIPTION_IS_PRIVATE);
- isprivateAttribute.setValue(is_private ? "1" : "0");
+ isprivateAttribute.setValue(is_private ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$
}
}
commentNum++;
@@ -1082,7 +1080,7 @@ public class BugzillaXmlRpcClient extends CommonXmlRpcClient {
}
for (TaskAttribute attachment : taskAttachments) {
BugzillaAttachmentMapper attachmentMapper = BugzillaAttachmentMapper.createFrom(attachment);
- attachmentMapper.setUrl(repURL.substring(0, repURL.indexOf("/xmlrpc.cgi"))
+ attachmentMapper.setUrl(repURL.substring(0, repURL.indexOf("/xmlrpc.cgi")) //$NON-NLS-1$
+ IBugzillaConstants.URL_GET_ATTACHMENT_SUFFIX + attachmentMapper.getAttachmentId());
attachmentMapper.applyTo(attachment);
}
diff --git a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java
index 6aa875769..a18edd166 100644
--- a/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java
+++ b/org.eclipse.mylyn.oslc.ui/src/org/eclipse/mylyn/internal/oslc/ui/OslcServiceLabelProvider.java
@@ -24,7 +24,6 @@ import org.eclipse.swt.graphics.Image;
/**
* @author Robert Elves
*/
-@SuppressWarnings("restriction")
public class OslcServiceLabelProvider extends LabelProvider {
@Override
diff --git a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultSupportHandler.java b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultSupportHandler.java
index 2d0373922..be5257a5c 100644
--- a/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultSupportHandler.java
+++ b/org.eclipse.mylyn.tasks.bugs/src/org/eclipse/mylyn/internal/tasks/bugs/DefaultSupportHandler.java
@@ -67,7 +67,7 @@ public class DefaultSupportHandler extends AbstractSupportHandler {
TaskData taskData = response.getTaskData();
if (contribution instanceof ProductStatus) {
if (response instanceof AttributeTaskMapper) {
- if (((AttributeTaskMapper) response).getAttribute("severity") == null) {
+ if (((AttributeTaskMapper) response).getAttribute("severity") == null) { //$NON-NLS-1$
AbstractRepositoryConnector connector = TasksUi.getRepositoryConnector(taskData.getConnectorKind());
ITaskMapping mapping = connector.getTaskMapping(taskData);
mapping.merge(new TaskMapping() {
diff --git a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/bugs/SupportHandlerManagerTest.java b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/bugs/SupportHandlerManagerTest.java
index 9e04ec38e..36a05a3dc 100644
--- a/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/bugs/SupportHandlerManagerTest.java
+++ b/org.eclipse.mylyn.tasks.tests/src/org/eclipse/mylyn/tasks/tests/bugs/SupportHandlerManagerTest.java
@@ -60,7 +60,7 @@ public class SupportHandlerManagerTest extends TestCase {
public void tearDown() throws Exception {
}
- public void testSupportHandlerManager() {
+ public void testSupportHandlerManager() throws CoreException {
SupportHandlerManager handlerManager = new SupportHandlerManager();
SupportProviderManager providerManager = new SupportProviderManager();
SupportProduct product = providerManager.getProduct("org.eclipse.mylyn.tasks.tests.productnormal");
@@ -74,11 +74,7 @@ public class SupportHandlerManagerTest extends TestCase {
AttributeTaskMapper mapper = ((AttributeTaskMapper) request.getDefaultContribution());
assertTrue(!mapper.isHandled());
TaskData taskData = null;
- try {
- taskData = mapper.createTaskData(monitor);
- } catch (CoreException e) {
- fail("unexpected CoreException " + e.getMessage());
- }
+ taskData = mapper.createTaskData(monitor);
assertNotNull(taskData);
mapper.setTaskData(taskData);
handlerManager.postProcess(mapper, monitor);
@@ -86,7 +82,7 @@ public class SupportHandlerManagerTest extends TestCase {
assertEquals("enhancement", serv.getValue());
}
- public void testSeverityDefinedInExtensionPoint() {
+ public void testSeverityDefinedInExtensionPoint() throws CoreException {
SupportHandlerManager handlerManager = new SupportHandlerManager();
SupportProviderManager providerManager = new SupportProviderManager();
SupportProduct product = providerManager.getProduct("org.eclipse.mylyn.tasks.tests.productseverity");
@@ -100,11 +96,7 @@ public class SupportHandlerManagerTest extends TestCase {
AttributeTaskMapper mapper = ((AttributeTaskMapper) request.getDefaultContribution());
assertTrue(!mapper.isHandled());
TaskData taskData = null;
- try {
- taskData = mapper.createTaskData(monitor);
- } catch (CoreException e) {
- fail("unexpected CoreException " + e.getMessage());
- }
+ taskData = mapper.createTaskData(monitor);
assertNotNull(taskData);
mapper.setTaskData(taskData);
handlerManager.postProcess(mapper, monitor);
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracSslCertificateException.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracSslCertificateException.java
index 519ee1adc..0e47ddabe 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracSslCertificateException.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracSslCertificateException.java
@@ -19,7 +19,7 @@ public class TracSslCertificateException extends TracException {
private static final long serialVersionUID = -693879319319751584L;
public TracSslCertificateException() {
- super("Opening of the certificate keystore failed");
+ super("Opening of the certificate keystore failed"); //$NON-NLS-1$
}
}
diff --git a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java
index 9660753cf..13c4be1fa 100644
--- a/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java
+++ b/org.eclipse.mylyn.trac.core/src/org/eclipse/mylyn/internal/trac/core/client/TracWebClient.java
@@ -399,7 +399,7 @@ public class TracWebClient extends AbstractTracClient {
ticket.putBuiltinValue(Key.REPORTER, getText(tokenizer));
}
// TODO handle custom fields
- } else if ((tag.getTagType() == Tag.H2 && ("summary".equals(tag.getAttribute("class")) || "summary searchable".equals(tag.getAttribute("class"))))
+ } else if ((tag.getTagType() == Tag.H2 && ("summary".equals(tag.getAttribute("class")) || "summary searchable".equals(tag.getAttribute("class")))) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
|| tag.getTagType() == Tag.SPAN && ("summary".equals(tag.getAttribute("class")))) { //$NON-NLS-1$ //$NON-NLS-2$
ticket.putBuiltinValue(Key.SUMMARY, getText(tokenizer));
} else if (tag.getTagType() == Tag.H3 && "status".equals(tag.getAttribute("class"))) { //$NON-NLS-1$ //$NON-NLS-2$
@@ -547,7 +547,7 @@ public class TracWebClient extends AbstractTracClient {
HtmlTag tag = (HtmlTag) token.getValue();
if (tag.getTagType() == Tag.SCRIPT) {
String text = getText(tokenizer).trim();
- int i = text.indexOf("var properties=");
+ int i = text.indexOf("var properties="); //$NON-NLS-1$
if (i != -1) {
if (!parseAttributesJSon(text.substring(i))) {
// fall back

Back to the top