[
https://issues.apache.org/jira/browse/BEAM-3527?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16338711#comment-16338711
]
Kenneth Knowles commented on BEAM-3527:
---------------------------------------
Lol, this is kind of silly, actually. Effective Java involves using static
factory methods and builders and whatnot instead of directly calling
constructors. And then devs say "oh yea if I can't call a constructor I am
going to make an inscrutable method title simply {{create}}". And then the same
bugs occur.
> org.apache.beam.sdk.metrics.DistributionResult mixes up min and max
> constructor args
> -------------------------------------------------------------------------------------
>
> Key: BEAM-3527
> URL: https://issues.apache.org/jira/browse/BEAM-3527
> Project: Beam
> Issue Type: Bug
> Components: runner-core
> Reporter: Claire McGinty
> Assignee: Kenneth Knowles
> Priority: Minor
>
> [GitHub link to
> class|https://github.com/apache/beam/blob/a39960b131674e6c1d120a971b91b37226c88414/sdks/java/core/src/main/java/org/apache/beam/sdk/metrics/DistributionResult.java]
> given the constructor:
>
> {code:java}
> public static DistributionResult create(long sum, long count, long min, long
> max){code}
>
> the ZERO value
>
> {code:java}
> public static final DistributionResult ZERO = create(0, 0, Long.MAX_VALUE,
> Long.MIN_VALUE){code}
>
> should be:
>
> {code:java}
> public static final DistributionResult ZERO = create(0, 0, Long.MIN_VALUE,
> Long.MAX_VALUE);{code}
>
> unless this is intentional...?
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)