[jira] [Updated] (CONFIGURATION-421) VFSFileChangedReloadingStrategy.init() uses configuration before checking it for null

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Updated] (CONFIGURATION-421) VFSFileChangedReloadingStrategy.init() uses configuration before checking it for null

ASF GitHub Bot (Jira)

     [ https://issues.apache.org/jira/browse/CONFIGURATION-421?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

John Glassmyer updated CONFIGURATION-421:
-----------------------------------------

    Attachment: VFSFCRS.init - check for null before using configuration.diff

patch: fix and test
               

> VFSFileChangedReloadingStrategy.init() uses configuration before checking it for null
> -------------------------------------------------------------------------------------
>
>                 Key: CONFIGURATION-421
>                 URL: https://issues.apache.org/jira/browse/CONFIGURATION-421
>             Project: Commons Configuration
>          Issue Type: Bug
>          Components: File reloading
>            Reporter: Sebb
>         Attachments: VFSFCRS.init - check for null before using configuration.diff
>
>
> VFSFileChangedReloadingStrategy.init() uses configuration before checking it for null:
> {noformat}
>         if (configuration.getURL() == null && configuration.getFileName() == null)
>         {
>             return;
>         }
>         if (this.configuration == null)
>         {
>             throw new IllegalStateException("No configuration has been set for this strategy");
>         }
> {noformat}
> The if statements should be swapped.
> [Note found by Findbugs]

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira