Skip to content

Conversation

@teabot
Copy link
Contributor

@teabot teabot commented Jul 7, 2022

Motivation

To reduce warnings generated during compilation by cleaning up the code.

[WARNING] /Users/ewest/git/pulsar/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java:[334,9] finally clause cannot complete normally
[WARNING] /Users/ewest/git/pulsar/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java:[642,9] finally clause cannot complete normally

Modifications

  • Moved return from finally blocks
  • Simplified code through the use of simpler, equivalent language constructs
  • Made some constant fields final

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API: no
  • The schema: no
  • The default values of configurations: no
  • The wire protocol: no
  • The rest endpoints: no
  • The admin cli options: no
  • Anything that affects deployment: no

Documentation

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    Non functional change

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@github-actions github-actions bot added the doc-not-needed Your PR changes do not impact docs label Jul 7, 2022
@merlimat merlimat added the type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use label Jul 8, 2022
@merlimat merlimat added this to the 2.11.0 milestone Jul 8, 2022
@teabot
Copy link
Contributor Author

teabot commented Jul 11, 2022

/pulsarbot run-failure-checks

Refactor code so that return occurs outside of finally blocks
@teabot teabot force-pushed the cleanup-return-in-finally-warning branch from 6f18371 to c2c2a77 Compare July 12, 2022 14:00
@Technoboy-
Copy link
Contributor

/pulsarbot run-failure-checks

@codelipenghui codelipenghui modified the milestones: 2.11.0, 2.12.0 Jul 26, 2022
@teabot
Copy link
Contributor Author

teabot commented Aug 10, 2022

/pulsarbot rerun-failure-checks

@zymap zymap merged commit 62e2a9a into apache:master Aug 11, 2022
coderzc pushed a commit to coderzc/pulsar that referenced this pull request Aug 13, 2022
…finally (apache#16451)

### Motivation

To reduce warnings generated during compilation by cleaning up the code.

```
[WARNING] /Users/ewest/git/pulsar/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java:[334,9] finally clause cannot complete normally
[WARNING] /Users/ewest/git/pulsar/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java:[642,9] finally clause cannot complete normally
```

### Modifications

* Moved `return` from `finally` blocks
* Simplified code through the use of simpler, equivalent language constructs
* Made some constant fields `final`

Co-authored-by: Matteo Merli <mmerli@apache.org>
Technoboy- pushed a commit to merlimat/pulsar that referenced this pull request Aug 16, 2022
…finally (apache#16451)

### Motivation

To reduce warnings generated during compilation by cleaning up the code.

```
[WARNING] /Users/ewest/git/pulsar/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java:[334,9] finally clause cannot complete normally
[WARNING] /Users/ewest/git/pulsar/pulsar-functions/worker/src/main/java/org/apache/pulsar/functions/worker/SchedulerManager.java:[642,9] finally clause cannot complete normally
```

### Modifications

* Moved `return` from `finally` blocks
* Simplified code through the use of simpler, equivalent language constructs
* Made some constant fields `final`

Co-authored-by: Matteo Merli <mmerli@apache.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

doc-not-needed Your PR changes do not impact docs type/cleanup Code or doc cleanups e.g. remove the outdated documentation or remove the code no longer in use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants