Change in ovirt-engine[master]: core: remove unneeded reflection use in SyntaxChecker

rgolan at redhat.com rgolan at redhat.com
Thu Nov 29 11:13:26 UTC 2012


Roy Golan has submitted this change and it was merged.

Change subject: core: remove unneeded reflection use in SyntaxChecker
......................................................................


core: remove unneeded reflection use in SyntaxChecker

Using the built-in valueOf method of Enum instead of fancy, expensive
other ways to try to get the enum value.

The former code did eventually a valueOf check which is case sensitive
and then another EnumUtils method which was case *insensitive*. Since the
inner EnumUtils call would only be read on a match there is no point in repeating
the enum fetching twice, and in a very expensive way when we have a
ready made method for it.

Change-Id: Idd74aad49d292e64dec6f5925ffd186f13b9887c
Signed-off-by: Roy Golan <rgolan at redhat.com>
---
M backend/manager/modules/compat/src/main/java/org/ovirt/engine/core/compat/EnumCompat.java
M backend/manager/modules/searchbackend/pom.xml
M backend/manager/modules/searchbackend/src/main/java/org/ovirt/engine/core/searchbackend/SyntaxChecker.java
M backend/manager/modules/searchbackend/src/test/java/org/ovirt/engine/core/searchbackend/SyntaxCheckerTest.java
4 files changed, 57 insertions(+), 20 deletions(-)

Approvals:
  Roy Golan: Verified; Looks good to me, approved


--
To view, visit http://gerrit.ovirt.org/9461
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idd74aad49d292e64dec6f5925ffd186f13b9887c
Gerrit-PatchSet: 5
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Roy Golan <rgolan at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Daniel Erez <derez at redhat.com>
Gerrit-Reviewer: Roy Golan <rgolan at redhat.com>



More information about the Engine-commits mailing list