Issue #17310: Added new Notes Macro#17311
Conversation
| /** | ||
| * Assigns values to each instance variable. | ||
| * | ||
| * @param moduleName name of module. | ||
| * @return set of property names. | ||
| * @throws MacroExecutionException if the module could not be retrieved. | ||
| */ | ||
| private static Set<String> getPropertyNames(String moduleName) | ||
| throws MacroExecutionException { | ||
| final Object instance = SiteUtil.getModuleInstance(moduleName); | ||
| final Class<?> clss = instance.getClass(); | ||
|
|
||
| return SiteUtil.getPropertiesForDocumentation(clss, instance); | ||
| } |
There was a problem hiding this comment.
There was a problem hiding this comment.
moving to common should be delayed.
We will do unification with JavadocMetadataScraper, and reduction of doing the same, only after macroses fully cover our code base, and functionally we will be satisfied.
There will be a lot of surprises as move forward with migrations, so this implementation might change.
There was a problem hiding this comment.
@SteLeo1602 , please create issue to move all potentially same methods to some common utility class to reuse between macroses.
|
@SteLeo1602 , please rebase. macros is breathing , but polishing is required. |
fa37ce7 to
a1d0bca
Compare
|
GitHub, generate website |
7354a09 to
3db3e20
Compare
| if (NotesMacro.getNotesStartIndex(moduleJavadoc) > -1) { | ||
| descriptionEndIndex += NotesMacro.getNotesStartIndex(moduleJavadoc); | ||
| } |
There was a problem hiding this comment.
This is not a good way to use common methods. We shouldn't use method directly from other Macro. Instead we should have a common class for all Macros to use the util methods v
There was a problem hiding this comment.
Done, the common util development is in progress in #17377
There was a problem hiding this comment.
I can still see it's usage. For now just copy paste the common methods in macros. We'll move them toa common place as part of the issue you linked.
romani
left a comment
There was a problem hiding this comment.
Lets merge this, we can improve in followup PRs.
There two PRs already open that are based on this PR
| /** | ||
| * Gets the start index of the Notes section. | ||
| * | ||
| * @param moduleJavadoc javadoc of module. | ||
| * @return start index. | ||
| */ | ||
| public static int getNotesStartIndex(DetailNode moduleJavadoc) { |
There was a problem hiding this comment.
Why do we have this method inside description macro?
There was a problem hiding this comment.
To check if there is Notes section in module's javadoc
There was a problem hiding this comment.
There was a problem hiding this comment.
You have used NotesMacro's static method.
There was a problem hiding this comment.
It will be the util's soon
There was a problem hiding this comment.
Please follow this:#17311 (comment)
Do not use NotesMacro inside Description Macro. You have copy pasted the method in the Macro, just use it instead of using NotesMacro's public static method
Issue: #17310