You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by luke-zhu <gi...@git.apache.org> on 2017/10/21 05:35:28 UTC
[GitHub] beam pull request #4024: [BEAM-2304] Fixed bug allowing declared state to be...
GitHub user luke-zhu opened a pull request:
https://github.com/apache/beam/pull/4024
[BEAM-2304] Fixed bug allowing declared state to be accessed as a superclass.
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Make sure there is a [JIRA issue](https://issues.apache.org/jira/projects/BEAM/issues/) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
- [x] Each commit in the pull request should have a meaningful subject line and body.
- [x] Format the pull request title like `[BEAM-XXX] Fixes bug in ApproximateQuantiles`, where you replace `BEAM-XXX` with the appropriate JIRA issue.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Run `mvn clean verify` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
- [N/A] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
---
This is a fix to BEAM-2304: State declared with one class cannot be accessed as a superclass (applies to BagState|CombiningState <: GroupingState).
I changed the stateId check in `analyzeExtraParameter` of `DoFnSignatures.java` to check that the initial state declaration is a subtype of the state type of `processElement` instead of equal to.
I updated the corresponding error message and added a test to `DoFnSignaturesTest.java` which makes sure that the example code in the original JIRA issue instantiates a DoFn without a runtime error.
This is my first pull request. I'm excited to learn from everyone!
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/luke-zhu/beam luke
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/beam/pull/4024.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #4024
----
commit ed29adf3de87a8f118316a9e6fb4cf398da135ca
Author: luke-zhu <lu...@brown.edu>
Date: 2017-10-21T05:06:00Z
Allowed for declared state to be accessed as a supertype and updated error messages.
----
---