diff options
Diffstat (limited to 'platform/android')
-rw-r--r-- | platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java | 2 | ||||
-rwxr-xr-x | platform/android/scripts/generate-style-code.js | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java index 94e6303c3a..ae2c6d98f6 100644 --- a/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java +++ b/platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java @@ -598,7 +598,7 @@ public class SymbolLayerTest extends BaseLayerTest { assertNull(layer.getTextVariableAnchor().getValue()); // Set and Get - String[] propertyValue = [undefined]; + String[] propertyValue = new String[0]; layer.setProperties(textVariableAnchor(propertyValue)); assertEquals(layer.getTextVariableAnchor().getValue(), propertyValue); } diff --git a/platform/android/scripts/generate-style-code.js b/platform/android/scripts/generate-style-code.js index 6f64a38a67..688a3aa527 100755 --- a/platform/android/scripts/generate-style-code.js +++ b/platform/android/scripts/generate-style-code.js @@ -198,7 +198,11 @@ global.defaultValueJava = function(property) { switch (property.value) { case 'string': case 'enum': - return '[' + property['default'] + "]"; + if (property['default'] !== undefined) { + return '[' + property['default'] + ']'; + } else { + return 'new String[0]'; + } case 'number': var result ='new Float[] {'; for (var i = 0; i < property.length; i++) { |