This repository was archived by the owner on Feb 26, 2023. It is now read-only.

Description
AA version: 3.2
The documentation of @DefaultStringSet states that an empty Set of Strings is returned on default. The generated code on the other hand returns null by default.
Example:
Base interface:
@SharedPref(SharedPref.Scope.UNIQUE)
public interface PrefsClass {
/* Documentation of @DefaultStringSet states:
* "Use on methods in SharedPref annotated class.
* The generated method will return an empty java.util.Set of Strings by default."
*/
@DefaultStringSet
public Set<String> stringSetPref();
}
Generated code:
public final class PrefsClass_ extends SharedPreferencesHelper{
// ...
public StringSetPrefField stringSetPref() {
// returns null instead of empty Set
return stringSetField("stringSetPref", null);
}
}
Expected code:
public final class PrefsClass_ extends SharedPreferencesHelper{
// ...
public StringSetPrefField stringSetPref() {
// returns a new empty set (not necessarily HashSet)
return stringSetField("stringSetPref", new HashSet<String>());
}
}