This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-384
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-384 by this push:
new 4196f60 Fix for NLPCRAFT-416 + WIP NLPCRAFT-384
4196f60 is described below
commit 4196f60f260c0b4d6682a743b0251e54ba1dfb9e
Author: Aaron Radzinski <[email protected]>
AuthorDate: Tue Aug 17 22:28:13 2021 -0700
Fix for NLPCRAFT-416 + WIP NLPCRAFT-384
---
.../org/apache/nlpcraft/model/tools/cmdline/NCCli.scala | 11 +++++++++--
.../apache/nlpcraft/probe/mgrs/deploy/NCDeployManager.scala | 13 +++++++------
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
index ed6eec5..5a44297 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/tools/cmdline/NCCli.scala
@@ -258,13 +258,20 @@ object NCCli extends NCCliBase {
* @param args
* @return
*/
- private def getCpParams(args: Seq[Argument]): String =
- U.splitTrimFilter(
+ private def getCpParams(args: Seq[Argument]): String = {
+ val s = U.splitTrimFilter(
getParams( args, "cp").map(cp =>
normalizeCp(U.trimQuotes(cp))).mkString(CP_SEP),
CP_SEP
)
.mkString(CP_SEP)
+ // Remove extra '\' from the end, if possible.
+ if (s.last == '\\' && !s.endsWith(":\\"))
+ s.substring(0, s.length - 1)
+ else
+ s
+ }
+
/**
*
* @param args
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 122b5dc..ab0fd21 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
@@ -112,6 +112,12 @@ object NCDeployManager extends NCService {
*/
case class SynonymHolder(elmId: String, syn: NCProbeSynonym)
+ /**
+ *
+ * @param method
+ * @param objClassName
+ * @param obj
+ */
case class MethodOwner(method: Method, objClassName: String, obj: Any) {
require(method != null)
require(objClassName != null ^ obj != null)
@@ -120,12 +126,7 @@ object NCDeployManager extends NCService {
def getObject: Any = {
if (lazyObj == null)
- try
- lazyObj = U.mkObject(objClassName)
- catch {
- // TODO:
- case e: Throwable => throw new NCE(s"Error initializing
object of type: $objClassName", e)
- }
+ lazyObj = U.mkObject(objClassName)
lazyObj
}