Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMickael Istria2013-10-08 09:34:22 +0000
committerMickael Istria2013-10-08 12:48:19 +0000
commit8de3155d663912d58c7b1b72a02807af3e359096 (patch)
tree952f917d3c59d34d8807be8975dd73b46d8aa970
parent2b27206f669049c2bc430a71a09b4e6578c80176 (diff)
downloadeclipse.platform.ui-8de3155d663912d58c7b1b72a02807af3e359096.tar.gz
eclipse.platform.ui-8de3155d663912d58c7b1b72a02807af3e359096.tar.xz
eclipse.platform.ui-8de3155d663912d58c7b1b72a02807af3e359096.zip
Fixes suggested by FindBugs:
* StringBuilder instead of String "+" (performances) * Removed useless instanceof Signed-off-by: Mickael Istria <mistria@redhat.com> Change-Id: I1684e140863b08abf5432f617ada9b6f996334a9
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java15
-rw-r--r--bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java9
2 files changed, 12 insertions, 12 deletions
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java
index 0f439228db1..42ff07a0a02 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/dom/properties/providers/CSSPropertyHandlerLazyProviderImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Angelo Zerr and others.
+ * Copyright (c) 2008, 2013 Angelo Zerr 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
@@ -8,6 +8,7 @@
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
* IBM Corporation - ongoing development
+ * Red Hat Inc. (mistria) - Fixes suggested by FindBugs
*******************************************************************************/
package org.eclipse.e4.ui.css.core.dom.properties.providers;
@@ -131,15 +132,15 @@ public class CSSPropertyHandlerLazyProviderImpl extends
* @return
*/
protected String getHandlerClassName(String property) {
- String handlerClassName = "CSSProperty";
- String[] s = StringUtils.split(property, "-");
+ StringBuilder handlerClassName = new StringBuilder("CSSProperty"); //$NON-NLS-1$
+ String[] s = StringUtils.split(property, "-"); //$NON-NLS-1$
for (int i = 0; i < s.length; i++) {
String p = s[i];
- p = p.substring(0, 1).toUpperCase() + p.substring(1, p.length());
- handlerClassName += p;
+ handlerClassName.append(p.substring(0, 1).toUpperCase());
+ handlerClassName.append(p.substring(1));
}
- handlerClassName += "Handler";
- return handlerClassName;
+ handlerClassName.append("Handler"); //$NON-NLS-1$
+ return handlerClassName.toString();
}
/*
diff --git a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java
index 2c130e3918b..d5670e46fa2 100644
--- a/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java
+++ b/bundles/org.eclipse.e4.ui.css.core/src/org/eclipse/e4/ui/css/core/impl/engine/AbstractCSSEngine.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2008, 2012 Angelo Zerr and others.
+ * Copyright (c) 2008, 2013 Angelo Zerr 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
@@ -8,6 +8,7 @@
* Contributors:
* Angelo Zerr <angelo.zerr@gmail.com> - initial API and implementation
* IBM Corporation - ongoing development
+ * Red Hat Inc. (mistria) - Fixes suggested by FindBugs
*******************************************************************************/
package org.eclipse.e4.ui.css.core.impl.engine;
@@ -222,10 +223,8 @@ public abstract class AbstractCSSEngine implements CSSEngine {
//final stylesheet
CSSStyleSheetImpl s = new CSSStyleSheetImpl();
s.setRuleList(masterList);
- if (documentCSS instanceof ExtendedDocumentCSS) {
- if (!parseImport) {
- documentCSS.addStyleSheet(s);
- }
+ if (!parseImport) {
+ documentCSS.addStyleSheet(s);
}
return s;
}

Back to the top