Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polishing in Asciidoctor rendering #608

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ public String renderEvents(ApplicationModule module) {
return builder.toString();
}

public String renderConfigurationProperties(ApplicationModule module, List<ModuleProperty> properties) {
public String renderConfigurationProperties(List<ModuleProperty> properties) {

if (properties.isEmpty()) {
return "none";
Expand All @@ -208,16 +208,14 @@ public String renderConfigurationProperties(ApplicationModule module, List<Modul

var defaultValue = it.defaultValue();

if (defaultValue != null && StringUtils.hasText(defaultValue)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've kept the additional, explicit checks, as only those cause the null analysis in Eclipse to realize that defaultValue is not null. Simply passing it to StringUtil.hasText(…) doesn't do the trick and the compiler would now mark the invocation of toInlineCode(…) as problematic as the method expects a non-null value.


if (StringUtils.hasText(defaultValue)) {
builder = builder.append(", default ")
.append(toInlineCode(defaultValue))
.append("");
.append(toInlineCode(defaultValue));
}

var description = it.description();

if (description != null && StringUtils.hasText(description)) {
if (StringUtils.hasText(description)) {
builder = builder.append(". ")
.append(toAsciidoctor(description));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ String toModuleCanvas(ApplicationModule module, CanvasOptions options) {

// Properties
.append(addTableRow("Properties",
asciidoctor.renderConfigurationProperties(module, properties.getModuleProperties(module)), options)) //
asciidoctor.renderConfigurationProperties(properties.getModuleProperties(module)), options)) //
.append(startOrEndTable())
.toString();
}
Expand Down
Loading