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

Static property reference compile error on release 209 and up #385

Closed
JvWoerkom opened this issue Nov 21, 2019 · 26 comments
Closed

Static property reference compile error on release 209 and up #385

JvWoerkom opened this issue Nov 21, 2019 · 26 comments

Comments

@JvWoerkom
Copy link

@JvWoerkom JvWoerkom commented Nov 21, 2019

Subject of the issue

Reference to a public static method using only class name and supply a using to the full class, with strict compile options require-full-names and require-field-qualifiers.

Your environment

  • win10 - 64bit
  • 11.7.5
  • 1.9.4, 1,9.8 and 1.10.7
  • PCT version 209, 210, 211 and 212

Actual behaviour

Compile error

[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] Error compiling file 'src/maia/wfl/client/wrd/wrdclientcontext.cls' ...
[PCTCompile]  ... in file 'src/maia/wfl/common/wrd/wrdabstractcontext.cls' at line 206 column 9
[PCTCompile]          childContext:tokenParent   = if parentFlow > 0
[PCTCompile] ---------^
[PCTCompile] Unknown attribute FlowParentToken used in widget:attribute phrase. (3406)
[PCTCompile] ** src\maia\wfl\common\wrd\wrdabstractcontext.cls Could not understand line 206. (196)
[PCTCompile]  ... in file 'src/maia/wfl/common/wrd/wrdabstractcontext.cls' at line 238 column 9
[PCTCompile]          return CreateFlow (Internal:SplitIdPackage(pIdApplication),
[PCTCompile] ---------^
[PCTCompile] Unknown attribute SplitIdPackage used in widget:attribute phrase. (3406)
[PCTCompile] Unknown attribute SplitIdPackage used in widget:attribute phrase. (3406)
[PCTCompile] Could not locate method 'CreateFlow' with matching signature in class 'maia.wfl.common.wrd.wrdabstractcontext'. (14457)
[PCTCompile] ** src\maia\wfl\common\wrd\wrdabstractcontext.cls Could not understand line 238. (196)
...

Expected behaviour

version 194 up to 208 + local compile in PDSOE

  • compile OK with strict compile options require-full-names and require-field-qualifiers.
  • compile error without strict compile options require-full-names and require-field-qualifiers.
    In this last case, internal is seen as a field: in tabel syncDBPensionsBase.internalEmployerId and not as a class name.

Steps to reproduce

Reference to a static method in oe code giving only the class name, with using statement pointen to full class name and have a field name in a db buffer that begins with the same name.

using maia.wfl.common.Internal.
...
class maia.wfl.common.wrd.wrdabstractcontext
.......
method private void LinkParentFlow(childContext as maia.wfl.common.wrd.wrdabstractcontext, input parentFlow as int64):
        childContext:tokenParent   = if parentFlow > 0
                                     then Internal:FlowParentToken(parentFlow)
                                     else ''.
end method.

The class Internal.cls contains:

using maia.wfl.common.intf.taskresult.
block-level on error undo, throw.

class maia.wfl.common.Internal:
...
define public static property FlowTypeParentToken as character no-undo initial 'F' get.
...       
method public static character FlowParentToken (input pSeqFlowParent as int64):
        return ParentToken (FlowTypeParentToken , string(pSeqFlowParent)).
end method.
@gquerret

This comment has been minimized.

Copy link
Contributor

@gquerret gquerret commented Nov 21, 2019

Isn't that a Progress bug (rather than a PCT bug) ?

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

PCT compile OK up to build 209.
As long as I use the strict compiler options, local compile and ant / pct compile are OK
Since higher versions: given error

@gquerret

This comment has been minimized.

Copy link
Contributor

@gquerret gquerret commented Nov 21, 2019

I will try to reproduce.

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

Renamed the field to "JvW", local compile, without the strict option now nolonger gives the error
(Expected behaviour).
Now doing a total compile thru pct - wait pls.....

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

Compile OK (build 212 with ant 10.)
now rename the field back to original name and lets see with happens

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

Renamed field in connected db tabel from JvWinternalEmployerId to internalEmployerId
no strict options: local compile in PDSOE: error
with strict options: compile OK
Re-testing PCT build (4 threads!) (with strict options)

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

error in this part of the build.xml:

        <PCTCompile destDir="build" dlcHome="${DLC}" graphicalMode="${graphMode}" iniFile="build-config/maia-${os}.ini" inputChars="32000" stackSize="1024" token="6000" noParse="${noxref}" multiCompile="true" debugListing="${dbg}" relativePaths="${relPath}" failOnError="${failOnError}">
            <OEFileSet baseDir="src" modules="maia/wfl" />
            <OEFileSet baseDir="src" modules="maia/wls" />
            <DBConnectionSet refid="dbset.ctb${localdb}" />
            <Option name="-h" value="20" />
            <Option name="-compileroptionsfile" value="build-compileroptions.txt" />
            <propath>
                <pathelement path="src" />
            </propath>
        </PCTCompile>

===================
[PCTCompile] Error compiling file 'src/maia/wfl/client/wrd/wrdclientcontext.cls' ...
[PCTCompile] ... in file 'src/maia/wfl/common/wrd/wrdabstractcontext.cls' at line 206 column 9
[PCTCompile] childContext:tokenParent = if parentFlow > 0
[PCTCompile] ---------^
[PCTCompile] Unknown attribute FlowParentToken used in widget:attribute phrase. (3406)
[PCTCompile] ** src\maia\wfl\common\wrd\wrdabstractcontext.cls Could not understand line 206. (196)
[PCTCompile] ... in file 'src/maia/wfl/common/wrd/wrdabstractcontext.cls' at line 238 column 9
[PCTCompile] return CreateFlow (Internal:SplitIdPackage(pIdApplication),
[PCTCompile] ---------^
[PCTCompile] Unknown attribute SplitIdPackage used in widget:attribute phrase. (3406)
[PCTCompile] Unknown attribute SplitIdPackage used in widget:attribute phrase. (3406)
[PCTCompile] Could not locate method 'CreateFlow' with matching signature in class 'maia.wfl.common.wrd.wrdabstractcontext'. (14457)
[PCTCompile] ** src\maia\wfl\common\wrd\wrdabstractcontext.cls Could not understand line 238. (196)
[PCTCompile] ... in file 'src/maia/wfl/common/wrd/wrdabstractcontext.cls' at line 493 column 9
[PCTCompile] this-object:idPackage = Internal:IdWflMainPackage.
[PCTCompile] ---------^

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

now compile with pct build 208 with ant 1.9.8

succes:

Buildfile: C:\OpenEdge117\Workspace\ms-main\build.xml
-init-unix:
-init-windows:
init:
build:
build.private:
[echo] Number of build threads 4
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 1021 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 2109 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 3970 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 302 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 524 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 434 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 1763 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 22 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 8 file(s) compiled
[PCTCompile] 2612 file(s) compiled
[PCTCompile] 5611 file(s) compiled
[PCTCompile] 1785 file(s) compiled
build-xcode:
[PCTXCode] PCTXCode - Progress Encryption Tool
[PCTXCode] PCTXCode - Progress Encryption Tool
BUILD SUCCESSFUL
Total time: 3 minutes 50 seconds

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

@JvWoerkom JvWoerkom changed the title Abstract class compile error on release 209 and up Abstract method reference compile error on release 209 and up Nov 21, 2019
@JvWoerkom JvWoerkom changed the title Abstract method reference compile error on release 209 and up Static method reference compile error on release 209 and up Nov 21, 2019
@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

extra test:

compile build 194 with ant 1.9.4 (in use for years)

succes AND FASTER!!!!!!!!!!!!!!!!!!!!!!

Buildfile: C:\OpenEdge117\Workspace\ms-main\build.xml
-init-unix:
-init-windows:
init:
build:
build.private:
[echo] Number of build threads 4
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 1021 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 2109 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 3970 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 302 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 434 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 524 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 1763 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 22 file(s) compiled
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] 8 file(s) compiled
[PCTCompile] 2612 file(s) compiled
[PCTCompile] 5611 file(s) compiled
[PCTCompile] 1785 file(s) compiled
build-xcode:
[PCTXCode] PCTXCode - Progress Encryption Tool
[PCTXCode] PCTXCode - Progress Encryption Tool
BUILD SUCCESSFUL
Total time: 3 minutes 22 seconds

@gquerret

This comment has been minimized.

Copy link
Contributor

@gquerret gquerret commented Nov 21, 2019

I have the same error with this small test case : https://github.com/Riverside-Software/pct/tree/bugfix/PCT-385-StaticMethod/tests/PCTCompile/test80
I've added a field InternalSomething to sports2000.customer table, and I have this error message:

test2:
    [mkdir] Created dir: C:\Users\gquer\projets\pct\testbox\PCTCompile\test80\build2
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] Error compiling file 'C:/Users/gquer/projets/pct/testbox/PCTCompile/test80/src/rssw/Class1.cls' ...
[PCTCompile]  ... in main file at line 7 column 5
[PCTCompile]      if true then Internal:StaticMethod1().
[PCTCompile] -----^
[PCTCompile] Unknown attribute StaticMethod1 used in widget:attribute phrase. (3406)
[PCTCompile] ** C:\Users\gquer\projets\pct\testbox\PCTCompile\test80\src\rssw\Class1.cls Could not understand line 7. (196)
[PCTCompile]
[PCTCompile] 1 file(s) compiled
[PCTCompile] Failed to compile  1  file(s)

Running 11.7.3 on this machine, latest PCT version. But I'm almost sure a non-pct build script (with only two compile statements) will produce the same error message.

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 21, 2019

was working on little example too: You were faster 🥇

If you add the strict options require-full-names and require-field-qualifiers, does it compile OK then for local compile OE only?

@gquerret

This comment has been minimized.

Copy link
Contributor

@gquerret gquerret commented Nov 22, 2019

Still doesn't compile, and warning message is correctly displayed:

test3:
    [mkdir] Created dir: C:\Users\gquer\Projets\pct\testbox\PCTCompile\test80\build3
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] Error compiling file 'C:/Users/gquer/Projets/pct/testbox/PCTCompile/test80/src/rssw/Class1.cls' ...
[PCTCompile]  ... in main file at line 7 column 5
[PCTCompile]      if true then Internal:StaticMethod1().
[PCTCompile] -----^
[PCTCompile] You must qualify the field "Internal" with the table name "Customer" due to the "require-field-qualifiers" compiler option. (14789)
[PCTCompile]    C:\Users\gquer\Projets\pct\testbox\PCTCompile\test80\src\rssw\Class1.cls Warning at line 7. (2411)
[PCTCompile] Unknown attribute StaticMethod1 used in widget:attribute phrase. (3406)
[PCTCompile] ** C:\Users\gquer\Projets\pct\testbox\PCTCompile\test80\src\rssw\Class1.cls Could not understand line 7. (196)
[PCTCompile]
[PCTCompile] 1 file(s) compiled
[PCTCompile] Failed to compile  1  file(s)
@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

If you add the strict options require-full-names and require-field-qualifiers, does it compile OK then for local compile OE only and fail using PCT/ANT? The original field name only begins with internal, but is not just internal. require-full-names solved that in the OE compile / pct-194 -> 208

@gquerret

This comment has been minimized.

Copy link
Contributor

@gquerret gquerret commented Nov 22, 2019

Can you use the require* attributes in PCTCompile, rather than the <Option> node ?

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

compilation failed

using: pct-208, build.xml containing

        <PCTCompile requireFieldQualifiers="true" requireFullNames="true" 
                    destDir="build" dlcHome="${DLC}" graphicalMode="${graphMode}" iniFile="build-config/maia-${os}.ini" inputChars="32000" stackSize="1024" token="6000" noParse="${noxref}" multiCompile="true" debugListing="${dbg}" relativePaths="${relPath}" failOnError="${failOnError}">
            <OEFileSet baseDir="src" modules="maia/wfl" />
            <OEFileSet baseDir="src" modules="maia/wls" />
            <DBConnectionSet refid="dbset.ctb${localdb}" />
            <Option name="-h" value="20" />
            <propath>
                <pathelement path="src" />
            </propath>
        </PCTCompile>

erors:
[PCTCompile] PCTCompile - Progress Code Compiler
[PCTCompile] Error compiling file 'src/maia/wfl/common/wrd/wrdabstractcontext.cls' ...
[PCTCompile] ... in main file at line 206 column 9
[PCTCompile] childContext:tokenParent = if parentFlow > 0
[PCTCompile] ---------^
[PCTCompile] Unknown attribute FlowParentToken used in widget:attribute phrase. (3406)
[PCTCompile] ** src\maia\wfl\common\wrd\wrdabstractcontext.cls Could not understand line 206. (196)
[PCTCompile] ... in main file at line 238 column 9
[PCTCompile] return CreateFlow (Internal:SplitIdPackage(pIdApplication),
[PCTCompile] ---------^
[PCTCompile] Unknown attribute SplitIdPackage used in widget:attribute phrase. (3406)
[PCTCompile] Unknown attribute SplitIdPackage used in widget:attribute phrase. (3406)
[PCTCompile] Could not locate method 'CreateFlow' with matching signature in class 'maia.wfl.common.wrd.wrdabstractcontext'. (14457)
[PCTCompile] ** src\maia\wfl\common\wrd\wrdabstractcontext.cls Could not understand line 238. (196)
[PCTCompile] ... in main file at line 493 column 9
[PCTCompile] this-object:idPackage = Internal:IdWflMainPackage.

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

compile NO error

using pct-208, build.xml contains

        <PCTCompile destDir="build" dlcHome="${DLC}" graphicalMode="${graphMode}" iniFile="build-config/maia-${os}.ini" inputChars="32000" stackSize="1024" token="6000" noParse="${noxref}" multiCompile="true" debugListing="${dbg}" relativePaths="${relPath}" failOnError="${failOnError}">
            <OEFileSet baseDir="src" modules="maia/wfl" />
            <OEFileSet baseDir="src" modules="maia/wls" />
            <DBConnectionSet refid="dbset.ctb${localdb}" />
            <Option name="-h" value="20" />
            <Option name="-compileroptionsfile" value="build-compileroptions.txt" />
            <propath>
                <pathelement path="src" />
            </propath>
        </PCTCompile>

build-compileroptions.txt contains:

require-full-names,
require-field-qualifiers

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

compile on save in PDSOE OK, when using strict options
Project -> properties -> Progress OpenEdge -> build -> Compile
Require full names and Require field qualifiers both selected

@gquerret

This comment has been minimized.

Copy link
Contributor

@gquerret gquerret commented Nov 22, 2019

I can't reproduce in my environment. I've pushed again some code in the same branch (bugfix/PCT-385-StaticMethod), I always have a consistent result between PCT and a Progress plain session, it always fails when require-field-qualifiers is enabled (with OE 11.7.5)
Can you reproduce the same problem in test80 of this branch ?

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

i'll try

@JvWoerkom JvWoerkom changed the title Static method reference compile error on release 209 and up Static property reference compile error on release 209 and up Nov 22, 2019
@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

problem seems property ref

local reproduce: The classes I used are:

using prgs.Internal.
class rssw.Class1:
    define public property idPackage as character no-undo get. set.
    method public void NewFlow ():
        this-object:idPackage = Internal:IdWflMainPackage.
    end method.
end class.
class prgs.Internal:
    define public static property IdWflMainPackage as character no-undo initial 'WFL' get.
end.

=====
using pct-208,

compile OK for this build.xml fragment

            <PCTCompile 
            	destDir="build" dlcHome="${DLC}" graphicalMode="${graphMode}" iniFile="build-config/maia-${os}.ini" inputChars="32000" stackSize="1024" token="6000" noParse="${noxref}" multiCompile="true" debugListing="${dbg}" relativePaths="${relPath}" failOnError="${failOnError}">
                <OEFileSet baseDir="src" modules="prgs" />
                <OEFileSet baseDir="src" modules="rssw" />
                <DBConnectionSet refid="dbset.ctb${localdb}" />
                <Option name="-h" value="20" />
                <Option name="-compileroptionsfile" value="build-compileroptions.txt" />
                <propath>
                    <pathelement path="src" />
                </propath>
            </PCTCompile>

compile error using

            <PCTCompile 
                requireFieldQualifiers="true" requireFullNames="true" 
            	destDir="build" dlcHome="${DLC}" graphicalMode="${graphMode}" iniFile="build-config/maia-${os}.ini" inputChars="32000" stackSize="1024" token="6000" noParse="${noxref}" multiCompile="true" debugListing="${dbg}" relativePaths="${relPath}" failOnError="${failOnError}">
                <OEFileSet baseDir="src" modules="prgs" />
                <OEFileSet baseDir="src" modules="rssw" />
                <DBConnectionSet refid="dbset.ctb${localdb}" />
                <Option name="-h" value="20" />
                <!-- 
                <Option name="-compileroptionsfile" value="build-compileroptions.txt" />
                 -->
                <propath>
                    <pathelement path="src" />
                </propath>
            </PCTCompile>
@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

need option "require-full-names

compile-ok with:

COMPILE "prgs/Internal.cls" SAVE INTO "C:\OpenEdge117\Workspace\ms-main\build4" OPTIONS "require-full-names,require-field-qualifiers".
MESSAGE SUBSTITUTE("Error &1 - Num messages &2 - Warnings &3", COMPILER:ERROR, COMPILER:NUM-MESSAGES, COMPILER:WARNING).
COMPILE "rssw/Class1.cls" SAVE INTO "C:\OpenEdge117\Workspace\ms-main\build4" OPTIONS "require-full-names,require-field-qualifiers".
MESSAGE SUBSTITUTE("Error &1 - Num messages &2 - Warnings &3", COMPILER:ERROR, COMPILER:NUM-MESSAGES, COMPILER:WARNING).

RETURN '0'.

====

compile error with

COMPILE "prgs/Internal.cls" SAVE INTO "C:\OpenEdge117\Workspace\ms-main\build4" OPTIONS "require-field-qualifiers".
MESSAGE SUBSTITUTE("Error &1 - Num messages &2 - Warnings &3", COMPILER:ERROR, COMPILER:NUM-MESSAGES, COMPILER:WARNING).
COMPILE "rssw/Class1.cls" SAVE INTO "C:\OpenEdge117\Workspace\ms-main\build4" OPTIONS "require-field-qualifiers".
MESSAGE SUBSTITUTE("Error &1 - Num messages &2 - Warnings &3", COMPILER:ERROR, COMPILER:NUM-MESSAGES, COMPILER:WARNING).

RETURN '0'.
@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

with 208
not ok: requireFieldQualifiers="true" requireFullNames="true"
but ok with :

compile statement works OK with : OPTIONS "require-full-names,require-field-qualifiers".

seems a problem with setting the strict options for the compile

209 and up seem to ignore the : Option name="-compileroptionsfile" value="build-compileroptions.txt"

or override is value in the compiler:options

@gquerret

This comment has been minimized.

Copy link
Contributor

@gquerret gquerret commented Nov 22, 2019

209 and up seem to ignore the : Option name="-compileroptionsfile" value="build-compileroptions.txt"
or override is value in the compiler:options

I confirm that's right. Since PCT 209, the COMPILE statement always has OPTIONS ipOptions, and the value is passed based on the require* fields of the Ant task. This means -compileroptionsfile is not used (and even discarded).

@JvWoerkom

This comment has been minimized.

Copy link
Author

@JvWoerkom JvWoerkom commented Nov 22, 2019

But why does the build fail using the require* attr.?
the compile statement with correct strict option seems to work, as does the -compileroption files in 208. The require* attributes do not work. Can you explain that?

@gquerret

This comment has been minimized.

Copy link
Contributor

@gquerret gquerret commented Nov 23, 2019

But why does the build fail using the require* attr.?

That's something for PSTS. But there are other bugs related to require*, so I'm not really surprised.
Apart from -compileroptions which is discarded, the attributes work as expected (or re-open the issue with a test case based on test80).

@gquerret gquerret closed this Nov 23, 2019
gquerret added a commit that referenced this issue Feb 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.