reef-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "minhyeok kweun (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (REEF-968) Handle RequiredParameter set to null
Date Wed, 27 Jul 2016 07:49:20 GMT

    [ https://issues.apache.org/jira/browse/REEF-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15395184#comment-15395184
] 

minhyeok kweun edited comment on REEF-968 at 7/27/16 7:48 AM:
--------------------------------------------------------------

[~dss-2009@yandex.ru] Hello, I am Minhyeok (Daniel) Kweun, an assignee to resolve this issue.
Now I'm trying to understand what exactly the problem is and to figure out which part should
be modified in Tang. Could you please help me by answering me some question?

As far as I'm concerned, the existing policy is that when Tang catches an attempt to set a
RequiredParameter to null, it throws IllegalStateException in build() method of ConfigurationModule
class as like below. And we should change the policy to bind a default value to the RequiredParameter.
Is it right?

{code:title=Bar.java|borderStyle=solid}
      if (!foundOne && !(p instanceof OptionalParameter)) {
        final IllegalStateException e =
            new IllegalStateException("Cannot find the value for the RequiredParameter of
the " + clazz
                    + ". Check that you don't pass null as the parameter value.");
        LOG.log(Level.SEVERE, "Failed to build configuration", e);
        throw e;
      }

{code}

It would be grateful if you would answer me since this is the first time that I've ever analyzed
Tang.
Thank you!


was (Author: mhkweun):
[~dss-2009@yandex.ru] Hello, I am Minhyeok (Daniel) Kweun, an assignee to resolve this issue.
Now Ii'm trying to understand what exactly the problem is and to figure out which part should
be modified in Tang. Could you please help me by answering me some question?

As far as I'm concerned, the existing policy is that when Tang catches an attempt to set a
RequiredParameter to null, it throws IllegalStateException in build() method of ConfigurationModule
class as like below. And we should change the policy to bind a default value to the RequiredParameter.
Is it right?

{code:title=Bar.java|borderStyle=solid}
      if (!foundOne && !(p instanceof OptionalParameter)) {
        final IllegalStateException e =
            new IllegalStateException("Cannot find the value for the RequiredParameter of
the " + clazz
                    + ". Check that you don't pass null as the parameter value.");
        LOG.log(Level.SEVERE, "Failed to build configuration", e);
        throw e;
      }

{code}

It would be grateful if you would answer me since this is the first time that I've ever analyzed
Tang.
Thank you!

> Handle RequiredParameter set to null
> ------------------------------------
>
>                 Key: REEF-968
>                 URL: https://issues.apache.org/jira/browse/REEF-968
>             Project: REEF
>          Issue Type: Sub-task
>          Components: Tang
>            Reporter: Sergey Dudoladov
>            Assignee: minhyeok kweun
>
> Attempt to set a {{RequiredParameter}}  to null should probably use a default value if
available or throw a meaningful exception.
> To reproduce, see [the comment to REEF-932 | https://issues.apache.org/jira/browse/REEF-932?focusedCommentId=15009618&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15009618]
> I modified that patch to include the default value for 
> {code}
> @NamedParameter(default_value = "abc")
>   class FooStringness implements Name<String> {
>   }
> {code}
>  but that code also throws {{IllegalStateException}}. 
> We probably should use the default value instead and log (a) the warning that the {{RequiredParameter}}
is set to null (b) the default we use.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message