Github user takezoe commented on a diff in the pull request:

    
https://github.com/apache/incubator-predictionio/pull/387#discussion_r120147041
  
    --- Diff: 
data/src/main/scala/org/apache/predictionio/data/storage/Storage.scala ---
    @@ -306,9 +306,18 @@ object Storage extends Logging {
         }
         val constructor = clazz.getConstructors()(0)
         try {
    -      constructor.newInstance(ctorArgs: _*).
    +      val instance = constructor.newInstance(ctorArgs: _*).
             asInstanceOf[T]
    +      try {
    +        val init = instance.getClass.getMethod("init")
    +        init.invoke(instance)
    +      }
    +      catch {
    +        case e: NoSuchMethodException => None
    --- End diff --
    
    If the return value of try expression is not used, `Unit` is suitable than 
`None` for ignoring an exception as following:
    ```scala
    case _: NoSuchMethodException => ()
    ```



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to