engine: Remove empty String() constructors

Removed calls to new String() and replaced them with the "" literal.
Strings are immutable anyway, so there's no point in wasting memory on
new instance creations.

This patch fixes all occurrences of the DM_STRING_VOID_CTOR FindBugs
warning in the code.

Change-Id: I449ea291a152dff968afa4862b22043da655cdcf
Signed-off-by: Allon Mureinik <amureini@redhat.com>
engine: Remove Number constructors

Since Numbers are immutable, there is no reason to unbox, autobox
or force construction of new objects of those types - their value can,
instead, be used directly.

This patch fixes multiple FindBugs inspections around this issue.

Change-Id: I334513e25abee1f9bfd71c575767c54cc96bc87c
Signed-off-by: Allon Mureinik <amureini@redhat.com>
engine: Don't iterate maps with keySet()

Used entrySet() and values() to replace keySet() and get(key)
iterations, in order to improve performance in these sections.

This patch addresses the WMI_WRONG_MAP_ITERATOR FindBugs warning
throughout the code.

Change-Id: Ia17710ae5dcf61779cabb892638d3d8f6ac95d86
Signed-off-by: Allon Mureinik <amureini@redhat.com>
engine: Remove "not null and equals" calls

Checking nullness before comparing to a constant is redundant in Java,
since equals(Object) already handles null values.

I.e., instead of calling:
var != null && var.equals(constant)

we should call
constant.equals(var)

This is both faster and easier to read.

Change-Id: I062415b8e09c7ff39d54e4561e5034aa85540949
Signed-off-by: Allon Mureinik <amureini@redhat.com>
engine: Remove null check before instanceof

The instanceof operator returns false for null, so it's redundant to
explicitly check for nulls when using it.

Explicitly checking for nulls is both slower and more confusing to read.

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