[YANGTOOLS-503] Incorrect union generated code when using decimal64 Created: 14/Sep/15  Updated: 10/Apr/22  Resolved: 01/Oct/15

Status: Resolved
Project: yangtools
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Michal Polkorab Assignee: Martin Ciglan
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 4301

 Description   

Code generation fails when processing next yang input:

typedef cd-working-range-t {
type union {
type enumeration

{ enum "NA"; }

type decimal64

{ fraction-digits 2; range "-70000..70000"; }

}
}

  • with following error:
    [ERROR] /C:/*/CdWorkingRangeT.java:[24,33] cannot find symbol
    [ERROR] symbol: method getValue()
    [ERROR] location: variable _decimal64 of type java.math.BigDecimal

BigDecimal doesn't have .getValue() method, so code generator should take this into account.

Problem was reported for Helium-SR4, but it persists even in Beryllium.



 Comments   
Comment by Martin Ciglan [ 14/Sep/15 ]

replicated

Comment by Martin Ciglan [ 14/Sep/15 ]

Both BigDecimal & BigInteger types from java.math package suffer from this issue.
Will come back with solution ASAP

Comment by Martin Ciglan [ 14/Sep/15 ]

fix pushed:

https://git.opendaylight.org/gerrit/#/c/26918/

Comment by Tony Tkacik [ 22/Sep/15 ]

Needs also porting to mdsal-project

Comment by Martin Ciglan [ 22/Sep/15 ]

fix pushed to mdsal:

https://git.opendaylight.org/gerrit/#/c/27275

Generated at Wed Feb 07 20:53:26 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.