BUG-1485: deprecate public static range/length methods 85/21285/4
authorRobert Varga <rovarga@cisco.com>
Thu, 28 May 2015 00:46:35 +0000 (02:46 +0200)
committerRobert Varga <rovarga@cisco.com>
Thu, 28 May 2015 14:34:03 +0000 (16:34 +0200)
These methods are not efficient and expose implementation internals.
Mark them as deprecated for removal. This mirrors the deprecation in
ClassTemplate, which was not instantiated before due to how the code is
structured.

Change-Id: I7fcb831f00fd3baab02e1f25e10655c8288c6d4e
Signed-off-by: Robert Varga <rovarga@cisco.com>
code-generator/binding-java-api-generator/src/main/java/org/opendaylight/yangtools/sal/java/api/generator/BuilderTemplate.xtend

index 5d3ed1399449d2ece02d60fc72b0b088f6de63ba..b8b8810ae67518d600819193cbe9de5aa5124e5d 100644 (file)
@@ -536,6 +536,10 @@ class BuilderTemplate extends BaseTemplate {
         «val Restrictions restrictions = type.restrictions»
         «IF restrictions != null && !(restrictions.lengthConstraints.empty)»
             «val numberClass = restrictions.lengthConstraints.iterator.next.min.class»
+            /**
+             * @deprecated This method is slated for removal in a future release. See BUG-1485 for details.
+             */
+            @Deprecated
             public static «List.importedName»<«Range.importedName»<«numberClass.importedNumber»>> «methodName»() {
                 «IF numberClass.equals(typeof(BigDecimal))»
                     «lengthBody(restrictions, numberClass, className, varName)»
@@ -564,6 +568,10 @@ class BuilderTemplate extends BaseTemplate {
     def private generateRangeMethod(String methodName, Restrictions restrictions, Type returnType, String className, String varName) '''
         «IF restrictions != null && !(restrictions.rangeConstraints.empty)»
             «val number = returnType.importedNumber»
+            /**
+             * @deprecated This method is slated for removal in a future release. See BUG-1485 for details.
+             */
+            @Deprecated
             public static «List.importedName»<«Range.importedName»<«number»>> «methodName»() {
                 «IF returnType.fullyQualifiedName.equals(BigDecimal.canonicalName)»
                     «rangeBody(restrictions, BigDecimal, className, varName)»