Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Improve comments
Dieser Commit ist enthalten in:
Ursprung
1e0ec8ad66
Commit
b86622b849
@ -122,17 +122,17 @@ public abstract class AnnotatedConfig {
|
|||||||
Table table = field.getAnnotation(Table.class);
|
Table table = field.getAnnotation(Table.class);
|
||||||
if (table != null) {
|
if (table != null) {
|
||||||
lines.add(table.value()); // Write [name]
|
lines.add(table.value()); // Write [name]
|
||||||
lines.addAll(dumpConfig(field.get(dumpable))); // dump fields of table
|
lines.addAll(dumpConfig(field.get(dumpable))); // Dump fields of table
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (field.getAnnotation(IsMap.class) != null) { // check if field is map
|
if (field.getAnnotation(IsMap.class) != null) { // Check if field is a map
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Map<String, ?> map = (Map<String, ?>) field.get(dumpable);
|
Map<String, ?> map = (Map<String, ?>) field.get(dumpable);
|
||||||
for (Entry<String, ?> entry : map.entrySet()) {
|
for (Entry<String, ?> entry : map.entrySet()) {
|
||||||
lines.add(entry.getKey() + " = " + serialize(entry.getValue())); // Save map data
|
lines.add(entry.getKey() + " = " + serialize(entry.getValue())); // Save map data
|
||||||
}
|
}
|
||||||
lines.add(""); //Add empty line
|
lines.add(""); // Add empty line
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ public abstract class AnnotatedConfig {
|
|||||||
|
|
||||||
// Save field to config
|
// Save field to config
|
||||||
lines.add(name + " = " + serialize(value));
|
lines.add(name + " = " + serialize(value));
|
||||||
lines.add(""); // add empty line
|
lines.add(""); // Add empty line
|
||||||
}
|
}
|
||||||
} catch (IllegalAccessException | IllegalArgumentException | SecurityException e) {
|
} catch (IllegalAccessException | IllegalArgumentException | SecurityException e) {
|
||||||
throw new RuntimeException("Could not dump configuration", e);
|
throw new RuntimeException("Could not dump configuration", e);
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren