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
{{ message }}
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Feb 26, 2023. It is now read-only.
JavaDoc for string prefence fields with empty default value seems incomplete #1877
The following example shows what javadocs are generated. The empty default strings lead to a javadoc that seems incomplete when viewed with Android Studio.
@SharedPref
public interface PreferencesInterface {
// also works with @DefaultString("")
// will generate "<p><b>Defaults to</b>: </p>"
String stringField();
// will generate "<p><b>Defaults to</b>: not empty</p>"
@DefaultString("not empty")
String anotherStringField();
}
Suggestions
One possibility would be to include back-ticks in the generated javadoc. This seems to me like a clean solution; I have seen this in ruby docs but not yet in the "java world".
for empty strings:
<p><b>Defaults to</b>: ``</p>
for @DefaultString("non-empty")
<p><b>Defaults to</b>: `non-empty`</p>
for an int field as non-String example
<p><b>Defaults to</b>: `0`</p>
Another possibility would be to handle strings so that docs like <p><b>Defaults to</b>: ""</p> or <p><b>Defaults to</b>: "not empty"</p> are generated.
Pull Request submitted as #1878. If the back-tick solution is not as clean as I thought, feel free to close the PR and let me know the preferred solution.
Issue
The javadoc for
@SharedPrefs is generated in SharedPrefHolder like so:The following example shows what javadocs are generated. The empty default strings lead to a javadoc that seems incomplete when viewed with Android Studio.
Suggestions
One possibility would be to include back-ticks in the generated javadoc. This seems to me like a clean solution; I have seen this in ruby docs but not yet in the "java world".
This would generate javadocs like the following:
Another possibility would be to handle strings so that docs like
<p><b>Defaults to</b>: ""</p>or<p><b>Defaults to</b>: "not empty"</p>are generated.