Details
-
Bug
-
Status: Resolved
-
Medium
-
Resolution: Done
-
None
Description
The following model
module foo {
namespace foo;
prefix foo;
list string {
leaf name {
type string {
length 1..32;
}
}
}
}
generates code which does not compile because:
[target/test/src/mdsalXXX/org/opendaylight/yang/gen/v1/foo/norev/StringBuilder.java:99: error: cannot find symbol
final int length = value.codePointCount(0, value.length());
^
symbol: method length()
location: variable value of type org.opendaylight.yang.gen.v1.foo.norev.String, target/test/src/mdsalXXX/org/opendaylight/yang/gen/v1/foo/norev/StringBuilder.java:108: error: incompatible types: java.lang.String cannot be converted to org.opendaylight.yang.gen.v1.foo.norev.String
check_nameLength(value);
^, Note: Some messages have been simplified; recompile with -Xdiags:verbose to get full output]
Attachments
| # | Subject | Branch | Project | Status | CR | V |
|---|---|---|---|---|---|---|
| 96296,2 | Do not use a static String reference in length enforcer | 7.0.x | mdsal | Status: MERGED | +2 | +1 |
| 96342,1 | Do not use a static String reference in length enforcer | master | mdsal | Status: MERGED | +2 | +1 |
| 96345,1 | Do not use a static String reference in length enforcer | 6.0.x | mdsal | Status: MERGED | +2 | +1 |