Skip to content

Commit

Permalink
Fix tests, did not see how getters worked initially
Browse files Browse the repository at this point in the history
  • Loading branch information
octylFractal committed Jul 1, 2016
1 parent 2856e27 commit 5fa891f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,13 @@ ${gwtCompatibleAnnotation}

@Override
${p.nullableAnnotation}public $builderGetters[$p.name].type ${p.getter}() {
#set ($getterOptional = $builderGetters[$p.name].optional)
#if ($getterOptional)
#if ($builderGetters[$p.name].optional)

return ${getterOptional.rawType}.${getterOptional.nullable}($p);
if ($p == null) {
return $builderGetters[$p.name].optional.empty;
} else {
return ${builderGetters[$p.name].optional.rawType}.of($p);
}

#else
#if ($builderRequiredProperties.contains($p))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,7 +793,11 @@ public void correctBuilder() throws Exception {
"",
" @Override",
" public Optional<Integer> anInt() {",
" return Optional.fromNullable(anInt)",
" if (anInt == null) {",
" return Optional.absent();",
" } else {",
" return Optional.of(anInt);",
" }",
" }",
"",
" @Override",
Expand Down

0 comments on commit 5fa891f

Please sign in to comment.