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

Initialize keyword to default value #21

Open
Hitogoroshi opened this issue Feb 7, 2018 · 2 comments
Open

Initialize keyword to default value #21

Hitogoroshi opened this issue Feb 7, 2018 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@Hitogoroshi
Copy link
Contributor

Hitogoroshi commented Feb 7, 2018

When the method: OIFitsChecker.isInspectRules() has been added in the code to catch failures, we can go into methods with null values.
To prevent this problem a number of checks (on values that can be null) have been created:

if (value == null) {
}

In this case on FitsImageLoader, we propose to initialize the values to a default value so that it can not be null anymore and ensure all mandatory keywords in memory have a not null value (getters should never return null)

@Hitogoroshi Hitogoroshi added the enhancement New feature or request label Feb 7, 2018
@Hitogoroshi Hitogoroshi self-assigned this Feb 7, 2018
@bourgesl bourgesl changed the title FitsImageLoader: Initialized keyword to default value FitsImageLoader: Initialize keyword to default value Feb 7, 2018
@bourgesl bourgesl changed the title FitsImageLoader: Initialize keyword to default value Initialize keyword to default value Feb 7, 2018
@bourgesl
Copy link
Member

bourgesl commented Feb 9, 2018

Please indicate which & where checks were introduced + which keywords (type ?) are concerned, only mandatory keywords ?

@Hitogoroshi
Copy link
Contributor Author

Hitogoroshi commented Feb 12, 2018

In the case where isInspectRules () is true all the keywords are concerned.
Normally the flag hasKeyword = header.containsKey(name) checks for the presence of the keyword in the header.

Add a method so that mandatory keywords can never be null.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants