You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polygene.apache.org by "Niclas Hedhman (JIRA)" <ji...@apache.org> on 2018/08/20 07:23:00 UTC

[jira] [Created] (POLYGENE-309) @Optional in ValueBuilder does not work if field not touched

Niclas Hedhman created POLYGENE-309:
---------------------------------------

             Summary: @Optional in ValueBuilder does not work if field not touched
                 Key: POLYGENE-309
                 URL: https://issues.apache.org/jira/browse/POLYGENE-309
             Project: Polygene
          Issue Type: New Feature
            Reporter: Niclas Hedhman


{color:#707070}The code below will not fail, although it should. Instead it will output "title":null
{color}

{color:#707070}If the comments are removed, the exception will be thrown. This is not what is expected, all non-Optional properties must be disallowed.{color}

 

{{{color:#000080}public class {color}RegressionTest {color:#000080}extends {color}AbstractPolygeneTest}}
{{{}}

{{    {color:#808000}@Test
{color}    {color:#000080}public void {color}test()}}
{{    {}}
{{        ValueBuilder<Value> builder = {color:#660e7a}valueBuilderFactory{color}.newValueBuilder( Value.{color:#000080}class {color});}}
{{{color:#808080}        // Value prototype = builder.prototype();
{color}{color:#808080}        // prototype.title().set( null );
{color}        System.{color:#660e7a}out{color}.println(builder.newInstance());}}
{{    }}}

{{    {color:#808000}@Override
{color}    {color:#000080}public void {color}assemble( ModuleAssembly module )}}
{{        {color:#000080}throws {color}AssemblyException}}
{{    {}}
{{        module.defaultServices();}}
{{        module.values( Value.{color:#000080}class {color});}}
{{    }}}

{{{color:#000080}    public interface {color}Value}}
{{    {}}
{{        Property<String> title();}}
{{    }}}
{{}}}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)