Changeset 5443 for trunk/utils


Ignore:
Timestamp:
09/06/09 23:21:35 (11 years ago)
Author:
curtis
Message:

Fix some Eclipse warnings.

Location:
trunk/utils
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/utils/CommentSurgery.java

    r5335 r5443  
    1717    // rather than actually changing the comment 
    1818    boolean test = args[0].equals("-test"); 
    19     int start = test ? 1 : 0; 
    2019 
    2120    for (int i=0; i<args.length; i++) { 
  • trunk/utils/DumpClass.java

    r3560 r5443  
    88public class DumpClass { 
    99 
     10  @SuppressWarnings("unchecked") 
    1011  public static void main(String[] args) throws Exception { 
    1112    for (int i=0; i<args.length; i++) { 
  • trunk/utils/LineLength.java

    r5062 r5443  
    44 
    55import java.io.*; 
     6import java.util.ArrayList; 
    67import java.util.Arrays; 
    7 import java.util.Vector; 
    88 
    99/** 
     
    2525    boolean checkTabs = true, checkEndSpaces = true; 
    2626    boolean lociHacks = false; 
    27     Vector v = new Vector(); 
     27    ArrayList<File> fileList = new ArrayList<File>(); 
    2828    for (int i=0; i<args.length; i++) { 
    2929      if (args[i].startsWith("-")) { 
     
    5151      File[] files = new File(dir).listFiles(new LineLength(args[i])); 
    5252      if (files != null) { 
    53         for (int j=0; j<files.length; j++) v.add(strip(files[j])); 
     53        for (int j=0; j<files.length; j++) fileList.add(strip(files[j])); 
    5454      } 
    5555    } 
     
    5959    String tabSpaces = new String(spaces); 
    6060 
    61     File[] files = new File[v.size()]; 
    62     v.copyInto(files); 
     61    File[] files = new File[fileList.size()]; 
     62    fileList.toArray(files); 
    6363    if (files.length == 0) { 
    6464      System.out.println("No matching files found."); 
  • trunk/utils/ReflectionPerformance.java

    r5332 r5443  
    3333    System.out.println(); 
    3434    System.out.println("--== Fast method benchmark, no args ==--"); 
    35     Class c = ReflectionPerformance.class; 
     35    Class<ReflectionPerformance> c = ReflectionPerformance.class; 
    3636    Method method = c.getMethod("fastMethod"); 
    3737 
     
    7373    System.out.println(); 
    7474    System.out.println("--== Fast method benchmark, w/ arg ==--"); 
    75     Class c = ReflectionPerformance.class; 
     75    Class<ReflectionPerformance> c = ReflectionPerformance.class; 
    7676    Method method = c.getMethod("fastMethod", int.class); 
    7777 
     
    116116    System.out.println(); 
    117117    System.out.println("--== Slow method benchmark, no args ==--"); 
    118     Class c = ReflectionPerformance.class; 
     118    Class<ReflectionPerformance> c = ReflectionPerformance.class; 
    119119    Method method = c.getMethod("slowMethod"); 
    120120 
     
    156156    System.out.println(); 
    157157    System.out.println("--== Slow method benchmark, w/ arg ==--"); 
    158     Class c = ReflectionPerformance.class; 
     158    Class<ReflectionPerformance> c = ReflectionPerformance.class; 
    159159    Method method = c.getMethod("slowMethod", int.class); 
    160160 
  • trunk/utils/SortList.java

    r1221 r5443  
    44 
    55import java.io.*; 
     6import java.util.ArrayList; 
    67import java.util.Arrays; 
    7 import java.util.Vector; 
    88 
    99/** Sorts a text file alphabetically, removing duplicates. */ 
     
    1313    boolean showDups = args[0].equals("-v"); 
    1414    String file = args[showDups ? 1 : 0]; 
    15     Vector v = new Vector(); 
     15    ArrayList<String> lineList = new ArrayList<String>(); 
    1616    BufferedReader fin = new BufferedReader(new FileReader(file)); 
    1717    while (true) { 
    1818      String line = fin.readLine(); 
    1919      if (line == null) break; 
    20       v.add(line); 
     20      lineList.add(line); 
    2121    } 
    2222    fin.close(); 
    23     String[] lines = new String[v.size()]; 
    24     v.copyInto(lines); 
     23    String[] lines = new String[lineList.size()]; 
     24    lineList.toArray(lines); 
    2525    Arrays.sort(lines); 
    2626    new File(file).renameTo(new File(file + ".old")); 
  • trunk/utils/SumPlanes.java

    r5217 r5443  
    4040    int w = images[0].getWidth(); 
    4141    int h = images[0].getHeight(); 
    42     int type = images[0].getType(); 
     42    //int type = images[0].getType(); 
    4343 
    4444    BufferedImage result = new BufferedImage(w, h, 
  • trunk/utils/TestMem.java

    r4679 r5443  
    33// 
    44 
    5 import java.awt.*; 
    65import java.awt.event.*; 
    76import javax.swing.*; 
     
    98 
    109/** A little GUI for testing Java memory behavior. */ 
     10@SuppressWarnings("serial") 
    1111public class TestMem extends JFrame implements ActionListener { 
    1212  private static final int MEM = 32 * 1024 * 1024; // 32 MB 
    1313 
     14  @SuppressWarnings("unused") 
    1415  private byte[] data; 
    1516  private JLabel memTotal, memMax, memFree, memUsed; 
  • trunk/utils/UniqueTraces.java

    r3122 r5443  
    44 
    55import java.io.*; 
    6 import java.util.Vector; 
     6import java.util.ArrayList; 
    77 
    88/** 
     
    1414  public static void main(String[] args) throws IOException { 
    1515    BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); 
    16     Vector traces = new Vector(); 
     16    ArrayList<String> traces = new ArrayList<String>(); 
    1717    StringBuffer buf = null; 
    1818    while (true) { 
     
    3535 
    3636    String[] traceStrings = new String[traces.size()]; 
    37     traces.copyInto(traceStrings); 
     37    traces.toArray(traceStrings); 
    3838 
    3939    for (int i=0; i<traceStrings.length; i++) { 
Note: See TracChangeset for help on using the changeset viewer.