You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Hudson (JIRA)" <ji...@apache.org> on 2015/03/23 21:43:53 UTC

[jira] [Commented] (THRIFT-1909) Java: Add compiler flag to use the "option pattern" for optional fields

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

Hudson commented on THRIFT-1909:
--------------------------------

SUCCESS: Integrated in Thrift #1480 (See [https://builds.apache.org/job/Thrift/1480/])
THRIFT-1909 Java: Add compiler flag to use the "option pattern" for optional fields (roger: rev e6789480d262357d4de4ab608267165c79631cb3)
* lib/java/src/org/apache/thrift/Option.java
* lib/java/test/org/apache/thrift/TestOptionType.java
* compiler/cpp/src/generate/t_java_generator.cc


> Java: Add compiler flag to use the "option pattern" for optional fields
> -----------------------------------------------------------------------
>
>                 Key: THRIFT-1909
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1909
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Java - Compiler, Java - Library
>            Reporter: Eirik Sletteberg
>            Assignee: Roger Meier
>         Attachments: add-option-type.patch, thrift-0.9.3-option_type.patch
>
>
> This is a follow-up of the brainstorming issue about better null safety in Java.
> The patch adds:
> 1) A new abstract Option<T> class, with two subclasses: Some<T> and None<T>.
> 2) An optional compiler flag for the java compiler. When set, it wraps methods for optional fields in Option types.
> An example of usage is found here: https://github.com/eirslett/thrift-optional-example
> - No java dependencies are introduced.
> - The patch is entirely backwards-compatible; if the compiler flag is not present, it will generate the same code as thrift usually does.
> - The implementation is compatible with thrift servers/clients where the compiler flag is not used.



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