Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

improve nullness handling for i18n stuff #5864

Merged
merged 1 commit into from
Jul 6, 2018
Merged

improve nullness handling for i18n stuff #5864

merged 1 commit into from
Jul 6, 2018

Conversation

maggu2810
Copy link
Contributor

No description provided.

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
Copy link
Contributor

@htreu htreu left a comment

Choose a reason for hiding this comment

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

d'accord!

Only one remark.

* constant
*/
public static String stripConstantOr(final @Nullable String key, Supplier<String> supplier) {
if (key != null && key.startsWith(CONSTANT_PATTERN)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use isConstant here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

stripConstant needs to be called with a non-null argument.
The Eclipse Nullness support we are using cannot express "if isConstant returns true the given argument is known to be non-null" (the Checker Framework can handle such cases, e.g. https://checkerframework.org/api/org/checkerframework/checker/nullness/qual/EnsuresNonNullIf.html).
The Eclipse Nullness support knows that if the check key != null in the same function has been passed, that key is non-null.

Copy link
Contributor

@htreu htreu left a comment

Choose a reason for hiding this comment

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

Thanks.

@htreu htreu merged commit 1acea81 into eclipse-archived:master Jul 6, 2018
@maggu2810 maggu2810 deleted the nullness-further-annotations branch July 6, 2018 06:24
@htreu htreu added this to the 0.10.0 milestone Oct 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants