Skip to content

Comments

Fix errorprone warning#4929

Closed
akedin wants to merge 1 commit intoapache:masterfrom
akedin:errorprone-fix
Closed

Fix errorprone warning#4929
akedin wants to merge 1 commit intoapache:masterfrom
akedin:errorprone-fix

Conversation

@akedin
Copy link
Contributor

@akedin akedin commented Mar 21, 2018

Errorprone detects catching throwable and warns that it hides assertions failures


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

  • Make sure there is a JIRA issue 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.
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue.
  • Write a pull request description that is detailed enough to understand:
    • What the pull request does
    • Why it does it
    • How it does it
    • Why this approach
  • Each commit in the pull request should have a meaningful subject line and body.
  • Run mvn clean verify to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

@akedin
Copy link
Contributor Author

akedin commented Mar 21, 2018

R: @tgroh @lostluck

// May need options to be filesystem-independent, e.g., if filesystems ban certain chars.
}

@SuppressWarnings("TryFailThrowable")
Copy link
Member

Choose a reason for hiding this comment

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

This looks like the actual bug, rather than a spurious warning - the AssertionError thrown by fail can't ever be propagated out of the catch. You should instead fix the bug.

http://errorprone.info/bugpattern/TryFailThrowable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

makes sense, will do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Errorprone detects catching throwable and warns that it hides assertions failures
@tgroh
Copy link
Member

tgroh commented Mar 22, 2018

It would appear that we have some bugs in our tester, or in our resolvers:

java.lang.AssertionError: Should not be able to resolve against file resource hdfs:/file
	at org.junit.Assert.fail(Assert.java:88)
	at org.apache.beam.sdk.io.fs.ResourceIdTester.validateFailureResolvingIds(ResourceIdTester.java:118)
	at org.apache.beam.sdk.io.fs.ResourceIdTester.runResourceIdBattery(ResourceIdTester.java:58)
	at org.apache.beam.sdk.io.hdfs.HadoopResourceIdTest.testResourceIdTester(HadoopResourceIdTest.java:69)

@kennknowles
Copy link
Member

run java precommit

@kennknowles
Copy link
Member

Just waiting for green from our new and glorious :javaPreCommit

@akedin
Copy link
Contributor Author

akedin commented Apr 11, 2018

The failure is an actual bug. This PR allows the assertion to fail the test. Now we have to actually fix it

@akedin
Copy link
Contributor Author

akedin commented Apr 12, 2018

closing this for now

@akedin akedin closed this Apr 12, 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.

4 participants