Frank Kobzik has uploaded a new change for review.

Change subject: frontend: Fix NPE in ConsoleProtocol
......................................................................

frontend: Fix NPE in ConsoleProtocol

This patch fixes NPE when changing VM console protocol.

The exception was caused by modifying collection that was created using
Arrays.asList() and this list implementation throws NPE when removing
elements from it.

Fixed by wrapping the list in ArrayList implementation, so that client
code can mutate the collection.

Change-Id: Iaafdc72b83552b51ae65fcf3130b86b1949a3a56
Signed-off-by: Frantisek Kobzik <[email protected]>
Bug-Url: https://bugzilla.redhat.com/1109376
---
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ConsoleProtocol.java
1 file changed, 2 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/48/28848/1

diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ConsoleProtocol.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ConsoleProtocol.java
index 591c51f..bff7d54 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ConsoleProtocol.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/ConsoleProtocol.java
@@ -1,6 +1,7 @@
 package org.ovirt.engine.ui.uicommonweb.models;
 
 import java.io.Serializable;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Comparator;
@@ -65,7 +66,7 @@
     }
 
     public static List<ConsoleProtocol> getProtocolsByPriority() {
-        List<ConsoleProtocol> consoleProtocols = 
Arrays.asList(ConsoleProtocol.values());
+        List<ConsoleProtocol> consoleProtocols = new 
ArrayList(Arrays.asList(ConsoleProtocol.values()));
         Collections.sort(consoleProtocols, new PriorityComparator());
         return consoleProtocols;
     }


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

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

Reply via email to