[
https://issues.apache.org/jira/browse/CRUNCH-446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14065466#comment-14065466
]
Allan Shoup commented on CRUNCH-446:
------------------------------------
First, it looks like this exposed a couple of bugs
\[[1|https://git-wip-us.apache.org/repos/asf?p=crunch.git;a=blob;f=crunch-core/src/main/java/org/apache/crunch/types/avro/Avros.java;h=f950145fe237cae53caa4e18c99b388cd10a6cfc;hb=ded504eb133fa0814e2d90ff2a662e72a67e04bb#l582]\]
\[[2|https://git-wip-us.apache.org/repos/asf?p=crunch.git;a=blob;f=crunch-core/src/main/java/org/apache/crunch/types/avro/Avros.java;h=f950145fe237cae53caa4e18c99b388cd10a6cfc;hb=ded504eb133fa0814e2d90ff2a662e72a67e04bb#l740]\]
in Avros. I can update the patch to include fixes for those. I'm also finding,
however, that at least [some
code|https://git-wip-us.apache.org/repos/asf?p=crunch.git;a=blob;f=crunch-core/src/main/java/org/apache/crunch/types/avro/Avros.java;h=f950145fe237cae53caa4e18c99b388cd10a6cfc;hb=ded504eb133fa0814e2d90ff2a662e72a67e04bb#l592]
has branching logic based on getConfiguration returning null. If that is
desirable, we may want to back up to something closer to the first patch. What
are your thoughts?
> Add null checks for DoFn fields
> -------------------------------
>
> Key: CRUNCH-446
> URL: https://issues.apache.org/jira/browse/CRUNCH-446
> Project: Crunch
> Issue Type: Improvement
> Reporter: Allan Shoup
> Priority: Minor
> Attachments: CRUNCH-446.2.patch, CRUNCH-446.patch
>
>
> DoFn.getConfiguration() gracefully handles the fields being null, but most
> other methods do not. Adding null checks around all field access within DoFn
> would make it easier for consumers to write tests for their own function
> classes because they would not be required to set the context, for instance.
--
This message was sent by Atlassian JIRA
(v6.2#6252)