core: Remove vm_last_up_time member from VmDynamic

Removed the private member "vm_last_up_time" from the VmDynamic class.
This member was never updated (in fact, there are no methods to modify
it!), and never queried (no such methods exists either), and was only
used in the equals(Object) and hashCode() methods.
Since its value is always null, it's useless to continue holding it.

Change-Id: Iab5358b836c3cb7dd351bfeb25f1a197e534c1d1
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Remove vdsGroups member from storage_pool

Removed the private member "vdsGroups" from the storage_pool class.
This member was never updated (in fact, there are no methods to
modify it!), and never queried (no such methods exists either), and
was only used in the equals(Object) and hashCode() methods.
Since its value is always null, it's useless to continue holding it.

Change-Id: I5ffad5811b390fd25562e677c7d852fb24ac4284
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Fix DnsSRVLocator possible NPE

getSRVResult extracted recordList's length before null-checking it,
which may have resulted in an NPE.
This patch fixes that problem.

Change-Id: Id23f34bfb5b358f4c39dd0bd5d3515a5b89414fb
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: EJBUtilsStratehy - fix NPE in error log

In the findBean method, jndiNameSB is initialized inside the try block,
but referenced in the catch block.
If an exception was thrown before it was initialized, calling its
toString() will cause a NullPointerException.

This patch replaces the call of append(jndiNameSB.toString()) with
append(jndiNameSB), which is null-safe.

Change-Id: I6e29a2f69e68a2cc12768409fcba0162926638d7
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: GSSAPIDirContextAuthentication null-check

Removed a redundant null check on the "result" variable, since a couple
of lines before hand, result.getAuditLogType() was called. Hence, result
is clearly not null.

Change-Id: Ideb107acdbbe55e8efd4bb90f6ff4ce0be168746
Signed-off-by: Allon Mureinik <amureini@redhat.com>
ui: Simplify keySelected eval in KeyValueModel

Simplify the evaluation of eventRaised()'s keySelected variable in
KeyValueModel - listModel's getSelectedItem() is called a couple of
rows beforehand, so it is clearly not null.

Change-Id: I2a27e4e18774775c12b7f824a9b5c5a433397a3a
Signed-off-by: Allon Mureinik <amureini@redhat.com>
ui: Fix possible NPE in VmListModel

Fixed a possible NullPointerException in VmListModel, as
retVal.isSucceeded() is called before retVal is checked for null.

Change-Id: I324956607690f0b017da74b01d69973188c89638
Signed-off-by: Allon Mureinik <amureini@redhat.com>
ui: AddDataCenterRM redundant null check

The rollback3() method checks model for being null a couple of lines
after calling model.getWindow().
Hence, model is clearly not null, and this check is clearly redundant.

Change-Id: I02cf28a4b834d67ee0a90d9971461712c0954418
Signed-off-by: Allon Mureinik <amureini@redhat.com>
userportal: fix possible NPE in % progress bar

DoublePercentageProgressBar unboxes valueA and valueB (into fakeA and
fakeB, respectively), and only then checks if they were null.

If either of them is indeed null, we will get a NullPointerException
from the outboxing, and won't even reach the null check.

This patch moves the relevant code into the null-safe condition.

Change-Id: Id7a65802cc79a698863899085189ea80fcc6d57f
Signed-off-by: Allon Mureinik <amureini@redhat.com>
tools: StandaloneDataSource: add @Override

Added missing @Override annotations to StandaloneDataSource's methods.

Change-Id: I5b404d92e6231467ce5b6a26f8cc30c7a548d765
Signed-off-by: Allon Mureinik <amureini@redhat.com>
tools: StandaloneDataSource: configReader.close

Fixed a possible NPE when closing configReader in the finally block if
it wasn't initialized properly.

Change-Id: Ia0352afa56f226d8573fc4f55bf08db32510e3b0
Signed-off-by: Allon Mureinik <amureini@redhat.com>
ui: DiskModelByAliasComparer: null disk treatment

DiskModelByAliasComparer was checking DiskModel.getDisk() for being
null, but then ignoring the check, and performing the same operation
(DiskModel.getDisk().getDiskAlias()) regardless.

This is obviously wrong, since if the disk is null, this will result in
a NullPointerException. This patch assigns a default (empty String) as
the disk alias in case the disk is null.

Change-Id: I2d060a5b9d87dc3ec7bcc382d90a4f2825ca9a05
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: Remove GetUserTabsQuery

This query is unusable (it has no corresponding constant in
VdcQueryType), and all its code is commented out anyway.

Change-Id: Ieb1fc762c104db35eb01151edc3e1e4316f3171d
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: LdapBrokerUtils - use precalculated trim()

Reused trimmedDomain (which is equal to domain.trim()) instead of
calling domain.trim() again, needlessly.

Change-Id: I25e944125357c0a5973a240e8658ddd599a9eb74
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: LdapBrokerUtils - removed unused local var

Removed the unused local variable domainsList.

Change-Id: I093a5c947a45f5ac5575ff09e2bdd3c3bc2463b9
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: RemoveVm - removed unused local variable

Removed the unused vmId local variable.

Change-Id: Ia9864d18e9e6d6e758c5197b74baab3b13486427
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: vmDeviceCommonUtils - remove local var

Remove the unused local variable vmBase.

Change-Id: I2522cb550bdb13d5f01b524407fcff067305e4f6
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: BaseAutoCompleter - add @Override annotation

Add the missing @Override annotations to BaseAutoCompleter.

Change-Id: I95ba0198bbc286513964d32f2f6d331467245a2a
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: BaseAutoCompleter.getCompletion() array size

Used the proper way to convert a List to an array in
BaseAutoCompleter.getCompletion(), for better performance.

Change-Id: I0e699a3307e05694f5456282b07e95cf22332d44
Signed-off-by: Allon Mureinik <amureini@redhat.com>
core: RemoveNetworkVDSCommand - unused local var

Remove the unused local variable options.

Change-Id: I383bc145dbc4d6ff869f528465bc9ecc3ea378be
Signed-off-by: Allon Mureinik <amureini@redhat.com>