[YANGTOOLS-336] GeneratedTypeBuilderImpl allows add property with null name Created: 13/Oct/14 Updated: 10/Apr/22 Resolved: 17/Oct/14 |
|
| Status: | Resolved |
| Project: | yangtools |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Peter Kajsa | Assignee: | Peter Kajsa |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Operating System: All |
||
| External issue ID: | 2176 |
| Description |
|
GeneratedTypeBuilderImpl allows add property with null name. The Preconditions.checkArgument(name != null,"...") test is missing in the method addProperty(String name) in the class AbstractGeneratedTypeBuilder. Example: GeneratedTypeBuilderImpl generatedTypeBuilder = new GeneratedTypeBuilderImpl( GeneratedPropertyBuilder propertyBuilderNull = generatedTypeBuilder.addProperty(null); propertyBuilderNull != null //true GeneratedType instance = generatedTypeBuilder.toInstance(); properties.size() //1 Notice: The containsProperty method have this check: |
| Comments |
| Comment by Peter Kajsa [ 16/Oct/14 ] |