Ignore:
Timestamp:
2012-05-22T13:01:04+12:00 (12 years ago)
Author:
sjm84
Message:

Fixing Greenstone 3's use (or lack thereof) of generics, this was done automatically so we may want to change it over time. This change will also auto-format any files that have not already been formatted.

Location:
main/trunk/greenstone3/src/java/org/greenstone/util
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/util/Configuration.java

    r22085 r25635  
    4242public class Configuration {
    4343   
    44     static private Hashtable hash = null;
     44    static private Hashtable<String, String> hash = null;
    4545
    4646    /** The first of three patterns used during tokenization, this pattern handles a comma separated list. */
     
    5353    public Configuration() {
    5454   
    55     hash = new Hashtable();
     55    hash = new Hashtable<String, String>();
    5656   
    5757   
     
    7676    /** Retrieve whether the named property is set or not */
    7777    static public boolean get(String property) {
    78     String value = (String)hash.get(property);
     78    String value = hash.get(property);
    7979    return (value != null && value.equalsIgnoreCase("true"));
    8080    }
     
    8282    /** Retrieve the value of the named property as a String */
    8383    static public String getString(String property) {
    84     return (String)hash.get(property);
     84    return hash.get(property);
    8585    }
    8686
     
    8989    Locale result = Locale.getDefault();
    9090    try {
    91         String raw = (String) hash.get(property);
     91        String raw = hash.get(property);
    9292        if (raw==null) {
    9393        return result;
     
    113113    static public Color getColor(String property) {
    114114    Color result = Color.white; // Default
    115     String raw = (String)hash.get(property);
     115    String raw = hash.get(property);
    116116    if (raw == null || raw.equals("")) {
    117117        return result;
  • main/trunk/greenstone3/src/java/org/greenstone/util/ScriptReadWrite.java

    r22085 r25635  
    1515    }
    1616
    17     public ArrayList readInFile(File file) {
     17    public ArrayList<String> readInFile(File file) {
    1818    try {
    19         ArrayList fileLines = new ArrayList();
     19        ArrayList<String> fileLines = new ArrayList<String>();
    2020        String oneLine = null;
    2121        BufferedReader bufferedReader = new BufferedReader(new FileReader(file));
     
    3131    }
    3232
    33     public void writeOutFile(File file, ArrayList fileLines_in) {
     33    public void writeOutFile(File file, ArrayList<String> fileLines_in) {
    3434    try {
    3535        PrintWriter printWriter = new PrintWriter(new BufferedWriter(new FileWriter(file)));
     
    4444    }
    4545
    46     public ArrayList queryReplace(ArrayList fileLines_ex, String param,
     46    public ArrayList<String> queryReplace(ArrayList<String> fileLines_ex, String param,
    4747                  String newValue) {
    4848    // only replace existing, don't append if param does not exist
     
    5252    // if the parameter exists, then a replace is performed, else the parameter-value
    5353    // is appended
    54     public ArrayList replaceOrAddLine(ArrayList fileLines_ex, String param, String newValue,
     54    public ArrayList<String> replaceOrAddLine(ArrayList<String> fileLines_ex, String param, String newValue,
    5555                      boolean replaceElseAdd)
    5656    {   
     
    6363
    6464    for (int i = 0; i < fileLines_ex.size(); i++) {
    65         oneLine = ((String) fileLines_ex.get(i)).trim();
     65        oneLine = fileLines_ex.get(i).trim();
    6666        // oneLine_length = oneLine.length();
    6767        StringTokenizer st = new StringTokenizer(oneLine, "=");
Note: See TracChangeset for help on using the changeset viewer.