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

fix(docs): make sure that mapped properties are sorted properly #7797

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,7 @@
package io.quarkus.annotation.processor.generate_doc;

import static io.quarkus.annotation.processor.generate_doc.ConfigPhase.COMPARATOR;

import java.io.IOException;
import java.io.Writer;

Expand All @@ -19,18 +21,13 @@ public interface ConfigDocElement {
default int compare(ConfigDocElement item) {
if (isWithinAMap()) {
if (item.isWithinAMap()) {
return 0;
return COMPARATOR.compare(getConfigPhase(), item.getConfigPhase());
}
return 1;
} else if (item.isWithinAMap()) {
return -1;
}

int phaseComparison = ConfigPhase.COMPARATOR.compare(getConfigPhase(), item.getConfigPhase());
if (phaseComparison == 0) {
return 0;
}

return phaseComparison;
return COMPARATOR.compare(getConfigPhase(), item.getConfigPhase());
}
}
Expand Up @@ -41,14 +41,8 @@ public int compare(ConfigPhase firstPhase, ConfigPhase secondPhase) {
}
case BOOTSTRAP: {
switch (secondPhase) {
case BUILD_TIME:
return 1;
case BUILD_AND_RUN_TIME_FIXED:
return 1;
case BOOTSTRAP:
return 0;
case RUN_TIME:
return 1;
default:
return 1;
}
Expand Down