You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
LightningStorage file type does not store list correctly
To Reproduce
Steps to reproduce the behavior:
Create String array
Create Lightning file and store array as list
See result:
Method used to create files
private void setupConfig () {
String string1 = "string";
String nest1 = "Nested Value";
String nest2 = "Another nested value";
String[] list = new String[]{"List item one", "Another item", "The last one, I promise"};
int ultimateAnswer = 42;
boolean boo = true;
Json json = new Json("lightning.json", getDataFolder().toString());
Yaml yaml = new Yaml("lightning.yaml", getDataFolder().toString());
Toml toml = new Toml("lightning.toml", getDataFolder().toString());
LightningFile lightningFile = new LightningFile("lightning.ltn", getDataFolder().toString());
List <String> header = new ArrayList <String>();
header.add("This is a header");
header.add("It supports array list");
header.add("for multiple line comments.");
header.add("Only available in YAML");
json.setDefault("key1", string1);
json.setDefault("nested.key1", nest1);
json.setDefault("nested.key2", nest2);
json.setDefault("next_key", "next_value");
json.setDefault("the_answer_to_everything", ultimateAnswer);
json.setDefault("listExample", list);
yaml.setHeader(header);
yaml.write();
yaml.setDefault("key1", string1);
yaml.setDefault("nested.key1", nest1);
yaml.setDefault("nested.key2", nest2);
yaml.setDefault("next_key", "next_value");
yaml.setDefault("the_answer_to_everything", ultimateAnswer);
yaml.setDefault("listExample", list);
toml.setDefault("key1", string1);
toml.setDefault("nested.key1", nest1);
toml.setDefault("nested.key2", nest2);
toml.setDefault("next_key", "next_value");
toml.setDefault("the_answer_to_everything", ultimateAnswer);
toml.setDefault("listExample", list);
lightningFile.setDefault("key1", string1);
lightningFile.setDefault("nested.key1", nest1);
lightningFile.setDefault("nested.key2", nest2);
lightningFile.setDefault("next_key", "next_value");
lightningFile.setDefault("the_answer_to_everything", ultimateAnswer);
lightningFile.setDefault("listExample", list);
}
Resulting storage file
key1 = string
nested {
key1 = Nested Value
key2 = Another nested value
}
next_key = next_value
the_answer_to_everything = 42
listExample = [Ljava.lang.String;@25288e12
Expected behavior
Strings would be stored, not just a reference to java object.
Also tested with Json, Yaml and Toml with perfect results. I realize this is an array, not a list and is similar to #20 but not quite the same as I am using v3.1.0
Expected results achived with Json, Yaml, & Toml:
{
"key1": "string",
"listExample": [
"List item one",
"Another item",
"The last one, I promise"
],
"next_key": "next_value",
"nested": {
"key1": "Nested Value",
"key2": "Another nested value"
},
"the_answer_to_everything": 42
}
key1: string
nested:
key1: Nested Value
key2: Another nested value
next_key: next_value
the_answer_to_everything: 42
listExample:
- List item one
- Another item
- The last one, I promise
key1 = "string"
next_key = "next_value"
the_answer_to_everything = 42
listExample = ["List item one", "Another item", "The last one, I promise", ]
[nested]
key1 = "Nested Value"
key2 = "Another nested value"
Desktop (please complete the following information):
OS: Linux 5.3.0-46-generic x86_64 GNU/Linux
Browser Chrome
Version: 81.0.4044.138-1
Smartphone (please complete the following information):
OS: Android
Browser: Chrome
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered:
Describe the bug
LightningStorage file type does not store list correctly
To Reproduce
Steps to reproduce the behavior:
Method used to create files
Resulting storage file
Expected behavior
Strings would be stored, not just a reference to java object.
Also tested with Json, Yaml and Toml with perfect results. I realize this is an array, not a list and is similar to #20 but not quite the same as I am using v3.1.0
Expected results achived with Json, Yaml, & Toml:
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: