[Title] Commit temporary source because of miscommit before
authorBon-Yong Lee <bonyong.lee@samsung.com>
Tue, 7 May 2013 02:17:32 +0000 (11:17 +0900)
committerBon-Yong Lee <bonyong.lee@samsung.com>
Tue, 7 May 2013 02:17:32 +0000 (11:17 +0900)
[Desc.]
[Issue]

org.tizen.common.sdblib/src/org/tizen/sdblib/exception/SdbCommandRejectedException.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/exception/ShellCommandUnresponsiveException.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/exception/TimeoutException.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/util/ArrayHelper.java [changed mode: 0644->0755]
org.tizen.common.sdblib/src/org/tizen/sdblib/util/SdbShellProcess.java [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 1209939..e6a8846
  * limitations under the License.
  */
 
-package org.tizen.sdblib;
+package org.tizen.sdblib.exception;
 
 import java.io.IOException;
 
 /**
  * Exception thrown when sdb refuses a command.
  */
-public class SdbCommandRejectedException extends IOException {
-    private static final long serialVersionUID = 1L;
-    private final boolean mIsDeviceOffline;
-    private final boolean mErrorDuringDeviceSelection;
+public class
+SdbCommandRejectedException
+extends IOException
+{
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 3466997028942667337L;
+    
+       private final boolean bDeviceOffline;
+    private final boolean bErrorDuringDeviceSelection;
 
-    SdbCommandRejectedException(String message) {
-        super(message);
-        mIsDeviceOffline = "device offline".equals(message);
-        mErrorDuringDeviceSelection = false;
+    public
+    SdbCommandRejectedException(
+       final String message
+    )
+    {
+       this( message, false );
     }
 
-    SdbCommandRejectedException(String message, boolean errorDuringDeviceSelection) {
-        super(message);
-        mErrorDuringDeviceSelection = errorDuringDeviceSelection;
-        mIsDeviceOffline = "device offline".equals(message);
+    public
+    SdbCommandRejectedException(
+       final String message,
+       final boolean errorDuringDeviceSelection
+    )
+    {
+        super( message );
+        bErrorDuringDeviceSelection = errorDuringDeviceSelection;
+        bDeviceOffline = "device offline".equals(message);
     }
 
     /**
      * Returns true if the error is due to the device being offline.
      */
-    public boolean isDeviceOffline() {
-        return mIsDeviceOffline;
+    public
+    boolean
+    isDeviceOffline()
+    {
+        return bDeviceOffline;
     }
 
     /**
@@ -50,7 +67,10 @@ public class SdbCommandRejectedException extends IOException {
      * <p/>If false, sdb refused the command itself, if true, it refused to target the given
      * device.
      */
-    public boolean wasErrorDuringDeviceSelection() {
-        return mErrorDuringDeviceSelection;
+    public
+    boolean
+    wasErrorDuringDeviceSelection()
+    {
+        return bErrorDuringDeviceSelection;
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index bcd8bf4..6dd36f6
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.tizen.sdblib;
+package org.tizen.sdblib.exception;
 
 import java.io.IOException;
 
@@ -23,6 +23,13 @@ import java.io.IOException;
  * <p/>The command may not actually be unresponsive, it just has spent too much time not outputting
  * any thing to the console.
  */
-public class ShellCommandUnresponsiveException extends IOException {
-    private static final long serialVersionUID = 1L;
+public class
+ShellCommandUnresponsiveException
+extends IOException
+{
+
+       /**
+     * 
+     */
+    private static final long serialVersionUID = 8123258430753698798L;
 }
old mode 100644 (file)
new mode 100755 (executable)
index b0ae737..268810e
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-package org.tizen.sdblib;
+package org.tizen.sdblib.exception;
 
 import java.io.IOException;
 
@@ -22,6 +22,14 @@ import java.io.IOException;
  * Exception thrown when a connection to sdb failed with a timeout.
  *
  */
-public class TimeoutException extends IOException {
-    private static final long serialVersionUID = 1L;
+public class
+TimeoutException
+extends IOException
+{
+
+       /**
+     * 
+     */
+    private static final long serialVersionUID = -4311065054176283079L;
+       
 }
old mode 100644 (file)
new mode 100755 (executable)
index 1c60c08..8594b01
  * limitations under the License.
  */
 
-package org.tizen.sdblib;
+package org.tizen.sdblib.util;
 
 /**
  * Utility class providing array to int/long conversion for data received from devices through sdb. 
  */
-public final class ArrayHelper {
+public final class
+ArrayHelper
+{
+       
+       protected ArrayHelper() {}
 
     /**
      * Swaps an unsigned value around, and puts the result in an array that can be sent to a device.
@@ -28,7 +32,14 @@ public final class ArrayHelper {
      * @param offset the offset in the array where to put the swapped value.
      *      Array length must be at least offset + 4
      */
-    public static void swap32bitsToArray(int value, byte[] dest, int offset) {
+    public static
+    void
+    swap32bitsToArray(
+       final int value,
+       final byte[] dest,
+       final int offset
+    )
+    {
         dest[offset] = (byte)(value & 0x000000FF);
         dest[offset + 1] = (byte)((value & 0x0000FF00) >> 8);
         dest[offset + 2] = (byte)((value & 0x00FF0000) >> 16);
@@ -41,14 +52,17 @@ public final class ArrayHelper {
      * @param offset the offset in the array at which the int starts
      * @return the integer read from the array
      */
-    public static int swap32bitFromArray(byte[] value, int offset) {
-        int v = 0;
-        v |= ((int)value[offset]) & 0x000000FF;
-        v |= (((int)value[offset + 1]) & 0x000000FF) << 8;
-        v |= (((int)value[offset + 2]) & 0x000000FF) << 16;
-        v |= (((int)value[offset + 3]) & 0x000000FF) << 24;
-
-        return v;
+    public static
+    int
+    swap32bitFromArray(
+       final byte[] value,
+       final int offset
+    )
+    {
+        return (((int)value[offset]) & 0x000000FF)
+        | ((((int)value[offset + 1]) & 0x000000FF) << 8)
+        | ((((int)value[offset + 2]) & 0x000000FF) << 16)
+        | ((((int)value[offset + 3]) & 0x000000FF) << 24);
     }
     
     /**
@@ -59,12 +73,15 @@ public final class ArrayHelper {
      *      Array length must be at least offset + 2
      * @return the integer read from the array.
      */
-    public static int swapU16bitFromArray(byte[] value, int offset) {
-        int v = 0;
-        v |= ((int)value[offset]) & 0x000000FF;
-        v |= (((int)value[offset + 1]) & 0x000000FF) << 8;
-
-        return v;
+    public static
+    int
+    swapU16bitFromArray(
+       final byte[] value,
+       final int offset
+    )
+    {
+        return (((int)value[offset]) & 0x000000FF )
+        | ((((int)value[offset + 1]) & 0x000000FF) << 8);
     }
     
     /**
@@ -74,17 +91,20 @@ public final class ArrayHelper {
      *      Array length must be at least offset + 8
      * @return the integer read from the array
      */
-    public static long swap64bitFromArray(byte[] value, int offset) {
-        long v = 0;
-        v |= ((long)value[offset]) & 0x00000000000000FFL;
-        v |= (((long)value[offset + 1]) & 0x00000000000000FFL) << 8;
-        v |= (((long)value[offset + 2]) & 0x00000000000000FFL) << 16;
-        v |= (((long)value[offset + 3]) & 0x00000000000000FFL) << 24;
-        v |= (((long)value[offset + 4]) & 0x00000000000000FFL) << 32;
-        v |= (((long)value[offset + 5]) & 0x00000000000000FFL) << 40;
-        v |= (((long)value[offset + 6]) & 0x00000000000000FFL) << 48;
-        v |= (((long)value[offset + 7]) & 0x00000000000000FFL) << 56;
-
-        return v;
+    public static
+    long
+    swap64bitFromArray(
+       final byte[] value,
+       final int offset
+    )
+    {
+        return (((long)value[offset]) & 0x00000000000000FFL)
+        | ((((long)value[offset + 1]) & 0x00000000000000FFL) << 8)
+        | ((((long)value[offset + 2]) & 0x00000000000000FFL) << 16)
+        | ((((long)value[offset + 3]) & 0x00000000000000FFL) << 24)
+        | ((((long)value[offset + 4]) & 0x00000000000000FFL) << 32)
+        | ((((long)value[offset + 5]) & 0x00000000000000FFL) << 40)
+        | ((((long)value[offset + 6]) & 0x00000000000000FFL) << 48)
+        | ((((long)value[offset + 7]) & 0x00000000000000FFL) << 56);
     }
 }
old mode 100644 (file)
new mode 100755 (executable)
index 2bfa8f8..53f59c5
@@ -24,7 +24,7 @@
  * - S-Core Co., Ltd
  *
  */
-package org.tizen.sdblib;
+package org.tizen.sdblib.util;
 
 import java.io.BufferedWriter;
 import java.io.IOException;
@@ -32,6 +32,8 @@ import java.io.InputStream;
 import java.io.OutputStream;
 import java.io.OutputStreamWriter;
 
+import org.tizen.sdblib.Log;
+
 public class SdbShellProcess extends Process {
 
        public Process process = null;
@@ -50,9 +52,6 @@ public class SdbShellProcess extends Process {
        }
        
        private void interrupt() {
-               if (bw == null)
-                       return;
-
                char c = 0x03; //standard code representing "Ctrl-C" sequence
                try {
                        bw.write(c);
@@ -76,7 +75,9 @@ public class SdbShellProcess extends Process {
                interrupt();
                try {
                        process.exitValue();
-               } catch (IllegalThreadStateException e) {
+               }
+               catch ( final IllegalThreadStateException e )
+               {
                        process.destroy();
                }
        }