Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JENKINS-73768] Handle base=derived case in Util#isOverridden #9728

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

daniel-beck
Copy link
Member

See JENKINS-73768.

It looks like #4833 does not properly consider the case where base == derived. Somehow the existing test coverage is insufficient, did not dig further into this yet.

I encountered this when looking at the system log and being surprised about exception output using "Caused by" rather than "Causes" when what was thrown was a raw Throwable in test code -- hence the choice of types in the test.

An alternative solution could be to change the last line to use equals instead of !=, but that seems more likely to have unintended consequences.

CC @Zastai in case you're still around/interested.

Testing done

None.

Proposed changelog entries

  • human-readable text

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

Before the changes are marked as ready-for-merge:

Maintainer checklist

@Zastai
Copy link
Contributor

Zastai commented Sep 13, 2024

LGTM.

I suppose the second test assert is not 100% future proof (there's no guarantee that Exception will never override printStackTrace()). The test class could declare a nested private static class that extends Throwable for that purpose; not sure it's necessarily worth the effort though.

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