You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltaspike.apache.org by "Alexander Falb (JIRA)" <ji...@apache.org> on 2017/10/10 12:53:00 UTC
[jira] [Commented] (DELTASPIKE-1287) asList() getValue() fails with
a NPE if no configured value exists
[ https://issues.apache.org/jira/browse/DELTASPIKE-1287?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16198616#comment-16198616 ]
Alexander Falb commented on DELTASPIKE-1287:
--------------------------------------------
This fix does NOT work with default values. Please have a look at the patch attached to [https://issues.apache.org/jira/browse/DELTASPIKE-1272]. A testcase like
{code}
@Test
public void testConfiguredListValues_WithDefault()
{
List<Integer> intValues = ConfigResolver.resolve("notexisting").as(Integer.class).asList().withDefault(Arrays.asList(99, 88, 77)).getValue();
Assert.assertNotNull(intValues);
Assert.assertEquals(3, intValues.size());
Assert.assertTrue(intValues.contains(99));
Assert.assertTrue(intValues.contains(88));
Assert.assertTrue(intValues.contains(77));
}
{code}
will still fail.
> asList() getValue() fails with a NPE if no configured value exists
> ------------------------------------------------------------------
>
> Key: DELTASPIKE-1287
> URL: https://issues.apache.org/jira/browse/DELTASPIKE-1287
> Project: DeltaSpike
> Issue Type: Bug
> Components: Configuration
> Affects Versions: 1.8.0
> Reporter: Mark Struberg
> Assignee: Mark Struberg
> Fix For: 1.8.1
>
>
> We currently blow up with a NullPointerException if a List gets resolved and no value was actually configured.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)