Vojtech Szocs has posted comments on this change.

Change subject: HostGeneralModel: improve "node has upgrade" logic
......................................................................


Patch Set 7: (1 inline comment)

....................................................
File 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/hosts/HostGeneralModel.java
Line 1094:                                 VDS vds = 
hostGeneralModel.getEntity();
Line 1095:                                 String [] Host = 
vds.getHostOs().split("-"); //$NON-NLS-1$ //$NON-NLS-2$
Line 1096:                                 String NodeRPMVersion = 
Host[1].trim() + "." + Host[2].split("\\.")[0].trim(); //$NON-NLS-1$ 
//$NON-NLS-2$
Line 1097:                                 Version hostOS = new 
Version(NodeRPMVersion);
Line 1098:                                 
hostGeneralModel.setHasUpgradeAlert(shouldAlertUpgrade(isos, hostOS));
Correct, UI uses custom implementation of RpmVersion: 
frontend/webadmin/modules/gwt-extension/src/main/java/org/ovirt/engine/ui/uioverrides/org/ovirt/engine/core/compat/RpmVersion.java

This is because compat's RpmVersion uses java.util.regex.* which is not 
supported (emulated) by GWT: 
http://www.gwtproject.org/doc/latest/RefJreEmulation.html#Package_java_util

GWT offers a similar class (RegExp) but using this in compat's RpmVersion would 
impose dependency on GWT which is not desirable.

So the answer is, in order to reuse compat's RpmVersion (and eliminate its 
custom implementation in gwt-extension), ensure RpmVersion can be successfully 
compiled with GWT, i.e. don't use java.util.regex.* stuff. After all, this 
class is to be used in GWT client so it *should* meet general GWT coding rules.

If the above answer is not an option, consider adding some custom class for 
regexp processing which can be overriden in UI to use GWT RegExp instead of 
java.util.regex.* stuff.
Line 1099: 
Line 1100:                                 boolean executionAllowed = 
vds.getStatus() != VDSStatus.Up
Line 1101:                                     && vds.getStatus() != 
VDSStatus.Installing
Line 1102:                                     && vds.getStatus() != 
VDSStatus.PreparingForMaintenance


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I49c74d3d0d92c74848e0c175095610b6e6b5a88e
Gerrit-PatchSet: 7
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Alexander Wels <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Barak Azulay <[email protected]>
Gerrit-Reviewer: Doron Fediuck <[email protected]>
Gerrit-Reviewer: Douglas Schilling Landgraf <[email protected]>
Gerrit-Reviewer: Einav Cohen <[email protected]>
Gerrit-Reviewer: Vojtech Szocs <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to