Yair Zaslavsky has posted comments on this change.
Change subject: core: When updating entity name the event...
......................................................................
Patch Set 1: I would prefer that you didn't submit this
(2 inline comments)
....................................................
File
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/CommandBase.java
Line 547: String entity="UNKNOWN";
Line 548: String oldName="";
Line 549: String newName="";
Line 550: try {
Line 551: entity = ReflectionUtils.getMethodValue(this,
"getEntityName").toString();
Please perform cast -
RenamedEntityProvider provider = (RenamedEntityProvider)this;
and then use the methods, without reflecton , which hurts performance.
Line 552: oldName = ReflectionUtils.getMethodValue(this,
"getOldName").toString();
Line 553: newName = ReflectionUtils.getMethodValue(this,
"getNewName").toString();
Line 554: if (!oldName.equals(newName)) {
Line 555: // log entity rename details
Line 564: ReflectionUtils.callMethod(this, "setId",
partypes, arglist);
Line 565: AuditLogDirector.log(logable,
AuditLogType.ENTITY_RENAMED);
Line 566: }
Line 567: } catch (SecurityException e) {
Line 568: e.printStackTrace();
We should not print stack trace, but rather log it, and I would prefer
log.error(e.getMessage);
log.debug("Detailed stack trace",e");
Line 569: } catch (IllegalArgumentException e) {
Line 570: e.printStackTrace();
Line 571: } catch (NoSuchMethodException e) {
Line 572: e.printStackTrace();
--
To view, visit http://gerrit.ovirt.org/11756
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I17f0049ca0ffb1a3868ba404b112a8c10ee7778e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches