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
Reported by Wector11211: if a comment is set on a bean that's used in a MapProperty, the comment is repeated even if it's defined to be unique:
publicclassServerSettingHolderimplementsSettingsHolder {
publicstaticfinalProperty<Map<String, ServerCollection>> SERVERS =
newMapProperty<>("",
Map.of("foo", newServerCollection(), "bar", newServerCollection()),
BeanPropertyType.of(ServerCollection.class));
}
publicclassServerCollection {
@Comment("Comment that is present on all instances")
privateList<String> servers = newArrayList<>();
publicList<String> getServers() {
returnservers;
}
publicvoidsetServers(List<String> servers) {
this.servers = servers;
}
}
Problem
The mapper keeps a set of unique comments it's already used. The problem is when a bean type is used multiple times within the same property, it goes beyond the boundaries of the bean type. This not only affects MapProperty but any other collection properties where a bean property is used as type.
Solving this is a little tricky—I don't want to keep any global state, but there needs to be some mechanism to pass in a bit more state across multiple #toExportValue calls...
The text was updated successfully, but these errors were encountered:
ljacqu
changed the title
Comment on default value is repeated if it's not in a map
Unique comments repeated in MapProperty, ListProperty, ...
Aug 27, 2023
Reported by Wector11211: if a comment is set on a bean that's used in a MapProperty, the comment is repeated even if it's defined to be unique:
Problem
The mapper keeps a set of unique comments it's already used. The problem is when a bean type is used multiple times within the same property, it goes beyond the boundaries of the bean type. This not only affects
MapProperty
but any other collection properties where a bean property is used as type.Solving this is a little tricky—I don't want to keep any global state, but there needs to be some mechanism to pass in a bit more state across multiple #toExportValue calls...
The text was updated successfully, but these errors were encountered: