Miha-x64 / Mikes_IDEA_extensions

IntelliJ IDEA: missing parts.
Apache License 2.0
34 stars 7 forks source link

Bug: false positive warning of "Appending nullable value to StringBuilder " being shown on something that has no null value #51

Closed AndroidDeveloperLB closed 1 year ago

AndroidDeveloperLB commented 1 year ago

v0.28

For some reason, I can reproduce this only on a large project, but not on POC.

The code has something like that:

...
        val select =
            StringBuilder("${ActionLogColumns.COLUMN_NAME_IGNORE}=? AND ${ActionLogColumns.COLUMN_NAME_IS_PRIVATE_NUMBER}=?")
        select.append(" AND ${ActionLogColumns.COLUMN_NAME_CONTACTABLE_ROW_ID} IS NULL AND ${ActionLogColumns.COLUMN_NAME_PHONE_NUMBER} =?")
...

    object ActionLogColumns : BaseColumns {
        const val COLUMN_NAME_IGNORE = "ignore"
        const val COLUMN_NAME_IS_PRIVATE_NUMBER = "is_private_number"
        const val COLUMN_NAME_CONTACTABLE_ROW_ID = "contactable_row_id"
        const val COLUMN_NAME_PHONE_NUMBER = "phone_number"
    }
}

On the line that has "append", I get a warning even though nothing here is null (right in the editor, no need to perform code-analysis). And, when I tried to create a new sample with these, I couldn't reproduce this. It appears even after an OS restart.

image

Miha-x64 commented 1 year ago

The inspection will be removed in the following release. I don't know how to do this in reliable way.

AndroidDeveloperLB commented 1 year ago

ok thanks