Do not use a static String reference in length enforcer 42/96342/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 21 May 2021 11:13:11 +0000 (13:13 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Mon, 24 May 2021 19:59:00 +0000 (21:59 +0200)
commitb07c63ce93a839e806c8ce96b8ef659e658574e3
treee78e59b0fcde6965a853d780f3c5a67cb4565a89
parent6bbe26e519372be26ace031c24aefe92ab892ae8
Do not use a static String reference in length enforcer

LengthGenerator is making the mistake of having a static reference
to java.lang.String without FQCN. This breaks down if String is
overridden by definition context.

Fix this by using importedName(Type) to emit a properly-scoped
reference.

JIRA: MDSAL-664
Change-Id: I16b12865448bde807f0afd0d35e3145f8b6359c3
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
binding/mdsal-binding-java-api-generator/src/main/java/org/opendaylight/mdsal/binding/java/api/generator/LengthGenerator.java
binding/mdsal-binding-java-api-generator/src/test/java/org/opendaylight/mdsal/binding/java/api/generator/test/CompilationTest.java
binding/mdsal-binding-java-api-generator/src/test/resources/compilation/mdsal664/foo.yang [new file with mode: 0644]