Roy Golan has posted comments on this change.

Change subject: core: better illegal VM status message
......................................................................


Patch Set 2: Code-Review+1

(2 comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/validator/LocalizedVmStatus.java
Line 3: import java.util.HashMap;
Line 4: import org.ovirt.engine.core.common.businessentities.VMStatus;
Line 5: import org.ovirt.engine.core.common.errors.VdcBllMessages;
Line 6: 
Line 7: public class LocalizedVmStatus extends HashMap<VMStatus, 
VdcBllMessages> {
use an internal EnumMap which is more compact and efficient.
Line 8: 
Line 9:     private static final LocalizedVmStatus INSTANCE = new 
LocalizedVmStatus();
Line 10: 
Line 11:     private LocalizedVmStatus() {


Line 28:         put(VMStatus.PoweringDown, 
VdcBllMessages.VAR__VM_STATUS__POWERING_DOWN);
Line 29:         put(VMStatus.PreparingForHibernate, 
VdcBllMessages.VAR__VM_STATUS__PREPARING_FOR_HIBERNATE);
Line 30:     }
Line 31: 
Line 32:     public static final String byVmStatus(VMStatus status) {
can I propose another name for the method?

I think LocalizedVmStatus.from(vm.getStatus()) reads clearer.
Line 33:         if (INSTANCE.containsKey(status)) {
Line 34:             return INSTANCE.get(status).name();
Line 35:         }
Line 36: 


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Iea6840e555aeb0c7a33a3b90e72fef23433e2be1
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: Omer Frenkel <ofren...@redhat.com>
Gerrit-Reviewer: Roy Golan <rgo...@redhat.com>
Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to