You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2021/04/26 12:38:43 UTC

[incubator-nlpcraft] branch NLPCRAFT-302 created (now 268c9c5)

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

sergeykamov pushed a change to branch NLPCRAFT-302
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git.


      at 268c9c5  Intents methods processing fix.

This branch includes the following new commits:

     new 268c9c5  Intents methods processing fix.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[incubator-nlpcraft] 01/01: Intents methods processing fix.

Posted by se...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 268c9c58bb1692dcc79b28024f04806bf24f0d41
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Mon Apr 26 15:37:50 2021 +0300

    Intents methods processing fix.
---
 .../org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala   | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
index 240e318..4be20b5 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala
@@ -18,7 +18,7 @@
 package org.apache.nlpcraft.probe.mgrs.deploy
 
 import java.io._
-import java.lang.reflect.{InvocationTargetException, Method, ParameterizedType, Type, WildcardType}
+import java.lang.reflect.{InvocationTargetException, Method, Modifier, ParameterizedType, Type, WildcardType}
 import java.util
 import java.util.function.Function
 import java.util.jar.JarInputStream
@@ -1212,7 +1212,9 @@ object NCDeployManager extends NCService with DecorateAsScala {
     private def invoke(mtd: Method, mdl: NCModel, args: Array[AnyRef]): NCResult = {
         val mdlId = mdl.getId
 
-        var flag = mtd.canAccess(mdl)
+        val obj = if (Modifier.isStatic(mtd.getModifiers)) null else mdl
+
+        var flag = mtd.canAccess(obj)
 
         try {
             if (!flag) {
@@ -1223,7 +1225,7 @@ object NCDeployManager extends NCService with DecorateAsScala {
             else
                 flag = false
 
-            mtd.invoke(mdl, args: _*).asInstanceOf[NCResult]
+            mtd.invoke(obj, args: _*).asInstanceOf[NCResult]
         }
         catch {
             case e: InvocationTargetException ⇒ e.getTargetException match {