mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUACAMOLE-102: Move null checking logic to ModeledConnection.
This commit is contained in:
@@ -192,10 +192,8 @@ public class ConnectionModel extends ChildObjectModel {
|
|||||||
* negative numbers are used to indicate the system is
|
* negative numbers are used to indicate the system is
|
||||||
* unavailable.
|
* unavailable.
|
||||||
*/
|
*/
|
||||||
public int getConnectionWeight() {
|
public Integer getConnectionWeight() {
|
||||||
if (connectionWeight == null)
|
return connectionWeight;
|
||||||
return 1;
|
|
||||||
return connectionWeight.intValue();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -412,7 +412,8 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the weight of the connection, or the default.
|
* Returns the weight of the connection, or a default
|
||||||
|
* of 1 if the weight is undefined.
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
* The weight of the connection.
|
* The weight of the connection.
|
||||||
@@ -420,8 +421,10 @@ public class ModeledConnection extends ModeledChildDirectoryObject<ConnectionMod
|
|||||||
*/
|
*/
|
||||||
public int getConnectionWeight() {
|
public int getConnectionWeight() {
|
||||||
|
|
||||||
// Return the connection weight
|
Integer connectionWeight = getModel().getConnectionWeight();
|
||||||
return getModel().getConnectionWeight();
|
if(connectionWeight == null)
|
||||||
|
return 1;
|
||||||
|
return connectionWeight;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user