String's length is bound by Integer.MAX_VALUE 74/3874/2
authorRobert Varga <rovarga@cisco.com>
Fri, 20 Dec 2013 15:40:59 +0000 (16:40 +0100)
committerRobert Varga <rovarga@cisco.com>
Fri, 20 Dec 2013 17:56:01 +0000 (18:56 +0100)
This fixes a compilation problem with RFC6991 yang-identifier, which has
unbounded length.

Change-Id: I4a4c142d3a18bae5eb85cca38c3d634777264c48
Signed-off-by: Robert Varga <rovarga@cisco.com>
yang/yang-model-util/src/main/java/org/opendaylight/yangtools/yang/model/util/StringType.java

index edbbfff6a08f45f7c915f07a9551fb28cfe5d7b1..c40622ed30d47da7f190ede85f7dc488b9d414d9 100644 (file)
@@ -40,7 +40,7 @@ public final class StringType implements StringTypeDefinition {
      */
     private StringType() {
         final List<LengthConstraint> constraints = new ArrayList<LengthConstraint>();
-        constraints.add(BaseConstraints.lengthConstraint(0, Long.MAX_VALUE, "", ""));
+        constraints.add(BaseConstraints.lengthConstraint(0, Integer.MAX_VALUE, "", ""));
         lengthStatements = Collections.unmodifiableList(constraints);
         patterns = Collections.emptyList();
     }