Lior Vernia has posted comments on this change. Change subject: webadmin: removed ugly if-else chain ......................................................................
Patch Set 5: (1 comment) http://gerrit.ovirt.org/#/c/33619/5/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java File frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/dataprovider/AsyncDataProvider.java: Line 3221: } Line 3222: Line 3223: public Guid getEntityGuid(Object entity) { Line 3224: if (entity instanceof BusinessEntity) { Line 3225: return getEntityGuid((BusinessEntity<? extends Guid>) entity); Can't this cause a class cast exception? When entity is of type BusinessEntity<T> where T doesn't extend Guid. The casting will be alright because type erasure, but then T will be returned here which isn't of type Guid. I think you'll still have to extract the entity's ID, and only return it if it's of type Guid (same as before). I wouldn't do this using the other getEntityGuid (it might work due to type erasure but is wrong), I would instead cast explicitly to BusinessEntity<?> and call getId(). Line 3226: } Line 3227: Line 3228: if (entity instanceof VmPool) { Line 3229: return ((VmPool) entity).getVmPoolId(); -- To view, visit http://gerrit.ovirt.org/33619 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic716dc67b90c1d575de14c40b504c984bf0467f2 Gerrit-PatchSet: 5 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Lior Vernia <lver...@redhat.com> Gerrit-Reviewer: Martin Mucha <mmu...@redhat.com> Gerrit-Reviewer: Tomas Jelinek <tjeli...@redhat.com> Gerrit-Reviewer: automat...@ovirt.org 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