Issue with REDEFINES AND OCCURS together

114 views
Skip to first unread message

Athul prasanna Venkatesh

unread,
Nov 7, 2013, 11:17:20 AM11/7/13
to legsta...@googlegroups.com
Hi Fady,

I have the following block in my copybook

009700     05  SPF-BUCKET-TABLE REDEFINES SPF-RECORD-DATA               00970000
009800                                          OCCURS 3 TIMES                                       00980000
009900                                 INDEXED BY SPF-INDX.                                        00990000

and the following schema gets generated

<choice>
                <element name="spfRecordData" type="tns:SpfRecordData">
                    <annotation>
                        <appinfo>
                            <cb:cobolElement cobolName="SPF-RECORD-DATA" isRedefined="true" levelNumber="5" srceLine="80" type="GROUP_ITEM"                     unmarshalChoiceStrategyClassName="com.bony.csr.copybook.legstar.positionrecord.choice.spfRecordDataChoice"/>
                        </appinfo>
                    </annotation>
                </element>
                <element maxOccurs="3" minOccurs="3" name="spfBucketTable" type="tns:SpfBucketTable">
                    <annotation>
                        <appinfo>
                            <cb:cobolElement cobolName="SPF-BUCKET-TABLE" levelNumber="5" maxOccurs="3" minOccurs="3" redefines="SPF-RECORD-DATA" srceLine="98" type="GROUP_ITEM"/>
                        </appinfo>
                    </annotation>
                </element>
            </choice>

JAXB runs successfully and having issue only with COXBgen. The below is the compilation error I get,

[javac] C:\Dev\CorpTrust\Common\tools\legstar-distribution-1.5.2\BNY\src\com\bony\csr\copybook\legstar\positionrecord\bind\SpfRecordDataChoiceBinding.java:65: cannot find symbol
[javac] symbol  : variable _spfBucketTableWrapperItem
[javac] location: class com.bony.csr.copybook.legstar.positionrecord.bind.SpfRecordDataChoiceBinding
[javac]         _spfBucketTableWrapperItem = new SpfBucketTableBinding("SpfBucketTableWrapperItem",
[javac]         ^
[javac] C:\Dev\CorpTrust\Common\tools\legstar-distribution-1.5.2\BNY\src\com\bony\csr\copybook\legstar\positionrecord\bind\SpfRecordDataChoiceBinding.java:68: cannot find symbol
[javac] symbol  : variable _spfBucketTableWrapperItem
[javac] location: class com.bony.csr.copybook.legstar.positionrecord.bind.SpfRecordDataChoiceBinding
[javac]                "SpfBucketTable", getParentBinding(), _spfBucketTableWrapperItem);

The SpfRecordDataChoiceBinding java class generates this _spfBucketTableWrapperItem variable but not declared within the class,

public class SpfRecordDataChoiceBinding 
             extends CChoiceBinding {

    /** Alternative bound bound to value object property SpfRecordData(SpfRecordData). */
    public ICobolComplexBinding _spfRecordData;

    /** Alternative bound bound to value object property SpfBucketTable(SpfBucketTable). */
    public ICobolArrayComplexBinding _spfBucketTableWrapper;

    
    /**
     * Constructor for a Choice element.
     * 
     * @param bindingName the identifier for this binding
     * @param parentBinding a reference to the parent binding
     */
  

    /** Creates a binding property for each alternative. */
    private void initAlternatives() {
        if (_log.isDebugEnabled()) {
            _log.debug("Initializing started");
        }
        /* Create binding alternatives instances */

        _spfRecordData = new SpfRecordDataBinding("SpfRecordData",
               "SpfRecordData", getParentBinding(), null);
        _spfRecordData.setCobolName("SPF-RECORD-DATA");
        _spfRecordData.setByteLength(30);
        _spfBucketTableWrapperItem = new SpfBucketTableBinding("SpfBucketTableWrapperItem",
               "SpfBucketTable", getParentBinding(), null);
        _spfBucketTableWrapper = new SpfBucketTableWrapperBinding("SpfBucketTableWrapper",
               "SpfBucketTable", getParentBinding(), _spfBucketTableWrapperItem);
        _spfBucketTableWrapper.setCobolName("SPF-BUCKET-TABLE");
        _spfBucketTableWrapper.setByteLength(30);
        _spfBucketTableWrapper.setItemByteLength(10);
        _spfBucketTableWrapper.setMinOccurs(3);
        _spfBucketTableWrapper.setMaxOccurs(3);
        _spfBucketTableWrapper.setRedefines("SPF-RECORD-DATA");

        /* Add alternatives to alternatives list */
        addAlternative(_spfRecordData);
        addAlternative(_spfBucketTableWrapper);
 
        if (_log.isDebugEnabled()) {
            _log.debug("Initializing successful");
        }
    }

}

Your help is very much appreciated.

Thanks,
Athul

Fady

unread,
Nov 8, 2013, 4:08:33 AM11/8/13
to legsta...@googlegroups.com
Hello Athul

I confirm this is a bug. I have opened https://code.google.com/p/legstar/issues/detail?id=177 to follow up on this.

You can work around the issue by manually adding the missing variable declaration in SpfRecordDataChoiceBinding:

public SpfBucketTableBinding _spfBucketTableWrapperItem;

Thanks for raising this.

Fady

Athul prasanna Venkatesh

unread,
Nov 8, 2013, 9:32:17 AM11/8/13
to legsta...@googlegroups.com
Fady,

Thanks for your response.

Athul

Mike West

unread,
Nov 17, 2015, 3:50:31 PM11/17/15
to legstar-user
I'm having the identical problem on a large copybook. However I'm using later versions of legsem and expected that the fix would be present.

My errors 
oft-copybook-temp\m1_fwg07200_full\src\com\parasoft\soavirt\copybook\m1_fwg07200_full\bind\OccurrenceCodesDatesM1ChoiceBinding.java:65: error: cannot find symbol
        _occurCodesDatesTableM1WrapperItem = new OccurCodesDatesTableM1Binding("OccurCodesDatesTableM1WrapperItem",
        ^
  symbol:   variable _occurCodesDatesTableM1WrapperItem
  location: class OccurrenceCodesDatesM1ChoiceBinding
C:\Users\MWEST~1.PAR\AppData\Local\Temp\parasoft-copybook-temp\m1_fwg07200_full\src\com\parasoft\soavirt\copybook\m1_fwg07200_full\bind\OccurrenceCodesDatesM1ChoiceBinding.java:68: error: cannot find symbol
               "OccurCodesDatesTableM1", getParentBinding(), _occurCodesDatesTableM1WrapperItem);
                                                             ^
  symbol:   variable _occurCodesDatesTableM1WrapperItem
  location: class OccurrenceCodesDatesM1ChoiceBinding
C:\Users\MWEST~1.PAR\AppData\Local\Temp\parasoft-copybook-temp\m1_fwg07200_full\src\com\parasoft\soavirt\copybook\m1_fwg07200_full\bind\PcSavingsDataM1ChoiceBinding.java:65: error: cannot find symbol
        _pcSavingsTableM1WrapperItem = new PcSavingsTableM1Binding("PcSavingsTableM1WrapperItem",

... many more like this

This is the portion of the POM that shows the dependencies I'm using

<dependency>
<groupId>com.legsem.legstar</groupId>
<artifactId>legstar-cobcgen</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.legsem.legstar</groupId>
<artifactId>legstar-codegen</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.legsem.legstar</groupId>
<artifactId>legstar-coxbapi</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.legsem.legstar</groupId>
<artifactId>legstar-coxbgen</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.legsem.legstar</groupId>
<artifactId>legstar-coxbrt</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.legsem.legstar</groupId>
<artifactId>legstar-jaxbgen</artifactId>
<version>1.6.0</version>
</dependency>
<dependency>
<groupId>com.legsem.legstar</groupId>
<artifactId>legstar-cob2trans</artifactId>
<version>1.5.3</version>
</dependency>

Any help would be appreciated.
Reply all
Reply to author
Forward
0 new messages