[YANGTOOLS-250] BigInteger being used in range checks when a simple type would be sufficient Created: 05/Aug/14 Updated: 10/Apr/22 Resolved: 10/Mar/17 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | ||
| Reporter: | Robert Varga | Assignee: | Robert Varga |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| Issue Links: |
|
||||||||
| Description |
|
For example: model/l2-types/target/generated-sources/sal/org/opendaylight/yang/gen/v1/urn/opendaylight/l2/types/rev130827/VlanId.java public class VlanId private static final List<Range<BigInteger>> _range; public VlanId(java.lang.Integer _value) { } This is clearly inefficient: we know what the allowed range/type is, so any ranges have to fit into that too – which should allow us to skip instantiation on _constraint and more importantly, use more efficient range checks. This is a post-Helium item, because the type of _range is leaked via: public static List<Range<BigInteger>> range() { return _range; }so this constitutes a change in the binding specification. |
| Comments |
| Comment by Robert Varga [ 18/Mar/15 ] |
|
For Lithium we can deprecate the public range method. |
| Comment by Robert Varga [ 18/Mar/15 ] |
|
Deprecation of public methods (includes length(), which is essentially the same thing): https://git.opendaylight.org/gerrit/16780 |
| Comment by Robert Varga [ 18/Mar/15 ] |
|
Reschedule for Beryllium for follow-up. |
| Comment by Robert Varga [ 14/Jun/15 ] |