[YANGTOOLS-186] Odd use of number constructors in generated code Created: 12/Jun/14 Updated: 10/Apr/22 Resolved: 13/Jun/14 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Rob Adams | Assignee: | Unassigned |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: Linux |
||
| Issue Links: |
|
||||||||
| External issue ID: | 1194 | ||||||||
| Description |
|
We're calling things like new Long("1") with a string constant. Here we should use Long.valueOf(1L) rather than calling the constructor, and we shouldn't use a string we should use a constant. At a minimum this should be Long.valueOf("1") if somehow we can't properly generate the constant value. Here's something that shows up in some generated code: public static List<Range<Long>> length() { final List<Range<Long>> result = new ArrayList<>(); result.add(Range.closed(new Long("1"), new Long("4096"))); return result; }Here's another example: } } this._order = value; |
| Comments |
| Comment by Martin Vitez [ 13/Jun/14 ] |
|
This looks like duplicate of |