Skip to content
Snippets Groups Projects
Commit cc72cb66 authored by Raman Arora's avatar Raman Arora
Browse files

4274: OsAccount thread safety - made getters/setters synchronized.

parent ca844e39
No related branches found
No related tags found
No related merge requests found
...@@ -20,10 +20,8 @@ ...@@ -20,10 +20,8 @@
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Optional; import java.util.Optional;
import java.util.ResourceBundle; import java.util.ResourceBundle;
import org.apache.commons.lang3.StringUtils;
/** /**
* Abstracts an OS user account. OS Accounts have a scope, which is defined by * Abstracts an OS user account. OS Accounts have a scope, which is defined by
...@@ -246,7 +244,7 @@ public static OsAccountType fromID(int typeId) { ...@@ -246,7 +244,7 @@ public static OsAccountType fromID(int typeId) {
* *
* @param osAccountAttribute The osAccount Attribute that is to be added. * @param osAccountAttribute The osAccount Attribute that is to be added.
*/ */
void setAttributesInternal(List<OsAccountAttribute> osAccountAttributes) { synchronized void setAttributesInternal(List<OsAccountAttribute> osAccountAttributes) {
this.osAccountAttributes = osAccountAttributes; this.osAccountAttributes = osAccountAttributes;
} }
...@@ -350,7 +348,7 @@ public OsAccountDbStatus getOsAccountDbStatus() { ...@@ -350,7 +348,7 @@ public OsAccountDbStatus getOsAccountDbStatus() {
* *
* @throws TskCoreException * @throws TskCoreException
*/ */
public List<OsAccountAttribute> getExtendedOsAccountAttributes() throws TskCoreException { public synchronized List<OsAccountAttribute> getExtendedOsAccountAttributes() throws TskCoreException {
if (osAccountAttributes == null) { if (osAccountAttributes == null) {
osAccountAttributes = sleuthkitCase.getOsAccountManager().getOsAccountAttributes(this); osAccountAttributes = sleuthkitCase.getOsAccountManager().getOsAccountAttributes(this);
} }
...@@ -364,7 +362,7 @@ public List<OsAccountAttribute> getExtendedOsAccountAttributes() throws TskCoreE ...@@ -364,7 +362,7 @@ public List<OsAccountAttribute> getExtendedOsAccountAttributes() throws TskCoreE
* *
* @throws TskCoreException * @throws TskCoreException
*/ */
public List<OsAccountInstance> getOsAccountInstances() throws TskCoreException { public synchronized List<OsAccountInstance> getOsAccountInstances() throws TskCoreException {
if (osAccountInstances == null) { if (osAccountInstances == null) {
osAccountInstances = sleuthkitCase.getOsAccountManager().getOsAccountInstances(this); osAccountInstances = sleuthkitCase.getOsAccountManager().getOsAccountInstances(this);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment