diff graal/com.oracle.max.criutils/src/com/oracle/max/criutils/HexCodeFile.java @ 4142:bc8527f3071c

Adjust code base to new level of warnings.
author Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
date Sun, 18 Dec 2011 05:24:06 +0100
parents e233f5660da4
children aaac4894175c
line wrap: on
line diff
--- a/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/HexCodeFile.java	Sun Dec 18 05:23:52 2011 +0100
+++ b/graal/com.oracle.max.criutils/src/com/oracle/max/criutils/HexCodeFile.java	Sun Dec 18 05:24:06 2011 +0100
@@ -110,18 +110,18 @@
     /**
      * Map from a machine code position to a list of comments for the position.
      */
-    public final Map<Integer, List<String>> comments = new TreeMap<Integer, List<String>>();
+    public final Map<Integer, List<String>> comments = new TreeMap<>();
 
     /**
      * Map from a machine code position to a comment for the operands of the instruction at the position.
      */
-    public final Map<Integer, String> operandComments = new TreeMap<Integer, String>();
+    public final Map<Integer, String> operandComments = new TreeMap<>();
 
     public final byte[] code;
 
-    public final ArrayList<JumpTable> jumpTables = new ArrayList<JumpTable>();
+    public final ArrayList<JumpTable> jumpTables = new ArrayList<>();
 
-    public final ArrayList<LookupTable> lookupTables = new ArrayList<LookupTable>();
+    public final ArrayList<LookupTable> lookupTables = new ArrayList<>();
 
     public final String isa;
 
@@ -205,7 +205,7 @@
     public void addComment(int pos, String comment) {
         List<String> list = comments.get(pos);
         if (list == null) {
-            list = new ArrayList<String>();
+            list = new ArrayList<>();
             comments.put(pos, list);
         }
         list.add(encodeString(comment));
@@ -246,10 +246,11 @@
      */
     public static String encodeString(String s) {
         int index;
-        while ((index = s.indexOf(SECTION_DELIM)) != -1) {
-            s = s.substring(0, index) + " < |@" + s.substring(index + SECTION_DELIM.length());
+        String result = s;
+        while ((index = result.indexOf(SECTION_DELIM)) != -1) {
+            result = result.substring(0, index) + " < |@" + result.substring(index + SECTION_DELIM.length());
         }
-        return s;
+        return result;
     }
 
     /**