Hi,

One year after ... 

My company signed the contribution agreement and I would like to contribute 
this work.

I have not worked with geoserver\geotools since (+/-) my last post in this 
mailing list 
and I probably missed some important changes ...

I did a new patch (attached) for the current trunk of geotools.

Basically, I change the Opengis Stroke API:

-    float[] getDashArray();
+    Expression getDashArray();

and I made all the necessary changes.

There is already an issue (not mine) related to this: 
https://osgeo-org.atlassian.net/browse/GEOT-3776

Should I make a pull request ?

Best regards,

Nuno Oliveira


Le dimanche 10 novembre 2013 à 20:32 +0000, Jody Garnett a écrit :
> I separated it out its a procedure page as the steps to sign were
> being lost in the details:
> - 
> http://docs.geotools.org/latest/developer/procedures/contribution_license.html
> 
> 
> I also echo Andrea's words that we need to be sure you are comfortable
> donating your code to the OSGeo Foundation before we can use it.
> -- 
> Jody Garnett
> 
> 
> > Nuno, mind one important detail: if you don't sign the contributor
> > agreement we will never
> > be able to use your code, whoever decides in the future to work on
> > this task will have
> > to start from scratch.
> > 
> > 
> > If instead you don't do the proposal, but at least fill the
> > contribution agreement part, 
> > someone later can pick up the code and complete the work
> > 
> > 
> > Cheers
> > Andrea
> >  
> > --
> > ==
> > Our support, Your Success! Visit http://opensdi.geo-solutions.it for
> > more information.
> > ==
> > 
> > 
> > Ing. Andrea Aime 
> > 
> > @geowolf
> > Technical Lead
> > 
> > 
> > GeoSolutions S.A.S.
> > Via Poggio alle Viti 1187
> > 55054  Massarosa (LU)
> > Italy
> > phone: +39 0584 962313
> > fax: +39 0584 1660272
> > mob: +39  339 8844549
> > 
> > 
> > http://www.geo-solutions.it
> > http://twitter.com/geosolutions_it
> > 
> > 
> > -------------------------------------------------------
> > ------------------------------------------------------------------------------
> >  
> > November Webinars for C, C++, Fortran Developers 
> > Accelerate application performance with scalable programming models.
> > Explore 
> > techniques for threading, error checking, porting, and tuning. Get
> > the most 
> > from the latest Intel processors and coprocessors. See abstracts and
> > register 
> > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk_______________________________________________
> >  
> > GeoTools-Devel mailing list 
> > GeoTools-Devel@lists.sourceforge.net 
> > https://lists.sourceforge.net/lists/listinfo/geotools-devel 
> > 

>From 40938eb25ef0cb18b84aa550782ada2e84cbfaa7 Mon Sep 17 00:00:00 2001
From: nuno-miguel-oliveira <nuno-miguel-olive...@telecom.pt>
Date: Wed, 24 Jun 2015 18:03:14 +0100
Subject: [PATCH] Add support to dash-array expressions.

---
 .../geotools/styling/builder/StrokeBuilder.java    | 10 +++-
 .../geotools/styling/builder/CookbookLineTest.java |  8 +--
 .../geotools/sld/bindings/SLDStrokeBinding.java    | 13 +----
 .../sld/bindings/SLDStrokeBindingTest.java         |  7 ++-
 .../src/main/java/org/geotools/styling/Stroke.java | 15 +++---
 .../java/org/geotools/styling/StyleFactory.java    |  8 +--
 .../org/geotools/styling/AbstractStyleFactory.java |  2 +-
 .../src/main/java/org/geotools/styling/SLD.java    | 10 ++--
 .../main/java/org/geotools/styling/SLDParser.java  | 24 +--------
 .../java/org/geotools/styling/SLDTransformer.java  | 17 ++----
 .../main/java/org/geotools/styling/StrokeImpl.java | 61 ++++------------------
 .../java/org/geotools/styling/StyleBuilder.java    |  2 +-
 .../org/geotools/styling/StyleFactoryImpl.java     | 12 +++--
 .../org/geotools/styling/StyleFactoryImpl2.java    |  6 +--
 .../styling/visitor/DpiRescaleStyleVisitor.java    | 28 +++++-----
 .../styling/visitor/RescaleStyleVisitor.java       | 35 +++++++------
 .../styling/visitor/UomRescaleStyleVisitor.java    | 39 +++++++-------
 .../services/org.geotools.util.ConverterFactory    |  1 +
 .../java/org/geotools/styling/SLDStyleTest.java    |  2 +-
 .../org/geotools/styling/StyleFactoryImplTest.java |  6 ++-
 .../java/org/geotools/styling/StyleObjectTest.java |  2 +-
 .../visitor/DpiRescaleStyleVisitorTest.java        | 23 ++++----
 .../visitor/DuplicatorStyleVisitorTest.java        |  3 +-
 .../styling/visitor/RescaleStyleVisitorTest.java   |  5 +-
 .../src/main/java/org/opengis/style/Stroke.java    |  2 +-
 .../main/java/org/opengis/style/StyleFactory.java  |  6 +--
 .../renderer/style/DynamicLineStyle2D.java         |  2 +-
 .../geotools/renderer/style/SLDStyleFactory.java   |  2 +-
 28 files changed, 143 insertions(+), 208 deletions(-)

diff --git a/modules/extension/brewer/src/main/java/org/geotools/styling/builder/StrokeBuilder.java b/modules/extension/brewer/src/main/java/org/geotools/styling/builder/StrokeBuilder.java
index b64283f..b415f2f 100644
--- a/modules/extension/brewer/src/main/java/org/geotools/styling/builder/StrokeBuilder.java
+++ b/modules/extension/brewer/src/main/java/org/geotools/styling/builder/StrokeBuilder.java
@@ -38,7 +38,7 @@ public class StrokeBuilder extends AbstractStyleBuilder<Stroke> {
 
     Expression lineJoin;
 
-    float[] dashArray = null;
+    Expression dashArray;
 
     Expression dashOffset;
 
@@ -182,12 +182,18 @@ public class StrokeBuilder extends AbstractStyleBuilder<Stroke> {
         return lineJoin(literal(join));
     }
 
-    public StrokeBuilder dashArray(float... dashArray) {
+    public StrokeBuilder dashArray(Expression dashArray) {
         this.dashArray = dashArray;
         unset = false;
         return this;
     }
 
+    public StrokeBuilder dashArray(float... dashArray) {
+        this.dashArray = literal(dashArray);
+        unset = false;
+        return this;
+    }
+
     public StrokeBuilder dashOffset(Expression dashOffset) {
         this.dashOffset = dashOffset;
         return this;
diff --git a/modules/extension/brewer/src/test/java/org/geotools/styling/builder/CookbookLineTest.java b/modules/extension/brewer/src/test/java/org/geotools/styling/builder/CookbookLineTest.java
index 6181a71..3140d43 100644
--- a/modules/extension/brewer/src/test/java/org/geotools/styling/builder/CookbookLineTest.java
+++ b/modules/extension/brewer/src/test/java/org/geotools/styling/builder/CookbookLineTest.java
@@ -86,7 +86,7 @@ public class CookbookLineTest extends AbstractStyleTest {
         LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
         assertEquals(3, (int) ls.getStroke().getWidth().evaluate(null, Integer.class));
         assertEquals(Color.BLUE, ls.getStroke().getColor().evaluate(null, Color.class));
-        assertTrue(Arrays.equals(new float[] { 5, 2 }, ls.getStroke().getDashArray()));
+        assertTrue(Arrays.equals(new float[] { 5, 2 }, ls.getStroke().getDashArray().evaluate(null, float[].class)));
     }
 
     @Test
@@ -137,7 +137,7 @@ public class CookbookLineTest extends AbstractStyleTest {
 
         // check the dots
         LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
-        assertTrue(Arrays.equals(new float[] { 4, 6 }, ls.getStroke().getDashArray()));
+        assertTrue(Arrays.equals(new float[] { 4, 6 }, ls.getStroke().getDashArray().evaluate(null, float[].class)));
         Graphic graphic = ls.getStroke().getGraphicStroke();
         List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
         assertEquals(1, symbols.size());
@@ -168,11 +168,11 @@ public class CookbookLineTest extends AbstractStyleTest {
         LineSymbolizer ls = (LineSymbolizer) collector.symbolizers.get(0);
         assertEquals(1, (int) ls.getStroke().getWidth().evaluate(null, Integer.class));
         assertEquals(Color.BLUE, ls.getStroke().getColor().evaluate(null, Color.class));
-        assertTrue(Arrays.equals(new float[] { 10, 10 }, ls.getStroke().getDashArray()));
+        assertTrue(Arrays.equals(new float[] { 10, 10 }, ls.getStroke().getDashArray().evaluate(null, float[].class)));
 
         // check the dots
         ls = (LineSymbolizer) collector.symbolizers.get(1);
-        assertTrue(Arrays.equals(new float[] { 5, 15 }, ls.getStroke().getDashArray()));
+        assertTrue(Arrays.equals(new float[] { 5, 15 }, ls.getStroke().getDashArray().evaluate(null, float[].class)));
         assertEquals(7.5, ls.getStroke().getDashOffset().evaluate(null, Double.class), 0.0);
         Graphic graphic = ls.getStroke().getGraphicStroke();
         List<GraphicalSymbol> symbols = graphic.graphicalSymbols();
diff --git a/modules/extension/xsd/xsd-sld/src/main/java/org/geotools/sld/bindings/SLDStrokeBinding.java b/modules/extension/xsd/xsd-sld/src/main/java/org/geotools/sld/bindings/SLDStrokeBinding.java
index 3b93c1f..8749153 100644
--- a/modules/extension/xsd/xsd-sld/src/main/java/org/geotools/sld/bindings/SLDStrokeBinding.java
+++ b/modules/extension/xsd/xsd-sld/src/main/java/org/geotools/sld/bindings/SLDStrokeBinding.java
@@ -191,17 +191,6 @@ public class SLDStrokeBinding extends AbstractComplexBinding {
             }
         }
 
-        float[] dash = null;
-
-        if (dashArray != null) {
-            String[] string = Filters.asString(dashArray).split(" +");
-            dash = new float[string.length];
-
-            for (int i = 0; i < string.length; i++) {
-                dash[i] = Float.parseFloat(string[i]);
-            }
-        }
-
         //&lt;xsd:choice minOccurs="0"&gt;
         //   &lt;xsd:element ref="sld:GraphicFill"/&gt;
         //   &lt;xsd:element ref="sld:GraphicStroke"/&gt;
@@ -209,7 +198,7 @@ public class SLDStrokeBinding extends AbstractComplexBinding {
         Graphic graphicFill = (Graphic) node.getChildValue("GraphicFill");
         Graphic graphicStroke = (Graphic) node.getChildValue("GraphicStroke");
 
-        return styleFactory.createStroke(color, width, opacity, lineJoin, lineCap, dash,
+        return styleFactory.createStroke(color, width, opacity, lineJoin, lineCap, dashArray,
             dashOffset, graphicFill, graphicStroke);
     }
 }
diff --git a/modules/extension/xsd/xsd-sld/src/test/java/org/geotools/sld/bindings/SLDStrokeBindingTest.java b/modules/extension/xsd/xsd-sld/src/test/java/org/geotools/sld/bindings/SLDStrokeBindingTest.java
index 4542dc5..8add351 100644
--- a/modules/extension/xsd/xsd-sld/src/test/java/org/geotools/sld/bindings/SLDStrokeBindingTest.java
+++ b/modules/extension/xsd/xsd-sld/src/test/java/org/geotools/sld/bindings/SLDStrokeBindingTest.java
@@ -20,6 +20,8 @@ import org.geotools.filter.Filters;
 import org.geotools.styling.SLD;
 import org.geotools.styling.Stroke;
 
+import java.util.Arrays;
+
 
 /**
  * 
@@ -45,10 +47,7 @@ public class SLDStrokeBindingTest extends SLDTestSupport {
         assertEquals("butt", Filters.asString(stroke.getLineCap()));
         assertEquals("mitre", Filters.asString(stroke.getLineJoin()));
 
-        assertEquals(1.1d, stroke.getDashArray()[0], 0.000001);
-        assertEquals(2.2d, stroke.getDashArray()[1], 0.000001);
-        assertEquals(3.3d, stroke.getDashArray()[2], 0.000001);
-        assertEquals(4.4d, stroke.getDashArray()[3], 0.000001);
+        assertTrue(Arrays.equals(new float[]{1.1f, 2.2f, 3.3f, 4.4f}, stroke.getDashArray().evaluate(null, float[].class)));
 
         assertEquals(1.0, Filters.asDouble(stroke.getOpacity()), 0d);
     }
diff --git a/modules/library/api/src/main/java/org/geotools/styling/Stroke.java b/modules/library/api/src/main/java/org/geotools/styling/Stroke.java
index b902cf1..0f51665 100644
--- a/modules/library/api/src/main/java/org/geotools/styling/Stroke.java
+++ b/modules/library/api/src/main/java/org/geotools/styling/Stroke.java
@@ -87,6 +87,7 @@ public interface Stroke extends org.opengis.style.Stroke {
      * </p>
      */
     static final Stroke DEFAULT = new ConstantStroke() {
+
             public Expression getColor() {
                 return ConstantExpression.BLACK;
             }
@@ -111,9 +112,7 @@ public interface Stroke extends org.opengis.style.Stroke {
                 return ConstantExpression.constant("butt");
             }
 
-            public float[] getDashArray() {
-                return null;
-            }
+            public Expression getDashArray() { return  null; }
 
             public Expression getDashOffset() {
                 return ConstantExpression.ZERO;
@@ -164,8 +163,8 @@ public interface Stroke extends org.opengis.style.Stroke {
                 return ConstantExpression.NULL;
             }
 
-            public float[] getDashArray() {
-                return new float[] {  };
+            public Expression getDashArray() {
+                return ConstantExpression.NULL;
             }
 
             public Expression getDashOffset() {
@@ -256,7 +255,7 @@ public interface Stroke extends org.opengis.style.Stroke {
      * <code>--&nbsp;---&nbsp;&nbsp;--&nbsp;---&nbsp;&nbsp;--&nbsp;---&nbsp;&nbsp;
      * --&nbsp;---&nbsp;&nbsp;--&nbsp;---&nbsp;&nbsp;--</code>
      */
-    float[] getDashArray();
+    Expression getDashArray();
 
     /**
      * This parameter encodes the dash pattern as a seqeuence of floats.<br>
@@ -269,7 +268,7 @@ public interface Stroke extends org.opengis.style.Stroke {
      * <code>--&nbsp;---&nbsp;&nbsp;--&nbsp;---&nbsp;&nbsp;--&nbsp;---&nbsp;&nbsp;
      * --&nbsp;---&nbsp;&nbsp;--&nbsp;---&nbsp;&nbsp;--</code>
      */
-    void setDashArray(float[] dashArray);
+    void setDashArray(Expression dashArray);
 
     /**
      * A dash array need not start from the beginning.  This method allows for
@@ -357,7 +356,7 @@ abstract class ConstantStroke implements Stroke {
         cannotModifyConstant();
     }
 
-    public void setDashArray(float[] dashArray) {
+    public void setDashArray(Expression dashArray) {
         cannotModifyConstant();
     }
 
diff --git a/modules/library/api/src/main/java/org/geotools/styling/StyleFactory.java b/modules/library/api/src/main/java/org/geotools/styling/StyleFactory.java
index 554e374..a6d92cb 100644
--- a/modules/library/api/src/main/java/org/geotools/styling/StyleFactory.java
+++ b/modules/library/api/src/main/java/org/geotools/styling/StyleFactory.java
@@ -213,7 +213,7 @@ public interface StyleFactory extends Factory, org.opengis.style.StyleFactory {
      * @see org.geotools.stroke
      */
     public Stroke createStroke(Expression color, Expression width, Expression opacity,
-        Expression lineJoin, Expression lineCap, float[] dashArray, Expression dashOffset,
+        Expression lineJoin, Expression lineCap, Expression dashArray, Expression dashOffset,
         Graphic graphicFill, Graphic graphicStroke);
 
     public Rule createRule();
@@ -667,7 +667,7 @@ public interface StyleFactory extends Factory, org.opengis.style.StyleFactory {
             Expression width,
             Expression join,
             Expression cap,
-            float[] dashes,
+            Expression dashes,
             Expression offset);
 
     Stroke stroke(
@@ -677,7 +677,7 @@ public interface StyleFactory extends Factory, org.opengis.style.StyleFactory {
             Expression width,
             Expression join,
             Expression cap,
-            float[] dashes,
+            Expression dashes,
             Expression offset);
 
     Stroke stroke(
@@ -687,7 +687,7 @@ public interface StyleFactory extends Factory, org.opengis.style.StyleFactory {
             Expression width,
             Expression join,
             Expression cap,
-            float[] dashes,
+            Expression dashes,
             Expression offset);
 
     /**
diff --git a/modules/library/main/src/main/java/org/geotools/styling/AbstractStyleFactory.java b/modules/library/main/src/main/java/org/geotools/styling/AbstractStyleFactory.java
index 279f92e..992e28b 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/AbstractStyleFactory.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/AbstractStyleFactory.java
@@ -170,7 +170,7 @@ public abstract class AbstractStyleFactory implements StyleFactory {
      */
     public abstract Stroke createStroke(Expression color, Expression width,
         Expression opacity, Expression lineJoin, Expression lineCap,
-        float[] dashArray, Expression dashOffset, Graphic graphicFill,
+        Expression dashArray, Expression dashOffset, Graphic graphicFill,
         Graphic graphicStroke);
 
     public abstract Rule createRule();
diff --git a/modules/library/main/src/main/java/org/geotools/styling/SLD.java b/modules/library/main/src/main/java/org/geotools/styling/SLD.java
index 0d0d2aa..b7ddd8d 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/SLD.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/SLD.java
@@ -145,7 +145,7 @@ public class SLD {
                         Expression opacity = copy(stroke.getOpacity());
                         Expression lineJoin = copy(stroke.getLineJoin());
                         Expression lineCap = copy(stroke.getLineCap());
-                        float[] dashArray = copy(stroke.getDashArray());
+                        Expression dashArray = copy(stroke.getDashArray());
                         Expression dashOffset = copy(stroke.getDashOffset());
                         Graphic graphicStroke = copy(stroke.getGraphicStroke());
                         Graphic graphicFill = copy(stroke.getGraphicFill());
@@ -356,9 +356,9 @@ public class SLD {
      *
      * @param symbolizer Line symbolizer information.
      *
-     * @return float[] of the line dashes array, or null if unavailable.
+     * @return String of the line dashes array, or null if unavailable.
      */
-    public static float[] lineDash(LineSymbolizer symbolizer) {
+    public static String lineDash(LineSymbolizer symbolizer) {
         if (symbolizer == null) {
             return null;
         }
@@ -369,9 +369,7 @@ public class SLD {
             return null;
         }
 
-        float[] linedash = stroke.getDashArray();
-
-        return linedash;
+        return stroke.getDashArray().toString();
     }
 
     /**
diff --git a/modules/library/main/src/main/java/org/geotools/styling/SLDParser.java b/modules/library/main/src/main/java/org/geotools/styling/SLDParser.java
index afa980a..1e117b9 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/SLDParser.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/SLDParser.java
@@ -1971,29 +1971,7 @@ public class SLDParser {
                     stroke.setLineJoin(parseCssParameter(child));
                 } else if (res.equalsIgnoreCase("dasharray")
                         || res.equalsIgnoreCase("stroke-dasharray")) {
-                    String dashString = null;
-                    if( child.getChildNodes().getLength() == 1 && child.getFirstChild().getNodeType() == Node.TEXT_NODE ){
-                        dashString = getFirstChildValue(child);                        
-                    } else {
-                        Expression definition = parseCssParameter(child);
-                        if( definition instanceof Literal){
-                            dashString = ((Literal)definition).getValue().toString();
-                        }
-                        else {
-                            LOGGER.warning("Only literal stroke-dasharray supported at this time:"+definition);
-                        }                        
-                    }
-                    if( dashString != null){
-                        StringTokenizer stok = new StringTokenizer(dashString.trim(), " ");
-                        float[] dashes = new float[stok.countTokens()];
-                        for (int l = 0; l < dashes.length; l++) {
-                            dashes[l] = Float.parseFloat(stok.nextToken());
-                        }                    
-                        stroke.setDashArray(dashes);
-                    }
-                    else {
-                        LOGGER.fine("Unable to parse stroke-dasharray");
-                    }                
+                    stroke.setDashArray(parseCssParameter(child));
                 } else if (res.equalsIgnoreCase("dashoffset")
                         || res.equalsIgnoreCase("stroke-dashoffset")) {
                     stroke.setDashOffset(parseCssParameter(child));
diff --git a/modules/library/main/src/main/java/org/geotools/styling/SLDTransformer.java b/modules/library/main/src/main/java/org/geotools/styling/SLDTransformer.java
index f42b16d..a98f9bf 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/SLDTransformer.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/SLDTransformer.java
@@ -375,21 +375,10 @@ public class SLDTransformer extends TransformerBase {
             encodeCssParam("stroke-width", stroke.getWidth(), 1.0);
             encodeCssParam("stroke-dashoffset", stroke.getDashOffset(), 0.0);
 
-            float[] dash = stroke.getDashArray();
-
-            if (dash != null) {
-                StringBuffer sb = new StringBuffer();
-    
-                for (int i = 0; i < dash.length; i++) {
-                    sb.append(dash[i]);
-                    if(i < dash.length - 1) {
-                        sb.append(" ");
-                    }
-                }
-    
-                encodeCssParam("stroke-dasharray", ff.literal(sb.toString()));
-    
+            if (!(stroke.getDashArray() == null || stroke.getDashArray().equals(Stroke.DEFAULT.getDashArray()))) {
+                encodeCssParam("stroke-dasharray", stroke.getDashArray(), null);
             }
+
             end("Stroke");
         }
 
diff --git a/modules/library/main/src/main/java/org/geotools/styling/StrokeImpl.java b/modules/library/main/src/main/java/org/geotools/styling/StrokeImpl.java
index 518ae51..9f5e5cd 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/StrokeImpl.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/StrokeImpl.java
@@ -41,7 +41,7 @@ import org.opengis.util.Cloneable;
 public class StrokeImpl implements Stroke, Cloneable {
     private FilterFactory filterFactory;
     private Expression color;
-    private float[] dashArray;
+    private Expression dashArray;
     private Expression dashOffset;
     private GraphicImpl fillGraphic;
     private GraphicImpl strokeGraphic;
@@ -133,22 +133,11 @@ public class StrokeImpl implements Stroke, Cloneable {
      * @return The dash pattern as an array of float values in the form
      *         "dashlength gaplength ..."
      */
-    public float[] getDashArray() {
-        float[] ret = null;
-
-        if (dashArray != null) {
-            ret = new float[dashArray.length];
-            System.arraycopy(dashArray, 0, ret, 0, dashArray.length);
-        } else {
-        	final float[] defaultDashArray = Stroke.DEFAULT.getDashArray();
-        	if(defaultDashArray == null)
-        	    return null;
-        	
-        	ret = new float[defaultDashArray.length];
-        	System.arraycopy(defaultDashArray, 0, ret, 0, defaultDashArray.length);
-        }
-
-        return ret;
+    public Expression getDashArray() {
+        if (dashArray == null) {
+            return Stroke.DEFAULT.getDashArray();
+        }
+        return dashArray;
     }
 
     /**
@@ -167,7 +156,7 @@ public class StrokeImpl implements Stroke, Cloneable {
      * @param dashPattern The dash pattern as an array of float values in the
      *        form "dashlength gaplength ..."
      */
-    public void setDashArray(float[] dashPattern) {
+    public void setDashArray(Expression dashPattern) {
         dashArray = dashPattern;
     }
 
@@ -417,12 +406,6 @@ public class StrokeImpl implements Stroke, Cloneable {
         try {
             StrokeImpl clone = (StrokeImpl) super.clone();
 
-            if (dashArray != null) {
-                clone.dashArray = new float[dashArray.length];
-                System.arraycopy(dashArray, 0, clone.dashArray, 0,
-                    dashArray.length);
-            }
-
             if (fillGraphic != null && fillGraphic instanceof Cloneable) {
                 clone.fillGraphic = (GraphicImpl) ((Cloneable) fillGraphic).clone();
             }
@@ -476,26 +459,7 @@ public class StrokeImpl implements Stroke, Cloneable {
         }
 
         if (dashArray != null) {
-            result = (PRIME * result) + hashCodeDashArray(dashArray);
-        }
-
-        return result;
-    }
-
-    /*
-     * Helper method to compute the hashCode of float arrays.
-     */
-    private int hashCodeDashArray(float[] a) {
-        final int PRIME = 1000003;
-
-        if (a == null) {
-            return 0;
-        }
-
-        int result = 0;
-
-        for (int i = 0; i < a.length; i++) {
-            result = (PRIME * result) + Float.floatToIntBits(a[i]);
+            result = (PRIME * result) + dashArray.hashCode();
         }
 
         return result;
@@ -553,7 +517,7 @@ public class StrokeImpl implements Stroke, Cloneable {
             return false;
         }
 
-        if (!Arrays.equals(getDashArray(), other.getDashArray())) {
+        if( !Utilities.equals( getDashArray(), other.getDashArray() )) {
             return false;
         }
 
@@ -570,12 +534,7 @@ public class StrokeImpl implements Stroke, Cloneable {
         else {
             StrokeImpl copy = new StrokeImpl();
             copy.setColor( stroke.getColor());
-            if( stroke.getDashArray() != null ){
-                float dashArray[] = stroke.getDashArray();
-                float ret[] = new float[ dashArray.length ];
-                System.arraycopy(dashArray, 0, ret, 0, dashArray.length );                
-                copy.setDashArray( ret );
-            }
+            copy.setDashArray(stroke.getDashArray());
             copy.setDashOffset(stroke.getDashOffset());
             copy.setGraphicFill( GraphicImpl.cast(stroke.getGraphicFill()));
             copy.setGraphicStroke( GraphicImpl.cast(stroke.getGraphicStroke()));
diff --git a/modules/library/main/src/main/java/org/geotools/styling/StyleBuilder.java b/modules/library/main/src/main/java/org/geotools/styling/StyleBuilder.java
index f968335..e39a287 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/StyleBuilder.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/StyleBuilder.java
@@ -210,7 +210,7 @@ public class StyleBuilder {
      */
     public Stroke createStroke(Color color, double width, float[] dashArray) {
         Stroke stroke = createStroke(color, width);
-        stroke.setDashArray(dashArray);
+        stroke.setDashArray(literalExpression(dashArray));
 
         return stroke;
     }
diff --git a/modules/library/main/src/main/java/org/geotools/styling/StyleFactoryImpl.java b/modules/library/main/src/main/java/org/geotools/styling/StyleFactoryImpl.java
index 9546267..b8363e0 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/StyleFactoryImpl.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/StyleFactoryImpl.java
@@ -282,7 +282,7 @@ public class StyleFactoryImpl extends AbstractStyleFactory
      */
     public Stroke createStroke(Expression color, Expression width,
         Expression opacity, Expression lineJoin, Expression lineCap,
-        float[] dashArray, Expression dashOffset, Graphic graphicFill,
+        Expression dashArray, Expression dashOffset, Graphic graphicFill,
         Graphic graphicStroke) {
         Stroke stroke = new StrokeImpl(filterFactory);
 
@@ -312,6 +312,10 @@ public class StyleFactoryImpl extends AbstractStyleFactory
         	lineCap = Stroke.DEFAULT.getLineCap();
         }
 
+        if(dashArray == null) {
+            dashArray = Stroke.DEFAULT.getDashArray();
+        }
+
         stroke.setLineCap(lineCap);
         stroke.setDashArray(dashArray);
         stroke.setDashOffset(dashOffset);
@@ -957,17 +961,17 @@ public class StyleFactoryImpl extends AbstractStyleFactory
     }
 
     public Stroke stroke(Expression color, Expression opacity, Expression width,
-            Expression join, Expression cap, float[] dashes, Expression offset) {
+            Expression join, Expression cap, Expression dashes, Expression offset) {
         return delegate.stroke(color, opacity, width, join, cap, dashes, offset);
     }
     
     public Stroke stroke(GraphicFill fill, Expression color, Expression opacity,
-            Expression width, Expression join, Expression cap, float[] dashes, Expression offset) {
+            Expression width, Expression join, Expression cap, Expression dashes, Expression offset) {
         return delegate.stroke(fill, color, opacity, width, join, cap, dashes, offset);
     }
     
     public Stroke stroke(GraphicStroke stroke, Expression color,
-            Expression opacity, Expression width, Expression join, Expression cap, float[] dashes,
+            Expression opacity, Expression width, Expression join, Expression cap, Expression dashes,
             Expression offset) {
         return delegate.stroke(stroke, color, opacity, width, join, cap, dashes, offset);
     }
diff --git a/modules/library/main/src/main/java/org/geotools/styling/StyleFactoryImpl2.java b/modules/library/main/src/main/java/org/geotools/styling/StyleFactoryImpl2.java
index 538e92c..fbd281a 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/StyleFactoryImpl2.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/StyleFactoryImpl2.java
@@ -489,7 +489,7 @@ public class StyleFactoryImpl2 implements org.opengis.style.StyleFactory {
     }
 
     public StrokeImpl stroke(Expression color, Expression opacity, Expression width,
-            Expression join, Expression cap, float[] dashes, Expression offset) {
+            Expression join, Expression cap, Expression dashes, Expression offset) {
         StrokeImpl stroke = new StrokeImpl( filterFactory );
         stroke.setColor(color);
         stroke.setOpacity(opacity);
@@ -502,7 +502,7 @@ public class StyleFactoryImpl2 implements org.opengis.style.StyleFactory {
     }
     
     public StrokeImpl stroke(GraphicFill fill, Expression color, Expression opacity,
-            Expression width, Expression join, Expression cap, float[] dashes, Expression offset) {
+            Expression width, Expression join, Expression cap, Expression dashes, Expression offset) {
         StrokeImpl stroke = new StrokeImpl( filterFactory );
         stroke.setGraphicFill( fill );
         stroke.setColor(color);
@@ -516,7 +516,7 @@ public class StyleFactoryImpl2 implements org.opengis.style.StyleFactory {
     }
     
     public StrokeImpl stroke(GraphicStroke stroke, Expression color,
-            Expression opacity, Expression width, Expression join, Expression cap, float[] dashes,
+            Expression opacity, Expression width, Expression join, Expression cap, Expression dashes,
             Expression offset) {
         StrokeImpl s = new StrokeImpl(filterFactory);
         s.setColor(color);
diff --git a/modules/library/main/src/main/java/org/geotools/styling/visitor/DpiRescaleStyleVisitor.java b/modules/library/main/src/main/java/org/geotools/styling/visitor/DpiRescaleStyleVisitor.java
index ba70cc5..7fdcd1f 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/visitor/DpiRescaleStyleVisitor.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/visitor/DpiRescaleStyleVisitor.java
@@ -55,47 +55,47 @@ public class DpiRescaleStyleVisitor extends RescaleStyleVisitor {
         if(expr == Expression.NIL) {
             return Expression.NIL;
         }
-        
+
         // delegate the handling of the rescaling to ValueAndUnit 
         // to deal with local uom (px, m, ft suffixes)
         Measure v = new Measure(expr, defaultUnit);
         return RescalingMode.Pixels.rescaleToExpression(scale, v);
     }
-    
+
     @Override
-    float[] rescale(float[] values) {
+    protected Expression rescaleDashArray(Expression dashArrayExpression) {
         if (defaultUnit == null || defaultUnit == NonSI.PIXEL) {
-            return super.rescale(values);
+            return super.rescaleDashArray(dashArrayExpression);
         } else {
-            return values;
-        }        
+            return dashArrayExpression;
+        }
     }
-    
-    @Override    
+
+    @Override
     protected void rescaleOption(Map<String, String> options, String key, double defaultValue) {
         double scaleFactor = (double) scale.evaluate(null, Double.class);
         String value = options.get(key);
         if(value == null) {
             value = String.valueOf(defaultValue);
         }
-            
+
         Measure v = new Measure(value, defaultUnit);
         String rescaled = RescalingMode.Pixels.rescaleToString(scaleFactor, v);
         options.put(key, String.valueOf(rescaled));
     }
-    
-    @Override        
+
+    @Override
     protected void rescaleOption(Map<String, String> options, String key, int defaultValue) {
         double scaleFactor = (double) scale.evaluate(null, Double.class);
         String value = options.get(key);
         if(value == null) {
             value = String.valueOf(defaultValue);
         }
-            
+
         Measure v = new Measure(value, defaultUnit);
         String rescaled = RescalingMode.Pixels.rescaleToString(scaleFactor, v);
         options.put(key, String.valueOf(rescaled));
     }
-    
-    
+
+
 }
\ No newline at end of file
diff --git a/modules/library/main/src/main/java/org/geotools/styling/visitor/RescaleStyleVisitor.java b/modules/library/main/src/main/java/org/geotools/styling/visitor/RescaleStyleVisitor.java
index b24688c..3a435a0 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/visitor/RescaleStyleVisitor.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/visitor/RescaleStyleVisitor.java
@@ -124,7 +124,7 @@ public class RescaleStyleVisitor extends DuplicatingStyleVisitor {
     public void visit(org.geotools.styling.Stroke stroke) {
         Stroke copy = sf.getDefaultStroke();
         copy.setColor( copy(stroke.getColor()));
-        copy.setDashArray( rescale(stroke.getDashArray()));
+        copy.setDashArray( rescaleDashArray(stroke.getDashArray()));
         copy.setDashOffset( rescale(stroke.getDashOffset()));
         copy.setGraphicFill( copy(stroke.getGraphicFill()));
         copy.setGraphicStroke( copy( stroke.getGraphicStroke()));
@@ -133,24 +133,29 @@ public class RescaleStyleVisitor extends DuplicatingStyleVisitor {
         copy.setOpacity( copy(stroke.getOpacity()));
         copy.setWidth( rescale(stroke.getWidth()));
         pages.push(copy);
-    }   
-    
-    float[] rescale(float[] original) {
-        if(original == null) {
+    }
+
+    // FIXME This method could be avoid by implementing the support for array add/div/sub/mult operations.
+    // FIXME This method is only valid if the dash-array expression and the scale expression are literals.
+    protected Expression rescaleDashArray(Expression dashArrayExpression) {
+        if (dashArrayExpression == null) {
             return null;
         }
-        
-        // rescale the dash array if possible
-        float[] rescaled = new float[original.length];
-        float scaleFactor = 1;
-        if( scale instanceof Literal){
-            scaleFactor = scale.evaluate(null, Float.class);
+        if (dashArrayExpression == Expression.NIL) {
+            return Expression.NIL;
         }
-        for (int i = 0; i < rescaled.length; i++) {
-            rescaled[i] = scaleFactor * original[i];
+        if (dashArrayExpression instanceof Literal && scale instanceof Literal) {
+            float[] dashArray = dashArrayExpression.evaluate(null, float[].class);
+            if(dashArray == null) {
+                return null;
+            }
+            float scaleFactor = scale.evaluate(null, Float.class);
+            for (int i = 0; i < dashArray.length; i++) {
+                dashArray[i] = scaleFactor * dashArray[i];
+            }
+            return ff.literal(dashArray);
         }
-        
-        return rescaled;
+        return dashArrayExpression;
     }
 
     /** Make graphics (such as used with PointSymbolizer) bigger */
diff --git a/modules/library/main/src/main/java/org/geotools/styling/visitor/UomRescaleStyleVisitor.java b/modules/library/main/src/main/java/org/geotools/styling/visitor/UomRescaleStyleVisitor.java
index f3b9d5e..4ee7fc4 100644
--- a/modules/library/main/src/main/java/org/geotools/styling/visitor/UomRescaleStyleVisitor.java
+++ b/modules/library/main/src/main/java/org/geotools/styling/visitor/UomRescaleStyleVisitor.java
@@ -37,6 +37,7 @@ import org.geotools.styling.Stroke;
 import org.geotools.styling.TextSymbolizer;
 import org.geotools.styling.TextSymbolizer2;
 import org.opengis.filter.expression.Expression;
+import org.opengis.filter.expression.Literal;
 import org.opengis.style.GraphicalSymbol;
 
 /**
@@ -110,26 +111,26 @@ public class UomRescaleStyleVisitor extends DuplicatingStyleVisitor {
         return RescalingMode.RealWorld.rescaleToString(mapScale, v);
     }
 
-    /**
-     * Used to rescale the provided dash array.
-     * 
-     * @param dashArray the unscaled dash array. If null, the method returns null.
-     * @param mapScale the mapScale in pixels per meter.
-     * @param uom the unit of measure that will be used to scale.
-     * @return the rescaled dash array
-     */
-    protected float[] rescale(float[] dashArray, Unit<Length> unitOfMeasure) {
-        if (dashArray == null)
+    // FIXME This method could be avoid by implementing the support for array add/div/sub/mult operations.
+    // FIXME This method is only valid if the dash-array expression and the scale expression are literals.
+    protected Expression rescaleDashArray(Expression dashArrayExpression, Unit<Length> unitOfMeasure) {
+        if (dashArrayExpression == null) {
             return null;
-        if (unitOfMeasure == null || unitOfMeasure.equals(NonSI.PIXEL))
-            return dashArray;
-
-        float[] rescaledDashArray = new float[dashArray.length];
-
-        for (int i = 0; i < rescaledDashArray.length; i++) {
-            rescaledDashArray[i] = Float.parseFloat(rescale(String.valueOf(dashArray[i]), unitOfMeasure));
         }
-        return rescaledDashArray;
+        if (dashArrayExpression == Expression.NIL) {
+            return Expression.NIL;
+        }
+        if (dashArrayExpression instanceof Literal) {
+            float[] dashArray = dashArrayExpression.evaluate(null, float[].class);
+            if(dashArray == null) {
+                return Expression.NIL;
+            }
+            for (int i = 0; i < dashArray.length; i++) {
+                dashArray[i] = Float.parseFloat(rescale(String.valueOf(dashArray[i]), unitOfMeasure));
+            }
+            return ff.literal(dashArray);
+        }
+        return dashArrayExpression;
     }
 
     /**
@@ -142,7 +143,7 @@ public class UomRescaleStyleVisitor extends DuplicatingStyleVisitor {
     protected void rescaleStroke(Stroke stroke, Unit<Length> uom) {
         if (stroke != null) {
             stroke.setWidth(rescale(stroke.getWidth(), uom));
-            stroke.setDashArray(rescale(stroke.getDashArray(), uom));
+            stroke.setDashArray(rescaleDashArray(stroke.getDashArray(), uom));
             stroke.setDashOffset(rescale(stroke.getDashOffset(), uom));
             rescale(stroke.getGraphicFill(), uom);
             rescale(stroke.getGraphicStroke(), uom);
diff --git a/modules/library/main/src/main/resources/META-INF/services/org.geotools.util.ConverterFactory b/modules/library/main/src/main/resources/META-INF/services/org.geotools.util.ConverterFactory
index 1763a53..bbb2e99 100644
--- a/modules/library/main/src/main/resources/META-INF/services/org.geotools.util.ConverterFactory
+++ b/modules/library/main/src/main/resources/META-INF/services/org.geotools.util.ConverterFactory
@@ -13,3 +13,4 @@ org.geotools.util.QNameConverterFactory
 org.geotools.util.MeasureConverterFactory
 org.geotools.temporal.TemporalConverterFactory
 org.geotools.util.NameConverterFactory
+org.geotools.util.FloatArrayConverterFactory
diff --git a/modules/library/main/src/test/java/org/geotools/styling/SLDStyleTest.java b/modules/library/main/src/test/java/org/geotools/styling/SLDStyleTest.java
index 9077473..f6812fc 100644
--- a/modules/library/main/src/test/java/org/geotools/styling/SLDStyleTest.java
+++ b/modules/library/main/src/test/java/org/geotools/styling/SLDStyleTest.java
@@ -207,7 +207,7 @@ public class SLDStyleTest extends TestCase {
         assertEquals(1, symbolizers.size());
         
         LineSymbolizer ls = (LineSymbolizer) symbolizers.get(0);
-        assertTrue(Arrays.equals(new float[] {2.0f, 1.0f, 4.0f, 1.0f}, ls.getStroke().getDashArray()));
+        assertTrue(Arrays.equals(new float[] {2.0f, 1.0f, 4.0f, 1.0f}, ls.getStroke().getDashArray().evaluate(null, float[].class)));
     }
 
     public void testSLDParserWithWhitespaceIsTrimmed() throws Exception {
diff --git a/modules/library/main/src/test/java/org/geotools/styling/StyleFactoryImplTest.java b/modules/library/main/src/test/java/org/geotools/styling/StyleFactoryImplTest.java
index d741327..b6023f6 100644
--- a/modules/library/main/src/test/java/org/geotools/styling/StyleFactoryImplTest.java
+++ b/modules/library/main/src/test/java/org/geotools/styling/StyleFactoryImplTest.java
@@ -18,6 +18,7 @@ package org.geotools.styling;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
+import java.util.Arrays;
 import java.util.Random;
 import java.util.logging.Logger;
 
@@ -151,7 +152,7 @@ public class StyleFactoryImplTest extends TestCase {
                 filterFactory.literal(0.5),
                 filterFactory.literal("bevel"),
                 filterFactory.literal("square"),
-                new float[] { 1.1f, 2.1f, 6f, 2.1f, 1.1f, 5f },
+                filterFactory.literal(new float[] { 1.1f, 2.1f, 6f, 2.1f, 1.1f, 5f }),
                 filterFactory.literal(3), null, null);
 
         assertNotNull("Failed to build stroke ", s);
@@ -166,7 +167,8 @@ public class StyleFactoryImplTest extends TestCase {
             s.getLineJoin().evaluate(feature).toString());
         assertEquals("Wrong linejoin ", "square",
             s.getLineCap().evaluate(feature).toString());
-        assertEquals("Broken dash array", 2.1f, s.getDashArray()[1], 0.001f);
+        assertTrue("Broken dash array",
+                Arrays.equals(new float[]{1.1f, 2.1f, 6f, 2.1f, 1.1f, 5f}, s.getDashArray().evaluate(null, float[].class)));
         assertEquals("Wrong dash offset ", "3",
             s.getDashOffset().evaluate(feature).toString());
     }
diff --git a/modules/library/main/src/test/java/org/geotools/styling/StyleObjectTest.java b/modules/library/main/src/test/java/org/geotools/styling/StyleObjectTest.java
index 59a8ca7..43802a9 100644
--- a/modules/library/main/src/test/java/org/geotools/styling/StyleObjectTest.java
+++ b/modules/library/main/src/test/java/org/geotools/styling/StyleObjectTest.java
@@ -326,7 +326,7 @@ public class StyleObjectTest extends TestCase {
         // a stroke is a complex object with lots of properties,
         // need more extensive tests here.
         Stroke dashArray = styleFactory.getDefaultStroke();
-        dashArray.setDashArray(new float[] { 1.0f, 2.0f, 3.0f });
+        dashArray.setDashArray(filterFactory.literal(new float[] { 1.0f, 2.0f, 3.0f }));
 
         dashArray.accept( duplicate );
         Stroke dashArray2 = (Stroke) duplicate.getCopy();
diff --git a/modules/library/main/src/test/java/org/geotools/styling/visitor/DpiRescaleStyleVisitorTest.java b/modules/library/main/src/test/java/org/geotools/styling/visitor/DpiRescaleStyleVisitorTest.java
index be58d1a..7aa219a 100644
--- a/modules/library/main/src/test/java/org/geotools/styling/visitor/DpiRescaleStyleVisitorTest.java
+++ b/modules/library/main/src/test/java/org/geotools/styling/visitor/DpiRescaleStyleVisitorTest.java
@@ -65,8 +65,9 @@ public class DpiRescaleStyleVisitorTest {
         Stroke clone = ((LineSymbolizer) visitor.getCopy()).getStroke();
 
         assertEquals(4.0d, clone.getWidth().evaluate(null, Double.class), 0d);
-        assertEquals(10.0f, clone.getDashArray()[0], 0f);
-        assertEquals(20.0f, clone.getDashArray()[1], 0f);
+
+        assertEquals(10.0f, clone.getDashArray().evaluate(null, float[].class)[0], 0f);
+        assertEquals(20.0f, clone.getDashArray().evaluate(null, float[].class)[1], 0f);
     }
     
     @Test
@@ -78,8 +79,9 @@ public class DpiRescaleStyleVisitorTest {
         Stroke clone = ((LineSymbolizer) visitor.getCopy()).getStroke();
 
         assertEquals(2d, clone.getWidth().evaluate(null, Double.class), 0d);
-        assertEquals(5f, clone.getDashArray()[0], 0f);
-        assertEquals(10f, clone.getDashArray()[1], 0f);
+
+        assertEquals(5.0f, clone.getDashArray().evaluate(null, float[].class)[0], 0f);
+        assertEquals(10.0f, clone.getDashArray().evaluate(null, float[].class)[1], 0f);
     }
     
     @Test
@@ -91,8 +93,9 @@ public class DpiRescaleStyleVisitorTest {
         Stroke clone = ((LineSymbolizer) visitor.getCopy()).getStroke();
 
         assertEquals(2d, clone.getWidth().evaluate(null, Double.class), 0d);
-        assertEquals(5f, clone.getDashArray()[0], 0f);
-        assertEquals(10f, clone.getDashArray()[1], 0f);
+
+        assertEquals(5.0f, clone.getDashArray().evaluate(null, float[].class)[0], 0f);
+        assertEquals(10.0f, clone.getDashArray().evaluate(null, float[].class)[1], 0f);
     }
     
     @Test
@@ -107,8 +110,8 @@ public class DpiRescaleStyleVisitorTest {
         // this one has been rescaled
         assertEquals(4d, clone.getWidth().evaluate(null, Double.class), 0d);
         // the dash array did not, it's supposed to be meters
-        assertEquals(5f, clone.getDashArray()[0], 0f);
-        assertEquals(10f, clone.getDashArray()[1], 0f);
+        assertEquals(5.0f, clone.getDashArray().evaluate(null, float[].class)[0], 0f);
+        assertEquals(10.0f, clone.getDashArray().evaluate(null, float[].class)[1], 0f);
     }
     
     @Test
@@ -122,8 +125,8 @@ public class DpiRescaleStyleVisitorTest {
         // this one has not been rescaled
         assertEquals("2m", clone.getWidth().evaluate(null, String.class));
         // the dash array did , it's supposed to be pixels
-        assertEquals(10f, clone.getDashArray()[0], 0f);
-        assertEquals(20f, clone.getDashArray()[1], 0f);
+        assertEquals(10.0f, clone.getDashArray().evaluate(null, float[].class)[0], 0f);
+        assertEquals(20.0f, clone.getDashArray().evaluate(null, float[].class)[1], 0f);
     }
 
 
diff --git a/modules/library/main/src/test/java/org/geotools/styling/visitor/DuplicatorStyleVisitorTest.java b/modules/library/main/src/test/java/org/geotools/styling/visitor/DuplicatorStyleVisitorTest.java
index cc22142..3b34afe 100644
--- a/modules/library/main/src/test/java/org/geotools/styling/visitor/DuplicatorStyleVisitorTest.java
+++ b/modules/library/main/src/test/java/org/geotools/styling/visitor/DuplicatorStyleVisitorTest.java
@@ -254,6 +254,7 @@ public class DuplicatorStyleVisitorTest extends TestCase {
 
         rule.accept(visitor);
         Rule clone = (Rule) visitor.getCopy();
+
         assertCopy(rule, clone);
         assertEqualsContract(rule, clone);
         
@@ -599,7 +600,7 @@ public class DuplicatorStyleVisitorTest extends TestCase {
         // a stroke is a complex object with lots of properties,
         // need more extensive tests here.
         Stroke dashArray = sf.getDefaultStroke();
-        dashArray.setDashArray(new float[] { 1.0f, 2.0f, 3.0f });
+        dashArray.setDashArray(ff.literal(new float[] { 1.0f, 2.0f, 3.0f }));
 
         Stroke dashArray2 = (Stroke) ((Cloneable)dashArray).clone();
         assertEqualsContract(dashArray, dashArray2);
diff --git a/modules/library/main/src/test/java/org/geotools/styling/visitor/RescaleStyleVisitorTest.java b/modules/library/main/src/test/java/org/geotools/styling/visitor/RescaleStyleVisitorTest.java
index 28177a5..fc9ad0d 100644
--- a/modules/library/main/src/test/java/org/geotools/styling/visitor/RescaleStyleVisitorTest.java
+++ b/modules/library/main/src/test/java/org/geotools/styling/visitor/RescaleStyleVisitorTest.java
@@ -137,8 +137,9 @@ public class RescaleStyleVisitorTest {
         Stroke clone = (Stroke) visitor.getCopy();
         
         assertEquals(4.0d, clone.getWidth().evaluate(null, Double.class), 0d);
-        assertEquals(10.0f, clone.getDashArray()[0], 0d);
-        assertEquals(20.0f, clone.getDashArray()[1], 0d);
+
+        assertEquals(10.0f, clone.getDashArray().evaluate(null, float[].class)[0], 0d);
+        assertEquals(20.0f, clone.getDashArray().evaluate(null, float[].class)[1], 0d);
     }
     
     @Test
diff --git a/modules/library/opengis/src/main/java/org/opengis/style/Stroke.java b/modules/library/opengis/src/main/java/org/opengis/style/Stroke.java
index 5253ad8..4b88053 100644
--- a/modules/library/opengis/src/main/java/org/opengis/style/Stroke.java
+++ b/modules/library/opengis/src/main/java/org/opengis/style/Stroke.java
@@ -118,7 +118,7 @@ public interface Stroke {
      * @return expression
      */
     @XmlParameter("stroke-dasharray")
-    float[] getDashArray();
+    Expression getDashArray();
 
     /**
      * Indicates the distance offset into the dash array to begin drawing.
diff --git a/modules/library/opengis/src/main/java/org/opengis/style/StyleFactory.java b/modules/library/opengis/src/main/java/org/opengis/style/StyleFactory.java
index d8a4a1a..36841aa 100644
--- a/modules/library/opengis/src/main/java/org/opengis/style/StyleFactory.java
+++ b/modules/library/opengis/src/main/java/org/opengis/style/StyleFactory.java
@@ -423,7 +423,7 @@ public interface StyleFactory {
             Expression width,
             Expression join,
             Expression cap,
-            float[] dashes,
+            Expression dashes,
             Expression offset);
 
     Stroke stroke(
@@ -433,7 +433,7 @@ public interface StyleFactory {
             Expression width,
             Expression join,
             Expression cap,
-            float[] dashes,
+            Expression dashes,
             Expression offset);
 
     Stroke stroke(
@@ -443,7 +443,7 @@ public interface StyleFactory {
             Expression width,
             Expression join,
             Expression cap,
-            float[] dashes,
+            Expression dashes,
             Expression offset);
 
     /**
diff --git a/modules/library/render/src/main/java/org/geotools/renderer/style/DynamicLineStyle2D.java b/modules/library/render/src/main/java/org/geotools/renderer/style/DynamicLineStyle2D.java
index 2413dba..f23d5e1 100644
--- a/modules/library/render/src/main/java/org/geotools/renderer/style/DynamicLineStyle2D.java
+++ b/modules/library/render/src/main/java/org/geotools/renderer/style/DynamicLineStyle2D.java
@@ -78,8 +78,8 @@ public class DynamicLineStyle2D extends org.geotools.renderer.style.LineStyle2D
         capCode = SLDStyleFactory.lookUpCap(capType);
 
         // get the other properties needed for the stroke
-        float[] dashes = stroke.getDashArray();
         float width = ((Float) stroke.getWidth().evaluate(feature, Float.class)).floatValue();
+        float[] dashes = (stroke.getDashArray() == null) ? null : stroke.getDashArray().evaluate(feature, float[].class);
         float dashOffset = ((Float) stroke.getDashOffset().evaluate(feature, Float.class)).floatValue();
 
         // Simple optimization: let java2d use the fast drawing path if the line width
diff --git a/modules/library/render/src/main/java/org/geotools/renderer/style/SLDStyleFactory.java b/modules/library/render/src/main/java/org/geotools/renderer/style/SLDStyleFactory.java
index 3b97189..f1bde1e 100644
--- a/modules/library/render/src/main/java/org/geotools/renderer/style/SLDStyleFactory.java
+++ b/modules/library/render/src/main/java/org/geotools/renderer/style/SLDStyleFactory.java
@@ -1017,7 +1017,7 @@ public class SLDStyleFactory {
 		}
 
 		// get the other properties needed for the stroke
-		float[] dashes = stroke.getDashArray();
+        float[] dashes = (stroke.getDashArray() == null) ? null : stroke.getDashArray().evaluate(feature, float[].class);
 		float width = evalToFloat(stroke.getWidth(), feature, 1);
 		float dashOffset = evalToFloat(stroke.getDashOffset(), feature, 0);
 
-- 
1.9.3

------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
GeoTools-Devel mailing list
GeoTools-Devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to