X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fbe%2Fnikiroo%2Futils%2Fserial%2FConnectAction.java;h=1f9833624c552516efa821c214cbb74765f82a55;hb=cd0c27d2e457ea19fcd9def879e1534a528292c2;hp=ec49a1dd7f3c235c32614c0c04bee9db902e1166;hpb=ce0974c4b695f842fa7ec81f3c53d016d1959854;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/serial/ConnectAction.java b/src/be/nikiroo/utils/serial/ConnectAction.java index ec49a1d..1f98336 100644 --- a/src/be/nikiroo/utils/serial/ConnectAction.java +++ b/src/be/nikiroo/utils/serial/ConnectAction.java @@ -35,6 +35,7 @@ abstract class ConnectAction { public void connectAsync() { new Thread(new Runnable() { + @Override public void run() { connect(); } @@ -94,12 +95,23 @@ abstract class ConnectAction { return new Importer().read(str).getValue(); } - protected void onClientVersionReceived(Version clientVersion) { - + /** + * Handler called when the client {@link Version} is received. + * + * @param clientVersion + * the client {@link Version} + */ + protected void onClientVersionReceived( + @SuppressWarnings("unused") Version clientVersion) { } - protected void onError(Exception e) { - + /** + * Handler called when an unexpected error occurs in the code. + * + * @param e + * the exception that occurred + */ + protected void onError(@SuppressWarnings("unused") Exception e) { } // \n included in line, but not in rep (also, server never get anything) @@ -111,10 +123,10 @@ abstract class ConnectAction { if (server) { out.flush(); return null; - } else { - contentToSend = true; - return flushString(); } + + contentToSend = true; + return flushString(); } } @@ -139,9 +151,9 @@ abstract class ConnectAction { } return line; - } else { - return null; } + + return null; } } } \ No newline at end of file