[android] Fix style code generation if array default value is missing
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user