BUG-1270: be smart about Restrictions 39/9039/1
authorRobert Varga <rovarga@cisco.com>
Tue, 15 Jul 2014 21:04:23 +0000 (23:04 +0200)
committerRobert Varga <rovarga@cisco.com>
Tue, 15 Jul 2014 21:04:23 +0000 (23:04 +0200)
commitf1805c7c1c5d38e52ba128af40aa5e786e71005e
tree9e03b2889a05e0bbcdd56df5cb42e96bc5a378d3
parenta9376c86dfd881396ae04fb706064b59eeb8bbcf
BUG-1270: be smart about Restrictions

Restrictions are based on type definitions, which are constant. For base
types they always are. For extended types, they are usually empty.
Optimize memory usage by reusing the lists anchored in types and also by
having a singleton instance for the all-empty case.

Change-Id: Ie9773d7efb57d403a008b82716eb22d97fefb224
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-generator-util/src/main/java/org/opendaylight/yangtools/binding/generator/util/BindingGeneratorUtil.java