Do not use a static String reference in length enforcer 96/96296/2
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 20:40:55 +0000 (22:40 +0200)
commit82f336f1c17e31fc83b179e2764a9b80ea42e83a
tree4a301d1d574af8aae2776e1aed5f908069ac5c35
parentca736aceee8e37b209b6cd2255a35e605a587585
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>
(cherry picked from commit b07c63ce93a839e806c8ce96b8ef659e658574e3)
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]