2010-11-09 Francois Chouinard <fchouinard@gmail.com> Contribution for Bug315307
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / viewers / timeAnalysis / widgets / Utils.java
index 80680e32fdc84d3fabca2a20c6e409ba83a794a4..b04b4be50b6fb6ac29d571ac76f2ac4ed843d349 100644 (file)
@@ -48,11 +48,11 @@ public class Utils {
                SECONDS, MILLISEC, MICROSEC, NANOSEC\r
        };\r
 \r
-       static private final SimpleDateFormat stimeformat = new SimpleDateFormat("HH:mm:ss");\r
-       static private final SimpleDateFormat sdateformat = new SimpleDateFormat("yyyy-MM-dd");\r
+       static private final SimpleDateFormat stimeformat = new SimpleDateFormat("HH:mm:ss"); //$NON-NLS-1$\r
+       static private final SimpleDateFormat sdateformat = new SimpleDateFormat("yyyy-MM-dd"); //$NON-NLS-1$\r
        static {\r
-        stimeformat.setTimeZone(TimeZone.getTimeZone("GMT"));\r
-        sdateformat.setTimeZone(TimeZone.getTimeZone("GMT"));\r
+        stimeformat.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$\r
+        sdateformat.setTimeZone(TimeZone.getTimeZone("GMT")); //$NON-NLS-1$\r
        }\r
 \r
 //     static private String _externalPlugin[] = { "org.eclipse.debug.ui",\r
@@ -184,7 +184,7 @@ public class Utils {
                // str.append('0');\r
                str.append(sec);\r
                String ns = formatNs(v, res);\r
-               if (!ns.equals("")) {\r
+               if (!ns.equals("")) { //$NON-NLS-1$\r
                        str.append(':');\r
                        str.append(ns);\r
                }\r
@@ -214,7 +214,7 @@ public class Utils {
 \r
                // format time from nanoseconds to calendar time HH:MM:SS\r
                String stime = stimeformat.format(new Date((long) (time * 1E-6)));\r
-               str.append(stime + " ");\r
+               str.append(stime + " "); //$NON-NLS-1$\r
                // append the Milliseconds, MicroSeconds and NanoSeconds as specified in\r
                // the Resolution\r
                str.append(formatNs(time, res));\r
@@ -262,21 +262,21 @@ public class Utils {
                long ns = time;\r
                ns %= 1000000000;\r
                if (ns < 10) {\r
-                       temp.append("00000000");\r
+                       temp.append("00000000"); //$NON-NLS-1$\r
                } else if (ns < 100) {\r
-                       temp.append("0000000");\r
+                       temp.append("0000000"); //$NON-NLS-1$\r
                } else if (ns < 1000) {\r
-                       temp.append("000000");\r
+                       temp.append("000000"); //$NON-NLS-1$\r
                } else if (ns < 10000) {\r
-                       temp.append("00000");\r
+                       temp.append("00000"); //$NON-NLS-1$\r
                } else if (ns < 100000) {\r
-                       temp.append("0000");\r
+                       temp.append("0000"); //$NON-NLS-1$\r
                } else if (ns < 1000000) {\r
-                       temp.append("000");\r
+                       temp.append("000"); //$NON-NLS-1$\r
                } else if (ns < 10000000) {\r
-                       temp.append("00");\r
+                       temp.append("00"); //$NON-NLS-1$\r
                } else if (ns < 100000000) {\r
-                       temp.append("0");\r
+                       temp.append("0"); //$NON-NLS-1$\r
                }\r
                temp.append(ns);\r
 \r
@@ -287,12 +287,12 @@ public class Utils {
                }\r
                if (segments > 1) {\r
                        // append Micro secs\r
-                       str.append(".");\r
+                       str.append("."); //$NON-NLS-1$\r
                        str.append(temp.substring(3, 6));\r
                }\r
                if (segments > 2) {\r
                        // append Nano seconds\r
-                       str.append(".");\r
+                       str.append("."); //$NON-NLS-1$\r
                        str.append(temp.substring(6));\r
                }\r
 \r
@@ -410,13 +410,13 @@ public class Utils {
                if (pos >= 0) {\r
                        String ret = sig.substring(0, pos);\r
                        sig = sig.substring(pos);\r
-                       sig = sig + " " + ret;\r
+                       sig = sig + " " + ret; //$NON-NLS-1$\r
                }\r
                return sig;\r
        }\r
 \r
        static public String restoreMethodSignature(String sig) {\r
-               String ret = "";\r
+               String ret = ""; //$NON-NLS-1$\r
                int pos = sig.indexOf('(');\r
                if (pos >= 0) {\r
                        ret = sig.substring(0, pos);\r
@@ -426,15 +426,15 @@ public class Utils {
                if (pos >= 0) {\r
                        sig = sig.substring(0, pos);\r
                }\r
-               String args[] = sig.split(",");\r
-               sig = "(";\r
+               String args[] = sig.split(","); //$NON-NLS-1$\r
+               sig = "("; //$NON-NLS-1$\r
                for (int i = 0; i < args.length; i++) {\r
                        String arg = args[i].trim();\r
                        if (arg.length() == 0 && args.length == 1)\r
                                break;\r
                        sig += getTypeSignature(arg);\r
                }\r
-               sig += ")" + getTypeSignature(ret);\r
+               sig += ")" + getTypeSignature(ret); //$NON-NLS-1$\r
                return sig;\r
        }\r
 \r
@@ -447,29 +447,29 @@ public class Utils {
                int pos = type.indexOf('[');\r
                if (pos >= 0)\r
                        type = type.substring(0, pos);\r
-               String sig = "";\r
+               String sig = "";                //$NON-NLS-1$\r
                for (int j = 0; j < dim; j++)\r
-                       sig += "[";\r
-               if (type.equals("boolean"))\r
-                       sig += "Z";\r
-               else if (type.equals("byte"))\r
-                       sig += "B";\r
-               else if (type.equals("char"))\r
-                       sig += "C";\r
-               else if (type.equals("short"))\r
-                       sig += "S";\r
-               else if (type.equals("int"))\r
-                       sig += "I";\r
-               else if (type.equals("long"))\r
-                       sig += "J";\r
-               else if (type.equals("float"))\r
-                       sig += "F";\r
-               else if (type.equals("double"))\r
-                       sig += "D";\r
-               else if (type.equals("void"))\r
-                       sig += "V";\r
+                       sig += "[";                 //$NON-NLS-1$\r
+               if (type.equals("boolean"))     //$NON-NLS-1$\r
+                       sig += "Z";                 //$NON-NLS-1$\r
+               else if (type.equals("byte"))   //$NON-NLS-1$\r
+                       sig += "B";                 //$NON-NLS-1$\r
+               else if (type.equals("char"))   //$NON-NLS-1$\r
+                       sig += "C";                 //$NON-NLS-1$\r
+               else if (type.equals("short"))  //$NON-NLS-1$\r
+                       sig += "S";                 //$NON-NLS-1$\r
+               else if (type.equals("int"))    //$NON-NLS-1$\r
+                       sig += "I";                 //$NON-NLS-1$\r
+               else if (type.equals("long"))   //$NON-NLS-1$\r
+                       sig += "J";                 //$NON-NLS-1$\r
+               else if (type.equals("float"))  //$NON-NLS-1$\r
+                       sig += "F";                 //$NON-NLS-1$\r
+               else if (type.equals("double")) //$NON-NLS-1$\r
+                       sig += "D";                 //$NON-NLS-1$\r
+               else if (type.equals("void"))   //$NON-NLS-1$\r
+                       sig += "V";                 //$NON-NLS-1$\r
                else\r
-                       sig += "L" + type.replace('.', '/') + ";";\r
+                       sig += "L" + type.replace('.', '/') + ";"; //$NON-NLS-1$ //$NON-NLS-2$\r
                return sig;\r
        }\r
 \r
This page took 0.027859 seconds and 5 git commands to generate.