COMPILE XREF: Missing Private Methods

KMoody

Member
We have thousands of programs, and I'm trying to analyze how they interact and what data they affect. I've tried to analyze our classes using COMPILE XREF, and I noticed that private methods don't show up in the XREF file.

Example:
testing_util.cls:
Code:
USING Progress.Lang.*.

BLOCK-LEVEL ON ERROR UNDO, THROW.

CLASS testing_util:

    METHOD PRIVATE VOID myPrivateMethod(  ):
        
        RETURN.

    END METHOD.

    METHOD PUBLIC VOID myPublicMethod(  ):
        
        RETURN.

    END METHOD.

END CLASS.


COMPILE VALUE("testing_util.cls") XREF VALUE("c:\protemp\x.txt").

Output x.txt:

Code:
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 1 COMPILE [xxxxx]testing_util.cls
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 1 CPINTERNAL ISO8859-1
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 1 CPSTREAM ISO8859-1
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 3 BLOCK-LEVEL ON ERROR UNDO, THROW
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 5 CLASS testing_util,,,,,,
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 5 STRING "testing_util" 12 NONE UNTRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 11 STRING "MYPRIVATEMETHOD" 15 NONE UNTRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 17 METHOD PUBLIC,,,,,myPublicMethod,void,
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 17 STRING "MYPUBLICMETHOD" 14 NONE UNTRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 19 CONSTRUCTOR PUBLIC,,,,testing_util,void,
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 19 STRING "TESTING_UTIL" 12 NONE UNTRANSLATABLE

"myPublicMethod" shows up in the xref file (METHOD PUBLIC,,,,,myPublicMethod,void,), but myPrivateMethod does not.

Is this expected behavior?
 
I guess cross-referencing something private makes no sense, since nothing else can use it.

The compile statement docs state which types of method are shown in the xref:

{PUBLIC|PACKAGE-PROTECTED|PROTECTED|PACKAGE-PRIVATE}

No private.
 
I guess that makes sense, but it would be nice to see how methods within the same class reference each other.

For instance:

testing_util.cls:
Code:
USING Progress.Lang.*.

BLOCK-LEVEL ON ERROR UNDO, THROW.

CLASS testing_util:

    METHOD PRIVATE VOID myPrivateMethod(  ):
       
        CREATE ITEM.
        ITEM.PART-NUM = "TEST".
       
        RETURN.

    END METHOD.

    METHOD PUBLIC VOID myPublicMethod(  ):
       
        myPrivateMethod().

    END METHOD.

END CLASS.
xref:
Code:
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 1 COMPILE testing_util.cls
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 1 CPINTERNAL ISO8859-1
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 1 CPSTREAM ISO8859-1
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 3 BLOCK-LEVEL ON ERROR UNDO, THROW
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 5 CLASS testing_util,,,,,,
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 5 STRING "testing_util" 12 NONE UNTRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 9 STRING "ITEM" 4 NONE UNTRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 9 CREATE mffg1.ITEM
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 10 ACCESS mffg1.ITEM PART-NUM
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 10 STRING "TEST" 4 NONE TRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 10 UPDATE mffg1.ITEM PART-NUM
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 14 STRING "MYPRIVATEMETHOD" 15 NONE UNTRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 20 METHOD PUBLIC,,,,,myPublicMethod,void,
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 20 STRING "MYPUBLICMETHOD" 14 NONE UNTRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 22 CONSTRUCTOR PUBLIC,,,,testing_util,void,
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 22 STRING "TESTING_UTIL" 12 NONE UNTRANSLATABLE
[xxxxx]testing_util.cls [xxxxx]testing_util.cls 18 INVOKE testing_util:myPrivateMethod

What if I wanted to know what data myPublicMethod alters? The XREF shows that it invokes "myPrivateMethod," but it doesn't show where myPrivateMethod begins and ends or what it does.

Is there some other way of analyzing this situation (besides writing my own interpreter/compiler)?
 
Back
Top