should it be

```java
ret = connected ? Messages.StateConnected : Messages.StateDisconnected;
```