Martin Mucha has posted comments on this change.

Change subject: webadmin: removed ugly if-else chain
......................................................................


Patch Set 6:

(1 comment)

http://gerrit.ovirt.org/#/c/33619/6/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 3223:     public Guid getEntityGuid(Object entity) {
Line 3224:         if (entity instanceof BusinessEntity) {
Line 3225:             //BusinessEntity can have lot of different ID types, but 
from this context it cannot be determined.
Line 3226:             //cast is present JUST to point to proper method, it's 
not able to guarantee return type of that method.
Line 3227:             Object id = getEntityGuid((BusinessEntity<? extends 
Guid>) entity);
> As I mentioned in the previous patchset, while this should work due to type
I  wrote you mail about it. It is rather confusing, but for some reason, when 
you do not match method with generic parameter EXACTLY and by EXACTLY I mean 
EXACTLY, you'd call the one with Object parameter. Try it yourself.

Either it has to be like it is in this patch or on line 3227 there must not be 
no generics: i.e. casting must be like:

(BusinessEntity)entity

So If you don't like it like this, I can change it. Due to type erasure is 
static analyzer little bit confused, so it will probably complaint about 
unnecessary id instanceof Guid
Line 3228: 
Line 3229:             //check whether result can be casted to Guid, otherwise 
continue with explicit rules.
Line 3230:             if (id instanceof Guid) {
Line 3231:                 return (Guid) id;


-- 
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: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Martin Mucha <[email protected]>
Gerrit-Reviewer: Lior Vernia <[email protected]>
Gerrit-Reviewer: Martin Mucha <[email protected]>
Gerrit-Reviewer: Tomas Jelinek <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to