Change in ovirt-engine[master]: restapi: Fix initialization of system resource singleton
juan.hernandez at redhat.com
juan.hernandez at redhat.com
Thu Feb 4 16:52:12 UTC 2016
Juan Hernandez has submitted this change and it was merged.
Change subject: restapi: Fix initialization of system resource singleton
......................................................................
restapi: Fix initialization of system resource singleton
This is required in order to avoid the following findbugs warning:
Incorrect lazy initialization and update of static field
This method contains an unsynchronized lazy initialization of a static
field. After the field is set, the object stored into that location is
further updated or accessed. The setting of the field is visible to
other threads as soon as it is set. If the futher accesses in the method
that set the field serve to initialize the object, then you have a very
serious multithreading bug, unless something else prevents any other
thread from accessing the stored object until it is fully initialized.
Even if you feel confident that the method is never called by multiple
threads, it might be better to not set the static field until the value
you are setting it to is fully populated/initialized.
Bug kind and pattern: LI - LI_LAZY_INIT_UPDATE_STATIC
Change-Id: I0ca474dc6a65e29c128d14c13b3a512ab0373a91
Signed-off-by: Juan Hernandez <juan.hernandez at redhat.com>
---
M backend/manager/modules/restapi/jaxrs/src/main/java/org/ovirt/engine/api/restapi/resource/BackendApiResource.java
1 file changed, 5 insertions(+), 2 deletions(-)
Approvals:
Juan Hernandez: Verified; Looks good to me, approved
Jenkins CI: Passed CI tests
--
To view, visit https://gerrit.ovirt.org/53102
To unsubscribe, visit https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0ca474dc6a65e29c128d14c13b3a512ab0373a91
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Juan Hernandez <juan.hernandez at redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation at ovirt.org>
More information about the Engine-commits
mailing list