Vojtech Szocs has uploaded a new change for review.

Change subject: core: Fix GWT RPC serialization issue in RepoImage
......................................................................

core: Fix GWT RPC serialization issue in RepoImage

Since no UI code references RepoImage constructor, both
constructor (RepoImage method) and instance initializer
($init method) are marked as dead code by GWT compiler.

In consequence, instance initializer which is responsible
for adding fields such as "private X field = Y;" won't be
part of resulting JavaScript and corresponding GWT RPC
serialization policy.

In other words, if UI code doesn't reference business
entity constructor and we still want to use this entity
in UI code, the entity must not contain fields such as:

  private X field = Y;

instead, the entity must contain fields such as:

  private X field;

and do "field = Y;" assignment within its constructor.
Even though constructor won't execute in UI code, all
fields will still be part of resulting JavaScript.

Change-Id: I7085762877afc8f76090cf18f38bd303c5db2864
Signed-off-by: Vojtech Szocs <[email protected]>
---
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/RepoImage.java
1 file changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/52/17352/1

diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/RepoImage.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/RepoImage.java
index 48df02a..6c3f47f 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/RepoImage.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/RepoImage.java
@@ -10,15 +10,15 @@
  */
 public class RepoImage extends IVdcQueryable implements Serializable {
     private static final long serialVersionUID = 566928138057530047L;
-    private Guid storagePoolId = Guid.Empty;
+    private Guid storagePoolId;
     private StoragePoolStatus storagePoolStatus;
     private VDSStatus vdsStatus;
-    private Guid repoDomainId = Guid.Empty;
+    private Guid repoDomainId;
     private StorageDomainStatus storageDomainStatus;
     private String repoImageId;
     private String repoImageName;
-    private long size = 0;
-    private Date dateCreated = new Date();
+    private long size;
+    private Date dateCreated;
     private long lastRefreshed;
     private ImageFileType fileType;
 
@@ -26,6 +26,10 @@
      * Empty constructor for retrieving new clean entity
      */
     public RepoImage() {
+        storagePoolId = Guid.Empty;
+        repoDomainId = Guid.Empty;
+        size = 0;
+        dateCreated = new Date();
     }
 
     /**


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7085762877afc8f76090cf18f38bd303c5db2864
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to