Skip to content

[BEAM-5161] FindBugs enabled#21

Merged
VaclavPlajt merged 1 commit intovasek/reduce-window-test-fixfrom
vasek/enable-findbugs
Aug 21, 2018
Merged

[BEAM-5161] FindBugs enabled#21
VaclavPlajt merged 1 commit intovasek/reduce-window-test-fixfrom
vasek/enable-findbugs

Conversation

@VaclavPlajt
Copy link
Copy Markdown

FindBugs enabled. All warnings sorted out.


Follow this checklist to help us incorporate your contribution quickly and easily:

  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

It will help us expedite review of your Pull Request if you tag someone (e.g. @username) to look at it.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- --- --- --- ---
Java Build Status Build Status Build Status Build Status Build Status Build Status Build Status
Python Build Status --- Build Status
Build Status
--- --- --- ---

dmvk pushed a commit that referenced this pull request Aug 17, 2018
dmvk pushed a commit that referenced this pull request Aug 17, 2018
dmvk pushed a commit that referenced this pull request Aug 17, 2018
dmvk pushed a commit that referenced this pull request Aug 17, 2018
dmvk pushed a commit that referenced this pull request Aug 17, 2018
dmvk pushed a commit that referenced this pull request Aug 17, 2018
*/
public class BeamFlow extends Flow {

@SuppressFBWarnings("SE_TRANSIENT_FIELD_NOT_RESTORED")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is there because when the flow starts, it isnt needed anymore, am I right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, but it is a little more complicated. It have to be transient since PCollection is not serializable on purpose. FindBugs suggest to fix this by initializing it within readObject() serialization method. That will also not work since we need it final too.

* @param <T> the type of elements stored in this list storage
*/
@Audience(Audience.Type.EXECUTOR)
@SuppressFBWarnings("OBL_UNSATISFIED_OBLIGATION")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it because, its used only for testing?

Copy link
Copy Markdown
Author

@VaclavPlajt VaclavPlajt Aug 21, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope. FindBugs compleins that streams are not closed propertly. Which is true. But fixing it would mean to redesign whole class or even the API. I would rather avoid thad in pert which will not be used in Beam in future.


private final int sinkId = System.identityHashCode(this);

@SuppressFBWarnings("SE_BAD_FIELD")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it because, its used only for testing?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in fact very similar to the BeamFlow case.

@VaclavPlajt VaclavPlajt merged commit cd765f7 into vasek/reduce-window-test-fix Aug 21, 2018
@VaclavPlajt VaclavPlajt deleted the vasek/enable-findbugs branch August 21, 2018 10:46
dmvk pushed a commit that referenced this pull request Oct 5, 2018
dmvk pushed a commit that referenced this pull request Oct 5, 2018
dmvk pushed a commit that referenced this pull request Oct 5, 2018
dmvk pushed a commit that referenced this pull request Oct 5, 2018
dmvk pushed a commit that referenced this pull request Oct 5, 2018
dmvk pushed a commit that referenced this pull request Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants