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

Inconsistently in ScreenManager behavior if displayCapabilities is null #1310

Closed
JulianKast opened this issue Mar 16, 2020 · 0 comments
Closed
Projects

Comments

@JulianKast
Copy link
Contributor

JulianKast commented Mar 16, 2020

Bug Report

Currently, if RAIR.displayCapabilities == null, the SCM will create WindowCapablity that is not null but all fields inside it will be null. Previously, we used to assume that everything is enabled when displayCapabilities is null. However, after the change and because WindowCapablity is always not null, the case is not true in all places in ScreenManager.

int getNumberOfLines() {
    if (defaultMainWindowCapability == null){
        return 4;
    }
    int linesFound = 0;
    List<TextField> textFields = defaultMainWindowCapability.getTextFields();
    TextFieldName name;
    if (textFields != null && !textFields.isEmpty()) {
        for (TextField field : textFields) {
            if (field.getName() != null) {
                name = field.getName();
                if (name == TextFieldName.mainField1 || name == TextFieldName.mainField2 || name == TextFieldName.mainField3 || name == TextFieldName.mainField4) {
                    linesFound += 1;
                }
            }
        }
    }
    return linesFound;
}

Like in prev example, it's textFields are null, the function will return 0 even though it should return 4.

We have to go over all cases and clearly define what null means for capabilities. And pay special attention to NPEs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
4.11.0
  
Done
Development

No branches or pull requests

2 participants