This is an automated email from the ASF dual-hosted git repository.

aradzinski pushed a commit to branch NLPCRAFT-473
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-473 by this push:
     new 70f2e05  Update NCModelScanner.scala
70f2e05 is described below

commit 70f2e05a3be2f148a90c08b3ed0d3cca15b3c328
Author: Aaron Radzinski <[email protected]>
AuthorDate: Thu Jan 27 09:26:26 2022 -0800

    Update NCModelScanner.scala
---
 .../nlpcraft/internal/impl/NCModelScanner.scala       | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelScanner.scala
 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelScanner.scala
index aed9f00..45db01c 100644
--- 
a/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelScanner.scala
+++ 
b/nlpcraft/src/main/scala/org/apache/nlpcraft/internal/impl/NCModelScanner.scala
@@ -288,7 +288,7 @@ object NCModelScanner extends LazyLogging:
 
     /**
       *
-      * @param s
+      * @param a
       * @return
       */
     private def isNullOrEmpty(a: Any): Boolean =
@@ -307,9 +307,8 @@ object NCModelScanner extends LazyLogging:
 
     /**
       *
-      * @param спус
+      * @param anns
       * @param origin
-      * @tparam T
       */
     private def emptyError(anns: Iterable[_], origin: String): Unit =
         require(anns != null && anns.nonEmpty)
@@ -320,7 +319,7 @@ object NCModelScanner extends LazyLogging:
       *
       * @param anns
       * @param getValues
-      * @param src
+      * @param origin
       * @tparam T
       * @tparam K
       */
@@ -331,7 +330,7 @@ object NCModelScanner extends LazyLogging:
       *
       * @param anns
       * @param getValue
-      * @param src
+      * @param origin
       * @tparam T
       * @tparam K
       */
@@ -434,27 +433,26 @@ class NCModelScanner(mdl: NCModel) extends LazyLogging:
                             // Java, Scala, Groovy.
                             case _: Class[_] =>
                                 val genClass = 
compTypes.head.asInstanceOf[Class[_]]
-
                                 if genClass != CLS_ENTITY then
                                     E(s"Unexpected generic type for 
@NCIntentTerm annotated argument [mdlId=$mdlId, origin=$origin, 
type=${class2Str(genClass)}, arg=${mkArg()}]")
 
                             // Kotlin.
                             case _: WildcardType =>
                                 val wildcardType = 
compTypes.head.asInstanceOf[WildcardType]
-
                                 val lowBounds = wildcardType.getLowerBounds
                                 val upBounds = wildcardType.getUpperBounds
-
                                 if lowBounds.nonEmpty || upBounds.size != 1 || 
upBounds(0) != CLS_ENTITY then
                                     E(s"Unexpected Kotlin generic type for 
@NCIntentTerm annotated argument [mdlId=$mdlId, origin=$origin, 
type=${wc2Str(wildcardType)}, arg=${mkArg()}]")
+
                             case _ => E(s"Unexpected generic type for 
@NCIntentTerm annotated argument [mdlId=$mdlId, origin=$origin, 
type=${compType.getTypeName}, arg=${mkArg()}]")
 
                     case _ =>
-                        // Scala. For methods which added as
+                        // Scala.
                         if COMP_CLS.exists(_ == paramGenType) then
                             if (!warned)
                                 warned = true // TODO: text
                                 logger.warn(s"Method arguments types cannot be 
detected and checked: ${method2Str(mtd)}")
+                            end if
                         else
                             E(s"Unexpected parameter type for @NCIntentTerm 
annotated argument [mdlId=$mdlId, origin=$origin, 
type=${paramGenType.getTypeName}, arg=${mkArg()}]")
             // Other types.
@@ -464,7 +462,6 @@ class NCModelScanner(mdl: NCModel) extends LazyLogging:
 
     /**
       *
-      * @param mdl
       * @param mtd
       * @param paramCls
       * @param limits
@@ -624,7 +621,7 @@ class NCModelScanner(mdl: NCModel) extends LazyLogging:
 
     /**
       *
-      * @param mdl
+      * @param mtd
       * @return
       */
     private def scanSamples(mtd: Method): Map[String, Seq[Seq[String]]] =

Reply via email to