pct icon indicating copy to clipboard operation
pct copied to clipboard

Properties marked as FINAL are excluded from ClassDocumentation, HtmlDocumentation, ABLDuck tasks

Open PeterJudgeZA opened this issue 1 year ago • 10 comments

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

PeterJudgeZA avatar Jul 14 '22 18:07 PeterJudgeZA

ABLDuck still relies on the Progress parser (ast.jar and ast-dependencies.jar). Did you upgrade those JAR files to 12.5 ?

gquerret avatar Jul 25 '22 06:07 gquerret

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.

DustinGrau-PSC avatar Jul 25 '22 13:07 DustinGrau-PSC

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.

gquerret avatar Jul 25 '22 13:07 gquerret

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 avatar Jul 25 '22 14:07 DustinGrau-PSC

@DustinGrau-PSC Right, I think the problem comes from ast.jar, not from the ABLDuck task

gquerret avatar Jul 25 '22 14:07 gquerret

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.

DustinGrau-PSC avatar Jul 25 '22 15:07 DustinGrau-PSC

Good old System.out.println here: https://github.com/Riverside-Software/pct/blob/master/src/java/eu/rssw/pct/oedoc/ClassDocumentationVisitor.java#L272

gquerret avatar Jul 25 '22 15:07 gquerret

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.

DustinGrau-PSC avatar Aug 17 '22 19:08 DustinGrau-PSC

Is the jar file available somewhere ?

gquerret avatar Aug 17 '22 20:08 gquerret

Not just yet. It's still only an internal build and going through additional testing.

DustinGrau-PSC avatar Aug 18 '22 12:08 DustinGrau-PSC

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.

DustinGrau-PSC avatar Oct 04 '22 19:10 DustinGrau-PSC