Skip to content

Conversation

@kbendick
Copy link
Contributor

@kbendick kbendick commented Jul 5, 2022

When cleaning up some error prone warnings, I noticed that the ExceptionUtil.runSafely methods are not used anywhere other than from their own tests.

Given that we are going to have API stability guarantees come 1.0, we should consider deprecating these for 0.14.0 and then removing them at 1.0 so we're not giving API / ABI compatibility guarantees for code that isn't used within the library and gives error prone warnings that are difficult to reason about.

Original PR where the discussion of these functions took place: #5190

@github-actions github-actions bot added the API label Jul 5, 2022
@kbendick
Copy link
Contributor Author

kbendick commented Jul 5, 2022

I'd be ok with removing these now, though they are part of API so we might want to deprecate for at least one release.

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class TestExceptionUtil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove the test if the tested code is still in the codebase? Even if deprecated, it'd be nice to validate that it works. These tests do not look too expensive to run 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Happy to add them back!

Copy link
Contributor

Choose a reason for hiding this comment

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

thx :)

Copy link
Contributor

@dimas-b dimas-b Jul 5, 2022

Choose a reason for hiding this comment

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

nit: update the PR's summary line?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated. I'm going to add a note about removing in 1.0 as well.

@kbendick kbendick changed the title API - Deprecate unused runSafely funcs and remove their tests API - Deprecate unused runSafely functions Jul 6, 2022
…emoved and mentioning the unit test so we don't forget to remove those tooo
@kbendick
Copy link
Contributor Author

kbendick commented Jul 7, 2022

cc @RussellSpitzer I'm not sure if you guys use these functions internally.

They've always given somewhat difficult to reason about error prone warnings, and I discovered they aren't used at all (outside of in their associated tests). So I deprecated them but wanted to give you a heads up.

@RussellSpitzer
Copy link
Member

We do not use these, +1

@kbendick
Copy link
Contributor Author

Ryan mentioned that since this code is tested and works, we might want to have it still.

So I'm opening a PR to fix a small bug in the thrown combined Throwable and suppress the warning.

@kbendick kbendick closed this Jul 12, 2022
@kbendick kbendick deleted the kb-deprecate-unused-runSafely-functions branch July 12, 2022 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants