| Code with Finding: |
class APDUIOService {
/*@ requires state == SESSION_STOPPED_STATE;
*@ ensures state == SESSION_STARTED_STATE;
*/
public void open() {
Socket sock;
try {
sock = new Socket("localhost", 9025);
InputStream is = sock.getInputStream();
OutputStream os = sock.getOutputStream();
cad = CadDevice.getCadClientInstance(CadDevice.PROTOCOL_T1, is, os);
cad.powerUp();
} catch (IOException e) {
System.out.println(e);
} catch (CadTransportException e) {
System.out.println(e);
}
state = SESSION_STARTED_STATE;
notifyStartedAPDUSession();
}
}
|