diff options
author | Alexander Kurtakov | 2016-08-23 15:30:37 +0000 |
---|---|---|
committer | Alexander Kurtakov | 2016-08-23 15:30:37 +0000 |
commit | 5fab68ea7d7b1beafdc4b492495d8a596acb22df (patch) | |
tree | 1a35c4f5ea039dadc5aa29116ff6b87208e6cd3c /org.eclipse.help/src/org/eclipse/help/internal/dynamic/ValidationHandler.java | |
parent | 13c830c52c10111f4e49972e9468bcb3e19b9860 (diff) | |
download | eclipse.platform.ua-5fab68ea7d7b1beafdc4b492495d8a596acb22df.tar.gz eclipse.platform.ua-5fab68ea7d7b1beafdc4b492495d8a596acb22df.tar.xz eclipse.platform.ua-5fab68ea7d7b1beafdc4b492495d8a596acb22df.zip |
Bug 500144 - More compiler warnings by default in o.e.help Y20160825-1000I20160824-1429I20160823-1359
Enabld the following warnings and fix them:
* empty statement
* indirect static access
* try-with-resources not used
* raw types usage
* few others for which the codebase was already clean
Change-Id: I24e50a01af56f098bc2228b62eec0ac98a98d48d
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
Diffstat (limited to 'org.eclipse.help/src/org/eclipse/help/internal/dynamic/ValidationHandler.java')
-rw-r--r-- | org.eclipse.help/src/org/eclipse/help/internal/dynamic/ValidationHandler.java | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/org.eclipse.help/src/org/eclipse/help/internal/dynamic/ValidationHandler.java b/org.eclipse.help/src/org/eclipse/help/internal/dynamic/ValidationHandler.java index cc67509f8..4a4739fb6 100644 --- a/org.eclipse.help/src/org/eclipse/help/internal/dynamic/ValidationHandler.java +++ b/org.eclipse.help/src/org/eclipse/help/internal/dynamic/ValidationHandler.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2015 IBM Corporation and others. + * Copyright (c) 2006, 2016 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -22,14 +22,14 @@ import org.eclipse.help.internal.UAElement; */ public class ValidationHandler extends ProcessorHandler { - private Map requiredAttributes; - private Map deprecatedElements; + private Map<String, String[]> requiredAttributes; + private Map<String, String> deprecatedElements; /* * Creates a new validator that looks for the given mapping of * element names to required attribute names. */ - public ValidationHandler(Map requiredAttributes) { + public ValidationHandler(Map<String, String[]> requiredAttributes) { this(requiredAttributes, null); } @@ -38,7 +38,7 @@ public class ValidationHandler extends ProcessorHandler { * element names to required attribute names, as well as a mapping * of deprecated element names to suggested new element names. */ - public ValidationHandler(Map requiredAttributes, Map deprecatedElements) { + public ValidationHandler(Map<String, String[]> requiredAttributes, Map<String, String> deprecatedElements) { this.requiredAttributes = requiredAttributes; this.deprecatedElements = deprecatedElements; } @@ -46,13 +46,13 @@ public class ValidationHandler extends ProcessorHandler { @Override public short handle(UAElement element, String id) { if (deprecatedElements != null) { - String suggestion = (String)deprecatedElements.get(element.getElementName()); + String suggestion = deprecatedElements.get(element.getElementName()); if (suggestion != null) { String msg = "The \"" + element.getElementName() + "\" element is deprecated in \"" + id + "\"; use \"" + suggestion + "\" instead."; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ HelpPlugin.logWarning(msg); } } - String[] attributes = (String[])requiredAttributes.get(element.getElementName()); + String[] attributes = requiredAttributes.get(element.getElementName()); if (attributes != null) { for (int i=0;i<attributes.length;++i) { if (element.getAttribute(attributes[i]) == null) { |