Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6370438

patches to stop compiler warnings

XMLWordPrintable

    • b86
    • generic, x86
    • generic, windows_xp

      A DESCRIPTION OF THE FIX :
      No BUG ID.

      FILES affected:
      java.util.regex.Pattern
      java.util.regex.PatternSyntaxException

      These are patches to stop compiler warnings being emitted from these two. Pattern is still emitting them for a possible case fall through error. These do not appear to be errors so these appear not to be removable.

      unified diffs:
      --- /home/nstuff/java6/jdk1.6.0/java/util/regex/Pattern.java Thu Dec 15 02:17:09 2005
      +++ /home/javarefs/java/util/regex/Pattern.java Thu Jan 5 17:34:54 2006
      @@ -989,7 +989,7 @@
           public String[] split(CharSequence input, int limit) {
               int index = 0;
               boolean matchLimited = limit > 0;
      - ArrayList matchList = new ArrayList();
      + ArrayList<String> matchList = new ArrayList<String>();
               Matcher m = matcher(input);
       
               // Add segments before each match found
      @@ -1020,7 +1020,7 @@
                   while (resultSize > 0 && matchList.get(resultSize-1).equals(""))
                       resultSize--;
               String[] result = new String[resultSize];
      - return (String[])matchList.subList(0, resultSize).toArray(result);
      + return matchList.subList(0, resultSize).toArray(result);
           }
       
           /**


      --- /home/nstuff/java6/jdk1.6.0/java/util/regex/PatternSyntaxException.java Thu Dec 15 02:17:09 2005
      +++ /home/javarefs/java/util/regex/PatternSyntaxException.java Thu Jan 5 17:38:04 2006
      @@ -23,7 +23,8 @@
       public class PatternSyntaxException
           extends IllegalArgumentException
       {
      -
      +
      + static final long serialVersionUID = -3864639126226059218L;
           private final String desc;
           private final String pattern;
           private final int index;
      @@ -78,7 +79,7 @@
           private static String nl;
       
           static {
      - nl = (String)java.security.AccessController
      + nl = java.security.AccessController
        .doPrivileged(new GetPropertyAction("line.separator"));
           }
       


      JUnit TESTCASE :
      the compiler I am assuming is the test. These changes were driven by warnings that is was emitting.



      FIX FOR BUG NUMBER:
      NONE --> these are patches to stop compiler warnings

            sherman Xueming Shen
            tbell Tim Bell
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: