pct
pct copied to clipboard
Properties marked as FINAL are excluded from ClassDocumentation, HtmlDocumentation, ABLDuck tasks
Describe the bug Since OE 12.5 it has been possible to mark OOABL properties as FINAL (to prevent them being overridden).
When generating API documentation, using the ClassDocumentation task or the ABLDuck task, such properties are not seen in the output (.xml or .js/html).
To Reproduce Take the String class from https://github.com/progress/ADE/blob/release-12.5.x/corelib/OpenEdge/Core/String.cls, and add a FINAL modifier to the Value and/or Size properties.
Generate documentation using either ClassDocumentation or ABLDuck. Looking at the XML generated, only the "Encoding" property from that class appears. Previously, the Size, Value and Encoding properties appeared.
This can be seen with other properties marked as FINAL.
Expected behavior The properties should appear in the output.
Environment
- PCT 221
- OE 12.6
- Apache Ant(TM) version 1.10.6 compiled on May 2 2019
- Detected Java version: 17 in: C:\Program Files\Eclipse Adoptium\jdk-17.0.2.8-hotspot
ABLDuck still relies on the Progress parser (ast.jar and ast-dependencies.jar). Did you upgrade those JAR files to 12.5 ?
Yes, in a sense. This doc is being generated in an environment which is utilizing the 12.6.0 versions of those jar files. The "standard" documentation process runs to completion successfully, it just simply omits the properties that were marked with the FINAL keyword.
I've done a quick test with the latest version of the JAR files, and I confirm that I can reproduce the problem. The property is in fact not available in the resulting com.openedge.pdt.core.ast.model.ICompilationUnit
object, so I think the problem comes from ast.jar.
I have the same result if I try to define a property with an unknown keyword:
define public xxx property BaseKey as logical no-undo get. private set.
Glad to hear there's some replication of the issue. If I read the description correctly, the entire property is not being returned in the object from ICompilationUnit, hence why the property is nonexistent in the resulting documentation?
@DustinGrau-PSC Right, I think the problem comes from ast.jar, not from the ABLDuck task
Makes sense. Is there a way to enable logging so that this resulting object (or lack thereof) can be seen? I'm not sure how you had debugged to that level to see the omission.
Good old System.out.println here: https://github.com/Riverside-Software/pct/blob/master/src/java/eu/rssw/pct/oedoc/ClassDocumentationVisitor.java#L272
I have confirmation that the AST code has been updated, adding the FINAL keyword to the grammar for the Property definition. Based on my local tests it appears to resolve the issue as expected. This should most likely be present in the forthcoming 12.6 release.
Is the jar file available somewhere ?
Not just yet. It's still only an internal build and going through additional testing.
Sorry for the delay, I had meant to respond that the new version of the jar is available in the 12.6 which was just released. As you suggested, the AST was the culprit. If you care to test first or simply close out this issue, this is now resolved.