diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-27 15:59:39 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-27 15:59:39 +0300 |
commit | cf1f89072dcd820248474a36cfc2f60e5f3f9a1b (patch) | |
tree | cbe0cde8462785ab04b46f62bb4a3d447f2c5c79 /theme-compiler/src | |
parent | ed2d516f04fd156814cc43c55d36f567e2611ba2 (diff) | |
download | vaadin-framework-cf1f89072dcd820248474a36cfc2f60e5f3f9a1b.tar.gz vaadin-framework-cf1f89072dcd820248474a36cfc2f60e5f3f9a1b.zip |
Global code cleanup
Diffstat (limited to 'theme-compiler/src')
7 files changed, 19 insertions, 26 deletions
diff --git a/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java b/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java index 3378903c4d..c10d29aad9 100644 --- a/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java +++ b/theme-compiler/src/com/vaadin/sass/handler/SCSSDocumentHandlerImpl.java @@ -197,6 +197,7 @@ public class SCSSDocumentHandlerImpl implements SCSSDocumentHandler { property(name, (LexicalUnitImpl) value, important, null); } + @Override public void property(String name, LexicalUnitImpl value, boolean important, String comment) { RuleNode node = new RuleNode(name, value, important, comment); diff --git a/theme-compiler/src/com/vaadin/sass/tree/ListRemoveNode.java b/theme-compiler/src/com/vaadin/sass/tree/ListRemoveNode.java index 9c6400ec02..114e095a9c 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/ListRemoveNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/ListRemoveNode.java @@ -42,7 +42,7 @@ public class ListRemoveNode extends Node implements ListModifyNode, VariableNode clone = (VariableNode) DeepCopy.copy(variableNode); LexicalUnitImpl first = null; - LexicalUnitImpl current = (LexicalUnitImpl) clone.getExpr(); + LexicalUnitImpl current = clone.getExpr(); LexicalUnitImpl lastAccepted = null; while (current != null) { @@ -60,7 +60,7 @@ public class ListRemoveNode extends Node implements ListModifyNode, first = lastAccepted; } } - current = (LexicalUnitImpl) current.getNextLexicalUnit(); + current = current.getNextLexicalUnit(); } clone.setExpr(first); diff --git a/theme-compiler/src/com/vaadin/sass/tree/VariableNode.java b/theme-compiler/src/com/vaadin/sass/tree/VariableNode.java index ffe6b77896..6f97fd6f2c 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/VariableNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/VariableNode.java @@ -77,7 +77,7 @@ public class VariableNode extends Node implements IVariableNode { @Override public void replaceVariables(ArrayList<VariableNode> variables) { for (final VariableNode node : variables) { - if (!this.equals(node)) { + if (!equals(node)) { if (name.equals(node.getName())) { expr = (LexicalUnitImpl) DeepCopy.copy(node.getExpr()); diff --git a/theme-compiler/src/com/vaadin/sass/tree/controldirective/EachDefNode.java b/theme-compiler/src/com/vaadin/sass/tree/controldirective/EachDefNode.java index f75d5ed7b5..cb209273cb 100644 --- a/theme-compiler/src/com/vaadin/sass/tree/controldirective/EachDefNode.java +++ b/theme-compiler/src/com/vaadin/sass/tree/controldirective/EachDefNode.java @@ -67,7 +67,7 @@ public class EachDefNode extends Node implements IVariableNode { for (final VariableNode var : variables) { if (listVariable.equals(var.getName())) { - LexicalUnitImpl current = (LexicalUnitImpl) var.getExpr(); + LexicalUnitImpl current = var.getExpr(); list = new ArrayList<String>(); while (current != null) { @@ -75,8 +75,7 @@ public class EachDefNode extends Node implements IVariableNode { && current.getLexicalUnitType() != LexicalUnitImpl.SAC_OPERATOR_COMMA) { list.add(current.getValue().toString()); } - current = (LexicalUnitImpl) current - .getNextLexicalUnit(); + current = current.getNextLexicalUnit(); } listVariable = null; break; diff --git a/theme-compiler/src/com/vaadin/sass/util/ColorUtil.java b/theme-compiler/src/com/vaadin/sass/util/ColorUtil.java index 25e29ff9a2..7377b202ab 100644 --- a/theme-compiler/src/com/vaadin/sass/util/ColorUtil.java +++ b/theme-compiler/src/com/vaadin/sass/util/ColorUtil.java @@ -40,12 +40,11 @@ public class ColorUtil { LexicalUnitImpl hslParams = createHslParameters(hsl[0], hsl[1], hsl[2], hexColor.getLineNumber(), hexColor.getColumnNumber(), - (LexicalUnitImpl) hexColor.getPreviousLexicalUnit()); + hexColor.getPreviousLexicalUnit()); return LexicalUnitImpl.createFunction(hexColor.getLineNumber(), - hexColor.getColumnNumber(), - (LexicalUnitImpl) hexColor.getPreviousLexicalUnit(), "hsl", - hslParams); + hexColor.getColumnNumber(), hexColor.getPreviousLexicalUnit(), + "hsl", hslParams); } public static LexicalUnitImpl hslToHexColor(LexicalUnitImpl hsl, int lengh) { @@ -64,8 +63,7 @@ public class ColorUtil { builder.append(color); } return LexicalUnitImpl.createIdent(hsl.getLineNumber(), - hsl.getColumnNumber(), - (LexicalUnitImpl) hsl.getPreviousLexicalUnit(), + hsl.getColumnNumber(), hsl.getPreviousLexicalUnit(), builder.toString()); } @@ -90,7 +88,7 @@ public class ColorUtil { case 3: break; } - hslParam = (LexicalUnitImpl) hslParam.getNextLexicalUnit(); + hslParam = hslParam.getNextLexicalUnit(); i++; } float h = ((hue.getIntegerValue() % 360) + 360) % 360 / 360f; @@ -127,7 +125,7 @@ public class ColorUtil { case 3: break; } - rgbParam = (LexicalUnitImpl) rgbParam.getNextLexicalUnit(); + rgbParam = rgbParam.getNextLexicalUnit(); i++; } @@ -138,11 +136,10 @@ public class ColorUtil { LexicalUnitImpl hslParams = createHslParameters(hsl[0], hsl[1], hsl[2], rgbParam.getLineNumber(), rgbParam.getColumnNumber(), - (LexicalUnitImpl) rgbParam.getPreviousLexicalUnit()); + rgbParam.getPreviousLexicalUnit()); return LexicalUnitImpl.createFunction(rgb.getLineNumber(), - rgb.getColumnNumber(), - (LexicalUnitImpl) rgb.getPreviousLexicalUnit(), "hsl", + rgb.getColumnNumber(), rgb.getPreviousLexicalUnit(), "hsl", hslParams); } @@ -192,11 +189,10 @@ public class ColorUtil { LexicalUnitImpl hslParam = hsl.getParameters(); LexicalUnitImpl rgbParams = createRgbParameters(rgb[0], rgb[1], rgb[2], hslParam.getLineNumber(), hslParam.getColumnNumber(), - (LexicalUnitImpl) hslParam.getPreviousLexicalUnit()); + hslParam.getPreviousLexicalUnit()); return LexicalUnitImpl.createFunction(hsl.getLineNumber(), - hsl.getColumnNumber(), - (LexicalUnitImpl) hsl.getPreviousLexicalUnit(), "rgb", + hsl.getColumnNumber(), hsl.getPreviousLexicalUnit(), "rgb", rgbParams); } @@ -246,8 +242,7 @@ public class ColorUtil { public static LexicalUnitImpl darken(LexicalUnitImpl darkenFunc) { LexicalUnitImpl color = darkenFunc.getParameters(); float amount = getAmountValue(color); - LexicalUnitImpl pre = (LexicalUnitImpl) darkenFunc - .getPreviousLexicalUnit(); + LexicalUnitImpl pre = darkenFunc.getPreviousLexicalUnit(); return adjust(color, amount, ColorOperation.Darken, pre); } @@ -293,8 +288,7 @@ public class ColorUtil { public static LexicalUnitImpl lighten(LexicalUnitImpl lightenFunc) { LexicalUnitImpl color = lightenFunc.getParameters(); float amount = getAmountValue(color); - LexicalUnitImpl pre = (LexicalUnitImpl) lightenFunc - .getPreviousLexicalUnit(); + LexicalUnitImpl pre = lightenFunc.getPreviousLexicalUnit(); return adjust(color, amount, ColorOperation.Lighten, pre); } diff --git a/theme-compiler/src/com/vaadin/sass/visitor/EachVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/EachVisitor.java index cc7e4e5930..e2da712b6a 100644 --- a/theme-compiler/src/com/vaadin/sass/visitor/EachVisitor.java +++ b/theme-compiler/src/com/vaadin/sass/visitor/EachVisitor.java @@ -15,7 +15,7 @@ public class EachVisitor implements Visitor { @Override public void traverse(Node node) throws Exception { - this.rootNode = node; + rootNode = node; for (Node child : node.getChildren()) { if (child instanceof EachDefNode) { controlDefs.add((EachDefNode) child); diff --git a/theme-compiler/src/com/vaadin/sass/visitor/VariableVisitor.java b/theme-compiler/src/com/vaadin/sass/visitor/VariableVisitor.java index 50143180d2..d20914b32d 100644 --- a/theme-compiler/src/com/vaadin/sass/visitor/VariableVisitor.java +++ b/theme-compiler/src/com/vaadin/sass/visitor/VariableVisitor.java @@ -24,7 +24,6 @@ import com.vaadin.sass.tree.IVariableNode; import com.vaadin.sass.tree.ListModifyNode; import com.vaadin.sass.tree.Node; import com.vaadin.sass.tree.VariableNode; -import com.vaadin.sass.util.DeepCopy; public class VariableVisitor implements Visitor { |