Nir Soffer has posted comments on this change.
Change subject: webadmin: Display size of ISO and floppy files in human
readable format
......................................................................
Patch Set 6:
(2 comments)
Repeating my questions from patch set 4 as they were not answered in later
patches.
....................................................
File
frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/renderer/DiskSizeRenderer.java
Line 31: this.format = format;
Line 32: }
Line 33:
Line 34: protected boolean isUnavailable(T size) {
Line 35: return size == null || size.longValue() == -1;
Can we use constant instead of -1, e.g.
IsoDomainListSyncronizer.SIZE_IS_NOT_AVAILABLE?
Probably means that the constant should live elsewhere so both classes can us
it.
Line 36: }
Line 37:
Line 38: @Override
Line 39: public String render(T size) {
Line 54: default:
Line 55: throw new RuntimeException("Format '" + format + "' is
not supported!"); //$NON-NLS-1$ //$NON-NLS-2$
Line 56: }
Line 57:
Line 58: return res;
If we return inside the case clause, we can get rid of the res temporary
variable, the breaks and the last return line.
switch(format) {
case LEGACY:
return renderLegacySize(size.longValue());
...
default:
throw ...
}
Line 59: }
Line 60:
Line 61: private String renderLegacySize(long sizeInBytes) {
Line 62: long sizeInGB = SizeConverter.convert(sizeInBytes,
SizeConverter.SizeUnit.BYTES, SizeUnit.GB).longValue();
--
To view, visit http://gerrit.ovirt.org/19550
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I95961fde2256a44b8474d8f41562bc0e33b0ad4a
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Nir Soffer <[email protected]>
Gerrit-Reviewer: Sergey Gotliv <[email protected]>
Gerrit-Reviewer: Tal Nisan <[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