Project

General

Profile

Feature #9488

implement all built-in OO classes using the open source ADE code from 12.8.4

Added by Greg Shah over 1 year ago. Updated 2 months ago.

Status:
WIP
Priority:
Normal
Target version:
-
Start date:
Due date:
% Done:

50%

billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
production:
No
env_name:
topics:

cvt_20250221_9488a15716.log Magnifier (45.6 KB) Ioana-Cristina Prioteasa, 02/21/2025 04:06 AM

cvt_20250221_111047.log Magnifier (44.9 KB) Ioana-Cristina Prioteasa, 02/21/2025 04:30 AM

cvt_20250224_122630.log Magnifier - 9488a rev.15722 ADE conversion log (505 KB) Ioana-Cristina Prioteasa, 02/24/2025 06:47 AM

List.cls (20.8 KB) Ioana-Cristina Prioteasa, 03/05/2025 09:25 AM

cvt_20250305_161713.log Magnifier (79.3 KB) Ioana-Cristina Prioteasa, 03/05/2025 09:25 AM

build_20250310_150200.log Magnifier (28.2 KB) Ioana-Cristina Prioteasa, 03/10/2025 09:03 AM

cvt_20250310_150200.log Magnifier (155 KB) Ioana-Cristina Prioteasa, 03/10/2025 09:03 AM

ByteBucket.cls.ast (1.24 MB) Ioana-Cristina Prioteasa, 03/10/2025 09:33 AM

Cls.cls.ast (62.5 KB) Ioana-Cristina Prioteasa, 03/17/2025 06:15 AM

Cls.cls.ast - before post-parse-fixups (19.8 KB) Ioana-Cristina Prioteasa, 03/17/2025 06:32 AM

cvt_20250320_105831.log Magnifier (137 KB) Ioana-Cristina Prioteasa, 03/21/2025 07:58 AM

build_20250320_105831.log Magnifier (22.4 KB) Ioana-Cristina Prioteasa, 03/21/2025 07:58 AM

cvt_20250923_174406.log Magnifier (275 KB) Andrei Plugaru, 09/23/2025 10:45 AM

IStringKeyedMap2.cls (81 Bytes) Andrei Plugaru, 09/29/2025 06:17 AM

IMap2.cls (46 Bytes) Andrei Plugaru, 09/29/2025 06:17 AM

MapEntry2.cls (148 Bytes) Andrei Plugaru, 09/29/2025 06:17 AM

StringKeyedMap2.cls (271 Bytes) Andrei Plugaru, 09/29/2025 06:17 AM

file-cvt-list.txt Magnifier (3.15 KB) Andrei Plugaru, 10/01/2025 04:57 AM

build_20251002_110916.log Magnifier (6.84 KB) Andrei Plugaru, 10/02/2025 04:10 AM

file-cvt-list.txt Magnifier (3.4 KB) Andrei Plugaru, 10/06/2025 06:56 AM

Array.cls (3.84 KB) Andrei Plugaru, 01/19/2026 07:46 AM

Array_skeleton.patch Magnifier (2.53 KB) Andrei Plugaru, 01/29/2026 09:57 AM

9488_skeleton.patch Magnifier (16.7 KB) Andrei Plugaru, 01/30/2026 11:01 AM

9488_skeleton_final.patch Magnifier (16.6 KB) Andrei Plugaru, 02/04/2026 07:18 AM


Related issues

Related to Base Language - Feature #6410: implement additional built-in OO classes/interfaces Review
Related to Base Language - Feature #9436: add built-in OO classes WIP
Related to Base Language - Feature #9767: Support the new VAR statement introduced in Progress 12.x WIP
Related to Base Language - Feature #9868: Support generics introduced in Progress 12.x New
Related to Base Language - Bug #9923: extent argument type vs parameter type compatibility New
Related to Base Language - Feature #9955: Implement ClientPrincipal:TENANT-ID and ClientPrincipal:TENANT-NAME Test
Related to Base Language - Bug #10522: Bring changes from 7156e/15727 to trunk New

History

#1 Updated by Greg Shah over 1 year ago

  • Related to Feature #6410: implement additional built-in OO classes/interfaces added

#2 Updated by Greg Shah over 1 year ago

  • Assignee set to Marian Edu

As of 12.7.0, PSC has licensed all of its ADE code under the Apache 2.0 license (see https://github.com/progress/ADE/blob/v12.7.0.0/LICENSE).

There is also this https://github.com/progress/ADE/blob/v12.7.0.0/Notice.txt:

Copyright 2023 Progress Software Corporation

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License (*).
(*) - Notwithstanding any restriction in the License regarding redistribution, You may (but You are not required to) license modifications to Licensor. Modifications licensed by You to Licensor, if any, shall be under the same terms and conditions of this License.

With this change (which is still in force as of 12.8.4), it is safe to convert this code and include it directly into FWD. When we do this, we will have to maintain the notice.txt and we will add extra licensing info into each file. I will provide that text.

More importantly, we will pick up all of the built-in OO classes from 12.8.4 and move them into FWD. To make this work, we will have to implement anything missing in progress.lang.* since those are not written in 4GL code but instead are implemented in OE itself (C code).

Marian: Please evaluate what needs to be written in progress.lang.* and document that work here.
Constantin: Please evaluate the gaps that need to be resolved to convert all the OO built-in classes in the ADE project and document that work here.

#3 Updated by Greg Shah over 1 year ago

#4 Updated by Constantin Asofiei over 1 year ago

Greg Shah wrote:

Constantin: Please evaluate the gaps that need to be resolved to convert all the OO built-in classes in the ADE project and document that work here.

I assume you refer to parse and run reports on it. I'll work on creating a separate project and parse these.

BTW, there are some ~6000 files in this project. I propose to create a separate project, outside of the main FWD runtime, and include this as a separate jar. FWD will remain with only progress.lang parts and whatever else we need to 'hand write' maybe.

#5 Updated by Greg Shah over 1 year ago

There are less than 450 classes in src/corelib/ and src/netlib/. Isn't that all we're worried about? I don't think the src/businesscomponents/ is used much but could be wrong.

Anyway, we just care about the OO built-ins. I was expecting them to be part of FWD itself.

#6 Updated by Constantin Asofiei over 1 year ago

Greg Shah wrote:

There are less than 450 classes in src/corelib/ and src/netlib/. Isn't that all we're worried about? I don't think the src/businesscomponents/ is used much but could be wrong.

Anyway, we just care about the OO built-ins. I was expecting them to be part of FWD itself.

Ah, then makes sense, sorry for misunderstanding.

#7 Updated by Greg Shah over 1 year ago

To make this work, we will have to implement anything missing in progress.lang.* since those are not written in 4GL code but instead are implemented in OE itself (C code).

It is more than just progress.lang.*, I think we will need to also implement:

  • progress.applicationserver.*
  • progress.io.*
  • progress.json.*
  • progress.reflect.*
  • progress.util.*
  • progress.web.*

I'm not as sure if we need these:

  • progress.data.* (seems .NET related)
  • progress.database.*
  • progress.security.*
  • progress.windows.* (.NET related)
  • system.exception (.NET related)

#8 Updated by Constantin Asofiei over 1 year ago

I've started parsing the ADE .cls files - there are usages like this:
  • generic usage
    constructor private List (input pBackingList as Progress.Collections.IList<Object>):
    
    method public List<String> GetQueryValueList (input pcName as character):
    
    return (new List<String>()). // At least return an empty List.
    
  • var defined without 'def var'
    var serializable private Progress.Collections.IList<Object> mBackingList.
    
  • tenant-name(<dbname>) and tenant-id(<dbname>) handle methods
  • final prop definition:
        define final override public property Request as IHttpRequest no-undo
            get():
                return NewRequest().
            end get.
    
  • syntax like this - is this 'null protection':
    if not valid-object(pData?:ReturnValue?:OutputElement[loop]?:ElementType) then next RETURNLOOP.
    

We need these skeletons:

Cannot find class/interface Progress.Collections.HashMap in PROPATH.
Cannot find class/interface Progress.Collections.IComparable in PROPATH.
Cannot find class/interface Progress.Collections.IEqualityComparer in PROPATH.
Cannot find class/interface Progress.Collections.IHashable in PROPATH.
Cannot find class/interface Progress.Collections.IIterator in PROPATH.
Cannot find class/interface Progress.Collections.IList in PROPATH.
Cannot find class/interface Progress.Collections.ISet in PROPATH.
Cannot find class/interface Progress.Collections.KeyValuePair in PROPATH.
Cannot find class/interface Progress.Collections.List in PROPATH.
Cannot find class/interface Progress.Collections.SortedSet in PROPATH.
Cannot find class/interface Progress.IO.JsonSerializer in PROPATH.
Cannot find class/interface Progress.IO.MemoryInputStream in PROPATH.
Cannot find class/interface Progress.IO.MemoryOutputStream in PROPATH.
Cannot find class/interface Progress.Lang.Stop in PROPATH.
Cannot find class/interface Progress.Lang.StopAfter in PROPATH.
Cannot find class/interface Progress.Lang.UserInterrupt in PROPATH.
Cannot find class/interface Progress.OpenTelemetry.SpanContext in PROPATH.
Cannot find class/interface Progress.Web.AbstractWebRouter in PROPATH.

There may be more issues after these are fixed.

These are only for the corelib and netlib folders from the ADE project. The skeleton/oo4gl/OpenEdge/ was removed for this test.

#9 Updated by Constantin Asofiei over 1 year ago

I've ran the reports on the current parsed .cls files; these are some notes:
  • unsupported handle attributes: ROLES
  • unsupported methods: get-cgi-value
  • OO skeletons:
    Progress.Lang.Object.getclass()
    Progress.Lang.Object.tostring()
    Progress.Lang.Object.equals(KW_INPUT object<? extends progress.lang.object>)
    Progress.Lang.Class.isa(KW_INPUT object<? extends progress.lang.class>)
    Progress.Lang.Class.getclass(KW_INPUT character)
    Progress.Lang.Class.isinterface()
    Progress.Lang.Class.isabstract()
    Progress.Lang.Class.isfinal()
    Progress.Lang.Class.isserializable()
    Progress.Lang.Class.new()
    Progress.Lang.Object.clone()
    Progress.Lang.Class.new(KW_INPUT object<? extends progress.lang.parameterlist>)
    Progress.Lang.Class.invoke(KW_INPUT character, KW_INPUT object<? extends progress.lang.parameterlist>)
    Progress.Lang.Class.getpropertyvalue(KW_INPUT object<? extends progress.lang.object>, KW_INPUT character)
    Progress.Lang.Class.invoke(KW_INPUT object<? extends progress.lang.object>, KW_INPUT character, KW_INPUT object<? extends progress.lang.parameterlist>)
    Progress.Lang.Error.getmessage(KW_INPUT integer)
    Progress.Lang.Error.getmessagenum(KW_INPUT integer)
    Progress.Lang.Class.getproperty(KW_INPUT character)
    Progress.Reflect.Variable.set(KW_INPUT object<? extends progress.lang.object>, KW_INPUT Object)
    Progress.Lang.Class.getconstructor(KW_INPUT object<? extends progress.lang.parameterlist>)
    
    progress.lang.object
    progress.lang.class
    progress.lang.error
    progress.lang.enum
    progress.lang.stop
    progress.reflect.property
    progress.lang.oerequestinfo
    progress.reflect.constructor
    
    
  • serialization, use-widget-pool, final, abstract classes
  • undo, throw ; on ... undo, throw
  • put stream-handle - but this already works.
  • web stream

Please let me know if you want to upload the ADE project I used.

#10 Updated by Greg Shah over 1 year ago

Please let me know if you want to upload the ADE project I used.

Yes, we should have it located in ~/secure/code/p2j_repo/ade/.

#11 Updated by Constantin Asofiei over 1 year ago

OK, is there. I've included the abl/ADE checkout, but couldn't include the .git folder, too. The commit message is:

Initial version. Contains setup for parsing and running reports of ADE release 12.8.4 from Sep. 9 2024 (hash 2e350f0a48a6468b0a89254a1e21c0a98d6b2604).

To use:
  • setup p2j/ and skeleton/
  • remove skeleton/oo4gl/OpenEdge
  • run ant clean convert.front.list rpt-no-front

#12 Updated by Constantin Asofiei over 1 year ago

Please checkout again the project fully, there was some references from the source project I used to build it, which I didn't clean up properly, and I've commited rev 1 again.

#13 Updated by Constantin Asofiei over 1 year ago

I've tried parsing the web-disp.p program from ADE and this has hard-coded include-file references like src/web/method/webutils.i - I had to rename the abl/ADE folder to abl/src and adjust p2j.cfg.xml and file-cvt-list.txt accordingly.

The .cls files don't show any include file issue. Should I commit this change? We will need to create a profile/conversion list of files to be converted for webspeed, and that may show other issues (like propath).

#14 Updated by Greg Shah over 1 year ago

Constantin Asofiei wrote:

I've tried parsing the web-disp.p program from ADE and this has hard-coded include-file references like src/web/method/webutils.i - I had to rename the abl/ADE folder to abl/src and adjust p2j.cfg.xml and file-cvt-list.txt accordingly.

Yes, these references are deep inside the 4GL code. I don't know why PSC messed with the structure of the zip in this version.

If you saw my recent wiki page using this zip, it had these instructions:

unzip ~/shared/projects/posse/ade_tools_apache_license_12_8_4.zip -d abl/ade/
mv abl/ade/ADE-release-12.8.x/ abl/ade/src/

The .cls files don't show any include file issue. Should I commit this change? We will need to create a profile/conversion list of files to be converted for webspeed, and that may show other issues (like propath).

Yes, we should build the proper unzip/rename into the bzr repo.

#15 Updated by Greg Shah over 1 year ago

We should separate the ADE source out into its own repo (as is being discussed in #9516).

Why? Because:

  • We will be using it in many projects even though some of the code is included in FWD.
  • We will potentially need to process later versions of the ADE code (12.8.5? 12.8.6?).

#16 Updated by Constantin Asofiei over 1 year ago

Greg Shah wrote:

We should separate the ADE source out into its own repo (as is being discussed in #9516).

Hm... thanks, I understand now, we need a new project.

Please point me to the wiki page, I can't find it.

#17 Updated by Constantin Asofiei over 1 year ago

Constantin Asofiei wrote:

Please point me to the wiki page, I can't find it.

Nevermind, found it.

#18 Updated by Constantin Asofiei over 1 year ago

Marian, please let me know if you started any work on this.

#19 Updated by Marian Edu over 1 year ago

Constantin Asofiei wrote:

Marian, please let me know if you started any work on this.

Constantin, sorry I didn't even saw this one was assigned to me so no didn't started anything on it... I was under the impression you started to work on it converting all ADE code and ran some code analysis on it.

Normally we can try to convert and see how the converted code works agains existing test cases, problem is the test cases were written against 12.2(.0) version not 12.8(.4) and things surely have changed even if only slightly. The only thing I could think from the top of my head that it makes sense to keep - maybe just as an alternative solution - is the Apache based HttpClient instead of using the socket based ADE implementation.

What we can do is to run all OO tests we have against 12.8.4 ADE, adapt those as necessary and then attempt the conversion and see what needs to be done on the FWD side - some stuff we had will simply have to move in the 'Progress' package, like collections that will still need to be wrappers on top of corresponding Java implementation.

#20 Updated by Constantin Asofiei over 1 year ago

Marian Edu wrote:

What we can do is to run all OO tests we have against 12.8.4 ADE, adapt those as necessary

Please run the existing unit tests in OE, with 12.8.4 ADE and first lets document any differences.

and then attempt the conversion and see what needs to be done on the FWD side

We'll work on the ADE conversion part.

- some stuff we had will simply have to move in the 'Progress' package

We may need help with the 'Progress' package, I'll let you know.

#21 Updated by Constantin Asofiei over 1 year ago

  • Assignee changed from Marian Edu to Ioana-Cristina Prioteasa

#22 Updated by Constantin Asofiei over 1 year ago

This is a comment I meant to post yesterday:


For the ADE support, first we need to focus on these classes:

abl/src/corelib/OpenEdge/Core/Assert.cls
abl/src/corelib/OpenEdge/Core/ByteBucket.cls
abl/src/corelib/OpenEdge/Core/Collections/Collection.cls
abl/src/corelib/OpenEdge/Core/Collections/ICollection.cls
abl/src/corelib/OpenEdge/Core/Collections/IIterable.cls
abl/src/corelib/OpenEdge/Core/Collections/IIterator.cls
abl/src/corelib/OpenEdge/Core/Collections/IList.cls
abl/src/corelib/OpenEdge/Core/Collections/IListIterator.cls
abl/src/corelib/OpenEdge/Core/Collections/ISet.cls
abl/src/corelib/OpenEdge/Core/Collections/Iterator.cls
abl/src/corelib/OpenEdge/Core/Collections/List.cls
abl/src/corelib/OpenEdge/Core/Collections/ListIterator.cls
abl/src/corelib/OpenEdge/Core/Collections/Map.cls
abl/src/corelib/OpenEdge/Core/Collections/ObjectStack.cls
abl/src/corelib/OpenEdge/Core/Integer.cls
abl/src/corelib/OpenEdge/Core/IOModeEnum.cls
abl/src/corelib/OpenEdge/Core/Memptr.cls
abl/src/corelib/OpenEdge/Core/String.cls
abl/src/corelib/OpenEdge/Core/System/ApplicationError.cls
abl/src/corelib/OpenEdge/Core/System/InvalidValueSpecifiedError.cls
abl/src/corelib/OpenEdge/Core/System/NotFoundError.cls
abl/src/corelib/OpenEdge/Core/System/UnsupportedOperationError.cls
abl/src/corelib/OpenEdge/Core/TimeStamp.cls
abl/src/corelib/OpenEdge/Logging/LogEvent.cls
abl/src/corelib/OpenEdge/Logging/LogMessage.cls

Parsing shows problems as noted in #9488-9. From the list of the above classes, please start with the ones which do not yet exist in p2j.oo (and all their dependencies), and also see the #9436-7 for the support. From the front phase, there are lots of dependencies, please determine the full set which needs to be converted.

Attached are the converted skeletons (not ADE code) for the above and #9436 ones (I'm using this to go through parsing issues for the #9457 app). The FWD changes I used to generate these and the configured ADE project to convert the same files from ADE is on devsrv01:/tmp/ade_project.zip. This includes a p2j/ project of 9198a branch with changes which may or may not end up in trunk. For now, there is no branch for these changes. Please use a trunk branch to work on parsing/conversion issues, and included the p2j/ changes from ade_project.zip as necessary.

Also, if you encounter non-ADE builtin 4GL classes (which appear or not in skeleton/ - look for Builtin class ... is not implemented in FWD! in the parse log) please post here and we'll decide if they are needed or not for the first phase.


From what we've discussed today, Ioana, please:
  • determine the minimum list of .cls files from ADE which need to be converted and are not yet implemented in FWD, using as a start the list above.
  • this will require to determine dependencies from the hierarchy or usage from ADE code; so the list above will expand
  • any progress. package dependencies which are not yet implemented will need to be worked in #9436.
    • Determine any .cls file which does not exist in the skeleton/ project and please work with Octavian to get the skeleton .cls
    • once you have these, you can use FWD conversion of the new skeleton .cls files to get the 'template' of the Java code which needs to be implemented by us
    • check 6410b for any already implemented progress. package classes

#23 Updated by Constantin Asofiei over 1 year ago

When converting both ADE and standalone skeleton/ .cls files, this is required to have the proper Java package emitted; in com.goldencode.p2j.convert.NameConverter, method convertPackage, the return can be changed to this:

      return (false && builtin ? "com.goldencode.p2j.oo." : "") + sb.toString();

We should think of a better approach for this, but for now it works.

#24 Updated by Constantin Asofiei over 1 year ago

We also need @LegacyResourceSupport emitted for ADE or skeleton/ conversion. Please look into the rules where @LegacySignature is emitted, and emit:
  • @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL) for ADE stuff
  • @LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_STUBS) for cases when skeleton/ .cls files are converted (i.e. Progress. package).
I think a p2j.cfg.xml config can be used to check what we convert (ade or skeleton/), to tell to:
  • not emit @LegacyResourceSupport - if the config param is missing
  • emit whatever string is set at the param (i.e. CVT_LVL_FULL|RT_LVL_FULL, CVT_LVL_FULL|RT_LVL_STUBS or whatever combination).

Another config param is needed to emit or not LegacyResource annotation - the change is already in the ADE/p2j/ project, but this emits it always.

#25 Updated by Ioana-Cristina Prioteasa over 1 year ago

From testcases/oo/skeleton/12.8 I copied the following classes into ADE skeleton:

Progress.Collections.IList
Progress.Lang.Stop
Progress.Collections.IComparable
Progress.Collections.IHashable
Progress.Collections.HashMap
Progress.Collections.KeyValuePair
Progress.Collections.List
Progress.Collections.ISet
Progress.Collections.SortedSet
Progress.Collections.ICollection
Progress.Collections.IIterable
Progress.Collections.IMap
Progress.Collections.IEqualityComparer
Progress.Collections.IIterator
Progress.Collections.IComparer

With these added, converting the list in #9488-22 does not show this error anymore Cannot find class/interface .. in PROPATH.
Now, I have Builtin class .. is not implemented in FWD! for these:
com.goldencode.p2j.oo.collections.Iiterable
com.goldencode.p2j.oo.collections.Iiterator 
com.goldencode.p2j.oo.collections.Icollection 
com.goldencode.p2j.oo.collections.Ilist 
com.goldencode.p2j.oo.lang.Stop 
com.goldencode.p2j.oo.collections.Icomparable 
com.goldencode.p2j.oo.collections.Ihashable 
com.goldencode.p2j.oo.collections.Imap 
com.goldencode.p2j.oo.collections.Iset 
com.goldencode.p2j.oo.collections.HashMap 
com.goldencode.p2j.oo.collections.IequalityComparer
com.goldencode.p2j.oo.collections.KeyValuePair 
com.goldencode.p2j.oo.collections.List 
com.goldencode.p2j.oo.collections.SortedSet 
com.goldencode.p2j.oo.collections.Icomparer 

Next steps: convert the added skeleton classes and add them into p2j - oo package.

#26 Updated by Constantin Asofiei over 1 year ago

Did you check 6410b if they are there?

#27 Updated by Marian Edu over 1 year ago

Constantin Asofiei wrote:

Marian Edu wrote:

What we can do is to run all OO tests we have against 12.8.4 ADE, adapt those as necessary

Please run the existing unit tests in OE, with 12.8.4 ADE and first lets document any differences.

There aren't that many differences, mainly changes in error messages/numbers.

  • tests.oo.json.array.TestSetGetRaw (diff error number)
  • tests.oo.openedge.net.server_connection.client_socket.TestMethodStartTls (diff error msg)
  • tests.oo.progress.lang.class.TestMethodNew (diff error number)
  • tests.oo.progress.lang.parameter_list.TestMethodSetParameterExtent (diff error number)
  • tests.oo.progress.lang.parameter_list.TestMethodSetParameterParamErrors (diff error number)
  • tests.oo.progress.reflect.variable.TestPropertyExtent (extent property returns different values for variable length extents with default value set)

    Beside this we already changed the code because of some compile time error - numeric variables/properties used to allow string values as extent initial values, this is a syntax error now so we had to update the code.

#28 Updated by Ioana-Cristina Prioteasa over 1 year ago

Constantin Asofiei wrote:

Did you check 6410b if they are there?

At the moment 6410b does not compile, I am not sure about the state of this branch.

From the list above, this is the support level in 6410b:

Class Conversion Support Level Runtime Support Level
com.goldencode.p2j.oo.collections.Icomparable - -
com.goldencode.p2j.oo.collections.Ihashable - -
com.goldencode.p2j.oo.collections.HashMap - -
com.goldencode.p2j.oo.collections.IequalityComparer - -
com.goldencode.p2j.oo.collections.KeyValuePair - -
com.goldencode.p2j.oo.collections.SortedSet - -
com.goldencode.p2j.oo.collections.Icomparer - -
com.goldencode.p2j.oo.lang.Stop - -
com.goldencode.p2j.oo.core.collections.Iiterable FULL FULL
com.goldencode.p2j.oo.core.collections.Iiterator FULL FULL
com.goldencode.p2j.oo.core.collections.Icollection FULL FULL
com.goldencode.p2j.oo.core.collections.Ilist FULL FULL
com.goldencode.p2j.oo.core.collections.Imap FULL FULL
com.goldencode.p2j.oo.core.collections.Iset FULL FULL
com.goldencode.p2j.oo.core.collections.List FULL PARTIAL

#29 Updated by Ioana-Cristina Prioteasa over 1 year ago

From the list above, HashMap is in ADE at corelib/OpenEdge/Core/Collections/HashMap.cls, so this need to be added to the classes we convert, not implement.

#30 Updated by Ioana-Cristina Prioteasa over 1 year ago

I think I made an error in #9488-28 and #9488-29. We need the classes in com.goldencode.p2j.oo.collections.* (Progress.collections) not the ones in com.goldencode.p2j.oo.core.collections.* (OpenEdge.core.collections). The classes needed mentioned in #9488-25, all need their skeleton converted and implemented in FWD, they are not in 6410b.

For this conversion, I created branch 9488a and committed:
  • rev. 15716: Added support for generating LegacyResource and LegacyResourceSupport annotations and correcting the package name for converting legacy oo package.
  • rev. 15717: A change from Constantin's original branch needed for the conversion to successfully complete.

I will now convert all the needed skeletons. I understand I should add them to p2j oo package and commit them on another branch. What should that branch be? 9488b?

#31 Updated by Constantin Asofiei over 1 year ago

Ioana-Cristina Prioteasa wrote:

I understand I should add them to p2j oo package and commit them on another branch. What should that branch be? 9488b?

No, use 9436a and lets discuss them there. The plan is to commit the skeletons first and after that work on implementations in 9436b. Please add copyright/history/etc to all converted files.

#32 Updated by Ioana-Cristina Prioteasa over 1 year ago

I am right now trying to convert these skeletons with 9488a:
abl/Progress/Lang/Stop.cls
abl/Progress/Collections/HashMap.cls
abl/Progress/Collections/IComparable.cls
abl/Progress/Collections/IHashable.cls
abl/Progress/Collections/IEqualityComparer.cls
abl/Progress/Collections/KeyValuePair.cls
abl/Progress/Collections/SortedSet.cls
abl/Progress/Collections/IComparer.cls
abl/Progress/Collections/Iiterable.cls
abl/Progress/Collections/Iiterator.cls
abl/Progress/Collections/Icollection.cls
abl/Progress/Collections/Ilist.cls
abl/Progress/Collections/Imap.cls
abl/Progress/Collections/Iset.cls
abl/Progress/Collections/List.cls

Some are converting as they should, these I can commit to 9436a:
@LegacyResource(resource = "Progress.Collections.IComparable")
public interface Icomparable
extends com.goldencode.p2j.oo.lang._BaseObject_

@LegacyResource(resource = "Progress.Collections.IComparer")
public interface Icomparer
extends com.goldencode.p2j.oo.lang._BaseObject_

@LegacyResource(resource = "Progress.Collections.IEqualityComparer")
public interface IequalityComparer
extends com.goldencode.p2j.oo.lang._BaseObject_

@LegacyResource(resource = "Progress.Collections.IHashable")
public interface Ihashable
extends com.goldencode.p2j.oo.lang._BaseObject_

@LegacyResource(resource = "Progress.Collections.KeyValuePair")
@LegacySerializable
public final class KeyValuePair
extends BaseObject

So there are problems with these:
  • abl/Progress/Lang/Stop.cls - added for conversion
  • abl/Progress/Collections/HashMap.cls - added for conversion
  • abl/Progress/Collections/SortedSet.cls - added for conversion
  • abl/Progress/Collections/Iiterable.cls
  • abl/Progress/Collections/Iiterator.cls
  • abl/Progress/Collections/Icollection.cls
  • abl/Progress/Collections/Ilist.cls
  • abl/Progress/Collections/Imap.cls
  • abl/Progress/Collections/Iset.cls
  • abl/Progress/Collections/List.cls - added for conversion

This is the change that was needed for the conversion to finish (from Constantin's changes):

=== modified file 'src/com/goldencode/ast/AnnotatedAst.java'
--- old/src/com/goldencode/ast/AnnotatedAst.java    2025-02-20 12:47:04 +0000
+++ new/src/com/goldencode/ast/AnnotatedAst.java    2025-02-21 08:56:33 +0000
@@ -5100,7 +5100,6 @@
       if (annotation == null && !Configuration.isRuntimeConfig())
       {
          LOG.log(Level.WARNING, "Null annotation (" + key + ") for " + this.toStringVerbose());
+         annotation = "n/a";
       }

       if (annotations == null)

I attached the conversion log I obtained with 9488 rev.15716 (without the above change), but it ends in:
   [java] --- END RULE REPORT ---
     [java] 
     [java] 
     [java] 
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1100)
     [java]     at com.goldencode.p2j.convert.TransformDriver.processTrees(TransformDriver.java:589)
     [java]     at com.goldencode.p2j.convert.ConversionDriver.back(ConversionDriver.java:569)
     [java]     at com.goldencode.p2j.convert.TransformDriver.executeJob(TransformDriver.java:1001)
     [java]     at com.goldencode.p2j.convert.ConversionDriver.main(ConversionDriver.java:1305)
     [java] Caused by: com.goldencode.expr.ExpressionException: Expression execution error @1:1
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:495)
     [java]     at com.goldencode.p2j.pattern.Rule.apply(Rule.java:500)
     [java]     at com.goldencode.p2j.pattern.RuleContainer.apply(RuleContainer.java:597)
     [java]     at com.goldencode.p2j.pattern.RuleSet.apply(RuleSet.java:98)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.apply(PatternEngine.java:1711)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1578)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.processAst(PatternEngine.java:1511)
     [java]     at com.goldencode.p2j.pattern.PatternEngine.run(PatternEngine.java:1063)
     [java]     ... 4 more
     [java] Caused by: java.lang.NullPointerException: null value for annotation 'full-java-class':Progress.Collections.IList [CLASS_NAME]:124554051593 @2:20
     [java] 
     [java]     at com.goldencode.ast.XmlFilePlugin.writeSingleAnnotation(XmlFilePlugin.java:1167)
     [java]     at com.goldencode.ast.XmlFilePlugin.writeAnnotations(XmlFilePlugin.java:1131)
     [java]     at com.goldencode.ast.XmlFilePlugin.writeAst(XmlFilePlugin.java:1090)
     [java]     at com.goldencode.ast.XmlFilePlugin.writeAst(XmlFilePlugin.java:1096)
     [java]     at com.goldencode.ast.XmlFilePlugin.writeAst(XmlFilePlugin.java:1096)
     [java]     at com.goldencode.ast.XmlFilePlugin.writeAst(XmlFilePlugin.java:1096)
     [java]     at com.goldencode.ast.XmlFilePlugin.writeAst(XmlFilePlugin.java:1096)
     [java]     at com.goldencode.ast.XmlFilePlugin.saveTree(XmlFilePlugin.java:535)
     [java]     at com.goldencode.ast.AstManager.saveTree(AstManager.java:361)
     [java]     at com.goldencode.p2j.pattern.CommonAstSupport$Library.persist(CommonAstSupport.java:3520)
     [java]     at com.goldencode.expr.CE7418.execute(Unknown Source)
     [java]     at com.goldencode.expr.Expression.execute(Expression.java:398)
     [java]     ... 11 more
     [java] 

BUILD FAILED
/home/icp/projects/ADE/build.xml:300: Java returned: 1

With 9488a rev 15717 (with the change above): conversion ends but 5 classes convert correctly, 6 classes are not added for conversion and the rest of 4 classes seem to have issues that come from the AnnotatedAst change:
@LegacyResource(resource = "Progress.Collections.HashMap")
@LegacySerializable
public final class HashMap
extends BaseObject
implements n/a,
           n/a,
           n/a
{
   @LegacySignature(type = Type.PROPERTY, name = "Keys")
   private object<? extends n/a> keys = TypeFactory.object(n/a.class);
}

While in Progress.Collections.HashMap:

class Progress.Collections.HashMap
        implements Progress.Collections.IMap,
                Progress.Collections.ICollection,
                Progress.Collections.IIterable final serializable:

#33 Updated by Constantin Asofiei over 1 year ago

OK, this is a 'chicken and the egg' problem I think. Get the .java converted skeletons as close as possible to 'good' and do manually adjustments where 'n/a' appears; also check if anything has been dropped - i.e. all methods/properties/vars are there, inherits/implements clauses, etc.

#34 Updated by Ioana-Cristina Prioteasa over 1 year ago

I will do that for the classes that are converted, but I am not exactly sure why the rest are not ending in java classes.

#35 Updated by Constantin Asofiei over 1 year ago

Ioana-Cristina Prioteasa wrote:

... but I am not exactly sure why the rest are not ending in java classes.

Please post the full log.

#36 Updated by Ioana-Cristina Prioteasa over 1 year ago

Added the log for 9488a rev.15717, for this file-cvt-list:

abl/Progress/Lang/Stop.cls
abl/Progress/Collections/HashMap.cls
abl/Progress/Collections/IComparable.cls
abl/Progress/Collections/IHashable.cls
abl/Progress/Collections/IEqualityComparer.cls
abl/Progress/Collections/KeyValuePair.cls
abl/Progress/Collections/SortedSet.cls
abl/Progress/Collections/IComparer.cls
abl/Progress/Collections/Iiterable.cls
abl/Progress/Collections/Iiterator.cls
abl/Progress/Collections/Icollection.cls
abl/Progress/Collections/Ilist.cls
abl/Progress/Collections/Imap.cls
abl/Progress/Collections/Iset.cls
abl/Progress/Collections/List.cls

#37 Updated by Constantin Asofiei over 1 year ago

Did you add all files to the conversion list? For example Iiterator.cls is not picked up in Scanning Progress Source. Something is wrong with the config used as input.

#38 Updated by Ioana-Cristina Prioteasa over 1 year ago

I have a file-cvt-list.txt with the above contents and i run ant clean convert.list

#39 Updated by Ioana-Cristina Prioteasa over 1 year ago

Moved everything that I did not needed out of /abl:
  • running ant convert:
    Buildfile: /home/icp/projects/ADE/build.xml
    
    init:
    
    check-file-cvt-list:
    
    check-file-ignore-list:
    
    convert:
    
    BUILD SUCCESSFUL
    Total time: 0 seconds
    
  • running ant deploy.all - i still get the same files in the java classes.

It is weird because it seems they are parsed, these are the contents of by abl folder:

✨icp@icp:~/projects/ADE/abl$ tree -a
.
├── fwd-embedded-driver.p
└── Progress
    ├── Collections
    │   ├── HashMap.cls
    │   ├── HashMap.cls.ast
    │   ├── HashMap.cls.cache
    │   ├── HashMap.cls.jast
    │   ├── HashMap.cls.lexer
    │   ├── HashMap.cls.parser
    │   ├── HashMap.cls.pphints
    │   ├── ICollection.cls
    │   ├── ICollection.cls.ast
    │   ├── ICollection.cls.cache
    │   ├── ICollection.cls.lexer
    │   ├── ICollection.cls.parser
    │   ├── ICollection.cls.pphints
    │   ├── IComparable.cls
    │   ├── IComparable.cls.ast
    │   ├── IComparable.cls.cache
    │   ├── IComparable.cls.jast
    │   ├── IComparable.cls.lexer
    │   ├── IComparable.cls.parser
    │   ├── IComparable.cls.pphints
    │   ├── IComparer.cls
    │   ├── IComparer.cls.ast
    │   ├── IComparer.cls.cache
    │   ├── IComparer.cls.jast
    │   ├── IComparer.cls.lexer
    │   ├── IComparer.cls.parser
    │   ├── IComparer.cls.pphints
    │   ├── IEqualityComparer.cls
    │   ├── IEqualityComparer.cls.ast
    │   ├── IEqualityComparer.cls.cache
    │   ├── IEqualityComparer.cls.jast
    │   ├── IEqualityComparer.cls.lexer
    │   ├── IEqualityComparer.cls.parser
    │   ├── IEqualityComparer.cls.pphints
    │   ├── IHashable.cls
    │   ├── IHashable.cls.ast
    │   ├── IHashable.cls.cache
    │   ├── IHashable.cls.jast
    │   ├── IHashable.cls.lexer
    │   ├── IHashable.cls.parser
    │   ├── IHashable.cls.pphints
    │   ├── IIterable.cls
    │   ├── IIterable.cls.ast
    │   ├── IIterable.cls.cache
    │   ├── IIterable.cls.lexer
    │   ├── IIterable.cls.parser
    │   ├── IIterable.cls.pphints
    │   ├── IIterator.cls
    │   ├── IIterator.cls.ast
    │   ├── IIterator.cls.cache
    │   ├── IIterator.cls.lexer
    │   ├── IIterator.cls.parser
    │   ├── IIterator.cls.pphints
    │   ├── IList.cls
    │   ├── IList.cls.ast
    │   ├── IList.cls.cache
    │   ├── IList.cls.lexer
    │   ├── IList.cls.parser
    │   ├── IList.cls.pphints
    │   ├── IMap.cls
    │   ├── IMap.cls.ast
    │   ├── IMap.cls.cache
    │   ├── IMap.cls.lexer
    │   ├── IMap.cls.parser
    │   ├── IMap.cls.pphints
    │   ├── ISet.cls
    │   ├── ISet.cls.ast
    │   ├── ISet.cls.cache
    │   ├── ISet.cls.lexer
    │   ├── ISet.cls.parser
    │   ├── ISet.cls.pphints
    │   ├── KeyValuePair.cls
    │   ├── KeyValuePair.cls.ast
    │   ├── KeyValuePair.cls.cache
    │   ├── KeyValuePair.cls.jast
    │   ├── KeyValuePair.cls.lexer
    │   ├── KeyValuePair.cls.parser
    │   ├── KeyValuePair.cls.pphints
    │   ├── List.cls
    │   ├── List.cls.ast
    │   ├── List.cls.cache
    │   ├── List.cls.jast
    │   ├── List.cls.lexer
    │   ├── List.cls.parser
    │   ├── List.cls.pphints
    │   ├── SortedSet.cls
    │   ├── SortedSet.cls.ast
    │   ├── SortedSet.cls.cache
    │   ├── SortedSet.cls.jast
    │   ├── SortedSet.cls.lexer
    │   ├── SortedSet.cls.parser
    │   └── SortedSet.cls.pphints
    └── Lang
        ├── Stop.cls
        ├── Stop.cls.ast
        ├── Stop.cls.cache
        ├── Stop.cls.jast
        ├── Stop.cls.lexer
        ├── Stop.cls.parser
        └── Stop.cls.pphints

4 directories, 100 files

#40 Updated by Ioana-Cristina Prioteasa over 1 year ago

I am trying to add the LegacyResourceSupport at class level, right after the LegacyResource.
In /rules/convert/base_structure.xml:

            <action>isLegacyOo = getConfigParameter("is-legacy-oo")</action>
            <rule>isLegacyOo.equalsIgnoreCase("true")
               <action>annoref = java.createJavaAst(java.annotation, "LegacyResource", jclsdef.parent, jclsdef.indexPos)</action>
               <action>annoref = createJavaAst(java.assign, "=", annoref)</action>
               <action>createJavaAst(java.reference, "resource", annoref)</action>
               <action>createJavaAst(java.string, getNoteString("qualified_oo_name"), annoref)</action>
            </rule>

            <action>
               legacyResSupportType = getConfigParameter("legacy-res-support-type")
            </action>
            <rule> legacyResSupportType != null
               <action>
                  annoref = java.createJavaAst(java.annotation, "LegacyResourceSupport", jclsdef.parent, jclsdef.indexPos)
               </action>
               <action>hasLRSAnn = true</action>
               <action>
                  execLib("add_annotation_setting", "supportLvl", java.reference, legacyResSupportType, annoref)
               </action>
            </rule>
      </rule>

And I have this error:
     [java] execLib("add_annotation_setting", "supportLvl", java.reference, legacyResSupportType, annoref)
     [java] ^  { Cannot set value for variable 'lastid' (java.lang.Long) to type com.goldencode.p2j.uast.JavaAst }

I am not sure how lastid is used there.
Using lastid here execLib("add_annotation_setting", "supportLvl", java.reference, legacyResSupportType, lastid) does not give an error but it does not add the supportLvl either.

#41 Updated by Constantin Asofiei over 1 year ago

You need to use annoref.id as last argument.

#42 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a:
  • rev. 15719: Added lang.Stop, collections.Ihashable, collections.Icomparable, collections.Icomparer, collections.IequalityComparer.
  • rev. 15718: Conversion changes for adding LegacyResourceSupport at the class level.

#43 Updated by Ioana-Cristina Prioteasa over 1 year ago

In 9488a rev. 15720 I also added collection.KeyValuePair.
Next I have HashMap, List and SortedSet to correct.

#44 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a rev 15721-15722:
Added Icollection, Iiterable, Iiterator, Ilist, Imap, Iset, List, SortedSet, HashMap from Progress.Collections
This completes the list of skeletons to convert.

I am trying now to convert these from ADE:

  • abl/src/corelib/OpenEdge/Core/Assert.cls -- converted
  • abl/src/corelib/OpenEdge/Core/ByteBucket.cls
  • abl/src/corelib/OpenEdge/Core/Collections/Collection.cls
  • abl/src/corelib/OpenEdge/Core/Collections/ICollection.cls -- converted
  • abl/src/corelib/OpenEdge/Core/Collections/IIterable.cls -- converted
  • abl/src/corelib/OpenEdge/Core/Collections/IIterator.cls -- converted
  • abl/src/corelib/OpenEdge/Core/Collections/IList.cls -- converted
  • abl/src/corelib/OpenEdge/Core/Collections/IListIterator.cls --converted
  • abl/src/corelib/OpenEdge/Core/Collections/ISet.cls -- converted
  • abl/src/corelib/OpenEdge/Core/Collections/Iterator.cls -- converted
  • abl/src/corelib/OpenEdge/Core/Collections/List.cls
  • abl/src/corelib/OpenEdge/Core/Collections/ListIterator.cls
  • abl/src/corelib/OpenEdge/Core/Collections/Map.cls
  • abl/src/corelib/OpenEdge/Core/Collections/ObjectStack.cls
  • abl/src/corelib/OpenEdge/Core/Integer.cls
  • abl/src/corelib/OpenEdge/Core/IOModeEnum.cls -- converted
  • abl/src/corelib/OpenEdge/Core/Memptr.cls
  • abl/src/corelib/OpenEdge/Core/String.cls
  • abl/src/corelib/OpenEdge/Core/System/ApplicationError.cls -- converted
  • abl/src/corelib/OpenEdge/Core/System/InvalidValueSpecifiedError.cls
  • abl/src/corelib/OpenEdge/Core/System/NotFoundError.cls
  • abl/src/corelib/OpenEdge/Core/System/UnsupportedOperationError.cls -- converted
  • abl/src/corelib/OpenEdge/Core/TimeStamp.cls
  • abl/src/corelib/OpenEdge/Logging/LogEvent.cls
  • abl/src/corelib/OpenEdge/Logging/LogMessage.cls
I have 2 questions:
1. The above list is from #9488-22. But there are already in com.goldencode.p2j.oo.core with FULL support reported the following:
  • IomodeEnum
  • Icollection
  • Iiterable
  • Iiterator
  • Ilist
  • IlistIterator
  • Iset
  • LegacyMap
  • ApplicationError
  • UnsupportedOperationError

There are some more existent but with PARTIAL or STUB support level.
Do we need converted from ADE the above if we already have them implemented?

2. I have a lot of Could not find legacy builtin method javaname for .. errors at ADE conversion, all setters, like this one:

[java] Could not find legacy builtin method javaname for 'Progress.Collections.KeyValuePair:set-key(KW_INPUT object<? extends progress.lang.object>)'
[java] Could not find legacy builtin method javaname for 'Progress.Collections.KeyValuePair:set-value(KW_INPUT object<? extends progress.lang.object>)'

In KeyValuePair (this was converted from skeleton) I have only getters for the class properties. Do the setters need to be added by hand?

Added the ADE conversion log file, ran with 9488 rev. 15722.

#45 Updated by Ioana-Cristina Prioteasa over 1 year ago

As disscused in the office today, the skeletons needed for #8904 (Progress.Lang.UserInterrupt, Progress.Lang.Stop, Progress.Lang.StopError, Progress.Lang.LockConflict, Progress.Lang.StopAfter) will also be converted and added in 9488a. After a review these can be merged and Eduard would pick them up in a rebase.

I am trying to convert them now, but I have 2 issues:
  • Stop is final, but UserInterrupt, LockConflict and StopAfter extend it. This can be easily fixed by Stop not being final, but in the skeleton it is and in the documentation: Progress.Lang.Stop is also the immediate super class for the following built-in objects ..(mentioned above). You cannot inherit from this class.
  • I get a conversion mismatch in the mentioned classes that extend Stop.
    The constructor of Stop is called like:
    __lang_Stop_constructor__();
    

    instead of:
    __lang_stop__constructor__();
    

#46 Updated by Ioana-Cristina Prioteasa over 1 year ago

  • Status changed from New to WIP
  • reviewer Constantin Asofiei added
Corrected by hand the issues in #9488-45 and committed to 9488a rev. 15723:
  • Added LockConflict, StopAfter, StopError, UserInterrupt and made Stop not final.

#47 Updated by Ioana-Cristina Prioteasa over 1 year ago

  • Status changed from WIP to Review

Constantin, we should have all the needed skeletons from Progress converted and in 9488a.
Please review 9488a rev. 15716 - 15723.
The only revision that I am not sure if could be merged into trunk is 15717.

#48 Updated by Constantin Asofiei over 1 year ago

Ioana, sorry I've not noticed sooner - the progress.* Java stubs for the skeletons need to be in 9436a, so please move them there. I just want to do some tests with them. 9488a has some other changes, we need to discuss those.

Otherwise, if you have changes in the skeleton bzr project, please make sure they are committed.

#49 Updated by Ioana-Cristina Prioteasa over 1 year ago

  • Status changed from Review to WIP

I committed them to 9436a, I will ask for review there.
I added in the skeleton bzr project only the classes Eduard asked for, should I also add the rest, mentioned in #9436-25?

#50 Updated by Ioana-Cristina Prioteasa over 1 year ago

To convert the above I needed these skeletons added:
  • Progress.Data.ChildrenAllowEdit
  • Progress.Data.ChildrenAllowNew
  • Progress.Data.ChildrenAllowRemove
  • Progress.Data.ChildrenInputValue
  • Progress.Data.InputValue
  • Progress.Data.CancelCreateRowEventArgs
  • Progress.Data.CreateRowEventArgs
  • Progress.Data.SortRequestEventArgs
  • System.ComponentModel.ComponentResourceManager

I found all of them, except the last System.ComponentModel.ComponentResourceManager, this is not in skeleton/dotnet/System/ComponentModel/ and in testcases/oo there is nothing regarding dotnet.
Marian, do you know if this skeleton exists of how can I generate it?

#51 Updated by Ioana-Cristina Prioteasa over 1 year ago

Sorry, I meant to post the above on #9436.

#52 Updated by Ioana-Cristina Prioteasa over 1 year ago

I'm encountering recurring issues while converting ADE, so I'm currently focusing on converting a single class: OpenEdge/Core/TimeStamp.cls

The conversion fails due to a parsing error related to generics:

pre_scan_class failure with text '<', error 'unexpected token: <' at line 26, column 23 in file ./abl/OpenEdge/Core/TimeStamp.cls

This happens because the original code includes:

using Progress.Collections.IComparable.
using Progress.Collections.IHashable.
class OpenEdge.Core.TimeStamp
serializable
implements IComparable<TimeStamp>
         , IHashable

For now, IComparable (from the skeleton) does not use generics.

As an initial fix, I plan to ignore the < > syntax when parsing implements clauses. The error occurs in ProgressParser, which is a generated file, so I'm currently investigating progress.g to adjust the grammar accordingly.

#53 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a rev 15724: Ignore generics in symbol-based class names.
With this change the conversion passes the previous error but other issues are found:

     [java] ./abl/OpenEdge/Core/TimeStamp.cls:256:27: unexpected token: *
     [java]     at com.goldencode.p2j.uast.ProgressParser.assign(ProgressParser.java:39897)
     [java]     at com.goldencode.p2j.uast.ProgressParser.assign_stmt(ProgressParser.java:28477)
     [java]     at com.goldencode.p2j.uast.ProgressParser.stmt_list(ProgressParser.java:27480)

This is coming from:
assign tz *= -1.

Investigating this now.

#54 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a rev. 15725: Added support for compound assignment operators (*=, +=, -=, /=).
The next parsing error to investigate:

     [java] ./abl/OpenEdge/Core/TimeStamp.cls:478:16: unexpected token: hash-code
     [java]     at com.goldencode.p2j.uast.ProgressParser.lvalue(ProgressParser.java:18638)
     [java]     at com.goldencode.p2j.uast.ProgressParser.primary_expr(ProgressParser.java:59609)
     [java]     at com.goldencode.p2j.uast.ProgressParser.chained_object_members(ProgressParser.java:23377)
     [java]     at com.goldencode.p2j.uast.ProgressParser.un_type(ProgressParser.java:59311)
     [java]     at com.goldencode.p2j.uast.ProgressParser.prod_expr(ProgressParser.java:59176)

This is coming from this line:

return hash-code(this-object:GetClass():TypeName, this-object:Format, mtDate, miTime, miTZOffset).

Moving to this issue now.

#55 Updated by Ioana-Cristina Prioteasa over 1 year ago

I'm having some trouble with the hash-code() function.
I modified progress.g and now the token is found, the new error is:

{ ## Error:: Could not process function 'hash-code', not found in super or local definitions (hmfuncs/reference)! [BLOCK id <12884901889> 0:0] }

I tried to create a testcase but my it seems these are not available in my VM, they must be from a newer version.

I think the problem is that it is searching for it in local or super definitions when it should be seen as a built in function. Tried mapping it to a new annotated BaseDataType.hashCode but I must be missing something.

#56 Updated by Constantin Asofiei over 1 year ago

hash-code is a new builtin function, see https://docs.progress.com/bundle/abl-reference/page/HASH-CODE-function.html . You need to treat it as any other builtin function like ENCODE.

#57 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a rev. 15726: Added conversion support and basic runtime support for the new hash-code builtin function.

With this latest 9488a OpenEdge/Core/TimeStamp.cls is converted.
In the converted java class there are still some issues:
  • the n/a issue, the output is:
    public class TimeStamp
    extends BaseObject
    implements Icomparable,
               n/a
    

    for
    using Progress.Collections.IComparable.
    using Progress.Collections.IHashable.
    
    class OpenEdge.Core.TimeStamp
    serializable
    implements IComparable<TimeStamp>
             , IHashable
    

    Not exactly sure why because IHashable exists in 9488a, like IComparable.
    n/a also appears in other places:
    import n/a;
    storeReturnValue(DateOps.interval(thisDate, n/a.oo_references.rules_FIXME4(), "seconds"));
    storeReturnValue(DateOps.interval(thisDate, n/a.oo_references.rules_FIXME4(), "milliseconds"));
    n/a.oo_references.rules_FIXME6(pOther, new character("CompareTo object"));
    
  • assign tz *= -1. convert to:
    tz;
    -1;
    

    It should be tz.assign(multiply(tz, new integer(-1)));
  • Implementing Icomparable forces the compareTo method to have this signature
    public integer compareTo(final object< ? extends com.goldencode.p2j.oo.lang._BaseObject_ > _otherObject);
    but it is converted as:
    public integer compareTo(final object< ? extends TimeStamp > _pOther)
    I think Icomparable needs generics and more conversion changes are required to emit implements Icomparable<Timestamp>

#58 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a rev 15727: Full conversion support for +=, -=, *=, /=.
Now assign tz *= -1. converts to tz.assign(multiply(tz, new integer(-1)));

#59 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a rev. 15728:
  • Conversion support for using generics in implements clause.
  • Modified Icomparable to use generics, this change will need to be ported in 9436a.

We may need more changes for other places that could use generics, for now this is sufficient to correctly convert OpenEdge.Core.TimeStamp.
Now I will move to supporting the new variable definition statements: VAR INT n.

#60 Updated by Constantin Asofiei over 1 year ago

Ioana, I assume you want to create the equivalent DEFINE VAR n AS INT instead of VAR INT n, directly in the parser. Greg, I think this would be the 'right' approach, either in the parse or post-parse-fixups.

If we do it in the parser, we can create ASTs with constructs like this (see the assignment rule in the parser)

assignment! 
  :
      stmt_term
      {
         if (lstmt)
         {
            ## = #([STATEMENT, "statement"], e, k);
         }
         else
         {
            ## = #([ASSIGNMENT, "assignment"], e, k);
         }
         skipExpression = false;
         matchAssign = false;
      }

There is this doc: https://bioinformatics.ai.sri.com/biowarehouse/repos/enzyme-loader/docs/antlr_2.7.1_ref_man.pdf Look for #([. In the assignment rule, ! turns of standard tree construction, and ## is the returned AST for this rule. #() creates another AST with the wanted structure.

#61 Updated by Ioana-Cristina Prioteasa over 1 year ago

Had a meeting today with Constantin about the new VAR statement. It's clear from the documentation https://docs.progress.com/bundle/openedge-develop-abl-applications/page/Learn-about-the-VAR-statement.html that the changes needed to support these are very extensive. Some examples of what can be done with Progress 12.8:
VAR CHAR s1, s2, s3.
VAR CHAR[10] s4.
VAR CHAR s6 = "My character string".

We decided to manually modify these constructs in ADE for now to move forward with the conversion.
I started with OpenEdge/Core/Collections/List.cls and after rewriting the VAR statements there are some other problematic constructs like:
  • final keyword use, I am not sure about this, cannot find Progress documentation for it. For now i removed it.
        define final non-serializable public property Size as integer no-undo
            get():
                return mBackingList:Count.
            end get.
    
  • generics used, here we need some conversion modifications.
        constructor public List():
            this-object(new Progress.Collections.List<Object>()).
        end constructor.
    

I will try now to support the generic in the new call.

#62 Updated by Constantin Asofiei over 1 year ago

Ioana, please change progress.g to allow FINAL option at the property rule, and the conversion rules to emit it. For generics - that's lets say ... complicated again.

#63 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed on 9488a rev. 15731:
  • a quick fix for a NPE when the p2j.cfg.xml is-legacy-oo configuration is not present.
  • parser and conversion support for emitting a final property.

Note: added in rev. 15729 my changes related to the VAR statement and reverted them in rev. 15730.

#64 Updated by Ioana-Cristina Prioteasa over 1 year ago

I am still trying to convert OpenEdge/Core/Collections/List.cls (a modified version where I rewritten the var statement and removed the generics). With 9488a rev.15731 I don't have errors parsing, but some weird warnings appear now:

     [java] WARNING: more than one method def found using fuzzy lookup: GetIterator from class Progress.Collections.IList
     [java] 
     [java]    CALLER GetIterator [OO_METH_CLASS]:<id_unavailable> @313:43
     [java]       (original-token=["GetIterator",<496>,line=313,col=43])
     [java] 
     [java]    PARAMETERS: 0
     [java]    MATCH 0: METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@75dc1d5a ooLvl; [Ljava.lang.String;@1946d235 overrides; 
     [java]         KW_PUBLIC instance member GetIterator (OO_METH_CLASS - progress.collections.iiterator), extent 0, javaname getIterator, override false, abstract false in class Progress.Collections.IIterable, tempIdx 0
     [java]    PARAMETERS: 0
     [java]  data
     [java] 
     [java]    MATCH 1: METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@3c9163df ooLvl; [Ljava.lang.String;@7d07e6aa overrides; 
     [java]         KW_PUBLIC instance member GetIterator (OO_METH_CLASS - progress.collections.iiterator), extent 0, javaname getIterator, override false, abstract false in class Progress.Collections.IIterable, tempIdx 0
     [java]    PARAMETERS: 0
     [java]  data

     [java] annotateMethodCall FAILURE: Join from class OpenEdge.Core.String, access KW_PRIVATE, static true, at Join [OO_METH_CLASS]:<id_unavailable> @369:37
     [java]    cast [FUNC_CLASS]:<id_unavailable> @369:42
     [java]       : [OBJECT_INVOCATION]:<id_unavailable> @369:54
     [java]          poValue [VAR_CLASS]:<id_unavailable> @369:47
     [java]          ToArray [OO_METH_CLASS]:<id_unavailable> @369:55
     [java]       OpenEdge.Core.String [CLASS_NAME]:<id_unavailable> @369:66
     [java]    pcDelimiter [VAR_CHAR]:<id_unavailable> @369:89
     [java] 
     [java]    PARAMETERS: 2
     [java]        object<? extends openedge.core.string>
     [java]        character
     [java] WARNING: No annotateClassRef due to missing 'qualified' annotation
     [java] Join [OO_METH_CLASS]:<id_unavailable> @369:37
     [java]       (original-token=["Join",<496>,line=369,col=37])
     [java]    cast [FUNC_CLASS]:<id_unavailable> @369:42
     [java]          (original-token=["cast",<560>,line=369,col=42], dotnet-cls=false, indirect-dotnet=false, qualified=openedge.core.string, returnsunknown=true, is-class=true, oldtype=560, is-interface=false, builtin-cls=false, builtin=true, source-file=./abl/OpenEdge/Core/String.cls, param_index=0, is-java=false, is-enum=false)
     [java]       : [OBJECT_INVOCATION]:<id_unavailable> @369:54
     [java]             (original-token=[":",<2969>,line=369,col=54], param_index=0)
     [java]          poValue [VAR_CLASS]:<id_unavailable> @369:47
     [java]                (original-token=["poValue",<384>,line=369,col=47], dotnet-cls=false, tempidx-file=./abl/OpenEdge/Core/String.cls, tempidx=146, qualified=openedge.core.collections.array, indirect-dotnet=false, is-class=true, oldtype=2986, is-interface=false, builtin-cls=false, source-file=./abl/OpenEdge/Core/Collections/Array.cls, found-in-source-file=./abl/OpenEdge/Core/String.cls, is-java=false, is-enum=false, found-in-cls=OpenEdge.Core.String)
     [java]          ToArray [OO_METH_CLASS]:<id_unavailable> @369:55
     [java]                (original-token=["ToArray",<496>,line=369,col=55], dotnet-cls=false, static=false, tempidx-file=./abl/OpenEdge/Core/Collections/Array.cls, extent=-1, signature=toarray(), tempidx=84, qualified=progress.lang.object, indirect-dotnet=false, is-class=true, is-interface=false, builtin-cls=true, access-mode=2130, source-file=./skeleton/oo4gl/Progress/Lang/Object.cls, found-in-source-file=./abl/OpenEdge/Core/Collections/Array.cls, found-in-cls=OpenEdge.Core.Collections.Array, is-enum=false, is-java=false)
     [java]       OpenEdge.Core.String [CLASS_NAME]:<id_unavailable> @369:66
     [java]             (original-token=["OpenEdge.Core.String",<6>,line=369,col=66], dotnet-cls=false, indirect-dotnet=false, qualified=openedge.core.string, is-class=true, oldtype=2986, is-interface=false, builtin-cls=false, source-file=./abl/OpenEdge/Core/String.cls, param_index=1, is-java=false, is-enum=false)
     [java]    pcDelimiter [VAR_CHAR]:<id_unavailable> @369:89
     [java]          (original-token=["pcDelimiter",<383>,line=369,col=89], tempidx-file=./abl/OpenEdge/Core/String.cls, tempidx=147, param_index=1, found-in-source-file=./abl/OpenEdge/Core/String.cls, found-in-cls=OpenEdge.Core.String, oldtype=2986)
     [java] 
     [java] 
     [java] annotateMethodCall FAILURE: listiterator from class OpenEdge.Core.Collections.ListIterator, access KW_PUBLIC, static false, at new [FUNC_CLASS]:<id_unavailable> @435:16
     [java]    OpenEdge.Core.Collections.ListIterator [CLASS_NAME]:<id_unavailable> @435:20
     [java]    ( [LPARENS]:<id_unavailable> @435:58
     [java]       parameter [PARAMETER]:<id_unavailable> @0:0
     [java]          mBackingList [VAR_CLASS]:<id_unavailable> @435:59
     [java] 
     [java]    PARAMETERS: 1
     [java]        object<? extends progress.collections.ilist>
     [java] 
     [java] 

 [java] WARNING: non-local property javaname (get-javaname) lookup failure! Size [OO_METH_INT]:12884902373 @116:47
     [java]       (override=true, refid=12884902033, cls-container=./abl/OpenEdge/Core/Collections/List.cls, access-mode=2130, property-access-type=getter, original-property-type=391, cls-property=true, support_level=16400)
     [java] 
     [java] MISSING_REFID for property Size [VAR_INT]:12884904171 @375:25
     [java]       (cls-container=./abl/OpenEdge/Core/Collections/ICollection.cls, access-mode=2130, tempidx-file=./abl/OpenEdge/Core/Collections/ICollection.cls, tempidx=0, found-in-source-file=./abl/OpenEdge/Core/Collections/ICollection.cls, found-in-cls=OpenEdge.Core.Collections.ICollection, cls-property=true)
     [java] 
     [java] WARNING: non-local property javaname (get-javaname) lookup failure! Size [OO_METH_INT]:12884904174 @375:45
     [java]       (override=true, refid=12884902033, cls-container=./abl/OpenEdge/Core/Collections/List.cls, access-mode=2130, property-access-type=getter, original-property-type=391, cls-property=true, support_level=16400)

And the conversions end with this error:
     [java] ---------------------------
     [java] varref= getAst(#(long) varref.getAnnotation("refid"))
     [java]                               ^  { Cannot invoke "java.lang.Long.longValue()" because the return value of "com.goldencode.ast.Aast.getAnnotation(String)" is null }
     [java] ---------------------------
     [java] ERROR:
     [java] com.goldencode.p2j.pattern.TreeWalkException: ERROR!  Active Rule:
     [java] -----------------------
     [java]       RULE REPORT      
     [java] -----------------------
     [java] Rule Type :   WALK
     [java] Source AST:  [ extent ] BLOCK/CLASS_DEF/BLOCK/METHOD_DEF/BLOCK/STATEMENT/KW_ASSIGN/KW_EXTENT/ @312:16 {12884903725}
     [java] Copy AST  :  [ extent ] BLOCK/CLASS_DEF/BLOCK/METHOD_DEF/BLOCK/STATEMENT/KW_ASSIGN/KW_EXTENT/ @312:16 {12884903725}
     [java] Condition :  varref= getAst(#(long) varref.getAnnotation("refid"))
     [java] Loop      :  false
     [java] --- END RULE REPORT ---
     [java] Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "com.goldencode.ast.Aast.getAnnotation(String)" is null

The above is in /rules/convert/language_statements.rules:

         <rule>type == prog.kw_extent
            <rule>copy.firstChild.type == prog.object_invocation
               <action>varref = copy.firstChild</action>
               <action>varref = varref.getChildAt(1)</action>
               <action on="false">varref = copy.getChildAt(0)</action>
            </rule>
            <action>
               varref= getAst(#(long) varref.getAnnotation("refid"))
            </action>

I attached the modified List class and the full conversion log.

#65 Updated by Ioana-Cristina Prioteasa over 1 year ago

Reproduced the extent conversion error with this testcase:

def var myList as Progress.Collections.IList.
myList = new Progress.Collections.List().

def var arr as integer extent.
assign extent(arr) = myList:Count.

I am investigating this.
Note: The above parser warning don't show.

#66 Updated by Ioana-Cristina Prioteasa over 1 year ago

Reproduced the error with an even simpler testcase. This works in Progress.

def var arr as integer extent.
assign extent(arr) = 10.

#67 Updated by Constantin Asofiei over 1 year ago

Ioana-Cristina Prioteasa wrote:

Reproduced the error with an even simpler testcase. This works in Progress.
[...]

Did you test with trunk?

#68 Updated by Ioana-Cristina Prioteasa over 1 year ago

With trunk it works, working on pinpointing what change on 9488a introduced this regression.

#69 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to bzr skeleton project, rev 123: Added the following skeletons from Progress.Collections: IList, IComparable, IHashable, ISet, ICollection, IMap, IIterable, IIterator, IComparer, IEqualityComparer, List, HashMap, KeyValuePair, SortedSet.
These are only the skeletons I needed to far for the ADE conversion, ported from testcases/oo/skeleton/12.8/Progress/Collections.

#70 Updated by Ioana-Cristina Prioteasa over 1 year ago

The regression was caused by the changes for the *= operators, found the issue and committed the solution in 9488a rev. 15732.
Now the warnings still appear but the List conversion completes. It has a lot of issues with n/a but those are fixed when the needed classes are converted or set up for conversion.
Next I will investigate the warnings, will post what I find. I also want to add to the conversion list everything again to see if there are any other issues in other classes. For now I think I will modify where generics are used.

#71 Updated by Ioana-Cristina Prioteasa over 1 year ago

  • The first warning:
         [java] annotateMethodCall FAILURE: Join from class OpenEdge.Core.String, access KW_PRIVATE, static true, at Join [OO_METH_CLASS]:<id_unavailable> @369:37
         [java]    cast [FUNC_CLASS]:<id_unavailable> @369:42
         [java]       : [OBJECT_INVOCATION]:<id_unavailable> @369:54
         [java]          poValue [VAR_CLASS]:<id_unavailable> @369:47
         [java]          ToArray [OO_METH_CLASS]:<id_unavailable> @369:55
         [java]       OpenEdge.Core.String [CLASS_NAME]:<id_unavailable> @369:66
         [java]    pcDelimiter [VAR_CHAR]:<id_unavailable> @369:89
    

    Seems to be emitted in this method:
    method public override logical Equals(o as Object):
            define variable list as OpenEdge.Core.Collections.IList no-undo.
            def var iter as OpenEdge.Core.Collections.IIterator.
            def var idx as integer.
            def var element as Object extent 2.
    
            if super:Equals(o) then
                return true.
    
            if type-of(o, OpenEdge.Core.Collections.IList) then
            do:
                assign list = cast(o, OpenEdge.Core.Collections.IList).
                if not list:Size eq this-object:Size then
                    return false.
    
                assign iter = list:Iterator().
                do while iter:HasNext():
                    assign idx       += 1
                           element[1] = mBackingList:Get(idx)
                           element[2] = iter:Next()
                           .
                    // if one item is not valid, and the other is, they cannot be the same
                    if valid-object(element[1])
                    and not valid-object(element[2])
                    then
                        return false.
    
                    if not valid-object(element[1])
                    and valid-object(element[2])
                    then
                        return false.
    
                    // if both items are not valid, then they are the same
                    // if they are both valid, check for equality
                    if valid-object(element[1])
                    and valid-object(element[2])
                    and not element[1]:Equals(element[2])
                    then
                        return false.
                end.
    
                return true.
            end.
    
            return false.
        end method.
    

    Specifically here:
    if super:Equals(o) then
                return true.
    

    Not exactly sure how Join is resolved as the method name.
  • The second warning:
    annotateMethodCall FAILURE: listiterator from class OpenEdge.Core.Collections.ListIterator, access KW_PUBLIC, static false, at new [FUNC_CLASS]:<id_unavailable> @435:16
         [java]    OpenEdge.Core.Collections.ListIterator [CLASS_NAME]:<id_unavailable> @435:20
         [java]    ( [LPARENS]:<id_unavailable> @435:58
         [java]       parameter [PARAMETER]:<id_unavailable> @0:0
         [java]          mBackingList [VAR_CLASS]:<id_unavailable> @435:59
    

    Emits in multiple places:
        method public OpenEdge.Core.Collections.IIterator Iterator():
            return new OpenEdge.Core.Collections.ListIterator(mBackingList).
        end method.
    

        method public OpenEdge.Core.Collections.IListIterator ListIterator():
            return new OpenEdge.Core.Collections.ListIterator(mBackingList).
        end method.
    

        method public OpenEdge.Core.Collections.IListIterator ListIterator(pStartIdx as integer):
            Assert:IsPositive(pStartIdx, 'List index').
            if pStartIdx gt mBackingList:Count then
                return error new AssertionFailedError(substitute('Index &1 is larger than List size &2',
                                                                pStartIdx, mBackingList:Count)).
    
            return new OpenEdge.Core.Collections.ListIterator(mBackingList, pStartIdx).
        end method.
    

#72 Updated by Ioana-Cristina Prioteasa over 1 year ago

Continue with conversion and I had to add 2 more skeletons: Progress.IO.MemoryOutputStream, Progress.IO.ByteOrder. These need to be converted and committed to 9436a.
After adding the skeletons, for OpenEdge/Core/ByteBucket.cls:

./abl/OpenEdge/Core/ByteBucket.cls:336:39: unexpected token: GetByte
     [java]     at com.goldencode.p2j.uast.ProgressParser.primary_expr(ProgressParser.java:59724)

This issue is coming from:
assign iByte                = GetByte(this-object:Position)

Context:

    method public integer GetByte ():
        define variable iByte as integer no-undo.

        assign iByte                = GetByte(this-object:Position)
               this-object:Position = this-object:Position + 1.
        return iByte.
    end method.

    method public integer GetByte (input piStartPos as int64):
        if piStartPos  <=  memoutStream:BytesWritten then do:
            return get-byte(memoutStream:Data,piStartPos).
        end.

        return 0.
    end method.

Maybe it is not correctly resolving the overloaded method.. I need to look into this.

#73 Updated by Ioana-Cristina Prioteasa over 1 year ago

Modifying from this

assign iByte = GetByte(this-object:Position)

to
assign iByte = this-object:GetByte(this-object:Position)

solves the issue. So somehow GetByte is not recognized as a method from the current class.

#74 Updated by Ioana-Cristina Prioteasa over 1 year ago

Another issue discovered in OpenEdge/Core/Collections/StringKeyedMap.cls, has to do with generics and I think this one will be difficult to solve:

//var Progress.Collections.IIterator<KeyValuePair<ILongcharHolder, Object>> iter.
def var iter as Progress.Collections.IIterator.
def var hValue as Object.
assign hValue = iter:Current:Value.

The commented line is the original definition, I removed the generic but this way Value is unknown to the parser because it is a property from KeyValuePair:

./abl/OpenEdge/Core/Collections/StringKeyedMap.cls:225:46: unexpected token: Value

I am not exactly if this code can be modified to convert without supporting the generic.

#75 Updated by Ioana-Cristina Prioteasa over 1 year ago

Report on remaining issues for ADE conversion

I added all files listed in #9488-22 to the conversion list using the latest 9488a, along with the two new required skeletons: Progress.IO.MemoryOutputStream and Progress.IO.ByteOrder. I resolved several issues by modifying the original code and compiled a comprehensive list of remaining items that need to be fixed or discussed.

VAR Statement

The new VAR statement is widely used in these classes with various constructs, including:

VAR INT a.
VAR INT a = 1.
VAR INT a,b.
VAR INT a, b =1.

I manually fixed these by rewriting them as DEF VAR statements, about 100 occurrences of more.

Generics

Below are some use cases I encountered:

def private serializable var mBackingList as Progress.Collections.IList<Object>.
var private HashMap<ILongcharHolder, Object> mBackingHashMap.
this-object(new Progress.Collections.List<Object>()).
constructor private List (input pBackingList as Progress.Collections.IList<Object>):

A more complex example involves:
var Progress.Collections.IIterator<KeyValuePair<ILongcharHolder, Object>> iter.
assign hValue = iter:Current:Value.

Here, Value is a property from KeyValuePair. This scenario is more challenging than the others.
I modified the files to exclude generics and, for this specific case, commented out the entire function body.

Overloaded class function not recognized

In OpenEdge/Core/ByteBucket.cls, the following construct did not work: assign iByte = GetByte(this-object:Position) However, this worked correctly: assign iByte = this-object:GetByte(this-object:Position). I applied this solution for now.

tenant-name and tenant-id built in functions not recognized by parser.

After discussing with Radu, I confirmed that these are added in progress.g, but further investigation is needed.
A test case fails with both trunk and 9488a with unexpected token: tenant-id and unexpected token: tenant-name, even though the code works in 4GL:

define variable client as handle no-undo.
define variable tokenValue as character no-undo.
define variable domainAccessCode as character no-undo initial "MyAccessCode".

create client-principal client.

client:user-id = "MyUser".
client:domain-name = "MyDomain".
client:session-id = "MySessionID".

client:seal(domainAccessCode).

assign tokenValue = string(client:tenant-id).
message "Tenant ID:" tokenValue view-as alert-box.

assign tokenValue = client:tenant-name.
message "Tenant Name:" tokenValue view-as alert-box.

delete object client no-error.

Issue with the Join function from OpenEdge.Core.String

The Join function also appears in the parser warnings posted in #9488-71. During the conversion of this class, it leads to the following error:

clsdef = loadConvertedClass(fname, false, this)
     [java]          ^  { Can not find class for accessing Join [OO_METH_CLASS] @369:37 (266287974500) }

at this line

return OpenEdge.Core.String:Join(cast(poValue:ToArray(), OpenEdge.Core.String), pcDelimiter).

A test case using a similar construct converts correctly using the LegacyString implementation, and I have not yet managed to reproduce the issue:

define variable myArray as character extent 2 no-undo.
define variable pcDelimiter as character no-undo initial ",".
define variable joinedString as character no-undo.

myArray[1] = "Item1".
myArray[2] = "Item2".

joinedString = OpenEdge.Core.String:Join(myArray, pcDelimiter).

message "Joined String:" joinedString view-as alert-box.

Parser warnings:

  • A lot of Could not find legacy builtin method javaname for
  • WARNING: more than one method def found using fuzzy lookup: GetIterator from class Progress.Collections.IList
  • annotateMethodCall FAILURE: listiterator from class OpenEdge.Core.Collections.ListIterator, access KW_PUBLIC, static false, at new [FUNC_CLASS]:<id_unavailable> @435:16

Conversion warnings:

  • Null annotation (legacy-import) for using [KW_USING] @17:1 (12884901914) - a lot of these for annotations: legacy-import, full-java-class, simple-java-class, containing-package, found-in-full-java-class
  • MISSING_REFID for property Size [VAR_INT]:12884923722 @2355:22
  • WARNING: non-local property javaname (get-javaname) lookup failure!
  • WARNING: removing unsuported legacy annotation for since and depricated
  • WARNING: no type calculated for BUFFER-VALUE in [261993005876] buffer-value [ATTR_POLY]:261993005876 @99:53
  • Passing unknown value literal to builtin func! Size [OO_METH_INT64]:158913791822 @302:31

Next steps

  • Investigate tenant-name and tenant-id parsing issues in progress.g.
  • Deep dive into the Join function issue in OpenEdge.Core.String.
  • Investigate parser and conversion warnings, focusing on annotateMethodCall failure and method lookups.
  • Discuss about generics handling strategy.

#76 Updated by Constantin Asofiei over 1 year ago

Ioana, some notes:
  • the tenant-id() and tenant-name() support I think is only for the builtin function, and not the handle method, in FWD. Please add conversion and runtime stubs for these, at CLIENT-PRINCIPAL.
  • Null annotation and MISSING_REFID are of concern - are these because of parse failures of ADE classes?
  • are there .NET dependencies from ADE?

#77 Updated by Ioana-Cristina Prioteasa over 1 year ago

Constantin Asofiei wrote:

Ioana, some notes:
  • the tenant-id() and tenant-name() support I think is only for the builtin function, and not the handle method, in FWD. Please add conversion and runtime stubs for these, at CLIENT-PRINCIPAL.

Working on this.

  • Null annotation and MISSING_REFID are of concern - are these because of parse failures of ADE classes?

No.. I am in a state now where I have no parsing or conversion errors, only warnings.

  • are there .NET dependencies from ADE?

No, AFAIK.

#78 Updated by Ioana-Cristina Prioteasa over 1 year ago

Added all the necessary files to conversion(all OpenEdge/ dependencies). The conversion list now:

abl/OpenEdge/Core/Assert.cls
abl/OpenEdge/Core/ByteBucket.cls
abl/OpenEdge/Core/Collections/Collection.cls
abl/OpenEdge/Core/Collections/ICollection.cls
abl/OpenEdge/Core/Collections/IIterable.cls
abl/OpenEdge/Core/Collections/IIterator.cls
abl/OpenEdge/Core/Collections/IList.cls
abl/OpenEdge/Core/Collections/IListIterator.cls
abl/OpenEdge/Core/Collections/ISet.cls
abl/OpenEdge/Core/Collections/Iterator.cls
abl/OpenEdge/Core/Collections/List.cls
abl/OpenEdge/Core/Collections/ListIterator.cls
abl/OpenEdge/Core/Collections/Map.cls
abl/OpenEdge/Core/Collections/ObjectStack.cls
abl/OpenEdge/Core/Integer.cls
abl/OpenEdge/Core/IOModeEnum.cls
abl/OpenEdge/Core/Memptr.cls
abl/OpenEdge/Core/String.cls
abl/OpenEdge/Core/System/ApplicationError.cls
abl/OpenEdge/Core/System/InvalidValueSpecifiedError.cls
abl/OpenEdge/Core/System/NotFoundError.cls
abl/OpenEdge/Core/System/UnsupportedOperationError.cls
abl/OpenEdge/Core/TimeStamp.cls
abl/OpenEdge/Logging/LogEvent.cls
abl/OpenEdge/Logging/LogMessage.cls

abl/OpenEdge/Core/Assertion/AssertArray.cls
abl/OpenEdge/Core/Assertion/AssertObject.cls

abl/OpenEdge/Core/Collections/IMap.cls
abl/OpenEdge/Core/Collections/IMapEntry.cls
abl/OpenEdge/Core/Collections/IStringKeyedMap.cls
abl/OpenEdge/Core/Collections/MapEntry.cls
abl/OpenEdge/Core/Collections/Set.cls
abl/OpenEdge/Core/Collections/StringStringMap.cls
abl/OpenEdge/Core/Collections/IStringStringMap.cls
abl/OpenEdge/Core/Collections/EntrySetIterator.cls
abl/OpenEdge/Core/Collections/KeySet.cls
abl/OpenEdge/Core/Collections/ValueCollection.cls
abl/OpenEdge/Core/Collections/ObjectStack.cls
abl/OpenEdge/Core/Collections/Stack.cls
abl/OpenEdge/Core/Collections/StackOverflowError.cls
abl/OpenEdge/Core/Collections/StackUnderflowError.cls
abl/OpenEdge/Core/Collections/Array.cls
abl/OpenEdge/Core/Collections/ArrayIterator.cls
abl/OpenEdge/Core/Collections/ResizeError.cls
abl/OpenEdge/Core/Collections/AbstractTTCollection.cls
abl/OpenEdge/Core/Collections/EntrySet.cls
abl/OpenEdge/Core/Collections/MapBackedCollection.cls
abl/OpenEdge/Core/Collections/StringKeyedMap.cls

abl/OpenEdge/Core/DataTypeEnum.cls
abl/OpenEdge/Core/DataTypeHelper.cls
abl/OpenEdge/Core/HashAlgorithmEnum.cls
abl/OpenEdge/Core/ISupportInitialize.cls
abl/OpenEdge/Core/ISupportEncoding.cls
abl/OpenEdge/Core/IMemoryPointer.cls
abl/OpenEdge/Core/Session.cls
abl/OpenEdge/Core/Decimal.cls
abl/OpenEdge/Core/WidgetHandle.cls
abl/OpenEdge/Core/StringConstant.cls
abl/OpenEdge/Core/TimeStampConstants.cls
abl/OpenEdge/Core/LongcharArrayHolder.cls
abl/OpenEdge/Core/EventArgs.cls
abl/OpenEdge/Core/AssertionFailedError.cls

abl/OpenEdge/Core/System/ApplicationError.cls
abl/OpenEdge/Core/System/ErrorSeverityEnum.cls
abl/OpenEdge/Core/System/UnsupportedOperationError.cls
abl/OpenEdge/Core/System/InvalidValueSpecifiedError.cls
abl/OpenEdge/Core/System/NotFoundError.cls

abl/OpenEdge/Logging/ILogWriter.cls
abl/OpenEdge/Logging/LogLevelEnum.cls

abl/OpenEdge/Core/Util/Token.cls
abl/OpenEdge/Core/Util/TokenResolver.cls
abl/OpenEdge/Core/Util/TokenResolverEventArgs.cls

abl/OpenEdge/Security/Principal.cls

abl/src/corelib/Ccs/Common/Support/IMemptrHolder.cls
abl/src/corelib/Ccs/Common/Support/IPrimitiveHolder.cls
abl/src/corelib/Ccs/Common/Support/IHandleHolder.cls
abl/src/corelib/Ccs/Common/Support/ILongcharHolder.cls
abl/src/corelib/Ccs/Common/Support/IDecimalHolder.cls
abl/src/corelib/Ccs/Common/Support/IInt64Holder.cls
abl/src/corelib/Ccs/Common/Support/ILongcharArrayHolder.cls
abl/src/corelib/Ccs/Common/Support/IPrimitiveArrayHolder.cls
abl/src/corelib/Ccs/Common/Support/IDateTimeTzHolder.cls

After this the generated code seems very close to compile, there are only a few issues left:
1. Progress code:

    define private variable memoutStream as MemoryOutputStream no-undo.

    define final public property Size as int64 no-undo
        get:
            return memoutStream:BytesWritten.
        end.

    define final public property PointerValue as int64 no-undo
        get():
            return get-pointer-value(memoutStream:Data).
        end get.

In java:
   @LegacySignature(type = Type.VARIABLE, name = "memoutStream")

   //  The storage of the memptr data - this is a dynamically-extensible primitive
   private object<? extends MemoryOutputStream> memoutStream = TypeFactory.object(MemoryOutputStream.class);

   @LegacySignature(type = Type.PROPERTY, name = "PointerValue")
   /* A pointer to the underlying/wrapped memptr */   
   private final int64 pointerValue = TypeFactory.int64();

   @LegacySignature(type = Type.GETTER, name = "Size", returns = "INT64")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_STUB)
   public int64 getSize()
   {
      return function(ByteBucket.class, this, "Size", int64.class, new Block((Body) () -> 
      {
         storeReturnValue(((MemoryOutputStream) pointerValue.ref()).getBytesWritten());
      }));
   }


So instead of using storeReturnValue(((MemoryOutputStream) memoutStream.ref()).getBytesWritten());, the wrong field is used storeReturnValue(((MemoryOutputStream) pointerValue.ref()).getBytesWritten());

2. A lot of errors of these kind appear. This:

if (piSize + this-object:Size) > twoGbSize then

is converted into:
if (_isGreaterThan(plus(piSize, ByteBucket.this.null()), twoGbSize))

This seems to be related to this warning:
 [java] 
     [java] WARNING: non-local property javaname (get-javaname) lookup failure! Size [OO_METH_INT64]:158913791084 @187:50
     [java]       (property-access-type=getter, access-mode=2130, cls-container=./abl/OpenEdge/Core/Memptr.cls, original-property-type=392, override=true, refid=158913790343, support_level=16400, cls-property=true)


These 2 categories are the main errors I see. Added the new conversion and build logs.

#79 Updated by Constantin Asofiei over 1 year ago

For this.null - look in the .ast, I think ByteBucket:size may be missing?

#80 Updated by Ioana-Cristina Prioteasa over 1 year ago

I am not exactly sure, I also tried to create a testcase but it's converting atm. I attached the .ast file.

#81 Updated by Constantin Asofiei over 1 year ago

The refid annotation points to a constructor instead to the getter - look for '137438953915' in the .ast file.

<ast col="71" id="137438957382" line="642" text="Value" type="OO_METH_MEMPTR">
<annotation datatype="java.lang.String" key="property-access-type" value="getter"/>
<annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
<annotation datatype="java.lang.Long" key="peerid" value="871878365155"/>
<annotation datatype="java.lang.String" key="cls-container" value="./abl/OpenEdge/Core/ByteBucket.cls"/>
<annotation datatype="java.lang.Long" key="original-property-type" value="395"/>
<annotation datatype="java.lang.Boolean" key="override" value="true"/>
<annotation datatype="java.lang.Long" key="refid" value="137438953915"/>
<annotation datatype="java.lang.Long" key="support_level" value="16400"/>
<annotation datatype="java.lang.Boolean" key="cls-property" value="true"/>
</ast>

Use -Drules.tracing=true in build.xml for the convert task, this may help to get you who sets refid.

Something looks unbalanced, may be the same root cause why the wrong field is used in #9488-78.

#82 Updated by Ioana-Cristina Prioteasa over 1 year ago

The refid is set in rules/annotations/early_annotations.xml:

<!-- identify all var references and convert tempidx to real using
              the dictionary, exclude widgets that can't be frame fields
              (and thus are not backed by a variable or are not cross-ref'd
              otherwise like button or browse) -->
               <!--type == prog.wid_sub_menu or--> 
         <rule>
            !(type == prog.wid_dialog   or  type == prog.wid_frame    or
              type == prog.wid_window)   and 
            (evalLib("variables")                                                      or
             (this.type == prog.class_event and parent.type == prog.object_invocation) or 
             evalLib("widget_references"))                              and
            type != prog.sys_handle                                     and
            isNote("tempidx")                                           and
            isNote("tempidx-file")                                      and
            ooVarTempIdx.containsKey(sprintf("%s-%s", 
                                             getNoteString("tempidx-file"),
                                             getNoteLong("tempidx")))
            <action>
               putNote("refid", 
                       #(java.lang.Long) ooVarTempIdx.get(sprintf("%s-%s", 
                                                                  getNoteString("tempidx-file"), 
                                                                  getNoteLong("tempidx"))))
            </action>
            <action>removeNote("tempidx")</action>
            <action>removeNote("tempidx-file")</action>
            <action>fprintf("post_parse_fixups.log",
                            "VAR_REF  %-40s: %-25s @ %05d : %05d\n",
                            file,
                            this.getSymbolicTokenType(), 
                            line,
                            this.getColumn())
            </action>
         </rule>

The dumpTree shows:

     [java] Size [VAR_INT64]:137438955304 @306:20
     [java]       (tempidx-file=./abl/OpenEdge/Core/ByteBucket.cls, found-in-source-file=./abl/OpenEdge/Core/ByteBucket.cls, found-in-cls=OpenEdge.Core.ByteBucket, tempidx=0, cls-container=./abl/OpenEdge/Core/ByteBucket.cls, override=true, cls-property=true, access-mode=2130)

tempIdx is set to 0 at parsing, not sure if that is ok, in SymbolResolver.addWrappedWorker:
               // private will match any access mode
               boolean st = var.isStatic();
               Variable old = ssd == varDict 
                                 ? cls.lookupVariableWrapper(name, KW_PRIVATE, st)
                                 : ssd == dsetDict ? cls.lookupDataSetWrapper(name, KW_PRIVATE, st)
                                                   : cls.lookupDataSourceWrapper(name, KW_PRIVATE, st);
               if (old != null)
               {
                  var.setTempIndex(old.getTempIndex());
               }

Size is matched to a variable searched in the interfaces, in OpenEdge.Core.IMemoryPointer. I still need to look into this.

#83 Updated by Constantin Asofiei over 1 year ago

Ioana, is there a task for the new VAR statement? If not, please create one, and lets work it in a different branch. The goal would be to get the minimal syntax to allow what you posted in #9488-75 to convert and run.

#84 Updated by Ioana-Cristina Prioteasa over 1 year ago

  • Related to Feature #9767: Support the new VAR statement introduced in Progress 12.x added

#85 Updated by Constantin Asofiei over 1 year ago

Ioana, please check something (tomorrow is OK): are the associated .cls skeletons in the FWD skeleton project, for what you've converted in ADE? If yes, I'd like to get these converted (the skeletons, not the ADE conversion) and put in a branch.

#86 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed in 9488a rev. 15733: Added conversion and minimal runtime support for TENANT-ID and TENANT-NAME functions in ClientPrincipal.

#87 Updated by Ioana-Cristina Prioteasa over 1 year ago

Constantin Asofiei wrote:

Ioana, please check something (tomorrow is OK): are the associated .cls skeletons in the FWD skeleton project, for what you've converted in ADE? If yes, I'd like to get these converted (the skeletons, not the ADE conversion) and put in a branch.

I checked and it seems that the skeletons of the classes mentioned in #9488-78 are in the skeleton bzr project. I will start converting them. Where should I commit them? 9436a?

#88 Updated by Constantin Asofiei over 1 year ago

Ioana-Cristina Prioteasa wrote:

Where should I commit them? 9436a?

Yes, 9436a

#89 Updated by Ioana-Cristina Prioteasa over 1 year ago

From those some are already present in fwd, should I skip them?

#90 Updated by Constantin Asofiei over 1 year ago

Ioana-Cristina Prioteasa wrote:

From those some are already present in fwd, should I skip them?

Yes, add only what's missing.

#91 Updated by Ioana-Cristina Prioteasa over 1 year ago

I still have the error with n/a, not sure why some classes that are in p2j are not recognized. Example:

  [java] ./abl/OpenEdge/Core/Decimal.cls
     [java] Null annotation (full-java-class) for Ccs.Common.Support.IPrimitiveHolder [CLASS_NAME] @3:17 (111669149708)
     [java] Null annotation (simple-java-class) for Ccs.Common.Support.IPrimitiveHolder [CLASS_NAME] @3:17 (111669149708)
     [java] Null annotation (containing-package) for Ccs.Common.Support.IPrimitiveHolder [CLASS_NAME] @3:17 (111669149708)
     [java] Null annotation (full-java-class) for Ccs.Common.Support.IPrimitiveHolder [CLASS_NAME] @3:17 (120259084300)
     [java] Null annotation (simple-java-class) for Ccs.Common.Support.IPrimitiveHolder [CLASS_NAME] @3:17 (120259084300)
     [java] Null annotation (containing-package) for Ccs.Common.Support.IPrimitiveHolder [CLASS_NAME] @3:17 (120259084300)
     [java] Null annotation (full-java-class) for Ccs.Common.Support.IPrimitiveArrayHolder [CLASS_NAME] @3:17 (124554051596)
     [java] Null annotation (simple-java-class) for Ccs.Common.Support.IPrimitiveArrayHolder [CLASS_NAME] @3:17 (124554051596)
     [java] Null annotation (containing-package) for Ccs.Common.Support.IPrimitiveArrayHolder [CLASS_NAME] @3:17 (124554051596)

Even tho we have:
package com.goldencode.p2j.oo.common.support;

import com.goldencode.p2j.util.*;

import static com.goldencode.p2j.util.BlockManager.*;
import static com.goldencode.p2j.report.ReportConstants.*;

/**
 * Business logic (converted to Java from the 4GL source code
 * in Ccs/Common/Support/IPrimitiveHolder.cls).
 */
@LegacyResource(resource = "Ccs.Common.Support.IprimitiveHolder")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL|RT_LVL_FULL)
public interface IprimitiveHolder
extends com.goldencode.p2j.oo.lang._BaseObject_
{
}

I tried to modify the LegacyResource to resource = "Ccs.Common.Support.IPrimitiveHolder"), with capital P but the error persists. I can modify them by hand to get them committed today, there are not that many n/a, but i don't really know why this happens.

#92 Updated by Ioana-Cristina Prioteasa over 1 year ago

Constantin, is the LegacyResourceSupport annotation needed for types: PROPERTY, SUBSCRIBE, PUBLISH, UNSUBSCRIBE?

#93 Updated by Ioana-Cristina Prioteasa over 1 year ago

Also, these skeletons are missing from the skeleton bzr project:
  • OpenEdge/Core/IMemoryPointer.cls
  • OpenEdge/Core/TimeStampConstants.cls
  • OpenEdge/Security/Principal.cls

I got them from the testcases/oo/skeleton and have them converted. Should I add them to the skeleton project?

#94 Updated by Ioana-Cristina Prioteasa over 1 year ago

Managed to isolate the refid issue with this test:
  • abl/OpenEdge/Security/Principal.cls
                                                             
    block-level on error undo, throw.
    using OpenEdge.Core.Memptrr.
    
    class OpenEdge.Security.Principal :
        constructor private Principal():
        end constructor.
    
        method static public void Import(input poCP as class Memptrr):
            poCP:Value = 0.
        end method.
    end class.
    
  • abl/OpenEdge/Core/Memptrr.cls
    block-level on error undo, throw.
    
    using Ccs.Common.Support.IMemptrHolderr.
    
    class OpenEdge.Core.Memptrr
    implements IMemptrHolderr:
        define final public property Value as memptr no-undo get.
    
        constructor protected Memptrr():
        end constructor.
    end class.
    
  • abl/Ccs/Common/Support/IMemptrHolderr.cls
                                                         
    INTERFACE Ccs.Common.Support.IMemptrHolderr:
        DEFINE PUBLIC PROPERTY Value AS MEMPTR NO-UNDO
        GET.
    
    END INTERFACE.
    

If I delete implements IMemptrHolderr: from IMemptrHolderr, the issue is gone. But with the above, the Import function from Principal.cls converts to:

   @LegacySignature(type = Type.METHOD, name = "Import", parameters = 
   {
      @LegacyParameter(name = "poCP", type = "OBJECT", qualified = "openedge.core.memptrr", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_STUB)
   public static void import_(final object<? extends Memptrr> _poCp)
   {
      ObjectOps.load(Principal.class);
      object<? extends Memptrr> poCp = TypeFactory.initInput(_poCp);

      internalProcedure(Principal.class, "Import", new Block((Body) () -> 
      {
         poCp.ref().null(new memptr(new memptr(0)));
      }));
   }

I will start investigating this testcase.

#95 Updated by Ioana-Cristina Prioteasa over 1 year ago

Simplified the testcase a little more:
  • IInterface.cls
    INTERFACE IInterface:
        DEFINE PUBLIC PROPERTY Value AS int NO-UNDO
        GET.
    END INTERFACE.
    
  • Cls.cls
    block-level on error undo, throw.
    
    class Cls
    implements IInterface:
        define final public property Value as int no-undo get.
    
        constructor protected Cls():
        end constructor.
    
        method public void SetValue():
            if(this-object:Value > 0) then
                MESSAGE "".
        end method.
    end class.
    

If I delete the final keyword from the property definition in Cls, the above converts correctly.

#96 Updated by Ioana-Cristina Prioteasa over 1 year ago

Value is a keyword but this does not affect the above testcase, even if we use define final public property v1 as int no-undo get. we still have the issue, the only thing is we don't need to use this-object. So this has something to do with the final keyword.
I will stick with working on this test:
  • IInterface.cls
    INTERFACE IInterface:
        DEFINE PUBLIC PROPERTY v1 AS int NO-UNDO GET.
        DEFINE PUBLIC PROPERTY v2 AS int NO-UNDO GET.
    END INTERFACE.
    
  • Cls.cls
    class Cls
    implements IInterface:
        define final public property v1 as int no-undo get.
        define public property v2 as int no-undo get.
    
        constructor protected Cls():
        end constructor.
    
        method public void verify():
            if(v1 > 0 AND v2 > 0) then
                MESSAGE "".
        end method.
    end class.
    

This converts to:

public class Cls
extends BaseObject
implements com.goldencode.dataset.Iinterface
{
   @LegacySignature(type = Type.PROPERTY, name = "v1")
   private final integer v1 = TypeFactory.integer();

   @LegacySignature(type = Type.PROPERTY, name = "v2")
   private integer v2 = TypeFactory.integer();

   @LegacySignature(type = Type.GETTER, name = "v1", returns = "INTEGER")
   public integer getV1()
   {
      return v1.duplicate();
   }

   @LegacySignature(type = Type.GETTER, name = "v2", returns = "INTEGER")
   public integer getV2()
   {
      return v2.duplicate();
   }

   @LegacySignature(type = Type.CONSTRUCTOR, name = "Cls")
   protected void __cls_constructor__()
   {
      internalProcedure(Cls.class, this, "Cls", new Block((Body) () -> 
      {
         __lang_BaseObject_constructor__();
      }));
   }

   @LegacySignature(type = Type.METHOD, name = "verify")
   public void verify()
   {
      internalProcedure(Cls.class, this, "verify", new Block((Body) () -> 
      {
         if (_and(isGreaterThan(null(), 0), () -> isGreaterThan(getV2(), 0)))
         {
            message("");
         }
      }));
   }
}

And the conversion log shows at Core Conversion Annotation step:

     [java] ./abl/Cls.cls
     [java] WARNING: non-local property javaname (get-javaname) lookup failure! v1 [OO_METH_INT]:12884901978 @10:12
     [java]       (oldtype=2986, support_level=16400, override=true, support_level-byrule=gaps/gap_analysis_marking.xml:435, refid=12884901940, access-mode=2130, cls-container=./abl/Cls.cls, refid-byrule=annotations/early_annotations.xml:136, cls-property=true, property-access-type-byrule=annotations/oo_references.rules:895, original-property-type-byrule=include/common-progress.rules:6689, property-access-type=getter, original-property-type=391)

#97 Updated by Constantin Asofiei over 1 year ago

Please post the AST for the DEFINE PROPERTY node for v1 and v2.

#98 Updated by Ioana-Cristina Prioteasa over 1 year ago

For v1:

<ast col="5" id="12884901902" line="3" text="define" type="DEFINE_PROPERTY">
            <annotation datatype="java.lang.String" key="get-javaname" value="getV1"/>
            <annotation datatype="java.lang.String" key="promote-byrule" value="annotations/scope_promotion.rules:306"/>
            <annotation datatype="java.lang.String" key="getter-javaname" value="getV1"/>
            <annotation datatype="java.lang.String" key="vardef-byrule" value="fixups/post_parse_fixups.xml:298"/>
            <annotation datatype="java.lang.String" key="classname" value="integer"/>
            <annotation datatype="java.lang.String" key="set-javaname" value="setV1"/>
            <annotation datatype="java.lang.String" key="oo-data-store" value="VAR"/>
            <annotation datatype="java.lang.String" key="classname-byrule" value="annotations/variable_definitions.rules:308"/>
            <annotation datatype="java.lang.String" key="getter-javaname-byrule" value="annotations/naming.rules:469"/>
            <annotation datatype="java.lang.Long" key="type" value="391"/>
            <annotation datatype="java.lang.Long" key="peerid" value="236223201311"/>
            <annotation datatype="java.lang.Boolean" key="undoable" value="false"/>
            <annotation datatype="java.lang.String" key="javaname-byrule" value="include/common-progress.rules:11904"/>
            <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
            <annotation datatype="java.lang.Boolean" key="override" value="true"/>
            <annotation datatype="java.lang.String" key="support_level-byrule" value="gaps/gap_analysis_marking.xml:435"/>
            <annotation datatype="java.lang.Boolean" key="vardef" value="true"/>
            <annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
            <annotation datatype="java.lang.String" key="cls-container" value="./abl/Cls.cls"/>
            <annotation datatype="java.lang.Boolean" key="cls-property" value="true"/>
            <annotation datatype="java.lang.String" key="javaname" value="v1"/>
            <annotation datatype="java.lang.Boolean" key="promote" value="true"/>
            <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/variable_definitions.rules:760"/>
            <annotation datatype="java.lang.String" key="name" value="v1"/>
            <ast col="12" id="12884901904" line="3" text="final" type="KW_FINAL"/>
            <ast col="18" id="12884901906" line="3" text="public" type="KW_PUBLIC"/>
            <ast col="34" id="12884901910" line="3" text="v1" type="SYMBOL"/>
            <ast col="37" id="12884901912" line="3" text="as" type="KW_AS">
              <ast col="40" id="12884901914" line="3" text="int" type="KW_INT"/>
            </ast>
            <ast col="44" id="12884901916" line="3" text="no-undo" type="KW_NO_UNDO">
              <annotation datatype="java.lang.String" key="support_level-byrule" value="gaps/gap_analysis_marking.xml:435"/>
              <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
            </ast>
            <ast col="52" id="12884901918" line="3" text="get" type="KW_GET">
              <annotation datatype="java.lang.String" key="javaname-byrule" value="annotations/naming.rules:466"/>
              <annotation datatype="java.lang.String" key="name-byrule" value="annotations/naming.rules:391"/>
              <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
              <annotation datatype="java.lang.String" key="support_level-byrule" value="gaps/gap_analysis_marking.xml:435"/>
              <annotation datatype="java.lang.String" key="default_getter-byrule" value="annotations/method_defs.rules:745"/>
              <annotation datatype="java.lang.String" key="classname" value="integer"/>
              <annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
              <annotation datatype="java.lang.String" key="access-mode-byrule" value="annotations/method_defs.rules:683"/>
              <annotation datatype="java.lang.String" key="javaname" value="getV1"/>
              <annotation datatype="java.lang.String" key="classname-byrule" value="annotations/method_defs.rules:632"/>
              <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/method_definitions.rules:394"/>
              <annotation datatype="java.lang.Long" key="peerid" value="236223201324"/>
              <annotation datatype="java.lang.String" key="name" value="v1"/>
              <annotation datatype="java.lang.Boolean" key="default_getter" value="true"/>
              <ast col="0" hidden="true" id="12884902008" line="0" text="" type="KW_METHOD">
                <annotation datatype="java.lang.String" key="javaname-byrule" value="annotations/naming.rules:464"/>
                <annotation datatype="java.lang.String" key="return_type-byrule" value="annotations/naming.rules:413"/>
                <annotation datatype="java.lang.String" key="name-byrule" value="annotations/naming.rules:463"/>
                <annotation datatype="java.lang.Long" key="return_type" value="391"/>
                <annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
                <annotation datatype="java.lang.String" key="oo-data-store" value="METHOD"/>
                <annotation datatype="java.lang.String" key="access-mode-byrule" value="annotations/naming.rules:460"/>
                <annotation datatype="java.lang.String" key="oo-data-store-byrule" value="annotations/naming.rules:465"/>
                <annotation datatype="java.lang.String" key="javaname" value="getV1"/>
                <annotation datatype="java.lang.String" key="byrule" value="annotations/naming.rules:394"/>
                <annotation datatype="java.lang.String" key="name" value="get-v1"/>
                <ast col="0" id="12884902009" line="0" text="" type="LPARENS">
                  <annotation datatype="java.lang.String" key="byrule" value="annotations/naming.rules:395"/>
                </ast>
              </ast>
              <ast col="0" id="12884902013" line="0" text="(" type="LPARENS">
                <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/operators.rules:704"/>
                <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                <annotation datatype="java.lang.Long" key="peerid" value="236223201325"/>
              </ast>
              <ast col="0" id="12884902014" line="0" text="block" type="BLOCK">
                <annotation datatype="java.lang.Boolean" key="recordscoping" value="false"/>
                <annotation datatype="java.lang.String" key="recordscoping-byrule" value="annotations/record_scoping_prep.rules:768"/>
                <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/control_flow.rules:2544"/>
                <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                <annotation datatype="java.lang.Long" key="peerid" value="236223201326"/>
                <ast col="0" id="12884902015" line="0" text="statement" type="STATEMENT">
                  <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                  <ast col="0" id="12884902016" line="0" text="return" type="KW_RETURN">
                    <annotation datatype="java.lang.Boolean" key="oo-reference" value="false"/>
                    <annotation datatype="java.lang.Boolean" key="real_return" value="true"/>
                    <annotation datatype="java.lang.Long" key="refid" value="12884901902"/>
                    <annotation datatype="java.lang.String" key="default_getter-byrule" value="annotations/method_defs.rules:734"/>
                    <annotation datatype="java.lang.String" key="classname" value="integer"/>
                    <annotation datatype="java.lang.String" key="refid-byrule" value="annotations/return_statements.rules:156"/>
                    <annotation datatype="java.lang.Boolean" key="infunc" value="true"/>
                    <annotation datatype="java.lang.String" key="oo-reference-byrule" value="annotations/return_statements.rules:157"/>
                    <annotation datatype="java.lang.String" key="classname-byrule" value="annotations/return_statements.rules:155"/>
                    <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                    <annotation datatype="java.lang.Long" key="peerid" value="236223201328"/>
                    <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/control_flow.rules:858"/>
                    <annotation datatype="java.lang.String" key="real_return-byrule" value="annotations/return_stmts.rules:140"/>
                    <annotation datatype="java.lang.Boolean" key="default_getter" value="true"/>
                    <annotation datatype="java.lang.String" key="infunc-byrule" value="annotations/return_statements.rules:146"/>
                    <ast col="0" id="12884902017" line="0" text="expression" type="EXPRESSION">
                      <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/expressions.rules:1428"/>
                      <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                      <annotation datatype="java.lang.Long" key="peerid" value="236223201329"/>
                      <ast col="0" id="12884902018" line="0" text="v1" type="VAR_INT">
                        <annotation datatype="java.lang.String" key="cls-property-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.Long" key="refid" value="12884901902"/>
                        <annotation datatype="java.lang.Boolean" key="direct-property-access" value="true"/>
                        <annotation datatype="java.lang.String" key="cls-container" value="./abl/Cls.cls"/>
                        <annotation datatype="java.lang.String" key="refid-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.Boolean" key="cls-property" value="true"/>
                        <annotation datatype="java.lang.Boolean" key="static" value="false"/>
                        <annotation datatype="java.lang.String" key="property-access-type-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.String" key="direct-property-access-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.String" key="property-access-type" value="getter"/>
                        <annotation datatype="java.lang.Long" key="peerid" value="236223201330"/>
                        <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/variable_references.rules:1018"/>
                        <annotation datatype="java.lang.String" key="cls-container-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.String" key="static-byrule" value="annotations/method_defs.rules:734"/>
                      </ast>
                    </ast>
                  </ast>
                </ast>
              </ast>
            </ast>
          </ast>

For v2:

<ast col="5" id="12884901922" line="4" text="define" type="DEFINE_PROPERTY">
            <annotation datatype="java.lang.String" key="get-javaname" value="getV2"/>
            <annotation datatype="java.lang.String" key="promote-byrule" value="annotations/scope_promotion.rules:306"/>
            <annotation datatype="java.lang.String" key="getter-javaname" value="getV2"/>
            <annotation datatype="java.lang.String" key="vardef-byrule" value="fixups/post_parse_fixups.xml:298"/>
            <annotation datatype="java.lang.String" key="classname" value="integer"/>
            <annotation datatype="java.lang.String" key="set-javaname" value="setV2"/>
            <annotation datatype="java.lang.String" key="oo-data-store" value="VAR"/>
            <annotation datatype="java.lang.String" key="classname-byrule" value="annotations/variable_definitions.rules:308"/>
            <annotation datatype="java.lang.String" key="getter-javaname-byrule" value="annotations/naming.rules:469"/>
            <annotation datatype="java.lang.Long" key="type" value="391"/>
            <annotation datatype="java.lang.Long" key="peerid" value="236223201338"/>
            <annotation datatype="java.lang.Boolean" key="undoable" value="false"/>
            <annotation datatype="java.lang.String" key="javaname-byrule" value="include/common-progress.rules:11904"/>
            <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
            <annotation datatype="java.lang.Boolean" key="override" value="true"/>
            <annotation datatype="java.lang.String" key="support_level-byrule" value="gaps/gap_analysis_marking.xml:435"/>
            <annotation datatype="java.lang.Boolean" key="vardef" value="true"/>
            <annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
            <annotation datatype="java.lang.String" key="cls-container" value="./abl/Cls.cls"/>
            <annotation datatype="java.lang.Boolean" key="cls-property" value="true"/>
            <annotation datatype="java.lang.String" key="javaname" value="v2"/>
            <annotation datatype="java.lang.Boolean" key="promote" value="true"/>
            <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/variable_definitions.rules:760"/>
            <annotation datatype="java.lang.String" key="name" value="v2"/>
            <ast col="12" id="12884901924" line="4" text="public" type="KW_PUBLIC"/>
            <ast col="28" id="12884901928" line="4" text="v2" type="SYMBOL"/>
            <ast col="31" id="12884901930" line="4" text="as" type="KW_AS">
              <ast col="34" id="12884901932" line="4" text="int" type="KW_INT"/>
            </ast>
            <ast col="38" id="12884901934" line="4" text="no-undo" type="KW_NO_UNDO">
              <annotation datatype="java.lang.String" key="support_level-byrule" value="gaps/gap_analysis_marking.xml:435"/>
              <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
            </ast>
            <ast col="46" id="12884901936" line="4" text="get" type="KW_GET">
              <annotation datatype="java.lang.String" key="javaname-byrule" value="annotations/naming.rules:466"/>
              <annotation datatype="java.lang.String" key="name-byrule" value="annotations/naming.rules:391"/>
              <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
              <annotation datatype="java.lang.String" key="support_level-byrule" value="gaps/gap_analysis_marking.xml:435"/>
              <annotation datatype="java.lang.String" key="default_getter-byrule" value="annotations/method_defs.rules:745"/>
              <annotation datatype="java.lang.String" key="classname" value="integer"/>
              <annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
              <annotation datatype="java.lang.String" key="access-mode-byrule" value="annotations/method_defs.rules:683"/>
              <annotation datatype="java.lang.String" key="javaname" value="getV2"/>
              <annotation datatype="java.lang.String" key="classname-byrule" value="annotations/method_defs.rules:632"/>
              <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/method_definitions.rules:394"/>
              <annotation datatype="java.lang.Long" key="peerid" value="236223201351"/>
              <annotation datatype="java.lang.String" key="name" value="v2"/>
              <annotation datatype="java.lang.Boolean" key="default_getter" value="true"/>
              <ast col="0" hidden="true" id="12884902010" line="0" text="" type="KW_METHOD">
                <annotation datatype="java.lang.String" key="javaname-byrule" value="annotations/naming.rules:464"/>
                <annotation datatype="java.lang.String" key="return_type-byrule" value="annotations/naming.rules:413"/>
                <annotation datatype="java.lang.String" key="name-byrule" value="annotations/naming.rules:463"/>
                <annotation datatype="java.lang.Long" key="return_type" value="391"/>
                <annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
                <annotation datatype="java.lang.String" key="oo-data-store" value="METHOD"/>
                <annotation datatype="java.lang.String" key="access-mode-byrule" value="annotations/naming.rules:460"/>
                <annotation datatype="java.lang.String" key="oo-data-store-byrule" value="annotations/naming.rules:465"/>
                <annotation datatype="java.lang.String" key="javaname" value="getV2"/>
                <annotation datatype="java.lang.String" key="byrule" value="annotations/naming.rules:394"/>
                <annotation datatype="java.lang.String" key="name" value="get-v2"/>
                <ast col="0" id="12884902011" line="0" text="" type="LPARENS">
                  <annotation datatype="java.lang.String" key="byrule" value="annotations/naming.rules:395"/>
                </ast>
              </ast>
              <ast col="0" id="12884902020" line="0" text="(" type="LPARENS">
                <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/operators.rules:704"/>
                <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                <annotation datatype="java.lang.Long" key="peerid" value="236223201352"/>
              </ast>
              <ast col="0" id="12884902021" line="0" text="block" type="BLOCK">
                <annotation datatype="java.lang.Boolean" key="recordscoping" value="false"/>
                <annotation datatype="java.lang.String" key="recordscoping-byrule" value="annotations/record_scoping_prep.rules:768"/>
                <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/control_flow.rules:2544"/>
                <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                <annotation datatype="java.lang.Long" key="peerid" value="236223201353"/>
                <ast col="0" id="12884902022" line="0" text="statement" type="STATEMENT">
                  <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                  <ast col="0" id="12884902023" line="0" text="return" type="KW_RETURN">
                    <annotation datatype="java.lang.Boolean" key="oo-reference" value="false"/>
                    <annotation datatype="java.lang.Boolean" key="real_return" value="true"/>
                    <annotation datatype="java.lang.Long" key="refid" value="12884901922"/>
                    <annotation datatype="java.lang.String" key="default_getter-byrule" value="annotations/method_defs.rules:734"/>
                    <annotation datatype="java.lang.String" key="classname" value="integer"/>
                    <annotation datatype="java.lang.String" key="refid-byrule" value="annotations/return_statements.rules:156"/>
                    <annotation datatype="java.lang.Boolean" key="infunc" value="true"/>
                    <annotation datatype="java.lang.String" key="oo-reference-byrule" value="annotations/return_statements.rules:157"/>
                    <annotation datatype="java.lang.String" key="classname-byrule" value="annotations/return_statements.rules:155"/>
                    <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                    <annotation datatype="java.lang.Long" key="peerid" value="236223201355"/>
                    <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/control_flow.rules:858"/>
                    <annotation datatype="java.lang.String" key="real_return-byrule" value="annotations/return_stmts.rules:140"/>
                    <annotation datatype="java.lang.Boolean" key="default_getter" value="true"/>
                    <annotation datatype="java.lang.String" key="infunc-byrule" value="annotations/return_statements.rules:146"/>
                    <ast col="0" id="12884902024" line="0" text="expression" type="EXPRESSION">
                      <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/expressions.rules:1428"/>
                      <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                      <annotation datatype="java.lang.Long" key="peerid" value="236223201356"/>
                      <ast col="0" id="12884902025" line="0" text="v2" type="VAR_INT">
                        <annotation datatype="java.lang.String" key="cls-property-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.Long" key="refid" value="12884901922"/>
                        <annotation datatype="java.lang.Boolean" key="direct-property-access" value="true"/>
                        <annotation datatype="java.lang.String" key="cls-container" value="./abl/Cls.cls"/>
                        <annotation datatype="java.lang.String" key="refid-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.Boolean" key="cls-property" value="true"/>
                        <annotation datatype="java.lang.Boolean" key="static" value="false"/>
                        <annotation datatype="java.lang.String" key="property-access-type-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.String" key="byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.String" key="direct-property-access-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.String" key="property-access-type" value="getter"/>
                        <annotation datatype="java.lang.Long" key="peerid" value="236223201357"/>
                        <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/variable_references.rules:1018"/>
                        <annotation datatype="java.lang.String" key="cls-container-byrule" value="annotations/method_defs.rules:734"/>
                        <annotation datatype="java.lang.String" key="static-byrule" value="annotations/method_defs.rules:734"/>
                      </ast>
                    </ast>
                  </ast>
                </ast>
              </ast>
            </ast>
          </ast>

The issue would be here:
for v1:

                        <ast col="12" id="12884901978" line="10" text="v1" type="OO_METH_INT">
                          <annotation datatype="java.lang.Long" key="oldtype" value="2986"/>
                          <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
                          <annotation datatype="java.lang.Boolean" key="override" value="true"/>
                          <annotation datatype="java.lang.String" key="support_level-byrule" value="gaps/gap_analysis_marking.xml:435"/>
                          <annotation datatype="java.lang.Long" key="refid" value="12884901940"/>
                          <annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
                          <annotation datatype="java.lang.String" key="cls-container" value="./abl/Cls.cls"/>
                          <annotation datatype="java.lang.String" key="refid-byrule" value="annotations/early_annotations.xml:136"/>
                          <annotation datatype="java.lang.Boolean" key="cls-property" value="true"/>
                          <annotation datatype="java.lang.String" key="property-access-type-byrule" value="annotations/oo_references.rules:895"/>
                          <annotation datatype="java.lang.String" key="original-property-type-byrule" value="include/common-progress.rules:6689"/>
                          <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/oo_calls.rules:180"/>
                          <annotation datatype="java.lang.String" key="property-access-type" value="getter"/>
                          <annotation datatype="java.lang.Long" key="original-property-type" value="391"/>
                          <annotation datatype="java.lang.Long" key="peerid" value="236223201440"/>
                        </ast>

for v2:
                        <ast col="23" id="12884901983" line="10" text="v2" type="OO_METH_INT">
                          <annotation datatype="java.lang.String" key="javaname-byrule" value="annotations/oo_references.rules:930"/>
                          <annotation datatype="java.lang.Long" key="oldtype" value="2986"/>
                          <annotation datatype="java.lang.Long" key="support_level" value="16400"/>
                          <annotation datatype="java.lang.Boolean" key="override" value="true"/>
                          <annotation datatype="java.lang.String" key="support_level-byrule" value="gaps/gap_analysis_marking.xml:435"/>
                          <annotation datatype="java.lang.String" key="found-in-source-file" value="./abl/Cls.cls"/>
                          <annotation datatype="java.lang.Long" key="refid" value="12884901922"/>
                          <annotation datatype="java.lang.Long" key="access-mode" value="2130"/>
                          <annotation datatype="java.lang.String" key="cls-container" value="./abl/Cls.cls"/>
                          <annotation datatype="java.lang.String" key="refid-byrule" value="annotations/early_annotations.xml:136"/>
                          <annotation datatype="java.lang.Boolean" key="cls-property" value="true"/>
                          <annotation datatype="java.lang.String" key="property-access-type-byrule" value="annotations/oo_references.rules:895"/>
                          <annotation datatype="java.lang.String" key="original-property-type-byrule" value="include/common-progress.rules:6689"/>
                          <annotation datatype="java.lang.String" key="javaname" value="getV2"/>
                          <annotation datatype="java.lang.String" key="property-access-type" value="getter"/>
                          <annotation datatype="java.lang.Long" key="original-property-type" value="391"/>
                          <annotation datatype="java.lang.Long" key="peerid" value="236223201445"/>
                          <annotation datatype="java.lang.String" key="found-in-cls" value="Cls"/>
                          <annotation datatype="java.lang.String" key="peerid-byrule" value="convert/oo_calls.rules:180"/>
                        </ast>

For v1, the refid points to the constructor <ast col="5" id="12884901940" line="6" text="constructor" type="KW_CONSTRUC"> and for v2 it points to <ast col="5" id="12884901922" line="4" text="define" type="DEFINE_PROPERTY">
I atached the full Cls.cls.ast. I am debugging ClassDefinition and Variable to see if I can find the issue.

#99 Updated by Constantin Asofiei over 1 year ago

Please post the entire .ast file after parse, before post-parse-fixups.

#100 Updated by Ioana-Cristina Prioteasa over 1 year ago

This is Cls.cls.ast before post-parse-fixups.

#101 Updated by Constantin Asofiei over 1 year ago

Ioana, in progress.g:define_stmt_pre_scan you need to have KW_FINAL, too:

      d:KW_DEFINE^
      (
           am:access_mode
         | KW_SERIALAB     // should only apply to dataset, temp-table, var and prop
         | KW_NON_SER      // should only apply to dataset, temp-table, var and prop
         | st:KW_STATIC    // inStaticCtxt processing is not needed in pre-scan mode
         | ab:KW_ABSTRACT  // ignored for now
         | ov:KW_OVERRIDE  // ignored for now
         | KW_FINAL
      )*

#102 Updated by Ioana-Cristina Prioteasa over 1 year ago

Thank you! This solves the issue. I am looking now to see what other problems there are when compiling.

#103 Updated by Ioana-Cristina Prioteasa over 1 year ago

When generics are detected in the parser I added an annotation:

genericType = sym.loadClass(typeParams.toString());
if (genericType != null) 
{
  #sym.putAnnotation("generic-type", genericType);
}

Then in base_structure.xml:

         <rule>relativePath(this, prog.class_def, prog.kw_class, prog.kw_implemts)
            <action>createPeerAst(java.kw_implements, "implements", jclsdef.id, 0)</action>
         </rule>
         <rule>relativePath(this, prog.kw_implemts, prog.class_name)
            <action>jname = execLib("resolveClassReference", copy, null)</action>
            <action>genType = copy.getAnnotation("generic-type")</action>
            <rule>genType != null
               <action>jname = sprintf("%s%s%s%s", jname, "&lt;", genType, "&gt;")</action>
            </rule>
            <action>createPeerAst(java.class_reference, jname, closestPeerId)</action>
         </rule>

But instead I would need the resolved java class name. I tried using SymbolResolver.findConvertedLegacyClass() and this works in some cases where the classes that are used in the generic are already in p2j.oo, for the rest I get null.
Any tips on this?

#104 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a rev. 15734: Added FINAL keyword in define_stmt_pre_scan and excluded generics from implements clause.

Now the conversion completes. Remaining issues:

At parsing

There is still this warning:

     [java] WARNING: more than one method def found using fuzzy lookup: GetIterator from class Progress.Collections.IList
     [java] 
     [java]    CALLER GetIterator [OO_METH_CLASS]:<id_unavailable> @313:43
     [java]       (original-token=["GetIterator",<496>,line=313,col=43])
     [java] 
     [java]    PARAMETERS: 0
     [java]    MATCH 0: METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@b7a9093 ooLvl; [Ljava.lang.String;@7beba1a8 overrides; 
     [java]         KW_PUBLIC instance member GetIterator (OO_METH_CLASS - progress.collections.iiterator), extent 0, javaname getIterator, override false, abstract false in class Progress.Collections.IIterable, tempIdx 0
     [java]    PARAMETERS: 0
     [java]  data
     [java] 
     [java]    MATCH 1: METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@4f1f569a ooLvl; [Ljava.lang.String;@6332f548 overrides; 
     [java]         KW_PUBLIC instance member GetIterator (OO_METH_CLASS - progress.collections.iiterator), extent 0, javaname getIterator, override false, abstract false in class Progress.Collections.IIterable, tempIdx 0
     [java]    PARAMETERS: 0
     [java]  data

And this failure:

     [java] annotateMethodCall FAILURE: listiterator from class OpenEdge.Core.Collections.ListIterator, access KW_PUBLIC, static false, at new [FUNC_CLASS]:<id_unavailable> @435:16
     [java]    OpenEdge.Core.Collections.ListIterator [CLASS_NAME]:<id_unavailable> @435:20
     [java]    ( [LPARENS]:<id_unavailable> @435:58
     [java]       parameter [PARAMETER]:<id_unavailable> @0:0
     [java]          mBackingList [VAR_CLASS]:<id_unavailable> @435:59
     [java] 
     [java]    PARAMETERS: 1
     [java]        object<? extends progress.collections.ilist>

At complilation

Generics

A lot of the compilation errors come from the generics being used:
  • p2j/oo/core/String_.java:58: error: repeated interface Icomparable,
    Because in the original code there is:
    class OpenEdge.Core.String
    serializable
    implements ILongcharHolder
             , ISupportEncoding
             // Support comparision between either LongcharHolder or other String objects
             , IComparable<ILongcharHolder>
             , IComparable<OpenEdge.Core.String>
             , IHashable
    
  • p2j/oo/core/ByteBucket.java:46: error: ByteBucket is not abstract and does not override abstract method compareTo(object) in Icomparable

  • /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/ByteBucket.java:1140: error: name clash: compareTo(object<? extends ImemptrHolder>) in ByteBucket and compareTo(object) in Icomparable have the same erasure, yet neither overrides the other
        [javac]    public integer compareTo(final object<? extends ImemptrHolder> _pOther)

Constructors:

    [javac] /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/util/TokenResolverEventArgs.java:179: error: cannot find symbol
    [javac]          __core_EventArgs_constructor__();


In EventArgs the construstor's name is: __core_eventArgs_constructor__.

Others:

  • no suitable method found for indexOf(memptr,longchar,int64): idx.assign(indexOf(memoutStream.ref().getData(), pSearchStr, pStartAt));
  • p2j/oo/core/collections/Array_.java:470: error: incompatible types: unknown cannot be converted to int64
        [javac]             Array_.this.resizeValue(new unknown());
  • p2j/oo/core/EventArgs.java:74: error: no suitable method found for storeReturnValue(ContextLocal<object>): storeReturnValue(EventArgs.empty);
  • p2j/oo/core/LongcharArrayHolder.java:219: error: no suitable constructor found for longchar(character[]): LongcharArrayHolder.this.bulkSetValue(new longchar(pcValue[0]));
  • p2j/oo/core/collections/List.java:775: error: no suitable method found for newInstance(Class<ListIterator>,object<CAP#1>): storeReturnValue(ObjectOps.newInstance(com.goldencode.p2j.oo.core.collections.ListIterator.class, mBackingList));
  • p2j/oo/core/collections/List.java:815: error: no suitable method found for newInstance(Class<ListIterator>,object<CAP#1>,integer)

#105 Updated by Constantin Asofiei over 1 year ago

Ioana, my approach for investigating compile errors is to comment or otherwise 'remove' the offending code that doesn't compile, and run ant compile again - until it completes. This way, you can get a full list of compile errors. Please do so, if you haven't already.

#106 Updated by Ioana-Cristina Prioteasa over 1 year ago

I attached the conversion and build logs of the ADE code I converted.
I tried to get a list of the compile issues, but most of them are from the duplicate classes.(ADE classes that are already implemented in fwd)
  • common.support:
    • duplicate classes: IhandleHolder, IlongcharHolder, ImemptrHolder, IprimitiveHolder
  • core:assertion:
    • duplicate class: AssertArray, AssertObject
  • core:collections:
    • duplicate class: Icollection, Ilist, Iiterable, Iiterator, IlistIterator, Imap, ImapEntry, Iset, Array(Array_), ArrayIterator, EntrySet, MapBackedCollection, KeySet, ObjectStack, ResizeError, StackOverflowError(StackOverflowError_), StackUnderflowError, StringKeyedMap, StringStringMap, ValueCollection
    • Array_:
      - implements Ilist(this extends Icollection), missing isEmpty, isEmpty_ instead. I think this is still because of the duplicate classes. The existent Ilist implemented contained isEmpty. The ADE converted Ilist does not, but extends Icollection which had isEmpty_.
      - Array_.this.resizeValue(new unknown()); -- 'resizeValue(com.goldencode.p2j.util.int64)' in 'com.goldencode.p2j.oo.core.collections.Array_' cannot be applied to '(com.goldencode.p2j.util.unknown)' changed to Array_.this.resizeValue(new int64());
    • List:
      - storeReturnValue(ObjectOps.newInstance(com.goldencode.p2j.oo.core.collections.ListIterator.class, mBackingList));
      Cannot resolve method 'newInstance(Class<ListIterator>, object<capture of ? extends Ilist>)'
      - storeReturnValue(ObjectOps.newInstance(com.goldencode.p2j.oo.core.collections.ListIterator.class, mBackingList, pStartIdx));
      Cannot resolve method 'newInstance(Class<ListIterator>, object<capture of ? extends Ilist>, integer)'
    • ObjectStack:
      - using Stack constructor wrong __core_collections_Stack_constructor__ instead of __core_collections_stack_constructor__
    • ResizeError:
      - using ApplicationError constructor wrong: __core_system_ApplicationError_constructor__(); instead of __core_system_applicationError_constructor__();
    • Set:
      - storeReturnValue(ObjectOps.newInstance(com.goldencode.p2j.oo.core.collections.ListIterator.class, mBackingList));
      Cannot resolve method 'newInstance(Class<ListIterator>, object<capture of ? extends Ilist>)'
    • Stack:
      using ApplicationError constructor wrong: __core_system_ApplicationError_constructor__(); instead of __core_system_applicationError_constructor__();
    • StringKeyedMap:
      - entrySet_1.ref().add(ObjectOps.newInstance(MapEntry.class, (object) ObjectOps.thisObject(), iter.ref().getCurrent()));
      Cannot resolve method 'newInstance(Class<MapEntry>, object, object<capture of ? extends BaseObject>)'
      - StringStringMap:
      entrySet_1.ref().add(ObjectOps.newInstance(MapEntry.class, (object) ObjectOps.thisObject(), iter.ref().getCurrent()));
      Cannot resolve method 'newInstance(Class<MapEntry>, object, object<capture of ? extends BaseObject>)'
  • core:system:
    • duplicate class: ErrorSeverityEnum, UnsupportedOperationError
  • core:util:
    • Token:
      - Icomparable is using generics: Class 'Token' must either be declared abstract or implement abstract method 'compareTo(object)' in 'Icomparable'
      used implements Icomparable<Token>
    • TokenResolver:
      - silent(() -> tokenVal.assign(pError.ref().getMessage(integer.maximum(new integer(1), idx))));
      'getMessage(com.goldencode.p2j.util.integer)' in 'com.goldencode.p2j.oo.lang.LegacyError' cannot be applied to '(com.goldencode.p2j.util.int64)'
      used
      silent(() -> tokenVal.assign(pError.ref().getMessage(new integer(integer.maximum(new integer(1), idx)))));
    • TokenResolverEventArgs:
      using EventArgs constructor wrong: __core_EventArgs_constructor__(); instead of __core_eventArgs_constructor__();
  • core:
    • duplicate classes: Assert(Assert_), AssertionFailedError, Memptr, DataTypeEnum, HashAlgorithmEnum, IomodeEnum, Session, TimeStamp, WidgetHandle
    • ByteBucket:
      - generics issues:
      added implements Icomparable<ByteBucket> and changed
      public integer compareTo(final object _pOther) to
      public integer compareTo(final object _pOther)
      - idx.assign(indexOf(memoutStream.ref().getData(), pSearchStr, pStartAt));
      Cannot resolve method 'indexOf(memptr, longchar, int64)'
    • Decimal: same generic issue as in ByteBucket
    • EventArgs:
      - if (_not(EventArgs.empty.isValid()))
      Cannot resolve method 'isValid' in 'ContextLocal'
      - storeReturnValue(EventArgs.empty);
      Cannot resolve method 'storeReturnValue(ContextLocal<object>)'
    • Integer_: same generic issue as in ByteBucket
    • WidgetHandle:
      - LongcharArrayHolder.this.bulkSetValue(new longchar(pcValue[0]));
      Cannot resolve constructor 'longchar(character[])'
    • Memptr: same generic issue as in ByteBucket
    • String_: same generic issue as in ByteBucket, plus duplicate implements clause
    • Integer_: same generic issue as in ByteBucket
  • logging:
    • duplicate class: IlogWriter, LogLevelEnum, LogMessage

After fixing these I modified the existent classes already implemented with their converted version and also added the newly converted in 9488a. Had some refactoring and solved a lot of compilation issues but now I have a version that compiles with all the classes added. I have not committed them yet in 9488a.

#107 Updated by Ioana-Cristina Prioteasa over 1 year ago

Constantin, for ADE to convert I needed 2 converted skeletons inside p2j and I committed them in 9488a rev. 15735: Progress.IO.ByteOrder and Progress.IO.MemoryOutputStream.
I added on devsrv01/tmp:
  • the ADE conversion project I used, with a clean 9488a: ADE_project.zip
  • 9488a modified with the ADE converted code inside: 9488_withADE.zip

#108 Updated by Constantin Asofiei over 1 year ago

I think the problem with the ObjectOps.newInstance missing the parameter type mode is that the target method or constructor call has parameters defined with generics - so the target can't be resolved properly.

See these errors during parsing:

     [java] annotateMethodCall FAILURE: listiterator from class OpenEdge.Core.Collections.ListIterator, access KW_PUBLIC, static false, at new [FUNC_CLASS]:<id_unavailable> @435:16
     [java]    OpenEdge.Core.Collections.ListIterator [CLASS_NAME]:<id_unavailable> @435:20
     [java]    ( [LPARENS]:<id_unavailable> @435:58
     [java]       parameter [PARAMETER]:<id_unavailable> @0:0
     [java]          mBackingList [VAR_CLASS]:<id_unavailable> @435:59
     [java]
     [java]    PARAMETERS: 1
     [java]        object<? extends progress.collections.ilist>

Considering that we can't define our own types with <T> generic, to test this properly (please confirm), I'm not sure what's the best approach here.

For now, please try to debug while annotateMethodCall fails. And also open a separate task for the generic discussions.

Greg: considering that the #9457 project doesn't use generics in the app code, I want to find a way to delay this implementation. One of the 'weird' parts is:

class OpenEdge.Core.String
serializable
implements ILongcharHolder
         , ISupportEncoding
         // Support comparision between either LongcharHolder or other String objects
         , IComparable<ILongcharHolder>
         , IComparable<OpenEdge.Core.String>
         , IHashable

Note how you can implement the same interface but with different generic types. This is not allowed in Java.

#109 Updated by Ioana-Cristina Prioteasa over 1 year ago

Created issue #9868 for the discussion about generics. I will try to gather some examples of generics usage and add the description.

#110 Updated by Ioana-Cristina Prioteasa over 1 year ago

  • Related to Feature #9868: Support generics introduced in Progress 12.x added

#111 Updated by Ioana-Cristina Prioteasa over 1 year ago

The initial idea was to convert everything we need from ADE and later choose of we keep the current implementation(existent in p2j.oo package) or if we will keep the converted class. After discussing with Constantin today, we decided to get a minimum list of what is needed to be converted and only keep what is not existent in p2j.oo with full support.
I obtained this list:

abl/OpenEdge/Core/Collections/List.cls
abl/OpenEdge/Core/Collections/ListIterator.cls
abl/OpenEdge/Core/Collections/ObjectStack.cls
abl/OpenEdge/Core/Integer.cls
abl/OpenEdge/Core/Memptr.cls
abl/OpenEdge/Core/String.cls
abl/OpenEdge/Core/System/InvalidValueSpecifiedError.cls
abl/OpenEdge/Core/System/NotFoundError.cls
abl/Ccs/Common/Support/IInt64Holder.cls
abl/OpenEdge/Core/StringConstant.cls

I created a new /abl folder where I included only these classes (some classes not included in the conversion where parsed from the /abl folder if I did not do that).
I converted with 9488a. What I needed was to add ImemoryPointer in p2j.oo.core (this was merged to trunk with 9436a but did not reach 9488a) and also the skeleton for this class.
I still have some annotateMethodCall FAILURE that I will start investigating but these are all the compilation errors I have:

    [javac] /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/Memptr.java:156: error: '(' expected
    [javac]    public void n/a(final int64 _piSize)
    [javac]                 ^
    [javac] /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/Memptr.java:156: error: invalid method declaration; return type required
    [javac]    public void n/a(final int64 _piSize)
    [javac]                  ^
    [javac] /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/Memptr.java:611: error: not a statement
    [javac]             Memptr.this.n/a(piSize);
    [javac]                          ^
    [javac] /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/String_.java:121: error: '(' expected
    [javac]    public void n/a(character var)
    [javac]                 ^
    [javac] /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/String_.java:121: error: invalid method declaration; return type required
    [javac]    public void n/a(character var)
    [javac]                  ^
    [javac] /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/String_.java:166: error: not a statement
    [javac]          String_.this.n/a(new character(I18nOps.getCPInternal()));
    [javac]                        ^
    [javac] /home/icp/projects/ADE/src/com/goldencode/p2j/oo/core/String_.java:186: error: not a statement
    [javac]          String_.this.n/a(new character(longchar.getCodePage(pcString)));

They are all coming from property setters that are not emitted as they should.

#112 Updated by Ioana-Cristina Prioteasa over 1 year ago

Found missing skeletons needed on #9488 or #9436 and I committed then to the bzr skeleton project, rev. 125:
  • Progress.IO.MemoryOutputStream, Progress.IO.ByteOrder, OpenEdge.Core.IMemoryPointer, OpenEgde.Core.TimeStampConstants, OpenEdge.Security.Principal.

#113 Updated by Greg Shah over 1 year ago

Greg: considering that the #9457 project doesn't use generics in the app code, I want to find a way to delay this implementation. One of the 'weird' parts is:
[...]

Note how you can implement the same interface but with different generic types. This is not allowed in Java.

Yuck. Some things to record for posterity:

  • OO 4GL currently (as of the latest 12.8 LTS) doesn't have generics support that can be used by end user code. These references are only in the built-ins. Presumeably, they implement this limited special support in the native code of the OE runtime.
  • OE is shrinking (dying actually) annually and the next LTS release is not expected until at least 2027 (best case) as explained by Progress Software Corp's (PSC) themselves. Most (all?) commercial ISVs would never deploy an OE release that is not LTS. That means that no one will be deploying the post-12.8 LTS until 2027 or possibly long after that.
  • Supposedly PSC is working on generics for OO 4GL but generics can't appear in real OO 4GL code that goes to customers until that next LTS release is available so we have years to go before end user code will ever have direct access to generics.
  • I wonder if OE will still exist in 2028 or if it will just be in maintenance mode. Actually, it is already kind of in maintenance mode since the amount of development on OE itself is very limited. But for the sake of argument, let's say that maintenance mode is in the future somewhere. My suggestion is that given the pace of decline, maintenance mode is possibly not that far in the future. Under those conditions we may never have to implement generics in the FWD implementation of the OO 4GL.
  • Nevertheless, the current approach chosen by PSC seems to match the C# concept of generics which uses runtime information and tends to be much slower than generics in Java which use type erasure and are fast but have more type limitations on the implementation. As you note, we can't directly implement two parameterized interfaces using Java generics because of the type erasure implementation.

If it is feasible to defer the work on generics to another task, I am OK with that so long as that work can be deferred to after the current projects are complete. My point here is that if we defer the work but then just have to work it again in order to finish some current projects, then the deferral doesn't help too much. So, I'd like to know if we need it in the short term or not. If not, then we should defer it.

#114 Updated by Constantin Asofiei over 1 year ago

Greg Shah wrote:

So, I'd like to know if we need it in the short term or not. If not, then we should defer it.

The only concern is the ADE code - if we want to convert it fully, then we need generics. Ioana has a short list of files which we urgently need converted - if those can be solved without generics, then I think we are OK on the very short term.

#115 Updated by Greg Shah over 1 year ago

Constantin Asofiei wrote:

Greg Shah wrote:

So, I'd like to know if we need it in the short term or not. If not, then we should defer it.

The only concern is the ADE code - if we want to convert it fully, then we need generics. Ioana has a short list of files which we urgently need converted - if those can be solved without generics, then I think we are OK on the very short term.

Agreed.

#116 Updated by Ioana-Cristina Prioteasa over 1 year ago

Minimized the testcase where the setter of a property is not correctly emitted and ends up as n/a.
For this:

using OpenEdge.Core.IMemoryPointer.

class OpenEdge.Core.Memptr
implements IMemoryPointer
:
    define final public property Size as int64 no-undo
        get():
            return 0. 
        end get.
        set(input piSize as int64):
        end set.
end class.

ImemoryPointer is converted and in p2j.oo as stubs. It contains getters for 2 propertities: pointerValue and size.
This converts to:
public class Memptr
extends BaseObject
implements ImemoryPointer
{
// ..
   @LegacySignature(type = Type.SETTER, name = "Size", parameters = 
   {
      @LegacyParameter(name = "piSize", type = "INT64", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_STUB)
   public void n/a(final int64 _piSize)
   {
      int64 piSize = TypeFactory.initInput(_piSize);

      internalProcedure(Memptr.class, this, "Size", new Block());
   }
// .. 
}

If I add IMemoryPointer in the /abl folder, but not include it in the file-cvt-list, the behavior changes. It converts to:

public class Memptr
extends BaseObject
implements n/a
{
// ..
// the setter is emmitted correctly here
   @LegacySignature(type = Type.SETTER, name = "Size", parameters = 
   {
      @LegacyParameter(name = "piSize", type = "INT64", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_STUB)
   public void setSize(final int64 _piSize)
   {
      int64 piSize = TypeFactory.initInput(_piSize);

      internalProcedure(Memptr.class, this, "Size", new Block());
   }
// ..
}

But if I also add IMemoryPointer to the conversion list, the testcase converts correctly.

#117 Updated by Constantin Asofiei over 1 year ago

I've added my changes to 9488a rev 15736. Sorry, they are not fully tested/complete. Please check with your test now.

Also: please rebase the branch. The skeletons you added are already in trunk.

#118 Updated by Ioana-Cristina Prioteasa over 1 year ago

Rebased 9488a and tested again the conversion for only these files (needed from ADE and not existent in p2j with full support reported):

abl/OpenEdge/Core/Collections/List.cls
abl/OpenEdge/Core/Collections/ListIterator.cls
abl/OpenEdge/Core/Collections/ObjectStack.cls
abl/OpenEdge/Core/Integer.cls
abl/OpenEdge/Core/Memptr.cls
abl/OpenEdge/Core/String.cls
abl/OpenEdge/Core/System/InvalidValueSpecifiedError.cls
abl/OpenEdge/Core/System/NotFoundError.cls
abl/Ccs/Common/Support/IInt64Holder.cls
abl/OpenEdge/Core/StringConstant.cls

The setters are now emitted correctly, thanks Constantin!
Remaining issues:

LegacyList(OpenEdge.Core.Collections.List)

  • return new OpenEdge.Core.Collections.ListIterator(mBackingList).
    

    converts to:
    storeReturnValue(ObjectOps.newInstance(com.goldencode.p2j.oo.core.collections.LegacyListIterator.class, mBackingList));  
    

    Compilation error: Cannot resolve method 'newInstance(Class<LegacyListIterator>, object<capture of ? extends Ilist>)'
  • return new OpenEdge.Core.Collections.ListIterator(mBackingList, pStartIdx).
    

    converts to:
    storeReturnValue(ObjectOps.newInstance(com.goldencode.p2j.oo.core.collections.LegacyListIterator.class, mBackingList, pStartIdx));   
    

    Compilation error: Cannot resolve method 'newInstance(Class<LegacyListIterator>, object<capture of ? extends Ilist>, integer)'

LegacyInteger(OpenEdge.Core.Integer)

Generics issue:
LegacyInteger implements Icomparable, this interface uses generics now:

@LegacyResource(resource = "Progress.Collections.IComparable")
@LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_STUB)
public interface Icomparable<T extends _BaseObject_>
extends com.goldencode.p2j.oo.lang._BaseObject_
{
   @LegacySignature(type = Type.METHOD, name = "CompareTo", returns = "INTEGER", parameters = 
   {
      @LegacyParameter(name = "otherObject", type = "OBJECT", qualified = "progress.lang.object", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_STUB)
   public integer compareTo(final object<? extends T> _otherObject);
}

but in LegacyInteger:
public class LegacyInteger
extends BaseObject
implements Iint64Holder,
           Icomparable,
           Ihashable
{
   // ..
   public integer compareTo(final object<? extends Iint64Holder> _pOther)
   {
      // ..
   }
   // ..
}

For this to compile we would need to emit implements Icomparable<Iint64Holder>.

Memptr(OpenEdge.Core.Memptr)

The same issue as in LegacyList, here we need implements Icomparable<ImemptrHolder>

LegacyString(OpenEdge.Core.String)

Almost the same issue as in LegacyList, but here there is also the issue with the same class being implemented 2 times with different generics:

class OpenEdge.Core.String
serializable
implements ILongcharHolder
         , ISupportEncoding
         , IComparable<ILongcharHolder>
         , IComparable<OpenEdge.Core.String>
         , IHashable

converts to:
public class LegacyString
extends BaseObject
implements IlongcharHolder,
           ISupportEncoding,
           Icomparable,
           Icomparable,
           Ihashable
{
   // ..
   public integer compareTo(final object<? extends IlongcharHolder> _pOther)
   {
      // ..
   }
   public integer compareTo_1(final object<? extends com.goldencode.p2j.oo.core.LegacyString> _pOther)
   {
      // ..
   }
   // ..
}

Compilation errors are solved if the implements clause is:

implements IlongcharHolder,
           ISupportEncoding,
           Icomparable<IlongcharHolder>,
           Ihashable

I will start with the iterator issues in LegacyList, not sure what is happening but it is most likely linked to this parsing error:

     [java] WARNING: more than one method def found using fuzzy lookup: Iterator from class OpenEdge.Core.Collections.IList
     [java] 
     [java]    CALLER Iterator [OO_METH_CLASS]:<id_unavailable> @378:32
     [java]       (original-token=["Iterator",<497>,line=378,col=32])
     [java] 
     [java]    PARAMETERS: 0
     [java]    MATCH 0: METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@1f4cb17b ooLvl; [Ljava.lang.String;@280099a0 overrides; 
     [java]         KW_PUBLIC instance member Iterator (OO_METH_CLASS - openedge.core.collections.iiterator), extent 0, javaname iterator, override false, abstract false in class OpenEdge.Core.Collections.IIterable, tempIdx 0
     [java]    PARAMETERS: 0
     [java]  data
     [java] 
     [java]    MATCH 1: METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@7aca299e ooLvl; [Ljava.lang.String;@1bf52f10 overrides; 
     [java]         KW_PUBLIC instance member Iterator (OO_METH_CLASS - openedge.core.collections.iiterator), extent 0, javaname iterator, override false, abstract false in class OpenEdge.Core.Collections.IIterable, tempIdx 0
     [java]    PARAMETERS: 0
     [java]  data
     [java] 
     [java]    Lvl01 parse: ./abl/OpenEdge/Core/Collections/ListIterator.cls
     [java]    Lvl02 parse: | ./skeleton/oo4gl/OpenEdge/Core/Collections/Iterator.cls
     [java]    Lvl01 DONE:  ./abl/OpenEdge/Core/Collections/ListIterator.cls
     [java] 
     [java] annotateMethodCall FAILURE: listiterator from class OpenEdge.Core.Collections.ListIterator, access KW_PUBLIC, static false, at new [FUNC_CLASS]:<id_unavailable> @435:16
     [java]    OpenEdge.Core.Collections.ListIterator [CLASS_NAME]:<id_unavailable> @435:20
     [java]    ( [LPARENS]:<id_unavailable> @435:58
     [java]       parameter [PARAMETER]:<id_unavailable> @0:0
     [java]          mBackingList [VAR_CLASS]:<id_unavailable> @435:59
     [java] 
     [java]    PARAMETERS: 1
     [java]        object<? extends progress.collections.ilist>
     [java] 

#119 Updated by Constantin Asofiei over 1 year ago

Why are you converting String.cls? This is already implemented. Please post the only the .cls files which have no implementation in FWD.

#120 Updated by Ioana-Cristina Prioteasa over 1 year ago

This is the support for these in p2j:
- OpenEdge.Core.Collection.List (p2j.oo.core.collections.LegacyList) - STUBS
- OpenEdge.Core.Collection.ListIterator (p2j.oo.core.collections.LegacyListIterator) - STUBS
- OpenEdge.Core.Collection.ObjectStack (p2j.oo.core.collections.ObjectStack) - STUBS
- OpenEdge.Core.Integer (p2j.oo.core.LegacyInteger) - STUBS
- OpenEdge.Core.Memptr (p2j.oo.core.Memptr) - PARTIAL
- OpenEdge.Core.String (p2j.oo.core.LegacyString) - PARTIAL
- OpenEdge.Core.System.InvalidValueSpecifiedError (p2j.oo.core.system.InvalidValueSpecifiedError) - STUBS
- Ccs.Common.Support.IInt64Holder (p2j.oo.common.support.Iint64Holder)(needed in OpenEdge.Core.Integer) - STUBS
- OpenEdge.Core.StringConstant (p2j.oo.core.StringConstant)(needed in OpenEdge.Core.String) - STUBS
If partial support is ok for now, the conversion list is:

abl/OpenEdge/Core/Collections/List.cls
abl/OpenEdge/Core/Collections/ListIterator.cls
abl/OpenEdge/Core/Collections/ObjectStack.cls
abl/OpenEdge/Core/Integer.cls
abl/OpenEdge/Core/System/InvalidValueSpecifiedError.cls
abl/OpenEdge/Core/System/NotFoundError.cls
abl/Ccs/Common/Support/IInt64Holder.cls

After conversion, compilation error are in LegacyInteger and LegacyList, the ones described in #9488-118.

#121 Updated by Constantin Asofiei over 1 year ago

For LegacyInteger, for now make the change by hand.
For LegacyList, these are related to generics (I think) - see the annotateMethodCall FAILURE: errors.

#122 Updated by Constantin Asofiei over 1 year ago

Also, for the CCS and other 'holder' classes - are these fully implemented in FWD?

#123 Updated by Ioana-Cristina Prioteasa over 1 year ago

We have implemented in FWD:
  • IcharacterHolder.java
  • IdecimalHolder.java
  • Iint64Holder.java
  • IlongcharHolder.java
  • IprimitiveArrayHolder.java
  • IdateTimeTzHolder.java
  • IhandleHolder.java
  • IlongcharArrayHolder.java
  • ImemptrHolder.java
  • IprimitiveHolder.java

Some are reported with STUBS runtime support level but as these are interfaces it could be considered FULL.
Iint64Holder converted is the same as the one in p2j, I will remove this one from the ADE conversion list.

What I could find in /CCcs/Common/Support and is not in FWD:
  • IRowidArrayHolder.cls
  • ICharacterArrayHolder.cls
  • IMemptrArrayHolder.cls
  • IIntegerArrayHolder.cls
  • IDateTimeTzArrayHolder.cls
  • IDecimalArrayHolder.cls
  • IDateHolder.cls
  • IDateTimeHolder.cls
  • IDateTimeArrayHolder.cls
  • IInt64ArrayHolder.cls
  • IHandleArrayHolder.cls
  • IIntegerHolder.cls
  • IRowidHolder.cls
  • ILogicalHolder.cls
  • ILogicalArrayHolder.cls
  • IDateArrayHolder.cls

#124 Updated by Constantin Asofiei over 1 year ago

Ioana-Cristina Prioteasa wrote:

What I could find in /CCcs/Common/Support and is not in FWD:

Please add these to your 'short' list:

#125 Updated by Ioana-Cristina Prioteasa over 1 year ago

The issue in OpenEdge.Core.Collections.List:
annotateMethodCall failed because there was no method match. This happened because in ClassDefinition.checkAccessRights, for the method that should be resolved mdat.access was KW_PK_PRIV, while access was KW_PUBLIC.

   private MemberData checkAccessRights(MemberData mdat, int access)
   {
      if (mdat != null)
      {
         // check for a match to the access mode:
         // 1. searching for private methods match everything
         // 2. a direct match is always OK
         // 3. a public method matches a protected search
         boolean ok = (access == KW_PRIVATE)  ||
                      (access == mdat.access) ||
                      (access == KW_PROTECTD || && mdat.access == KW_PUBLIC);

         // pretend no match if access modes are not right
         if (!ok)
         {
            return null;
         }
      }

      return mdat;
   }

I modified SymbolResolver.calcAccess, which was responsible for the access parameter passed to checkAccessRights. I added a method to check the packages and also account for KW_PK_PRIV. In checkAccessRights:

         boolean ok = (access == KW_PRIVATE)  ||
                      (access == mdat.access) ||
                      ((access == KW_PROTECTD || access == KW_PK_PRIV) && mdat.access == KW_PUBLIC)||
                      (access == KW_PROTECTD  && mdat.access == KW_PK_PRIV);

After this, the class is now correctly converted. Another annotateMethodCall failure remained:
     [java] annotateMethodCall FAILURE: stack from class OpenEdge.Core.Collections.Stack, access KW_PROTECTD, static false, at super [KW_SUPER]:<id_unavailable> @22:9
     [java]    ( [LPARENS]:<id_unavailable> @22:14
     [java]       parameter [PARAMETER]:<id_unavailable> @0:0
     [java]          expression [EXPRESSION]:<id_unavailable> @0:0
     [java]             poArray [VAR_CLASS]:<id_unavailable> @22:15


But here the reason is different. The methods are matched but they are eliminated as possibilities because the parameter types don't match exactly:
In ClassDefinition.exactMethodLookup(), the list gotten from calling candidates is:
METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@3d42b756 ooLvl; [Ljava.lang.String;@7c93e69 overrides; 
        KW_PROTECTD instance member Stack (OO_METH_VOID), extent 0, javaname stack, override false, abstract false in class OpenEdge.Core.Collections.Stack, tempIdx 2
   PARAMETERS: 1
      KW_INPUT object<? extends progress.lang.object>[]
 data

METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@4e4c05a0 ooLvl; [Ljava.lang.String;@d763b06 overrides; 
        KW_PROTECTD instance member Stack (OO_METH_VOID), extent 0, javaname stack, override false, abstract false in class OpenEdge.Core.Collections.Stack, tempIdx 4
   PARAMETERS: 1
      KW_INPUT character[]
 data

METRICS 0 exact; 0 cvt; 0 extExact; 0 extCvt; 0 wildcard; [I@2526d5f9 ooLvl; [Ljava.lang.String;@6b529d42 overrides; 
        KW_PUBLIC instance member Stack (OO_METH_VOID), extent 0, javaname stack, override false, abstract false in class OpenEdge.Core.Collections.Stack, tempIdx 6
   PARAMETERS: 1
      KW_INPUT integer
 data

And I am looking for one with ParameterKey = object < ? extends progress.lang.object > . And one of them has KW_INPUT object < ? extends progress.lang.object > [].
Here in exactMethodLookup if fails to match it with both exactMatch and flexModeMatch. Not sure if it would be correct to find in here..
Then because exactMethodLookup return null it goes on to result = fuzzy.fuzzyMethodLookup(name, sig, access, isStatic, internal, node, constructor);
And the candidate with indeterminate extent is eliminated from the call to processExtentMatches:
 // no extent in caller
      if (callerExtVal == 0)
      {
         // no extent in the parameter definition
         test = (mem) -> mem.data.getSignature(idx).type.indexOf("[") == -1;

         // no marking needed here
         mark = (m) -> {};
      }

Maybe here we should let it pass if it is indeterminate and mark it as fuzzy.
// no extent in caller
      if (callerExtVal == 0)
      {
         test = (mem) ->
         {
            int parmExt = getExtent(mem.data.getSignature(idx).type);
            return parmExt == 0 || parmExt == -1;
         };

         mark = (mem) ->
         {
            int parmExt = getExtent(mem.data.getSignature(idx).type);
            if (parmExt == 0)
            {
               mem.extExact++;
            }
            else if (parmExt == -1)
            {
               mem.extCvt++;  
            }
         };
      }

This would solve the annotateMethodCall issues. I will commit in 9488a, but I am not exactly sure if this is correct.

#126 Updated by Ioana-Cristina Prioteasa over 1 year ago

I was wrong in my last post. This is the original 4GL code for the second annotateMethodCall issue:

block-level on error undo, throw.

using OpenEdge.Core.Collections.ObjectStack.
using OpenEdge.Core.Collections.Stack.
using Progress.Lang.Object.

class OpenEdge.Core.Collections.ObjectStack serializable inherits Stack:

    constructor public ObjectStack (poArray as Object extent):
        super(poArray).
    end constructor.
    // other methods
end class.

And is the Stack skeleton we have:
constructor protected Stack ( poArray as Progress.Lang.Object extent ):
end.

It should be resolved.
In SymbolResolver.readExtent():
      if (node.isAnnotation("extent"))
      {
         extent = (int) ((long) node.getAnnotation("extent"));
      }
      else
      {
         Aast child = node.getImmediateChild(KW_EXTENT, null);

         if (child != null)
         {
            // there is an extent, default to indeterminate
            extent = -1;

            Aast num = child.getChildAt(0);

            if (num != null)
            {
               extent = ExpressionConversionWorker.literalToInt(num);
            }
         }
      }

node.text = expression, and has no extent annotation. node.down.text = poArray and has extent=-1 annotation.

#127 Updated by Ioana-Cristina Prioteasa over 1 year ago

Something like this would solve the issue:

      if (node.isAnnotation("extent"))
      {
         extent = (int) ((long) node.getAnnotation("extent"));
      }
      else if (node.getChildAt(0)!= null && node.getChildAt(0).isAnnotation("extent"))
      {
         extent = (int) ((long) node.getChildAt(0).getAnnotation("extent"));
      }
      else
      {
         Aast child = node.getImmediateChild(KW_EXTENT, null);

         if (child != null)
         {
            // there is an extent, default to indeterminate
            extent = -1;

            Aast num = child.getChildAt(0);

            if (num != null)
            {
               extent = ExpressionConversionWorker.literalToInt(num);
            }
         }
      }

Not sure if this is ok. Maybe node is not correct and not that part of the code.. I will keep looking into it.

#128 Updated by Ioana-Cristina Prioteasa over 1 year ago

I committed in 9488a rev.15861:
  • Added SymbolResolver.getLegacyPackageName method that extracts the legacy package name from the fully qualified class name.
  • Corrected SymbolResolver.calcAccessMode to also calculate the package private access mode.
  • Modified SymbolResolver.readExtent to resolve the extent in the case the node's type is EXPRESSION and the extent annotation is present in the child.
  • Corrected ClassDefinition.checkAccessRights, added the case when a public method matches a package private search.

I am also in the process of consolidating the new list Constantin emailed me, containing needed classes.

I added OpenEdge/Collections/Array.cls to conversion and another annotateMethod failure appears. I am looking into it now.

#129 Updated by Ioana-Cristina Prioteasa over 1 year ago

This is the latest list of what is needed from the OpenEdge, Ccs and OEUnit packages:

Already implemented with reported runtime support FULL

  • ./skeleton/oo4gl/Ccs/Common/Support/IInt64Holder.cls - existent in p2j at com.goldencode.p2j.oo.common.support.Iint64Holder - rt STUB level reported but is interface, equivalent to full.
  • ./skeleton/oo4gl/Ccs/Common/Support/ILongcharHolder.cls - existent in p2j at com.goldencode.p2j.oo.common.support.IlongcharHolder
  • ./skeleton/oo4gl/Ccs/Common/Support/IMemptrHolder.cls - existent in p2j at com.goldencode.p2j.oo.common.support.ImemptrHolder
  • ./skeleton/oo4gl/Ccs/Common/Support/IPrimitiveHolder.cls - existent in p2j at com.goldencode.p2j.oo.common.support.IprimitiveHolder
  • ./skeleton/oo4gl/OEUnit/Assertion/Assert.cls - existent in p2j at com.goldencode.p2j.oo.oeunit.assertion.Assert
  • ./skeleton/oo4gl/OEUnit/Assertion/AssertionFailedError.cls - existent in p2j at com.goldencode.p2j.oo.oeunit.assertion.AssertionFailedError
  • ./skeleton/oo4gl/OEUnit/Assertion/AssertString.cls - existent in p2j at com.goldencode.p2j.oo.oeunit.assertion.AssertString
  • ./skeleton/oo4gl/OEUnit/Data/DataProvider.cls - existent in p2j at com.goldencode.p2j.oo.oeunit.data.DataProvider_
  • ./skeleton/oo4gl/OEUnit/Data/Fixture.cls - existent in p2j at com.goldencode.p2j.oo.oeunit.data.Fixture_
  • ./skeleton/oo4gl/OpenEdge/Core/DataTypeEnum.cls - existent in p2j at com.goldencode.p2j.oo.core.DataTypeEnum
  • ./skeleton/oo4gl/OpenEdge/Core/HashAlgorithmEnum.cls - existent in p2j at com.goldencode.p2j.oo.core.HashAlgorithmEnum
  • ./skeleton/oo4gl/OpenEdge/Core/IOModeEnum.cls - existent in p2j at com.goldencode.p2j.oo.core.IomodeEnum
  • ./skeleton/oo4gl/OpenEdge/Core/ISupportEncoding.cls - existent in p2j at com.goldencode.p2j.oo.core.ISupportEncoding
  • ./skeleton/oo4gl/OpenEdge/Core/ISupportInitialize.cls - existent in p2j at com.goldencode.p2j.oo.core.ISupportInitialize
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/AbstractTTCollection.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.AbstractTtcollection
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/Collection.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.LegacyCollection
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/ICollection.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.Icollection
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/IIterable.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.Iiterable
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/IIterator.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.Iiterator
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/IList.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.Ilist
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/IListIterator.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.IlistIterator
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/IMap.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.Imap
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/ISet.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.Iset
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/IStringStringMap.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.IStringStringMap
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/Iterator.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.LegacyIterator
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/Map.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.LegacyMap
  • ./skeleton/oo4gl/OpenEdge/Core/System/ApplicationError.cls - existent in p2j at com.goldencode.p2j.oo.core.system.ApplicationError
  • ./skeleton/oo4gl/OpenEdge/Core/System/UnsupportedOperationError.cls - existent in p2j at com.goldencode.p2j.oo.core.system.UnsupportedOperationError
  • ./skeleton/oo4gl/OpenEdge/Core/Util/BuilderRegistry.cls - existent in p2j at com.goldencode.p2j.oo.core.util.BuilderRegistry
  • ./skeleton/oo4gl/OpenEdge/Core/Util/ConfigBuilder.cls - existent in p2j at com.goldencode.p2j.oo.core.system.ConfigBuilder
  • ./skeleton/oo4gl/OpenEdge/Logging/ILogWriter.cls - existent in p2j at com.goldencode.p2j.oo.logging.IlogWriter
  • ./skeleton/oo4gl/OpenEdge/Logging/LogLevelEnum.cls - existent in p2j at com.goldencode.p2j.oo.logging.IlogWriter
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/BuilderRegistry.cls - existent in p2j at com.goldencode.p2j.oo.net.http.BuilderRegistry
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/ClientBuilder.cls - existent in p2j at com.goldencode.p2j.oo.net.http.ClientBuilder
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/ClientOptions.cls - existent in p2j at com.goldencode.p2j.oo.net.http.ClientOptions
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/ConfigBuilder.cls - existent in p2j at com.goldencode.p2j.oo.net.http.ConfgiBuilder
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/Cookie.cls - existent in p2j at com.goldencode.p2j.oo.net.http.Cookie
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/Credentials.cls - existent in p2j at com.goldencode.p2j.oo.net.http.Credentials
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/HttpHeader.cls - existent in p2j at com.goldencode.p2j.oo.net.http.HttpHeader
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/ICookieJar.cls - existent in p2j at com.goldencode.p2j.oo.net.http.ICookieJar
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/IHttpClient.cls - existent in p2j at com.goldencode.p2j.oo.net.http.IhttpClient
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/IHttpClientLibrary.cls - existent in p2j at com.goldencode.p2j.oo.net.http.IHttpClientLibrary - rt PARTIAL, but is interface so it should be FULL.
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/IHttpMessage.cls - existent in p2j at com.goldencode.p2j.oo.net.http.IhttpMessage
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/IHttpRequest.cls - existent in p2j at com.goldencode.p2j.oo.net.http.IhttpRequest
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/IHttpResponse.cls - existent in p2j at com.goldencode.p2j.oo.net.http.IhttpResponse
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/Lib/ClientLibraryBuilder.cls - existent in p2j at com.goldencode.p2j.oo.net.http.lib.ClientLibraryBuilder
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/RequestBuilder.cls - existent in p2j at com.goldencode.p2j.oo.net.http.RequestBuilder
  • ./skeleton/oo4gl/OpenEdge/Net/UriEncodingTypeEnum.cls - existent in p2j at com.goldencode.p2j.oo.net.UriEncodingTypeEnum

Existent with runtime support PARTIAL

  • ./skeleton/oo4gl/OpenEdge/Core/Assert.cls - existent in p2j at com.goldencode.p2j.oo.core.Assert
  • ./skeleton/oo4gl/OpenEdge/Core/ByteBucket.cls - existent in p2j at com.goldencode.p2j.oo.core.ByteBucker
  • ./skeleton/oo4gl/OpenEdge/Core/Memptr.cls - existent in p2j at com.goldencode.p2j.oo.core.Memptr
  • ./skeleton/oo4gl/OpenEdge/Core/String.cls - existent in p2j at com.goldencode.p2j.oo.core.LegacyString@
  • ./skeleton/oo4gl/OpenEdge/Net/HTTP/TransferEncodingEnum.cls - existent in p2j at com.goldencode.p2j.oo.net.http.TransferEncodingEnum
  • ./skeleton/oo4gl/OpenEdge/Net/URI.cls - existent in p2j at com.goldencode.p2j.oo.net.Uri
  • ./skeleton/oo4gl/OpenEdge/Core/AbstractAssertionFailedError.cls - existent in p2j at com.goldencode.p2j.oo.core.AbstractAssertionFailedError - rt STUBS but seems at least partially implemented.

Needs to be converted from ADE - runtime support STUB

  • ./skeleton/oo4gl/OpenEdge/Core/Integer.cls - existent in p2j at com.goldencode.p2j.oo.core.LegacyInteger
  • ./skeleton/oo4gl/OpenEdge/Core/TimeStamp.cls - existent in p2j at com.goldencode.p2j.oo.core.TimeStamp
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/Array.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.Array
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/List.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.LegacyList
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/ListIterator.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.LegacyListIterator
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/ObjectStack.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.ObjectStack
  • ./skeleton/oo4gl/OpenEdge/Core/Collections/Stack.cls - existent in p2j at com.goldencode.p2j.oo.core.collections.LegacyStack
  • ./skeleton/oo4gl/OpenEdge/Core/System/InvalidValueSpecifiedError.cls - existent in p2j at com.goldencode.p2j.oo.core.system.InvalidValueSpecifiedError
  • ./skeleton/oo4gl/OpenEdge/Core/System/NotFoundError.cls - existent in p2j at com.goldencode.p2j.oo.core.system.NotFoundError
  • ./skeleton/oo4gl/OpenEdge/Logging/LogEvent.cls - existent in p2j at com.goldencode.p2j.oo.logging.LogEvent
  • ./skeleton/oo4gl/OpenEdge/Logging/LogMessage.cls - existent in p2j at com.goldencode.p2j.oo.logging.LogMessage

There are 2 classes that are from OEUnit that we have with STUB level support, not sure what to do about these:

  • ./skeleton/oo4gl/OEUnit/Data/FixtureDataSet.cls - existent in p2j at com.goldencode.p2j.oo.oeunit.data.FixtureDataSet
  • ./skeleton/oo4gl/OEUnit/Util/List.cls - existent in p2j at com.goldencode.p2j.oo.oeunit.util.List

Conversion list

abl/OpenEdge/Core/Collections/List.cls
abl/OpenEdge/Core/Collections/Array.cls
abl/OpenEdge/Core/Collections/ArrayIterator.cls
abl/OpenEdge/Core/Collections/Stack.cls
abl/OpenEdge/Core/Collections/ListIterator.cls
abl/OpenEdge/Core/Collections/ObjectStack.cls

abl/OpenEdge/Core/Integer.cls
abl/OpenEdge/Core/TimeStamp.cls
abl/OpenEdge/Core/TimeStampConstants.cls

abl/OpenEdge/Core/System/InvalidValueSpecifiedError.cls
abl/OpenEdge/Core/System/NotFoundError.cls

abl/OpenEdge/Logging/LogEvent.cls
abl/OpenEdge/Logging/LogMessage.cls

abl/Ccs/Common/Support/ICharacterArrayHolder.cls
abl/Ccs/Common/Support/IDateTimeHolder.cls
abl/Ccs/Common/Support/IInt64ArrayHolder.cls
abl/Ccs/Common/Support/IIntegerArrayHolder.cls
abl/Ccs/Common/Support/IMemptrArrayHolder.cls
abl/Ccs/Common/Support/IDateArrayHolder.cls
abl/Ccs/Common/Support/IDateTimeTzArrayHolder.cls
abl/Ccs/Common/Support/IIntegerHolder.cls
abl/Ccs/Common/Support/IRowidArrayHolder.cls
abl/Ccs/Common/Support/IDateHolder.cls
abl/Ccs/Common/Support/IDecimalArrayHolder.cls
abl/Ccs/Common/Support/ILogicalArrayHolder.cls
abl/Ccs/Common/Support/IRowidHolder.cls
abl/Ccs/Common/Support/IDateTimeArrayHolder.cls
abl/Ccs/Common/Support/IHandleArrayHolder.cls
abl/Ccs/Common/Support/ILogicalHolder.cls

I added abl/OpenEdge/Core/TimeStampConstants.cls because it is used in OpenEdge.Core.TimeStamp and it has STUB rt support. And abl/OpenEdge/Core/Collections/ArrayIterator.cls, the reason is explained next. I also added the missing holders from Ccs, see #9488-123 and #9488-124.

The cause for the annotateMethodCall failure in OpenEdge.Core.Collections.Array was this line:

return new ArrayIterator(this-object, pIndex).

ArrayIterator is implemented in p2j with full support, but both the skeleton and our implementation is missing the constructor with 2 parameters. After investigation I realized this was added in a later version. I updated my skeleton in my local project with the one from /testcases/oo/skeleton/12.8 which contained the new constructor and also added ArrayIterator to the conversion list. Now the conversion completes with no errors, but a few more compilation errors are now present. I am looking at them now.

#130 Updated by Constantin Asofiei over 1 year ago

Please ignore the ./skeleton/oo4gl/OEUnit/Data/FixtureDataSet.cls and ./skeleton/oo4gl/OEUnit/Util/List.cls.

#131 Updated by Ioana-Cristina Prioteasa over 1 year ago

Compilation Errors

1. Generics need to be added by hand in
  • LegacyInteger: we need implements Icomparable<Iint64Holder>
  • TimeStamp: we need implements Icomparable<TimeStamp>

2. Issues in Array:

  •         // If the new size is 0 then make the array intedeterminate
            if pNewLength eq 0 then
            do:
                assign extent(this-object:Value) = ?.
                return 0.
            end.
    

    converts to:
             //  If the new size is 0 then make the array intedeterminate
             if (_isEqual(pNewLength, 0))
             {
                Array.this.resizeValue(new unknown());
                storeReturnValue(0);
                return;
             }
    

       @LegacySignature(type = Type.RESIZE, name = "Value", parameters = 
       {
          @LegacyParameter(name = "size", type = "INT64", mode = "INPUT")
       })
       @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
       protected void resizeValue(final int64 _size)
       {
          int64 size = TypeFactory.initInput(_size);
    
          internalProcedure(Array.class, this, "resize-Value", new Block((Body) () -> 
          {
             value = ArrayAssigner.resize(value, size);
          }));
       }
    

    The compilation error here is: 'resizeValue(com.goldencode.p2j.util.int64)' in 'com.goldencode.p2j.oo.core.collections.Array' cannot be applied to '(com.goldencode.p2j.util.unknown)'
    I think it would be correct to emit:
    Array.this.resizeValue(new int64());
    
  • // make room if needed. We are expanding this array potentially
    UpdateLength(max(this-object:Length, mSize + 1, pIndex + 1)).
    

     method private integer UpdateLength(input pNewLength as integer):
    

    converts to:
    //  make room if needed. We are expanding the array
    updateLength(integer.maximum(Array.this.getLength(), plus(mSize, cnt), plus(idxForSize, cnt)));
    

    but integer.maximum calls int64.maximum that returns int64. The error: 'updateLength(com.goldencode.p2j.util.integer)' in 'com.goldencode.p2j.oo.core.collections.Array' cannot be applied to '(com.goldencode.p2j.util.int64)'.
    Should there be a maximum method in integer?

#132 Updated by Ioana-Cristina Prioteasa over 1 year ago

I think the issue with new unknown() is in /rules/convert/literals.rules:

                  <!-- handle method call and OO method call parms need wrapping -->
                  <rule>
                     (parent.type &gt; prog.begin_meth and parent.type &lt; prog.end_meth) or
                     (parent.type &gt; prog.begin_oo_meth and
                         parent.type &lt; prog.end_oo_meth) or
                     (parent.type == prog.expression and 
                         parent.parent.type &gt; prog.begin_meth and 
                         parent.parent.type &lt; prog.end_meth)                            or
                     (parent.type == prog.expression and 
                         parent.parent.type &gt; prog.begin_oo_meth and 
                         parent.parent.type &lt; prog.end_oo_meth)
                     <!-- lookup override -->
                     <action>classname = getNoteString("classname")</action>

                     <rule>classname == null              and 
                           parent.type == prog.expression and 
                           parent.isAnnotation("classname")
                        <action>classname = getReferenceNoteString(parent.id, "classname")</action>
                     </rule>

I added this and it solves the issue but I am not sure it is ok:

                     <rule>
                        parent.type == prog.oo_meth_void and
                        parent.matchAnnotation("property-access-type", "resize", null)
                        <action>classname = "integer"</action>
                     </rule>

#133 Updated by Ioana-Cristina Prioteasa over 1 year ago

The parent.type check was not needed, it was included in the parent rule. I committed this solution to 9488a rev.15862.
I am looking now at the second compilation error: integer.maximum is returning an int64, inside a function that expects integer.

#134 Updated by Constantin Asofiei over 1 year ago

What I mentioned about MIN/MAX was related to a CASE i * 1, where multiply returns int64 while the expression is really integer... see #9457-27

In your case, I think we need to wrap the minimum argument in the target's expected type.

#135 Updated by Ioana-Cristina Prioteasa over 1 year ago

There is one more issue. In ObjectStack, the call to the Stack constructor with parameter has the wrong name:

   @LegacySignature(type = Type.CONSTRUCTOR, name = "ObjectStack", parameters = 
   {
      @LegacyParameter(name = "piDepth", type = "INTEGER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
   public void __core_collections_objectStack_constructor__(final integer _piDepth)
   {
      integer piDepth = TypeFactory.initInput(_piDepth);

      internalProcedure(ObjectStack.class, this, "ObjectStack", new Block((Body) () -> 
      {
         __core_collections_stack_constructor__(piDepth);
      }));
   }

   @LegacySignature(type = Type.CONSTRUCTOR, name = "ObjectStack")
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
   public void __core_collections_objectStack_constructor__()
   {
      internalProcedure(ObjectStack.class, this, "ObjectStack", new Block((Body) () -> 
      {
         __core_collections_LegacyStack_constructor__();
      }));
   }

This:
__core_collections_stack_constructor__(piDepth);

Should be:
__core_collections_LegacyStack_constructor__(piDepth);

May these be related to 9488 rev. 15860?

#136 Updated by Ioana-Cristina Prioteasa over 1 year ago

I did some tests regarding MIN MAX:

   @Test.
   METHOD PUBLIC VOID Test_Maximum_As_Parameter():
      DEFINE VARIABLE result AS INTEGER NO-UNDO.
      result = GetValue(MAXIMUM(3, 9)).
      Assert:Equals(9, result).
   END METHOD.

   METHOD PRIVATE INTEGER GetValue(INPUT val AS INTEGER):
      RETURN val.
   END METHOD.

This converted as:
result.assign(getValue(new integer(integer.maximum(new integer(3), new integer(9)))));

So this case is treated at conversion, it is just not working in my case. I am investigating now to find the problematic rule.

#137 Updated by Constantin Asofiei over 1 year ago

Ioana-Cristina Prioteasa wrote:

May these be related to 9488 rev. 15860?

See 9488a rev 15863, this solves the constructor problems.

#138 Updated by Ioana-Cristina Prioteasa over 1 year ago

I am trying now to eliminate ArrayIterator from the ADE conversion list, I have the new skeleton version (that contains the needed constructor) and I also added the constructor to the runtime. I eliminated from the class from the conversion list and I deleted the progress class from /abl. I still get the annotateMethod failure. I debugged it and in ClassDefinition.candidates:

Map<String, Map<SignatureKey, MemberData>> map = isStatic ? smethods : imethods;

imethods does not contain my newly added constructor, only the default one and the one with only one parameter. I am trying to figure out how imethods is populated but with no luck.

#139 Updated by Ioana-Cristina Prioteasa over 1 year ago

Committed to 9488a rev. 15864: Relaxed restriction in wrapper detection rule to allow built-in OO method calls to be wrapped appropriately when parameter type requires casting.
The issue was in rules/convert/base_structure.xml, the OO method calls were excluded from wrapping of integer:

             parent.isAnnotation("refid")                                                          and
             ((evalLib("function_call_type", parent.type)                                  and 
               (!parent.isAnnotation("param_modes") or copy.indexPos > 0))                      or 
-             (evalLib("oo_call_type", parent, copy) and !evalLib("is_builtin_cls", parent) and
+             (evalLib("oo_call_type", parent, copy) and
               !evalLib("is_java_cls", parent) and isNote("param_index")))

             <action>


With 9488a latest + the added constructor in ArrayIterator, only the generics issue remain. I will fix them by hand and zip them, until we decide how we can commit them.

#140 Updated by Ioana-Cristina Prioteasa over 1 year ago

ADE_converted_sources.zip is available at devsrv01:/home/icp/ADE_converted_sources.zip.

#141 Updated by Ioana-Cristina Prioteasa over 1 year ago

I am working now on implementing Progress.Collections.List. We decided to support List<Object> for now and in the test I am inserting in the list OpenEdge.Core.Integer and OpenEdge.Core.String as elements.
For this I tried adding the converted LegacyInteger in 9436b. It comes with a compilation error, not sure why I have not seen it before:

> Compile failed; see the compiler error output for details.[ant:javac] /home/icp/gcd/branches/9436b/src/com/goldencode/p2j/oo/core/LegacyInteger.java:220: error: method hashCode in class BaseDataType cannot be applied to given types;
     [exec] 
     [exec] 
     [exec] * Try:
     [exec] [ant:javac]          storeReturnValue(BaseDataType.hashCode(LegacyInteger.this.getLegacyClass().ref().getTypeName(), LegacyInteger.this.getValue()));> Run with --stacktrace option to get the stack trace.

The problematic line:
storeReturnValue(BaseDataType.hashCode(LegacyInteger.this.getLegacyClass().ref().getTypeName(), LegacyInteger.this.getValue()));

Is this a conversion issue?
For it to compile I modified it to:
storeReturnValue(LegacyInteger.this.hashCode());

Not sure if that is ok.

#142 Updated by Constantin Asofiei over 1 year ago

Ioana-Cristina Prioteasa wrote:

The problematic line:
[...]
Is this a conversion issue?
For it to compile I modified it to:
[...]
Not sure if that is ok.

What's the 4GL code here?

#143 Updated by Ioana-Cristina Prioteasa over 1 year ago

This is the function:

method public integer HashCode ():
   return hash-code(this-object:GetClass():TypeName. this-object:Value).
end method.

This is the new builtin function I added. The conversion is ok, I just need that function in 9436b, the branch I was working on. Tests and implementation will be needed for this method.

#144 Updated by Ioana-Cristina Prioteasa over 1 year ago

While working on the implementation for ArrayIterator, I discovered a conversion issue that appears twice in OpenEdge.Core.Collections.Array.
Original code:

    /* The actual holding array */
    define protected property Value as Object extent no-undo get. set.

    method public void SetValue(input poValue as Object,
                                input piExtent as integer):
        Assert:IsPositive(piExtent, 'Index').

        if this-object:Length eq ?
        or piExtent gt this-object:Length
        then
            // this method will throw a ResizeError if needed
            UpdateLength(integer(piExtent + round(0.5 * this-object:Length, 0))).

        assign this-object:Value[piExtent] = poValue
               mSize                       = max(mSize, piExtent)
               .
    end method.

This is how thing are converted:
  • The setter for the Value property:
       @LegacySignature(type = Type.SETTER, name = "Value", parameters = 
       {
          @LegacyParameter(name = "var", type = "OBJECT", qualified = "progress.lang.object", mode = "INPUT"),
          @LegacyParameter(name = "idx", type = "INT64", mode = "INPUT")
       })
       @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
       protected void setValue(final object<? extends _BaseObject_> _var, final int64 _idx)
       {
          object<? extends _BaseObject_> var = TypeFactory.initInput(_var);
          int64 idx = TypeFactory.initInput(_idx);
    
          internalProcedure(Array.class, this, "Value", new Block((Body) () -> 
          {
             assignSingle(value, idx, var);
          }));
       }
    
  • The setValue method:
       @LegacySignature(type = Type.METHOD, name = "SetValue", parameters = 
       {
          @LegacyParameter(name = "poValue", type = "OBJECT", qualified = "progress.lang.object", mode = "INPUT"),
          @LegacyParameter(name = "piExtent", type = "INTEGER", mode = "INPUT")
       })
       @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
       /* Set the value for a particular index to an object
    
              @param P.L.Object An object to add to the array
              @param integer  The index at which to add */   
       public void setValue(final object<? extends _BaseObject_> _poValue, final integer _piExtent)
       {
          object<? extends _BaseObject_> poValue = TypeFactory.initInput(_poValue);
          integer piExtent = TypeFactory.initInput(_piExtent);
    
          internalProcedure(Array.class, this, "SetValue", new Block((Body) () -> 
          {
             Assert.isPositive(piExtent, new character("Index"));
    
             if (_or(isUnknown(Array.this.getLength()), () -> isGreaterThan(piExtent, Array.this.getLength())))
             {
                //  this method will throw a ResizeError if needed
                updateLength(InputParameter.cast(integer.class, new integer(new integer(plus(piExtent, round(multiply(0.5, Array.this.getLength()), 0))))));
             }
    
             Array.this.setValue(poValue, piExtent);
             mSize.assign(int64.maximum(mSize, piExtent));
          }));
       }
    

The problem is: assign this-object:Value[piExtent] = poValue converts to Array.this.setValue(poValue, piExtent);
piExtent is integer so it goes on to call the method setValue again, creating a loop resulting in StackOverFlow error. To move on from this and make it call the actual setter I modified to:

Array.this.setValue(poValue, new int64(piExtent));

But I don't think this should be the solution. I am not sure exactly how to handle this. A very similar thing happens for the getter:
    method public Object GetValue(input piExtent as integer):
        Assert:IsPositive(piExtent, 'Index').

        if piExtent gt this-object:Size then
            undo, throw new AssertionFailedError(substitute('Requested index &1 is greater than array size &2',
                                                           piExtent, this-object:Size ), 0).

        return this-object:Value[piExtent].
    end method.

Where the converted return this-object:Value[piExtent]. end up calling the method method public Object GetValue(input piExtent as integer): it is called in, resulting again in StackOverFlow.

#145 Updated by Ioana-Cristina Prioteasa over 1 year ago

Saved to devsrv01 the modified ADE sources, with the def var statement instead of var and generics eliminated: /home/icp/modifiedADESources.zip

#146 Updated by Ioana-Cristina Prioteasa over 1 year ago

Investigating the issue described in #9488-144. This testcase recreates the issue:

class OpenEdge.Core.Collections.Array:
    define protected property Value as Object extent no-undo get. set.

    method public void SetValue(input poValue as Object):
        SetValue(poValue, 1).
    end method.

    method public void SetValue(input poValue as Object, input piExtent as integer):
        assign this-object:Value[piExtent] = poValue.
    end method.

    method public Object GetValue(input piExtent as integer):
        return this-object:Value[piExtent].
    end method.

end class.

Converts into:

   @LegacySignature(type = Type.METHOD, name = "SetValue", parameters = 
   {
      @LegacyParameter(name = "poValue", type = "OBJECT", qualified = "progress.lang.object", mode = "INPUT"),
      @LegacyParameter(name = "piExtent", type = "INTEGER", mode = "INPUT")
   })
   @LegacyResourceSupport(supportLvl = CVT_LVL_FULL | RT_LVL_FULL)
   public void setValue(final object<? extends _BaseObject_> _poValue, final integer _piExtent)
   {
      object<? extends _BaseObject_> poValue = TypeFactory.initInput(_poValue);
      integer piExtent = TypeFactory.initInput(_piExtent);

      internalProcedure(Array.class, this, "SetValue", new Block((Body) () -> 
      {
         Array.this.setValue(poValue, piExtent);
      }));
   }

And this Array.this.setValue(poValue, piExtent); is calling the same method instead of the getter.
I am trying to find where setter calls are emitted and add a wrap to int64. Right now I am not able to find a rule related.
This is how the tree looks in rules/convert/assignment.rules:
     [java] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
     [java] = [ASSIGN]:12884902253 @0:0
     [java]       (byrule=annotations/method_defs.rules:716)
     [java]    Value [VAR_CLASS]:12884902254 @0:0
     [java]          (property-access-type-byrule=annotations/method_defs.rules:716, direct-property-access=true, byrule=annotations/method_defs.rules:716, refid=12884901981, cls-property-byrule=annotations/method_defs.rules:716, cls-container=./abl/OpenEdge/Core/Collections/Array.cls, property-access-type=setter, extent=-1, static=false, cls-property=true, refid-byrule=annotations/method_defs.rules:716, static-byrule=annotations/method_defs.rules:716, direct-property-access-byrule=annotations/method_defs.rules:716, extent-byrule=annotations/method_defs.rules:354, cls-container-byrule=annotations/method_defs.rules:716)
     [java]    expression [EXPRESSION]:12884902258 @0:0
     [java]          (byrule=annotations/method_defs.rules:716)
     [java]       var [VAR_CLASS]:12884902259 @0:0
     [java]             (extent=-1, byrule=annotations/method_defs.rules:716, extent-byrule=annotations/method_defs.rules:365, refid=12884902241, refid-byrule=annotations/method_defs.rules:366)

#147 Updated by Ioana-Cristina Prioteasa over 1 year ago

This is the list of classes from ADE that implement the I*Holder classes:
OpenEdge.Core.DateArrayHolder implements IDateArrayHolder
OpenEdge.Core.Integer implements IInt64Holder
OpenEdge.Core.LogicalArrayHolder implements ILogicalArrayHolder
OpenEdge.Core.Memptr implements IMemptrHolder
OpenEdge.Core.String implements ILongcharHolder
OpenEdge.Core.DateTimeTzHolder implements IDateTimeTzHolder
OpenEdge.Core.LongcharArrayHolder implements ILongcharArrayHolder
OpenEdge.Core.IntegerArrayHolder implements IInt64ArrayHolder
OpenEdge.Core.DateTimeTzArrayHolder implements IDateTimeTzArrayHolder
OpenEdge.Core.HandleArrayHolder implements IHandleArrayHolder
OpenEdge.Core.WidgetHandle implements IHandleHolder
OpenEdge.Core.ObjectArrayHolder implements IObjectArrayHolder
OpenEdge.Core.DateHolder implements IDateHolder
OpenEdge.Core.ByteBucket implements IMemptrHolder
OpenEdge.Core.DateTimeArrayHolder implements IDateTimeArrayHolder
OpenEdge.Core.DateTimeHolder implements IDateTimeHolder
OpenEdge.Core.DecimalArrayHolder implements IDecimalArrayHolder
OpenEdge.Core.EncodedString implements ILongcharHolder
OpenEdge.Core.RowidArrayHolder implements IRowidArrayHolder
OpenEdge.Core.MemptrArrayHolder implements IMemptrArrayHolder
OpenEdge.Core.Decimal implements IDecimalHolder
OpenEdge.Core.StringArray mplements ILongcharArrayHolder
OpenEdge.Core.LogicalValue implements ILogicalHolder
OpenEdge.Core.LogicalArray implements ILogicalArrayHolder 

I added all of these for conversion, except Memptr, String, WidgetHandle, ByteBucket(these are already implemented).
A few more compilation/conversion issues popped up:
  • Method naming issue:
    Example: In DateArrayHolder implements IdateArrayHolder method name getValue_1 while in IdateArrayHolder is getValue. This generates this compilation error:Class 'DateArrayHolder' must either be declared abstract or implement abstract method 'getValue(int64)' in 'IdateArrayHolder'
    This issue is seen in DateArrayHolder, DateHolder, DateTimeArrayHolder, DateTimeHolder, DateTimeTzArrayHolder, DateTimeTzHolder, DecimalArrayHolder, HandleArrayHolder, IntegerArrayHolder, LogicalArrayHolder, LongcharArrayHolder, MemptrArrayHolder, ObjectArrayHolder, RowidArrayHolder.
    At parsing I have some: Builtin class com.goldencode.p2j.oo.common.support.IdateTimeArrayHolder is not implemented in FWD!, even tho these are in the conversion list. I am not sure if this message should appear, maybe it's related.
  • The compareTo issue we decided to fix by hand
  • Another issue in LongcharArrayHolder: LongcharArrayHolder.this.bulkSetValue(new longchar(pcValue[0])); gives this error: Cannot resolve constructor 'longchar(character[])'. The original code:
           @param longchar[] The Value array */
        constructor public LongcharArrayHolder (input pcValue as longchar extent):
            this-object().
            assign this-object:Value = pcValue.
        end constructor.
    

#148 Updated by Ioana-Cristina Prioteasa about 1 year ago

Committed in 9488a rev. 15865 a possible solution for the naming issue described in #9488-147. It solves all the cases except in LongcharArrayHolder. The ILongcharHolder is already implemented in FWD and it was not added for conversion, but I am not exactly sure what is going on in that case.

ClassDefinition.loadBuiltinDefinition calls addJavaMethodName(javaname, "", legacySig); with javaname=bulkGetValue and legacySig=get-value(). But when trying to match the method it searches in the map for legacy-sig = bulk-get-value().
I think in ClassDefinition.loadBuiltinDefinition, we need to add some checks to determine if it is a bulk call and add the prefix "bulk-".

               case UNSUBSCRIBE:
                  mname = lsig.type().toString() + "-" + mname;
                  break;

What I tried until now is not working properly, adding it in cases where it should not.

#149 Updated by Ioana-Cristina Prioteasa about 1 year ago

Committed in 9488a rev. 15866: When loading builtin classes, correctly resolve setter and getter names. In ClassDefinition.loadBuiltinDefinition the following setter and getter names were not accounted for: bulk-get, bulk-set, set-all.

Now all method naming issues are solved.

I still have the issue in LongcharArrayHolder with the bulkSetValue call. I tried applying the fix from 9457c rev. 15871, as Constantin advised but this does not solve it unfortunately. Looking into this now.

#150 Updated by Constantin Asofiei about 1 year ago

  • Related to Bug #9923: extent argument type vs parameter type compatibility added

#151 Updated by Constantin Asofiei about 1 year ago

Ioana, I've created #9923 for the bulkSetValue(new longchar problem - for now, please fix this 'by hand' by changing the generated Java code, to create a character[], copy the pcValue argument there, and pass that as the RVALUE. Thanks.

#152 Updated by Ioana-Cristina Prioteasa about 1 year ago

I did all the necessary modifications and saved the latest converted code at devsrv01:/home/icp/ADE_latest_converted.zip.
This archive includes the ADE converted code, the IHolders and the implementation for the holders.

#153 Updated by Constantin Asofiei about 1 year ago

Ioana, please go through all the changes in 9488a and group them by the common 'feature'; so, file x, y, z fix this problem, these a,b,c fix this problem, etc. I need to see what we want to bring into trunk. Where possible, show any existing redmine task and possible tests for the change.

#154 Updated by Ioana-Cristina Prioteasa about 1 year ago

Classes that implement com.goldencode.p2j.oo.core.collections.Icollection(OpenEdge.Core.Collections.ICollection):

  • com.goldencode.p2j.oo.core.collections.AbstractTtCollection - FULL(toTable implemented)
  • com.goldencode.p2j.oo.core.collections.Array - STUB now but will be ADE converted and contains ToTable implementation
  • com.goldencode.p2j.oo.core.collections.LegacyList - STUB now but will be ADE converted and contains ToTable implementation
  • com.goldencode.p2j.oo.core.collections.MapBackedCollection-PARTIAL(toTable also PARTIAL support), tests at /testcases/tests/oo/openedge/core/collections/map_backed_collection/TestMethodToTable.cls - it seem to check the core functionality of the method, but not the values in the returned table.
  • com.goldencode.p2j.oo.core.collections.EntrySet extends MapBackedCollection
  • com.goldencode.p2j.oo.core.collections.KeySet extends MapBackedCollection
  • com.goldencode.p2j.oo.core.collections.ValueCollection extends MapBackedCollection
  • com.goldencode.p2j.oo.core.collections.LegacyCollection extends AbstractTtcollection - Reported FULL but toTable is STUB, tests at /testcases/tests/oo/openedge/core/collections/collection/ but none for toTable method
  • com.goldencode.p2j.oo.core.collections.LegacySet extends LegacyCollection
  • com.goldencode.p2j.oo.net.http.CookieCollection extends LegacyCollection
  • com.goldencode.p2j.oo.core.collections.StringCollection extends LegacyCollection
  • com.goldencode.p2j.oo.core.collections.Ilist - interface
  • com.goldencode.p2j.oo.core.collections.Iset - interface
  • com.goldencode.p2j.oo.core.collections.IstringCollection - interface

So for full support for the toTable function, implementation in MapBackedCollection needs to be completed and in LegacyCollection needs to be fully implemented.

#155 Updated by Ioana-Cristina Prioteasa about 1 year ago

Went thru the commits in 9488a. Here is a summary:

Fixes for converting legacy oo

- Added support for emitting LegacyResourceSupport and LegacyResource, only when converting legacy oo classes. The parameter legacy-res-support-type and is-legacy-oo is read from configurations(p2j.cfg.xml).
  • rev. 15840
    - src/com/goldencode/p2j/convert/NameConverter.java - for package name
    - rules/convert/method_definitions.rules - for LegacyResourceSupport
    - rules/convert/base_structure.xml - for LegacyResource
  • rev. 15842
    - rules/convert/base_structure.xml - for LegacyResourceSupport at class level
  • rev. 15855
    - rules/convert/base_structure.xml - Fix NPE when p2j.cfg.xml config is not present

Supporting Progress v12.8

Generics

- Ignore generics in symbol-based class names.
  • rev. 15848
    - src/com/goldencode/p2j/uast/progress.g - user_defined_type_name
- Generics in implements clause
  • rev. 15852
    - possible start for a solution of converting generics in implements clause
    - rules/convert/base_structure.xml - emitting java implements with generic
    - src/com/goldencode/p2j/uast/progress.g - parsing and annotating.
  • rev. 15858
    - excluded generics from implements clause, now they are ignored.

Compound assignment operators (*=, +=, -=, /=)

  • rev. 15849
    - Parser support src/com/goldencode/p2j/uast/progress.g
  • rev. 15851
    - Full conversion support for compound operators
    - rules/annotations/assignment_style_stmt_rewriting.rules
    - src/com/goldencode/p2j/uast/progress.g
  • rev. 15856
    - Fix regression coming from compound operators changes
    - src/com/goldencode/p2j/uast/progress.g

Support for final property

  • rev. 15855
    - Conversion support for final property
    - src/com/goldencode/p2j/uast/progress.g
    - rules/convert/variable_definitions.rules
  • rev. 15858
    - Added FINAL keyword in define_stmt_pre_scan - src/com/goldencode/p2j/uast/progress.g

Support for ClientPricipal:TENANT-ID, ClientPricipal:TENANT-NAME

  • rev. 15857
    - Added full conversion support and stub runtime for ClientPricipal:TENANT-ID, ClientPricipal:TENANT-NAME.
    - rules/convert/methods_attributes.rules
    - rules/gaps/expressions.rules
    - src/com/goldencode/p2j/uast/progress.g
    - src/com/goldencode/p2j/util/ClientPrincipal.java
    - src/com/goldencode/p2j/util/ClientPrincipalResource.java
    Testcase:
    define variable client as handle no-undo.
    define variable tokenValue as character no-undo.
    define variable domainAccessCode as character no-undo initial "MyAccessCode".
    
    create client-principal client.
    
    client:user-id = "MyUser".
    client:domain-name = "MyDomain".
    client:session-id = "MySessionID".
    
    client:seal(domainAccessCode).
    
    assign tokenValue = string(client:tenant-id).
    message "Tenant ID:" tokenValue view-as alert-box.
    
    assign tokenValue = client:tenant-name.
    message "Tenant Name:" tokenValue view-as alert-box.
    
    delete object client no-error.
    

Support for builtin HASH-CODE function (already in 9436b)

  • rev. 15850
    - Basic support for HASH-CODE. Fixed and in 9436c.
    - rules/convert/builtin_functions.rules
    - rules/gaps/expressions.rules
    - src/com/goldencode/p2j/convert/SignatureHelper.java
    - src/com/goldencode/p2j/uast/progress.g
    - src/com/goldencode/p2j/util/BaseDataType.java

Bugs fixed

  • rev. 15861 - Fixes needed for annotateMethodCall failure:
    - Account for KW_PK_PRIV: src/com/goldencode/p2j/uast/ClassDefinition.java, src/com/goldencode/p2j/uast/SymbolResolver.java
    - Correctly resolve extent in EXPRESSION nodes: src/com/goldencode/p2j/uast/SymbolResolver.java
    - details in #9488-125, #9488-126, #9488-127
  • rev. 15862 - When an unknown literal is used as a parameter for methods with the annotation property-access-type=resize, assign type integer.
    - rules/convert/literals.rules
    - details in #9488-131, #9488-132
  • rev. 15864 - Relaxed restriction in wrapper detection rule to allow built-in OO method calls to be wrapped appropriately when parameter type requires casting.
    - rules/convert/base_structure.xml
    - details in #9488-131, #9488-134, #9488-136
  • rev. 15865 - Fixed naming issues for builtin override properties. Corrected ClassDefinition.registerPropertyMethod for the case when the property is builtin but also override.
    - src/com/goldencode/p2j/uast/ClassDefinition.java
    - details in #9488-147, #9488-148
  • rev. 15866 - When loading builtin classes, correctly resolve setter and getter names: ClassDefinition.loadBuiltinDefinition
    - src/com/goldencode/p2j/uast/ClassDefinition.java
    - details in #9488-147, #9488-148, #9488-149

Converted STUBS added - these already reaches trunk or will with 9436.

  • rev. 15843 - Added lang.Stop, collections.Ihashable, collections.Icomparable, collections.Icomparer, collections.IequalityComparer.
  • rev. 15844 - Added collections.KeyValuePair.
  • rev. 15845 - Added Icollection, Iiterable, Iiterator, Ilist, Imap, Iset, List, SortedSet, HashMap.
  • rev. 15846 - Modified some stubs to fix override issues.
  • rev. 15847 - Added LockConflict, StopAfter, StopError, UserInterrupt and made Stop not final.
  • rev. 15858 - Added converted skeletons for Progress.IO.ByteOrder and Progress.IO.MemoryOutputStream.

MISC

  • rev. 15841 (Original author CA) - Fix from constantin to bypass some annotation errors by reassigning it to n/a instead of null.
    - src/com/goldencode/ast/AnnotatedAst.java
  • rev. 15860(Original author CA) - First pass to allow a skeleton which already exists in p2j.oo to re-use the names from p2j.oo instead of creating new conversion names.
  • rev. 15853 - Start for VAR statement: src/com/goldencode/p2j/uast/progress.g
  • rev. 15854 - Reverted VAR changes src/com/goldencode/p2j/uast/progress.g
  • rev. 15863 (Original author CA)- The Java method name associated with a constructor must be resolved from the ClassDefinition, during conversion. Useful for converting skeleton classes.

----------

From what I discussed with Constantin, the plan would be to create 9488b and have committed there what we want to reach trunk.
My opinion:
  • all fixed bugs
  • from supporting progress v12: Compound assignment operators, Support for final property and Support for ClientPricipal:TENANT-ID, ClientPricipal:TENANT-NAME. The generic change were more so I did not have parsinf errors. For full conversion generics support there is a lot more work to be done.
  • maybe the fixes for converting legacy oo, as these don t impact the conversion if the specific parameters are not set.

#156 Updated by Constantin Asofiei about 1 year ago

9488a was rebased from trunk rev 15875 - new rev 15902.

#157 Updated by Constantin Asofiei about 1 year ago

Ioana, please get these changes and commit them (one at a time) to 9436b; please see the review bellow, and also make sure the history entry/copyright year are updated:
  • Support *=, -=, +=, /= operator syntax:
    • rules/annotations/assignment_style_stmt_rewriting.rules
    • src/com/goldencode/p2j/uast/progress.g
  • final modifier for class property
    • rules/convert/variable_definitions.rules
    • src/com/goldencode/p2j/uast/progress.g
  • ClientPricipal:TENANT-ID and ClientPricipal:TENANT-NAME
    • src/com/goldencode/p2j/uast/progress.g
    • rules/convert/methods_attributes.rules
    • rules/gaps/expressions.rules
    • src/com/goldencode/p2j/util/ClientPrincipal.java
    • src/com/goldencode/p2j/util/ClientPrincipalResource.java
    • FIX: change SignatureHelper for these methods
    • FIX: ClientPrincipal - use UnimplementedFeature.missing to mark that is not implemented
    • FIX: create a task and assign it to Ovidiu for implementing the runtime for this feature (note at the task that the conversion changes are already made)
  • support for package-private access modifier
    • src/com/goldencode/p2j/uast/SymbolResolver.java
    • src/com/goldencode/p2j/uast/ClassDefinition.java
  • move the changes to 9436b
    • src/com/goldencode/p2j/oo/collections/Icomparable.java
  • FWD Bugs:
    • resize needs an integer argument for the index:
      • rules/convert/literals.rules
    • read extent from an EXPRESSION node
      • src/com/goldencode/p2j/uast/SymbolResolver.java
    • fixed the names for the extent property Java methods when loading a builtin .cls from FWD p2j.oo
      • src/com/goldencode/p2j/uast/ClassDefinition.java

The other changes are:
  • automatically compute member names (ctors, methods, etc) from builtin OO legacy classes in FWD, when converting:
    • rules/annotations/method_defs.rules
    • src/com/goldencode/p2j/uast/ClassDefinition.java
  • added is-legacy-oo=true p2j.cfg.xml config parameter, used when converting ADE sources
    • rules/annotations/naming.rules
    • rules/convert/base_structure.xml
    • rules/convert/method_definitions.rules
    • src/com/goldencode/p2j/convert/NameConverter.java
    • src/com/goldencode/p2j/uast/SymbolResolver.java
  • generics support
    • src/com/goldencode/p2j/uast/progress.g
  • helpers from 9457c - will not reach trunk at this time
    • src/com/goldencode/ast/AnnotatedAst.java
    • src/com/goldencode/p2j/uast/AstGenerator.java
  • hash-code changes which are already in 9436b:
    • src/com/goldencode/p2j/uast/progress.g
    • rules/convert/builtin_functions.rules
    • rules/gaps/expressions.rules
    • src/com/goldencode/p2j/convert/SignatureHelper.java
    • src/com/goldencode/p2j/util/BaseDataType.java

#158 Updated by Ioana-Cristina Prioteasa about 1 year ago

  • Related to Feature #9955: Implement ClientPrincipal:TENANT-ID and ClientPrincipal:TENANT-NAME added

#159 Updated by Greg Shah about 1 year ago

For details on how we properly document the licensing of the ADE code, see Inclusion of Apache 2 Licensed ADE Code.

#160 Updated by Dănuț Filimon 10 months ago

  • Related to Bug #10522: Bring changes from 7156e/15727 to trunk added

#161 Updated by Greg Shah 10 months ago

  • Assignee changed from Ioana-Cristina Prioteasa to Andrei Plugaru
  • % Done changed from 0 to 50

#162 Updated by Andrei Plugaru 10 months ago

I have tried to convert the ADE source code with the latest revision of 9488a, however conversion of multiple files fails with:

     [java] Caused by: java.lang.StringIndexOutOfBoundsException: begin 41, end 28, length 32
     [java]     at java.base/java.lang.String.checkBoundsBeginEnd(String.java:4606)
     [java]     at java.base/java.lang.String.substring(String.java:2709)
     [java]     at com.goldencode.p2j.uast.SymbolResolver.createClassMappings(SymbolResolver.java:2531)
     [java]     at com.goldencode.p2j.uast.SymbolResolver.initPossibleClasses(SymbolResolver.java:9160)
     [java]     at com.goldencode.p2j.uast.SymbolResolver.<init>(SymbolResolver.java:1250)
     [java]     at com.goldencode.p2j.uast.AstGenerator.parse(AstGenerator.java:1615)
     [java]     at com.goldencode.p2j.uast.AstGenerator.processFile(AstGenerator.java:1055)

I have done some investigation and the root cause seems to be related to #7255. In that task, SymbolResolver.getClassFileList has been modified to call getCanonicalPath instead of getAbsolutePath. The return value of the getCanonicalPath call is used as a key in a map. The problematic difference between these methods here is when it is called for .. getCanonicalPath will return the actual absolute path, however getAbsolutePath returned [the absolute path]/.. So, now, no matter if we initially have the path as an absolute path or ., it will use the same values from the map. This is wrong as the values from the map are relative to the initial path.

I will try to understand the minimal requirements to reproduce this issue, then if it also reproduces with trunk, will open a new task and fix that.

#163 Updated by Andrei Plugaru 10 months ago

The problem mentioned above is actually already solved in trunk by this change:

=== modified file 'src/com/goldencode/p2j/uast/SymbolResolver.java'
--- old/src/com/goldencode/p2j/uast/SymbolResolver.java 2025-04-07 13:44:03 +0000
+++ new/src/com/goldencode/p2j/uast/SymbolResolver.java 2025-09-23 14:38:23 +0000
@@ -2514,6 +2514,7 @@
                                           String                    path,
                                           boolean                   caseSens)
    {
+      path = Configuration.normalizeFilename(path);
       int begin = path.length();
       if (path.equals("."))
       {

Applying this patch to 9488a also fixes the problem mentioned above. Unfortunately, the conversion of the ADE sources still fails with multiple issues. I attach the conversion log.

#164 Updated by Andrei Plugaru 10 months ago

I have managed to solve some of the issues presented in the last note by removing classes from the skeleton or removing some entries from the propath. This way most of the files convert. Currently, I get these errors/warnings while converting:
  1. This warning I get twice

For now, I have focused on the 2nd problem from the list above. I have managed to also reproduce this error in a standalone test case. I attach the needed files. The conversion problem is in file StringKeyedMap2.cls. Basically, we have the constructor for MapEntry2 which expects instances of IMap2. In the constructor of StringKeyedMap2 we instantiate MapEntry2 and pass as the argument an instance of StringKeyedMap2(StringKeyedMap2 inherits IStringKeyedMap2 which inherits IMap2). So, there is a kind of transitive relationship(StringKeyedMap2 ->(inherits) IStringKeyedMap2 ->(inherits) IMap2), therefore methods that expect IMap2 parameters, should also accept StringKeyedMap2. In FWD, it would have worked worked, if we would have passed an IStringKeyedMap2 instance, instead of StringKeyedMap2, so the problem is when we have a 2 level deep relationship. The problem is probably related to ClassDefinition.isInheritedFrom, I will try to find a solution.

On another note, I want to mention that the original problematic class - StringKeyedMap, is actually already included in FWD, however, it doesn't contain all the methods from the one from ADE sources, so I think it is worth to make it work.

#165 Updated by Andrei Plugaru 10 months ago

I found a fix for the annotateMethodCall error from above. In ClassDefinition.isInheritedFrom we have logic for checking both the implemented interfaces and the extended classes. The problem occurs for the recursive calls for the interfaces. Only the implemented interfaces from the inheritance tree would be checked. So, if we have this relation:
(class A (implements)-> interface I1 (extends)-> interface I2), a call to check whether class A is inherited from interface I2 would have returned false. As a fix, I have made it call isInheritedFrom in ClassDefinition.isInheritedFrom for all the inherited interfaces. Up until now, it was calling isImplemented. However, this method only checks the interfaces that are implemented by this one, however it doesn't check the classes that are extended.

I have made 2 commits to 9488a:
  1. 15903 - Contains some patches from trunk regarding propath processing
  2. 15903 - Solution for the annotateMethodCall problem

Next, I will focus on the other problem exposed in #9488-164.

#166 Updated by Andrei Plugaru 10 months ago

I think I understand the root cause for this problem: WARNING: more than one method def found using fuzzy lookup: GetIterator from class Progress.Collections.IList. I get this error when processing ./abl/OpenEdge/Core/Collections/List.cls for this file Progress.Collections.IList. It's important to note that the package name starts with Progress, as there is also an OpenEdge version. In the skeleton version for this class, it inherits from Progress.Collections.ICollection and Progress.Collections.IIterable. Progress.Collections.ICollection also inherits from Progress.Collections.IIterable. In Progress.Collections.IIterable, method GetIterator is defined. Therefore, in ClassDefinition.candidates it gets to have the same method twice(once coming directly from Progress.Collections.IIterable and another one from Progress.Collections.ICollection), even though it actually represents the same class method. I will try to refactor that code to use a set instead of the list in order to avoid this duplication.

#167 Updated by Andrei Plugaru 10 months ago

I fixed the problem from #9488-166 in 9488a/ rev. 15905. I have made ClassDefinition.candidates return a Set of MethodData instances. Up until now, it was returning a list of MatchMetrics, however, I don't think any other data was used up until ClassDefinition.candidates. I am creating back the List of MatchMetrics in FuzzyMethodLookup.fuzzyMethodLookup based on the unique method candidates.

#168 Updated by Andrei Plugaru 10 months ago

Update on the current status:
Currently, there are no more blocking issues when converting, however, there are still some warnings while converting:
  • Could not find legacy builtin method javaname for 'Progress.Collections.KeyValuePair:set-key(KW_INPUT object)'
  • [java] method () accessible from class OpenEdge.Core.Collections.Set has two Java names: __core_collections_LegacyCollection_execute__ and __core_collections_LegacySet_execute__
  • [java] resolve_class_package: WARNING: clsPkg not oo4gl: ./abl/OpenEdge/Core/Assertion/AssertObject.cls

For now, I moving past them, however if they are indeed important, I will try to investigate them.
Next, while compiling, I still get some errors. They are quite a few. I will take them one by one. The 1st one is about the fact LegacyString.java implements the same interface multiple times. This was also caught by Ioana, however, in #9488-119, it was suggested to ignore this file as we already have the implementation in FWD. However, I am not exactly sure this is right, as in the already implemented LegacyString, we don't have some methods, like unknown, compareTo_1. I think the better solution will be to remove the duplicate implemented interface from the original OE code. I also attach the current conversion list I am using.

#169 Updated by Andrei Plugaru 10 months ago

About the problem with classes that implement the same interface multiple times with different generics. This cannot really be solved as Java doesn't allow this inheritance. The only solution I can think of is to modify the source code in order to remove the other implementations. However, in this regard, there was another problem as in the converted code the generics was not added. Ioana started a solution for this, however she reverted at a point as it was not working properly. Currently, I got to a solution where it seems it works, at least for the ADE sources. I committed the solution in 9488a/ 15906.

Next compile problems

There are still some compile problems. I attach the entire build log.
Currently, I am investigating this:

    [javac] /home/ap/gcd/ade/icp/icp/ADE_project/ADE/src/com/goldencode/p2j/oo/core/ByteBucket.java:1090: error: no suitable method found for indexOf(memptr,longchar,int64)
    [javac]          idx.assign(indexOf(memoutStream.ref().getData(), pSearchStr, pStartAt));
    [javac]                     ^
    [javac]     method TextOps.indexOf(String,String,double) is not applicable
    [javac]       (argument mismatch; memptr cannot be converted to String)
    [javac]     method TextOps.indexOf(Text,String,double) is not applicable
    [javac]       (argument mismatch; memptr cannot be converted to Text)
    [javac]     method TextOps.indexOf(String,Text,double) is not applicable
    [javac]       (argument mismatch; memptr cannot be converted to String)
    [javac]     method TextOps.indexOf(Text,Text,double) is not applicable
    [javac]       (argument mismatch; memptr cannot be converted to Text)
    [javac]     method TextOps.indexOf(String,String,NumberType) is not applicable
    [javac]       (argument mismatch; memptr cannot be converted to String)
    [javac]     method TextOps.indexOf(Text,String,NumberType) is not applicable
    [javac]       (argument mismatch; memptr cannot be converted to Text)
    [javac]     method TextOps.indexOf(String,Text,NumberType) is not applicable
    [javac]       (argument mismatch; memptr cannot be converted to String)
    [javac]     method TextOps.indexOf(Text,Text,NumberType) is not applicable
    [javac]       (argument mismatch; memptr cannot be converted to Text)

It would seem that in the latest OE version, this construction is allowed: INDEX(mptr, "memptr", 10)., where mptr is a memptr. In FWD, we don't have any overloaded method for indexOf that accepts a memptr. I will work on adding an overloaded method for this in TextOps class.

#170 Updated by Andrei Plugaru 10 months ago

I have committed 9488/ rev. 15907 for adding the overloaded methods indexOf in TextOps.
After that, I investigated class Memptr, where there are 2 methods with the same signature, one for this explicit getter:

    method public int64 GetPointerValue ():
        return this-object:PointerValue.
    end method.

, and one for the implicit one from the property declaration:
        get():
            return get-pointer-value(mmValue).
        end get.

However, in a different class only with these constructs, the logic for avoiding the naming collision works, the problem is that GetPointerValue is a method from an implemented interface, so the name wasn't checked for collisions. Currently, I have this quick fix, which works for the ADE source, however, I would want to improve it before committing:

=== modified file 'src/com/goldencode/p2j/uast/ClassDefinition.java'
--- old/src/com/goldencode/p2j/uast/ClassDefinition.java        2025-09-30 07:55:55 +0000
+++ new/src/com/goldencode/p2j/uast/ClassDefinition.java        2025-10-02 14:32:31 +0000
@@ -879,6 +879,10 @@
             }
             else if (override && (javaname = lookupOverrideName(legacySig, override, true)) != null)
             {
+               if (javaMethodCollisions.contains(javaname + "(" + jparms + ")"))
+               {
+                  javaname = calculateUniqueJavaMethodName(accessor, jparms, legacySig);
+               }
                // first time in (for an override)
                addJavaMethodName(javaname, jparms, legacySig);

Other compiling issues

  1.     [javac] /home/ap/gcd/ade/icp/icp/ADE_project/ADE/src/com/goldencode/p2j/oo/core/EventArgs.java:69: error: cannot find symbol
        [javac]          if (_not(EventArgs.empty.isValid()))
        [javac]                                  ^
        [javac]   symbol:   method isValid()
        [javac]   location: variable empty of type ContextLocal<object<? extends EventArgs>>
    
  2.     [javac] /home/ap/gcd/ade/icp/icp/ADE_project/ADE/src/com/goldencode/p2j/oo/core/EventArgs.java:74: error: no suitable method found for storeReturnValue(ContextLocal<object<? extends EventArgs>>)
        [javac]          storeReturnValue(EventArgs.empty);
        [javac]          ^
        [javac]     method BlockManager.storeReturnValue(boolean) is not applicable
        [javac]       (argument mismatch; ContextLocal<object<? extends EventArgs>> cannot be converted to boolean)
        [javac]     method BlockManager.storeReturnValue(double) is not applicable
        [javac]       (argument mismatch; ContextLocal<object<? extends EventArgs>> cannot be converted to double)
        [javac]     method BlockManager.storeReturnValue(long) is not applicable
        [javac]       (argument mismatch; ContextLocal<object<? extends EventArgs>> cannot be converted to long)
        [javac]     method BlockManager.storeReturnValue(int) is not applicable
        [javac]       (argument mismatch; ContextLocal<object<? extends EventArgs>> cannot be converted to int)
        [javac]     method BlockManager.storeReturnValue(String) is not applicable
        [javac]       (argument mismatch; ContextLocal<object<? extends EventArgs>> cannot be converted to String)
        [javac]     method BlockManager.storeReturnValue(BaseDataType) is not applicable
        [javac]       (argument mismatch; ContextLocal<object<? extends EventArgs>> cannot be converted to BaseDataType)
        [javac]     method BlockManager.storeReturnValue(Stream) is not applicable
        [javac]       (argument mismatch; ContextLocal<object<? extends EventArgs>> cannot be converted to Stream)
        [javac]     method BlockManager.storeReturnValue(WrappedResource) is not applicable
        [javac]       (argument mismatch; ContextLocal<object<? extends EventArgs>> cannot be converted to WrappedResource)
    
  3.     [javac] /home/ap/gcd/ade/icp/icp/ADE_project/ADE/src/com/goldencode/p2j/oo/core/LongcharArrayHolder.java:219: error: no suitable constructor found for longchar(character[])
        [javac]          LongcharArrayHolder.this.bulkSetValue(new longchar(pcValue[0]));
        [javac]                                                ^
        [javac]     constructor longchar.longchar(BaseDataType) is not applicable
        [javac]       (argument mismatch; character[] cannot be converted to BaseDataType)
        [javac]     constructor longchar.longchar(String) is not applicable
        [javac]       (argument mismatch; character[] cannot be converted to String)
        [javac]     constructor longchar.longchar(char) is not applicable
        [javac]       (argument mismatch; character[] cannot be converted to char)
        [javac]     constructor longchar.longchar(Text) is not applicable
        [javac]       (argument mismatch; character[] cannot be converted to Text)
    
    
  4.     [javac] /home/ap/gcd/ade/icp/icp/ADE_project/ADE/src/com/goldencode/p2j/oo/core/util/TokenResolver.java:729: error: incompatible types: int64 cannot be converted to integer
        [javac]             silent(() -> tokenVal.assign(pError.ref().getMessage(integer.maximum(new integer(1), idx))));
    

The reason for the 1st and 2nd problem is that the converted code looks like this:

         if (_not(EventArgs.empty.isValid()))
         {
            EventArgs.setEmpty(new object(ObjectOps.newInstance(EventArgs.class)));
         }

         storeReturnValue(EventArgs.empty);

Calling get() on EventArgs.empty fixes both issues.
The 3rd problem has been discussed previously, according to #9488-151, the solution was to just manually modify the converted code. The 4th problem is that, in that case, integer.maximum returns an int64, and the result is passed as the argument to LegacyError.getMessage, which only accepts integer.

Right now, I don't have a concrete solution for these last problems, however, the good part is that, after manually modifying the converted code in order to fix these issues, it built successfully.

#171 Updated by Andrei Plugaru 10 months ago

I have made a few commits to 9488a:
  1. rev. 15908 - fixes the duplicate getter. I have used a similar approach as I previously posted in #9488-170. Basically, I have introduced the logic for checking name collisions for overridden methods. However, initially, I am only checking the methods in the current class, instead of the entire class hierarchy. The reason is that, after the 1st method is processed, in an upper class, the method is already marked for collisions. So, checking the entire class hierarchy, would have changed the method name even for the 1st method in the current class.
  2. rev. 15909 - fixes the missing get for EventArgs.empty. The reason the getter was not added, is this the condition from oo_calls.rules was evaluated as false:
                <!-- static variable access must dereference a context local -->
                <rule>
                   ref2.isAnnotation("static")                         and
                   #(java.lang.Boolean) ref2.getAnnotation("static")   and
                   !ref2.isAnnotation("cls-property")                  and
                   !evalLib("is_java_cls", ref2)
                   <action>
                      lastid = createJavaAst(java.method_call, "get", closestPeerId)
                   </action>
                   <action on="false">lastid = closestPeerId</action>
                </rule>
    

    The reason is !ref2.isAnnotation("cls-property") was false. To be honest, I don't quite understand why this check is needed. However, I didn't either find out what cls-property really means. I would assume it means it is a data member in a class. And, if my assumption is correct, I don't understand, why it needs NOT to be a class member in order to generate that getter. So, for now, I have deleted that condition from the rule and it is working fine.
  3. rev. 15910 - fixes the 4th problem from the compiling issues in #9488-170. The solution I have committed is to just have an implementation of the maximum method in integer class which returns an integer instance. IMHO, this is a correct solution, as up until now, it was just going up to the base implementation from int64, so it would have always returned an int64 instance. However, Ioana also encountered a similar issue, and she proposed this solution in #9488-131, however it wasn't implemnted. As far as I understand, it was solved by wrapping the return values into an integer when it was called. However, I don't really see the advantage for this conversion solution compared to just adding the method in integer class. However, I am open to make the conversion change if it is really needed.

With the last revision, the code converts and compiles successfully except for LongcharArrayHolder.this.bulkSetValue(new longchar(pcValue[0])); issue. However, as discussed previously(#9488-151), the solution is just to modify the converted code. The conversion list used is in #9488-168.

#172 Updated by Andrei Plugaru 10 months ago

This is the list of the current converted files and their runtime support in p2j.

Currently, I would assume that, next, we should focus only on classes that currently have PARTIAL or STUB runtime support. I have looked over some file with FULL runtime support, and all the public methods from the new converted classes are also inside the old classes from p2j. However, let me know, if further investigation is needed.
I will also attach here the conversion list used.

#173 Updated by Constantin Asofiei 10 months ago

Andrei, in this pass, I'd like to have only unimplemented files in FWD (RT_LVL_STUB) in a branch.

#174 Updated by Constantin Asofiei 10 months ago

From #10522, please also add OpenEdge.Core.Collections.StringCollection (and dependencies) plus check the changes from OpenEdge.Core.Collections.AbstractTTCollection in #10522 if they make sense.

#175 Updated by Andrei Plugaru 7 months ago

  • Status changed from WIP to Review

It's a bit lite, but I will put it into review, as me and Constantin talked via e-mail and I sent the files needed for the 1st pass.

#176 Updated by Constantin Asofiei 7 months ago

Greg, please see these notes:
  • files which have also a history list from our the hand-written .cls file - should we keep that history?
  • some interfaces are pretty simple (like in IdecimalHolder.java) - should we keep our version or the converted one?
  • AbstractTtcollection - this has a significant hand-written implementation, but it still may be buggy (see the #10522 issues); I think we can use the converted one, but we need to test the projects using it.
  • Array - this again has a significant hand-written implementation, without using temp-tables. I think we need to use our implementation and just double-check if our impl matches the logic from the 4GL Array.cls code.

Artur, please create a separate branch and place there all p2j/oo .java files, without any DMO files or other artifacts (name_map.xml, etc).

#177 Updated by Greg Shah 7 months ago

  • files which have also a history list from our the hand-written .cls file - should we keep that history?

We keep the history if we have manual changes in the file. If the file is just converted, then our old history entries don't apply.

some interfaces are pretty simple (like in IdecimalHolder.java) - should we keep our version or the converted one?

Unless there is some value in the existing implementation, I would expect to use the converted one.

AbstractTtcollection - this has a significant hand-written implementation, but it still may be buggy (see the #10522 issues); I think we can use the converted one, but we need to test the projects using it.

Is this a case where our existing implementation eliminated the temp-table usage? If so we might want to keep it. If there is no improvement, then use the converted version.

  • Array - this again has a significant hand-written implementation, without using temp-tables. I think we need to use our implementation and just double-check if our impl matches the logic from the 4GL Array.cls code.

Agreed

#178 Updated by Constantin Asofiei 7 months ago

Greg Shah wrote:

  • files which have also a history list from our the hand-written .cls file - should we keep that history?

We keep the history if we have manual changes in the file. If the file is just converted, then our old history entries don't apply.

Well, there were some changes which are brought automatically now via conversion while in the past were added manually.

some interfaces are pretty simple (like in IdecimalHolder.java) - should we keep our version or the converted one?

Unless there is some value in the existing implementation, I would expect to use the converted one.

Understood.

AbstractTtcollection - this has a significant hand-written implementation, but it still may be buggy (see the #10522 issues); I think we can use the converted one, but we need to test the projects using it.

Is this a case where our existing implementation eliminated the temp-table usage? If so we might want to keep it. If there is no improvement, then use the converted version.

Thanks, we'll move to the converted variant. There is no temp-table usage in this.

  • Array - this again has a significant hand-written implementation, without using temp-tables. I think we need to use our implementation and just double-check if our impl matches the logic from the 4GL Array.cls code.

Agreed

Understood. As a general idea - I think anything which has temp-tables for these cases, we will rewrite to not use them.

#179 Updated by Greg Shah 7 months ago

As a general idea - I think anything which has temp-tables for these cases, we will rewrite to not use them.

Yes, exactly right. Temp-tables should not be the basis for non-database data structures like collections or arrays.

#180 Updated by Constantin Asofiei 6 months ago

Andrei, please create a separate branch and place there all p2j/oo .java files, without any DMO files or other artifacts (name_map.xml, etc).

#181 Updated by Andrei Plugaru 6 months ago

Constantin Asofiei wrote:

Andrei, please create a separate branch and place there all p2j/oo .java files, without any DMO files or other artifacts (name_map.xml, etc).

Ok, I am on it.

#182 Updated by Andrei Plugaru 6 months ago

I have committed the converted classes in 9488b/16341. Important notes:
  1. Apart from the converted classes, I have also ported the change in integer.java from 9488a. The need for this change is explained in #9488-171
  2. I have slightly modified the initial converted class TokenResolver because of the changed name of some getter/setter methods in ClientPrincipalResource. tenantId/tenantName have changed to getTenantId/getTenantName since i made the initial conversion.
  3. I have added the converted Array as Array_conv and AbstractTTCollection as AbstractTTCollection_conv as these files need further inspection.

#183 Updated by Constantin Asofiei 6 months ago

Please add the history number to integer.java

Otherwise, please:
  • use the converted AbstractTtCollection.java
  • manually check the existing Array.java implementation with the 4GL Array.cls
  • remove the two _conv files

#184 Updated by Andrei Plugaru 6 months ago

I have committed 9488a/16342:
  1. replaced AbstractTtCollection with the converted version
  2. Added the history number to integer

Regarding Array.java, it seems there are multiple missing methods in our current implementation. The protected methods, I think can be ignored as these methods can't be called from any converted code. However, there are also some public methods that are not present in our current implementation(setDefaultArraySize, addNull, add(final integer _pIndex, final object _pElement), ...). I think these should be added. There are also methods that have slightly different implementations, I will compare each of them and see if they can behave differently.

#185 Updated by Andrei Plugaru 6 months ago

Danut, about the files that are in #10522:
  • In #10522 there are changes in StringCollection.java, AbstractTtcollection.java, LegacyList.java, LegacyListIterator.java
  • All of them are also in 9488a. I would assume that all the functionality in the converted classes is also in 10522a, even though implementation per-se can be slightly different.

#186 Updated by Andrei Plugaru 6 months ago

While checking the converted Array.java, I have across an issue that was also spotted by Ioana back when she was working on this task, but it seems it was never properly fixed(#9488-144). The problem is in setValue(final object _poValue, final integer _piExtent) method which has a recursive call:

   public void setValue(final object<? extends _BaseObject_> _poValue, final integer _piExtent)
   {
      object<? extends _BaseObject_> poValue = TypeFactory.initInput(_poValue);
      integer piExtent = TypeFactory.initInput(_piExtent);

      internalProcedure(Array.class, this, "SetValue", new Block((Body) () -> 
      {
         Assert.isPositive(piExtent, new character("Index"));

         if (_or(isUnknown(Array.this.getLength()), () -> isGreaterThan(piExtent, Array.this.getLength())))
         {
            //  this method will throw a ResizeError if needed
            updateLength(InputParameter.cast(integer.class, new integer(new integer(plus(piExtent, round(multiply(0.5, Array.this.getLength()), 0))))));
         }

         Array.this.setValue(poValue, piExtent);
         mSize.assign(int64.maximum(mSize, piExtent));
      }));
   }

This can be solved by wrapping piExtent to an int64. This way the call will resolve to another correct method. The same problem is also in getValue(final integer _piExtent), which has also a recursive call.

I am not sure if it is worth finding here the conversion solution, or we can just manually modify the converted file and defer this problem to another task?

#187 Updated by Constantin Asofiei 6 months ago

Andrei, so you have a 4GL method with the same name (and signature) as a converted 4GL getter or setter. Please create a standalone test for this.

#188 Updated by Andrei Plugaru 6 months ago

This testcase from #9488-146 reproduces the problem:

class OpenEdge.Core.Collections.Array:
    define protected property Value as Object extent no-undo get. set.

    method public void SetValue(input poValue as Object):
        SetValue(poValue, 1).
    end method.

    method public void SetValue(input poValue as Object, input piExtent as integer):
        assign this-object:Value[piExtent] = poValue.
    end method.

    method public Object GetValue(input piExtent as integer):
        return this-object:Value[piExtent].
    end method.

end class.

And it gets converted to


There is the Value property in the class which is an extent. assign this-object:Value[piExtent] = poValue. should have assigned the value to the extent at that position, instead it just calls the same method again.

I have a question, are the methods for setting a value at a position in an extent always having int64 as the type for the index parameter? If so, it seems that something like this solves the setter problem by wrapping the parameter into int64:

=== modified file 'rules/annotations/oo_references.rules'
--- old/rules/annotations/oo_references.rules   2025-10-01 13:25:42 +0000
+++ new/rules/annotations/oo_references.rules   2026-01-16 10:43:56 +0000
@@ -818,8 +818,11 @@
                   <action>idxref = subref.getChildAt(0)</action>
                   <action>subref.remove()</action>
                   <action>eref = createProgressAst(prog.expression, copy, 1)</action>
-                  <action>eref.putAnnotation("classname", "integer")</action>
+                  <action>eref.putAnnotation("classname", "int64")</action>
                   <action>eref.putAnnotation("wrap", true)</action>
+                  <action>eref.putAnnotation("wrap_parameter", true)</action>
+
+                  
                   <rule>idxref.type == prog.expression
                      <action>idxref = idxref.getChildAt(0)</action>
                   </rule>

#189 Updated by Constantin Asofiei 6 months ago

Andrei, we don't need to wrap it. This needs to be solved in ClassDefinition.hasCollision - that currently uses exact signature match, with no concept of overloading.

#190 Updated by Constantin Asofiei 6 months ago

Constantin Asofiei wrote:

Andrei, we don't need to wrap it. This needs to be solved in ClassDefinition.hasCollision - that currently uses exact signature match, with no concept of overloading.

Actually, you are right - the fix needs to be where we emit the getter/setter call, and only if the index parameter doesn't match int64.

#191 Updated by Andrei Plugaru 6 months ago

This patch seems to solve the issue both for getters and setters:

However, I am a little confused about the wrap annotation that was already being set. I had to remove it and only set wrap_parameter. If I kept both, literals would have been wrapped 2 times: assign this-object:Value[2] = poValue. -> ArrayRecursive.this.setValue(poValue, new int64(new int64(2)));

#192 Updated by Constantin Asofiei 6 months ago

Andrei, lets get this in another branch, as I want the p2j.oo in trunk soon.

Otherwise, how is Array.java looking when compared with Array.cls? Do we need to change anything?

#193 Updated by Andrei Plugaru 6 months ago

Constantin Asofiei wrote:

Andrei, lets get this in another branch, as I want the p2j.oo in trunk soon.

Ok, got it.

Otherwise, how is Array.java looking when compared with Array.cls? Do we need to change anything?

Yes, unfortunately, there are a few differences. The most important ones I am looking into are missing public methods from our implementation. Here are a few examples:
  • indexOf_
  • lastIndexOf_
  • public object remove(final integer _pIndex)
  • public object set(final integer _pIndex, final object _pElement)
  • subList
  • addArray(final integer _pIndex, final object[] _pArray)

Also, some methods like setSize seem to have a slightly different behaviour regarding handling error cases. I will come up with the whole list of differences soon and will try to implement those.

#194 Updated by Constantin Asofiei 6 months ago

The missing methods are not part of the skeleton Array.cls - so if you add them, you need to add them to the skeleton, too. And also check if the methods are overrides from some interface.

#195 Updated by Andrei Plugaru 6 months ago

Constantin Asofiei wrote:

And also check if the methods are overrides from some interface.

Hmm, it seems that these new methods are defined in IList interface, which is implemented by the new Array class. However, the old one implements Icollection.
Apart from adding the new methods in our Array class, should I also change it to implement Ilist?

PS: Ilist interface actually extends Icollection. So, the inheritance tree won't change by much.

#196 Updated by Constantin Asofiei 6 months ago

I think we have the wrong hierarchy in FWD. For 11.7, Array implements IList, which in turn implements ICollection.

Please check github for both 11.7 and 12.8 at https://github.com/progress/ADE/ and lets fix the hierarchy and the interfaces (including in skeleton .cls),

#197 Updated by Andrei Plugaru 6 months ago

I committed the changes to the Array class. They mainly contain the new methods that are from IList interface, but also contain some new constructors. Also, I attach the modified Array skeleton.
Currently, one thing that still needs to be done is regarding Arra.toTable. Right now we only have a stub for this method, however I think it is a good moment to have the implementation.

#198 Updated by Constantin Asofiei 6 months ago

Andrei Plugaru wrote:

Currently, one thing that still needs to be done is regarding Arra.toTable. Right now we only have a stub for this method, however I think it is a good moment to have the implementation.

Yes, implement that.

#199 Updated by Andrei Plugaru 6 months ago

Constantin, for the Array.toTable we would need a DMO for the temp table. I see 2 options:
  1. get the converted DMO used in this method(Ttarray_1) and add it to the branch
  2. create the temp table dynamically, similar to how it is done in List.ToTable:
            create temp-table tt.
            tt:add-new-field('sequence', 'integer').
            tt:add-new-field('objectref', 'Progress.Lang.Object').
            tt:add-new-index('objidx').
            tt:add-index-field('objidx', 'objectref').
            tt:add-new-index('seq', yes, yes).
            tt:add-index-field('seq', 'sequence').
            tt:temp-table-prepare('ttList').
    

I would prefer the 2nd option as we don't have to add another DMO interface.

#200 Updated by Constantin Asofiei 6 months ago

The temp-table will be dynamic, via create temp-table. Just make sure its definition is right (fields/types and indexes, temp-table name).

#201 Updated by Andrei Plugaru 6 months ago

Constantin, I have committed 9488b/ rev. 16344 with the proper implementation for toTable in Array.
Please review!

#202 Updated by Constantin Asofiei 6 months ago

Andrei, please fix the javadoc formatting at the new methods you've added - I know most methods are missing javadoc, but if you add it, make sure is following the standard.

Also, please update the copyright year on the file (and any other files which require it).

Otherwise, did you test toTable and the other methods in FWD?

#203 Updated by Andrei Plugaru 6 months ago

Constantin Asofiei wrote:

Andrei, please fix the javadoc formatting at the new methods you've added - I know most methods are missing javadoc, but if you add it, make sure is following the standard.

Also, please update the copyright year on the file (and any other files which require it).

Ok, will do.

Otherwise, did you test toTable and the other methods in FWD?

No, I haven't. Is there a suite of tests specifically for these classes? Or how exactly should they be tested?

#204 Updated by Constantin Asofiei 6 months ago

Andrei Plugaru wrote:

No, I haven't. Is there a suite of tests specifically for these classes? Or how exactly should they be tested?

See the new testcases project, the tests/oo/openedge/core/collections/array/ folder.

#205 Updated by Andrei Plugaru 6 months ago

I have tested the current Array class using the tests from testcases and unfortunately, there are a few dozen failures. There are quite a few regarding missing errors/warnings.
However, I have also tested the converted version of the Array(with the custom toTable) and it passes most of the tests. There are 2 issues:
  1. test testMethodToTableArray fails. At a first glance, it seems it is regarding the error management.
  2. testPropertyValueArray fails because of a conversion error:
        /* Default constructor */
        constructor public Array():
            this-object(Array:DefaultArraySize).
            // we don't have any elements yet
            assign mSize = 0.
        end constructor.
    

    Got converted to
       public void __core_collections___core_collections_Array_constructor__static___constructor__()
       {
    ...
       }
    

So, my question is wouldn't be better to move forward to the converted version or should I try to completely align our implementation to the converted one.
To be noted that the converted version doesn't use a temp table as the backing structure, it is an array.

#206 Updated by Constantin Asofiei 6 months ago

Andrei Plugaru wrote:

I have tested the current Array class using the tests from testcases and unfortunately, there are a few dozen failures. There are quite a few regarding missing errors/warnings.

Is this from your implementation or from trunk?

To be noted that the converted version doesn't use a temp table as the backing structure, it is an array.

What are you converting? See https://github.com/progress/ADE/blob/release-12.8.x/corelib/OpenEdge/Core/Collections/Array.cls - it has a ttArray temp-table.

#207 Updated by Andrei Plugaru 6 months ago

Constantin Asofiei wrote:

Andrei Plugaru wrote:

I have tested the current Array class using the tests from testcases and unfortunately, there are a few dozen failures. There are quite a few regarding missing errors/warnings.

Is this from your implementation or from trunk?

Here I mean the one from 9488b, which is based on the one from trunk + the new methods + toTable method.

To be noted that the converted version doesn't use a temp table as the backing structure, it is an array.

What are you converting? See https://github.com/progress/ADE/blob/release-12.8.x/corelib/OpenEdge/Core/Collections/Array.cls - it has a ttArray temp-table.

In the original OE code ttArray is only used for toTable method. However, I dropped it as we used the dynamic temp table for that. ttArray is not used as the backing structure. The backing structure is an extent.

#208 Updated by Constantin Asofiei 6 months ago

Andrei Plugaru wrote:

In the original OE code ttArray is only used for toTable method. However, I dropped it as we used the dynamic temp table for that. ttArray is not used as the backing structure. The backing structure is an extent.

Hmm... lets do this: get the converted Array.java and change it after in FWD, to get rid of the DMO and toTable to use a dynamic temp-table.

#209 Updated by Andrei Plugaru 6 months ago

Constantin Asofiei wrote:

Hmm... lets do this: get the converted Array.java and change it after in FWD, to get rid of the DMO and toTable to use a dynamic temp-table.

Well, I already done this :)) This is what I was referring to in:

However, I have also tested the converted version of the Array(with the custom toTable) and it passes most of the tests. There are 2 issues:

In 9488b/16345 I have committed the converted Array class with the changes about the DMO and toTable method + the new header for the file.
The only thing left to do from my POV is to do the cosmetic changes about the Java doc and copyright year.

#210 Updated by Andrei Plugaru 6 months ago

Constantin, about the Javadocs for the methods: it seems that in the original OE code most of the methods have some documentation, however they are either lost or put in completely wrong places. I think if we really want to have the right and complete Javadocs, I should go over the original OE code, copy the documentation from there and then adapt it to match our standard.

Do you think it is worth doing that?

#211 Updated by Constantin Asofiei 6 months ago

Andrei Plugaru wrote:

Do you think it is worth doing that?

Andrei, when I mentioned the javadocs, I meant what you manually wrote - not to add/fix 4GL javadocs; sorry for the confusion.

The same for the custom Array.toTable impl: please use our standard formatting for the hand-written code. Also, enhance the history entry to specify that toTable was re-written to use a dynamic temp-table.

#212 Updated by Andrei Plugaru 6 months ago

Constantin Asofiei wrote:

Andrei, when I mentioned the javadocs, I meant what you manually wrote - not to add/fix 4GL javadocs; sorry for the confusion.

The same for the custom Array.toTable impl: please use our standard formatting for the hand-written code. Also, enhance the history entry to specify that toTable was re-written to use a dynamic temp-table.

Ooh, got it.

#213 Updated by Andrei Plugaru 6 months ago

Constantin, I have addressed the copyright year, history entry and the javadocs in 9488b/rev. 16346

#214 Updated by Constantin Asofiei 6 months ago

Andrei Plugaru wrote:

Constantin, I have addressed the copyright year, history entry and the javadocs in 9488b/rev. 16346

Thanks. Please put this in both conversion and runtime regression.

We need also the skeletons updated with the Array.cls change for the IList interface (this will be committed when 9488b is merged). Please post the skeleton patch here.

#215 Updated by Andrei Plugaru 6 months ago

Here it is the patch for the skeleton.

Also, I committed a small change to 9488b/16347 to address the wrong constructor name: __core_collections___core_collections_Array_constructor__static___constructor__ -> __core_collections_Array_constructor__. This was explained in #9488-205, however, somehow the change got lost.

#216 Updated by Andrei Plugaru 6 months ago

After a discussion with Constantin via e-mail, I looked more carefully for the necessary changes in skeleton, besides only the Array. I added the missing methods and changed the inherited classes where it was needed.
I attach the completed skeleton patch.

#217 Updated by Andrei Plugaru 6 months ago

This is the final skeleton patch I used. Compared to the last one, it doesn't have anymore the generics in implements clause and also I have added the full class name as they were missing in some instances which also lead to errors.

With these patch, I converted so far a large application and didn't get any differences.

#218 Updated by Constantin Asofiei 5 months ago

Just a heads up: the readme in the root project file needs to be edited in the branch to contain the ADE files which have been included in FWD.

#219 Updated by Andrei Plugaru 5 months ago

I have committed 9488b/16425 with the updated readme. For now, I have just added the directories with the ADE files as I saw there was a TODO in this regard. However, I can also add the exact files if needed.

Regarding the testing, currently there is only one more application that needs to be tested. For the others, both the conversion and runtime succeeded.

#220 Updated by Constantin Asofiei 5 months ago

Andrei, something else: if we patch skeleton I assume is mandatory for 9488b to be in trunk, right?

#221 Updated by Andrei Plugaru 5 months ago

Constantin Asofiei wrote:

Andrei, something else: if we patch skeleton I assume is mandatory for 9488b to be in trunk, right?

Hmm, I am not really aware of all the situations when using out of sync skeleton and p2j can cause problems. The changes in skeleton are mostly additive(new methods, constructors, properties), however also some class hierarchies have been changed.

#223 Updated by Constantin Asofiei 5 months ago

  • Status changed from Review to Merge Pending

Please merge 9488b after 10727a. Also at the same time commit the skeleton patch. On the commit message for 9488b and in #8828 mention that this requires skeleton rev ... or greater.

#224 Updated by Andrei Plugaru 5 months ago

  • Status changed from Merge Pending to WIP

I have merged 9488b into trunk as rev. 16440. Also, committed the skeleton updates as rev. 126.

#225 Updated by Stefanel Pezamosca 5 months ago

I have spotted an error in skeleton's oo4gl/OpenEdge/Core/Collections/Array.cls, IListIterator is missing the qualifier, here is the patch:

=== modified file 'oo4gl/OpenEdge/Core/Collections/Array.cls'
--- old/oo4gl/OpenEdge/Core/Collections/Array.cls    2026-02-23 15:21:00 +0000
+++ new/oo4gl/OpenEdge/Core/Collections/Array.cls    2026-03-04 09:02:12 +0000
@@ -116,10 +116,10 @@
     method public integer IndexOf( input pElement as Progress.Lang.Object ):
     end.

-    method public IListIterator ListIterator():
+    method public OpenEdge.Core.Collections.IListIterator ListIterator():
     end.

-    method public IListIterator ListIterator(input pIndex as integer):
+    method public OpenEdge.Core.Collections.IListIterator ListIterator(input pIndex as integer):
     end.

     method public integer LastIndexOf(input pElement as Progress.Lang.Object):
@@ -128,7 +128,7 @@
     method public Progress.Lang.Object Remove(input pIndex as integer):
     end.

-    method public IList SubList(input pFromIndex as integer,
+    method public OpenEdge.Core.Collections.IList SubList(input pFromIndex as integer,
                                 input pToIndex as integer):
     end.

Should I commit it to skeleton repo ?

#226 Updated by Constantin Asofiei 4 months ago

Stefanel Pezamosca wrote:

I have spotted an error in skeleton's oo4gl/OpenEdge/Core/Collections/Array.cls, IListIterator is missing the qualifier, here is the patch:
[...] Should I commit it to skeleton repo ?

Please do.

#227 Updated by Dănuț Filimon 4 months ago

  • Assignee changed from Andrei Plugaru to Dănuț Filimon
I've made the following list of p2j.oo classes from trunk/16462 that need to be completed:
p2j.oo OE Code Status Support level
p2j.oo.collections.HashMap Progress.Collections.HashMap builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Icollection Progress.Collections.ICollection builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Icomparable Progress.Collections.IComparable builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Icomparer Progress.Collections.IComparer builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.IequalityComparer Progress.Collections.IEqualityComparer builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Ihashable Progress.Collections.IHashable builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Iiterable Progress.Collections.IIterable builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Iiterator Progress.Collections.IIterator builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Ilist Progress.Collections.IList builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Imap Progress.Collections.IMap builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.Iset Progress.Collections.ISet builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.KeyValuePair Progress.Collections.KeyValuePair builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.collections.SortedSet Progress.Collections.SortedSet builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.core.assertion.AssertError OpenEdge.Core.Assertion.AssertError available CVT_LVL_PARTIAL & RT_LVL_STUB
p2j.oo.core.assertion.AssertObject OpenEdge.Core.Assertion.AssertObject available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.core.collections.ClassClassMap OpenEdge.Core.Collections.ClassClassMap available CVT_LVL_PARTIAL & RT_LVL_STUB
p2j.oo.core.collections.LegacyLinkedList OpenEdge.Core.Collections.LinkedList available CVT_LVL_PARTIAL & RT_LVL_STUB
p2j.oo.core.collections.LegacyListNode OpenEdge.Core.Collections.ListNode available CVT_LVL_PARTIAL & RT_LVL_STUB
p2j.oo.core.collections.MapBackedCollection OpenEdge.Core.Collections.MapBackedCollection available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.core.AbstractAssert OpenEdge.Core.AbstractAssert not found CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.core.AbstractAssertionFailedError OpenEdge.Core.AbstractAssertionFailedError not found CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.core.Assert OpenEdge.Core.Assert available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.core.ByteBucket OpenEdge.Core.ByteBucket available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.core.LegacyString OpenEdge.Core.String available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.core.Memptr OpenEdge.Core.Memptr available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.dataadmin.error.DataAdminError OpenEdge.DataAdmin.Error.DataAdminError available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.dataadmin.error.OperationError OpenEdge.DataAdmin.Error.OperationError available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.database.TempTableInfo Progress.Database.TempTableInfo builtin CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.database.VsttableId Progress.Database.VSTTableId builtin CVT_LVL_PARTIAL & RT_LVL_STUB
p2j.oo.io.ByteOrder Progress.IO.ByteOrder builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.json.objectmodel.JsonArray Progress.Json.Objectmodel.JsonArray builtin CVT_LVL_FULL_RESTR & RT_LVL_PARTIAL
p2j.oo.lang.LegacyClass Progress.Lang.Class builtin CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.lang.OerequestInfo Progress.Lang.OERequestInfo builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.lang.ParameterList Progress.Lang.ParameterList builtin CVT_LVL_FULL & RT_LVL_BASIC
p2j.oo.lang.ProError Progress.Lang.ProError builtin CVT_LVL_FULL & RT_LVL_BASIC
p2j.oo.lang.SoapFaultError Progress.Lang.SoapFaultError builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.net.http.filter.payload.ClientSocketResponseWriter OpenEdge.Net.HTTP.Filter.Payload.ClientSocketResponseWriter available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.net.http.filter.payload.DefaultRequestFilter OpenEdge.Net.HTTP.Filter.Payload.DefaultRequestFilter available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.net.http.filter.payload.JsonBodyWriter OpenEdge.Net.HTTP.Filter.Payload.JsonBodyWriter available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.net.http.filter.payload.JsonEntityWriter OpenEdge.Net.HTTP.Filter.Payload.JsonEntityWriter available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.net.http.filter.payload.MultipartEntityWriter OpenEdge.Net.HTTP.Filter.Payload.MultipartEntityWriter available CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.net.http.filter.payload.MultipartFormEntityWriter OpenEdge.Net.HTTP.Filter.Payload.MultipartFormEntityWriter available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.net.http.filter.payload.MultipartFormSimpleEntityWriter OpenEdge.Net.HTTP.Filter.Payload.MultipartFormSimpleEntityWriter available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.net.http.filter.status.RedirectStatusFilter OpenEdge.Net.HTTP.Filter.Status.RedirectStatusFilter available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.net.http.filter.writer.DefaultMessageWriterBuilder OpenEdge.Net.HTTP.Filter.Writer.DefaultMessageWriterBuilder available CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.net.http.lib.sockets.LegacySocketLibrary OpenEdge.Net.HTTP.Lib.ABLSockets.ABLSocketLibrary available CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.net.http.ContentDispositionHeaderBuilder OpenEdge.Net.HTTP.ContentDispositionHeaderBuilder available CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.net.http.HttpClient OpenEdge.Net.HTTP.HttpClient available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.net.http.HttpMessage OpenEdge.Net.HTTP.HttpMessage available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.net.http.HttpRequestDecorator OpenEdge.Net.HTTP.HttpRequestDecorator available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.net.http.IHttpClientLibrary OpenEdge.Net.HTTP.IHttpClientLibrary available CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.net.http.ProxyHttpClient OpenEdge.Net.HTTP.ProxyHttpClient available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.net.http.SemicolonParamHeaderBuilder OpenEdge.Net.HTTP.SemicolonParamHeaderBuilder available CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.net.http.TransferEncodingEnum OpenEdge.Net.HTTP.TransferEncodingEnum available CVT_LVL_PARTIAL & RT_LVL_PARTIAL
p2j.oo.net.serverconnection.ClientSocket OpenEdge.Net.ServerConnection.ClientSocket available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.net.FileTypeRegistry OpenEdge.Net.FileTypeRegistry available CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.net.Uri OpenEdge.Net.URI available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.net.UriEncodingTypeEnum OpenEdge.Net.UriEncodingTypeEnum available CVT_LVL_PARTIAL & RT_LVL_FULL
p2j.oo.oeunit.data.FixtureDataSet OEUnit.Data.FixtureDataSet not found CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.oeunit.util.List OEUnit.Util.List not found CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.reflect.Event Progress.Reflect.Event builtin CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.reflect.LegacyConstructor Progress.Reflect.Constructor builtin CVT_LVL_FULL & RT_LVL_STUB
p2j.oo.reflect.Property Progress.Reflect.Property builtin CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.reflect.Variable Progress.Reflect.Variable builtin CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.util.CastUtil Progress.Util.CastUtil builtin CVT_LVL_PARTIAL & RT_LVL_STUB
p2j.oo.web.RemoteWebRequest OpenEdge.Web.WebRequest available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.web.WebHandler OpenEdge.Web.WebHandler available CVT_LVL_FULL & RT_LVL_PARTIAL
p2j.oo.web.WebResponseWriter OpenEdge.Web.WebResponseWriter available CVT_LVL_FULL & RT_LVL_PARTIAL

OpenEdge.Core.AbstractAssert and OpenEdge.Core.AbstractAssertionFailedError were the only ones I could not find a source file in https://github.com/progress/ADE/tree/v12.8.4.0

#228 Updated by Constantin Asofiei 4 months ago

From Progress packages - the interfaces I think can be marked as FULL; please group them together in the .

From other packages from ADE, which have FWD counterparts: check if the .java file has all methods marked as CVT_LVL_FULL and RT_LVL_FULL - in that case I think we can mark the class a FULL, also (assuming after a check of the ADE .cls file the implementation looks right). I'd like to leave these 'as is' for now.

For p2j.oo.web. package, this I don't think can be converted from ADE (at this time) without some other changes from #6506, WEB-CONTEXT and maybe also WEB stream.

Otherwise, from ADE repository, we need to check:
  • classes which are in FWD, but are full STUB - these can be converted from ADE
  • for packages which also have other classes in p2j.oo, what .cls files are not in FWD
  • for remaining packages, a list of them and what they do

#229 Updated by Dănuț Filimon 4 months ago

Constantin Asofiei wrote:

From Progress packages - the interfaces I think can be marked as FULL; please group them together in the .

Modified Icollection, Icomparable, Icomparer, IequalityComparer, Ihasable, Iiterable, Iiterator, Ilist, Imap, Iset

From other packages from ADE, which have FWD counterparts: check if the .java file has all methods marked as CVT_LVL_FULL and RT_LVL_FULL - in that case I think we can mark the class a FULL, also (assuming after a check of the ADE .cls file the implementation looks right). I'd like to leave these 'as is' for now.

I found the following:
  • AssertObject, all methods are CVT_LVL_FULL | RT_LVL_FULL but compared to 12.8.4.0 it seems there are a lot of methods missing
  • AbstractAssert
  • AbstractAssertionFailedError
  • Assert (I need to double check the methods, there are a lot)
  • ByteBucket (doesn't use MemoryOutputStream)
  • JsonEntityWriter (write_1 that uses Cookie is incomplete but marked as FULL, found one so probably there are more)
  • MultipartEntityWriter (CRLF is combined, but those are separated in the original code, uses Memptr from OpenEdge.Core.Memptr but the converted code seems to use a different interface)
  • DefaultMessageWriterBuilder (NewMessageWriter method is missing)
  • ContentDispositionHeaderBuilder (looks ok)
  • HttpRequestDecorator (looks ok)
  • TransferEncodingEnum (looks ok)
  • RemoteWebRequest (looks a bit off, but I've seen var being used without def)

For p2j.oo.web. package, this I don't think can be converted from ADE (at this time) without some other changes from #6506, WEB-CONTEXT and maybe also WEB stream.

Otherwise, from ADE repository, we need to check:
  • classes which are in FWD, but are full STUB - these can be converted from ADE

I think only those with RT_LVL_STUB can be converted now.

  • for packages which also have other classes in p2j.oo, what .cls files are not in FWD
  • for remaining packages, a list of them and what they do

I will check for what other classes are being used, but do not exists in FWD. For the rest, I will try to create a wiki (here for the moment).

#230 Updated by Dănuț Filimon 4 months ago

I created a zfile to convert all the classes mentioned in #9488-227 and there are a lot of failures because of the var defined variables (without defined), this was fixed previously by replacing this definition with one that uses the define variable statement.

I converted OpenEdge/Core/Assertion/AssertError.cls, but only the methods converted (without any of the logic). Is the goal to convert those classes fully or there should also be changes done by hand?

#231 Updated by Dănuț Filimon 4 months ago

Dănuț Filimon wrote:

I created a zfile to convert all the classes mentioned in #9488-227 and there are a lot of failures because of the var defined variables (without defined), this was fixed previously by replacing this definition with one that uses the define variable statement.

I converted OpenEdge/Core/Assertion/AssertError.cls, but only the methods converted (without any of the logic). Is the goal to convert those classes fully or there should also be changes done by hand?

I was using meld and ordered the sources wrong, AssertError does convert properly and all the methods look fine (including the logic). I noticed the following:
  •    @LegacySignature(type = Type.EXECUTE)
       public void __src_corelib_openedge_core_assertion_AssertError_execute__()
       {
          onBlockLevel(Condition.ERROR, Action.THROW);
          {
          }
       }
    
    is not needed
  • there are two constructors:
    
       @LegacySignature(type = Type.CONSTRUCTOR, name = "AssertError")
       public void __src_corelib_openedge_core_assertion_assertError_constructor__()
       {
          internalProcedure(AssertError.class, this, "AssertError", new Block((Body) () -> 
          {
             __lang_BaseObject_constructor__();
          }));
       }
    
       @LegacySignature(type = Type.CONSTRUCTOR, name = "AssertError")
       public static void __src_corelib_openedge_core_assertion_AssertError_constructor__static__()
       {
          externalProcedure(AssertError.class, "AssertError", new Block((Body) () -> 
          {
             onBlockLevel(Condition.ERROR, Action.THROW);
          }));
       }
    
    
    while the one from trunk only has one.

#232 Updated by Constantin Asofiei 4 months ago

Dănuț Filimon wrote:

Dănuț Filimon wrote:

I created a zfile to convert all the classes mentioned in #9488-227 and there are a lot of failures because of the var defined variables (without defined), this was fixed previously by replacing this definition with one that uses the define variable statement.

Yes, FWD doesn't support the short-hand var statement.

  • [...] is not needed
  • there are two constructors:
    [...] while the one from trunk only has one.

What do you mean exactly? Did you try to convert with trunk and 9488a? Please upload to devsrv01 the converted files (don't post them here at this time).

#233 Updated by Dănuț Filimon 4 months ago

Constantin Asofiei wrote:

Dănuț Filimon wrote:

Dănuț Filimon wrote:

I created a zfile to convert all the classes mentioned in #9488-227 and there are a lot of failures because of the var defined variables (without defined), this was fixed previously by replacing this definition with one that uses the define variable statement.

Yes, FWD doesn't support the short-hand var statement.

  • [...] is not needed
  • there are two constructors:
    [...] while the one from trunk only has one.

What do you mean exactly? Did you try to convert with trunk and 9488a? Please upload to devsrv01 the converted files (don't post them here at this time).

I am converted them one by one now and checking for dependencies, but there are also a few conversion issues. I am running the conversion with trunk + a patch from 9488a (the branch is old and some changes are already in trunk so a rebase is problematic).

#234 Updated by Dănuț Filimon 4 months ago

I currently have a conversion issue. SortedSet is being used, but it is not part of the ADE code while it can be found in the skeleton. This is used by LogMessage.cls (dependency).

#235 Updated by Dănuț Filimon 3 months ago

Committed 9488c/16551 containing conversion changes from 9488a + additional change to fix the LegacyString conversion. The Join(Cast()) call was troublesome and it would throw an error while loading the class because it could not annotate the method call.

#236 Updated by Dănuț Filimon 3 months ago

I've uploaded ade.src.9488c.7z to devsrv01:/tmp/ which contains the conversion for:

abl/src/corelib/OpenEdge/Core/Assertion/AssertError.cls
abl/src/corelib/OpenEdge/Core/Assertion/AssertObject.cls
abl/src/corelib/OpenEdge/Core/Collections/LinkedList.cls
abl/src/corelib/OpenEdge/Core/Collections/ListNode.cls
abl/src/corelib/OpenEdge/Core/Assert.cls
abl/src/corelib/OpenEdge/Core/String.cls
abl/src/corelib/OpenEdge/Core/Memptr.cls
abl/src/OpenEdge/DataAdmin/Error/DataAdminError.cls
abl/src/OpenEdge/DataAdmin/Error/OperationError.cls
and their dependencies.

I had to use List.cls from skeleton because of a few issues, other classes had to be removed from skeleton because the conversion failed.

#237 Updated by Dănuț Filimon 2 months ago

There are a few issues which I found that still give me issues during conversion, mostly related to generics.

#9488-74 has been reported before, but not fixed. I also found it easier to just comment out the methods involved and go on with the conversion and uncover other issues.

Other issues:
  • Other chained calls which I removed related to LogMessage
  • GetByte from ByteBucket.cls is a method call, which is also a reserved keyword (I adjusted progress.g)
  • var statement => def var
  • extent variables which assign 128 characters at once, but are not formatted properly
  • cast calls using generics
  • method calls which can't be found (an extent variable without a size is passed as parameter and the ParameterKey shows character[] instead of KW_INPUT character5)

I've reached a stable conversion with a few more sources and I'm trying to patch p2j.oo.* with what I have currently.

#238 Updated by Greg Shah 2 months ago

var statement => def var

We should just add a new rule to match this language statement. I don't think it is correct to change def var to support var.

cast calls using generics

Please document the syntax and capabilities of the "built-in" generics approach. We will then discuss how we make the correct changes to support it.

#239 Updated by Dănuț Filimon 2 months ago

Greg Shah wrote:

var statement => def var

We should just add a new rule to match this language statement. I don't think it is correct to change def var to support var.

cast calls using generics

Please document the syntax and capabilities of the "built-in" generics approach. We will then discuss how we make the correct changes to support it.

I am currently working on getting the var statement implemented. I've also discovered that method calls can use the name of reserved_functions, which was not specified in progress.g (I've tested all reserved_functions keywords and made methods with each one, the code built and ran fine).

I will also document the generics.

#240 Updated by Dănuț Filimon 2 months ago

Greg, about the VAR statement. Wouldn't the current structure of DEFINE VARIABLE be reasonable? During conversion, we can fix the VAR statement and turn it into a DEFINE VARIABLE statement.

#241 Updated by Greg Shah 2 months ago

Dănuț Filimon wrote:

Greg, about the VAR statement. Wouldn't the current structure of DEFINE VARIABLE be reasonable? During conversion, we can fix the VAR statement and turn it into a DEFINE VARIABLE statement.

No, it is not a good fit. The core structure is different in important ways, the worst of which is that it can implement more than one variable for the same statement.

We can reuse many of the sub-rules but the main var_stmt needs to be its own thing. And we will want to deal with it downstream in a different way.

#242 Updated by Constantin Asofiei 2 months ago

Dănuț Filimon wrote:

Committed 9488c/16551 containing conversion changes from 9488a + additional change to fix the LegacyString conversion. The Join(Cast()) call was troublesome and it would throw an error while loading the class because it could not annotate the method call.

I do not plan to commit the 9488a changes to trunk at this time. Any changes made to p2j.oo existing (or new) classes, please add them in a distinct branch.

I've uploaded ade.src.9488c.7z to devsrv01:/tmp/ which contains the conversion for:

  • OpenEdge.Core.Assertion classes in p2j.oo are implemented in a peculiar way. At this time, existing classes should not be changed. The assert effort needs to be on its own branch.
  • String, Memptr and others: lets discuss before moving to converting existing classes, which are not marked as 'stub' support
  • I recall in 9488a was an option to emit the LegacyResource and LegacyResourceSupport annotations - these do not exist here
My conclusion:
  • lets make a list of the next candidate ADE .cls files to convert and discuss them
  • use a separate branch to prepare p2j.oo code which gets converted and will be committed (with the usual license notices in the .java file and to p2j/readme file)
  • leave 9488c only with FWD changes (not p2j.oo) and we will discuss them
  • further work for unsupported 4GL features (like the var statement) need to be worked in separate branches

#243 Updated by Constantin Asofiei 2 months ago

Actually, for generics there is #9868 and for the var statement there is #9767 - lets work them in those tasks, please.

#244 Updated by Dănuț Filimon 2 months ago

Constantin Asofiei wrote:

I do not plan to commit the 9488a changes to trunk at this time. Any changes made to p2j.oo existing (or new) classes, please add them in a distinct branch.

I've uploaded ade.src.9488c.7z to devsrv01:/tmp/ which contains the conversion for:

  • OpenEdge.Core.Assertion classes in p2j.oo are implemented in a peculiar way. At this time, existing classes should not be changed. The assert effort needs to be on its own branch.
  • String, Memptr and others: lets discuss before moving to converting existing classes, which are not marked as 'stub' support
  • I recall in 9488a was an option to emit the LegacyResource and LegacyResourceSupport annotations - these do not exist here

is-legacy-oo and legacy-res-support-type are actually broken, I got lots of errors while using them.

My conclusion:
  • lets make a list of the next candidate ADE .cls files to convert and discuss them

I've posted a list of classes in #9488-227, we can take anything that has PARTIAL support.

  • use a separate branch to prepare p2j.oo code which gets converted and will be committed (with the usual license notices in the .java file and to p2j/readme file)
  • leave 9488c only with FWD changes (not p2j.oo) and we will discuss them

Got it.

#245 Updated by Constantin Asofiei 2 months ago

Dănuț Filimon wrote:

is-legacy-oo and legacy-res-support-type are actually broken, I got lots of errors while using them.

What errors do you get?

My conclusion:
  • lets make a list of the next candidate ADE .cls files to convert and discuss them

I've posted a list of classes in #9488-227, we can take anything that has PARTIAL support.

why PARTIAL? Are all STUB classes converted?

Please go through the list and strike-through all that were fixed via 9488b.

#246 Updated by Dănuț Filimon 2 months ago

Constantin Asofiei wrote:

Dănuț Filimon wrote:

is-legacy-oo and legacy-res-support-type are actually broken, I got lots of errors while using them.

What errors do you get?

With is-legacy-oo set to true, I get a lot of:

     [java] WARNING: Can not copy annotations for member in OpenEdge.Core.Util.TokenResolverEventArgs: parent is null
     [java] WARNING: Can not copy annotations for member in OpenEdge.Core.Util.TokenResolverEventArgs: parent is null
     [java] WARNING: Can not copy annotations for member in OpenEdge.Core.Util.TokenResolverEventArgs: parent is null
during Scan phase. Then the following:
     [java] ------------------------------------------------------------------------------
     [java] Code Conversion Annotations
     [java] ------------------------------------------------------------------------------
     [java] 
     [java] Optional rule set [customer_specific_annotations_prep] not found.
     [java] ./abl/src/corelib/OpenEdge/Core/Assert.cls
     [java] MISSING_REFID for property Size [VAR_INT]:103079236434 @2733:22
     [java]       (tempidx-file=./abl/src/corelib/OpenEdge/Core/Collections/ICollection.cls, tempidx=0, cls-container=./abl/src/corelib/OpenEdge/Core/Collections/ICollection.cls, found-in-source-file=./abl/src/corelib/OpenEdge/Core/Collections/ICollection.cls, found-in-cls=OpenEdge.Core.Collections.ICollection, cls-property=true, access-mode=2133)
     [java] 
     [java] 
     [java] EXPRESSION EXECUTION ERROR:
     [java] ---------------------------
     [java] apropref = propref.getImmediateChild(prog.kw_get, null)
     [java]                    ^  { Cannot invoke "com.goldencode.ast.Aast.getImmediateChild(int, com.goldencode.ast.Aast)" because the return value of "com.goldencode.expr.CompiledExpression.getVar(int)" is null }
     [java] ---------------------------
     [java] ERROR!  Active Rule:
     [java] -----------------------
     [java]       RULE REPORT      
     [java] -----------------------
     [java] Rule Type :   WALK
     [java] Source AST:  [ Size ] BLOCK/CLASS_DEF/BLOCK/METHOD_DEF/BLOCK/STATEMENT/KW_IF/EXPRESSION/EQUALS/OBJECT_INVOCATION/VAR_INT/ @2733:22 {103079236434}
     [java] Copy AST  :  [ Size ] BLOCK/CLASS_DEF/BLOCK/METHOD_DEF/BLOCK/STATEMENT/KW_IF/EXPRESSION/EQUALS/OBJECT_INVOCATION/VAR_INT/ @2733:22 {103079236434}
     [java] Condition :  apropref = propref.getImmediateChild(prog.kw_get, null)
     [java] Loop      :  false
     [java] --- END RULE REPORT ---

My conclusion:
  • lets make a list of the next candidate ADE .cls files to convert and discuss them

I've posted a list of classes in #9488-227, we can take anything that has PARTIAL support.

why PARTIAL? Are all STUB classes converted?

I based it on

String, Memptr and others: lets discuss before moving to converting existing classes, which are not marked as 'stub' support

Please go through the list and strike-through all that were fixed via 9488b.

The following were added in trunk/16440.

  src/com/goldencode/p2j/oo/common/support/IdateTimeTzHolder.java
  src/com/goldencode/p2j/oo/common/support/IdecimalHolder.java
  src/com/goldencode/p2j/oo/common/support/Iint64Holder.java
  src/com/goldencode/p2j/oo/common/support/IlongcharArrayHolder.java
  src/com/goldencode/p2j/oo/common/support/IprimitiveArrayHolder.java
  src/com/goldencode/p2j/oo/core/DataTypeHelper.java
  src/com/goldencode/p2j/oo/core/EventArgs.java
  src/com/goldencode/p2j/oo/core/ImemoryPointer.java
  src/com/goldencode/p2j/oo/core/LegacyDecimal.java
  src/com/goldencode/p2j/oo/core/LegacyInteger.java
  src/com/goldencode/p2j/oo/core/LongcharArrayHolder.java
  src/com/goldencode/p2j/oo/core/Session.java
  src/com/goldencode/p2j/oo/core/StringConstant.java
  src/com/goldencode/p2j/oo/core/TimeStamp.java
  src/com/goldencode/p2j/oo/core/TimeStampConstants.java
  src/com/goldencode/p2j/oo/core/collections/AbstractTtcollection.java
  src/com/goldencode/p2j/oo/core/collections/Array.java
  src/com/goldencode/p2j/oo/core/collections/LegacyList.java*
  src/com/goldencode/p2j/oo/core/collections/LegacyListIterator.java*
  src/com/goldencode/p2j/oo/core/collections/LegacyStack.java*
  src/com/goldencode/p2j/oo/core/collections/ObjectStack.java*
  src/com/goldencode/p2j/oo/core/collections/StringCollection.java*
  src/com/goldencode/p2j/oo/core/system/InvalidValueSpecifiedError.java
  src/com/goldencode/p2j/oo/core/system/NotFoundError.java
  src/com/goldencode/p2j/oo/core/util/Token.java
  src/com/goldencode/p2j/oo/core/util/TokenResolver.java
  src/com/goldencode/p2j/oo/core/util/TokenResolverEventArgs.java
  src/com/goldencode/p2j/oo/logging/LogEvent.java
  src/com/goldencode/p2j/oo/logging/LogLevelEnum.java
  src/com/goldencode/p2j/oo/logging/LogMessage.java
  src/com/goldencode/p2j/oo/security/Principal.java

Also available in: Atom PDF