Changeset 35665


Ignore:
Timestamp:
2021-10-21T19:57:30+13:00 (3 years ago)
Author:
davidb
Message:

Calling things like new Boolean(false) and new Integer(100) has been depreated in favour of Boolean.valueOf(false) and Integer.valueOf(100). This set of code commits reflects the necessary coding changes to the valueOf() form, which the JDK developers specify is a more efficient way to achieve the same thing

Location:
main/trunk/gli/src/org/greenstone/gatherer
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/cdm/DOMProxyListModel.java

    r18608 r35665  
    209209        }
    210210       
    211         Object object = cache.get (new Integer (index));
     211        Object object = cache.get (Integer.valueOf(index));
    212212        if (object != null) {
    213213            return object;
     
    223223        // Now wrap it in the object of the users choice
    224224        object = class_type.create (element);
    225         cache.put (new Integer (index), object);
     225        cache.put (Integer.valueOf(index), object);
    226226        return object;
    227227    }
  • main/trunk/gli/src/org/greenstone/gatherer/download/DownloadProgressBar.java

    r31720 r35665  
    348348        else {
    349349            // Assign a new progress bar of length expected content length.
    350             progress = new JProgressBar(0, (new Long(expected)).intValue());
     350            progress = new JProgressBar(0, (Long.valueOf(expected)).intValue());
    351351        }
    352352        progress.setEnabled(true);
     
    358358        // update percent complete.
    359359        else if (expected != 0) {
    360         progress.setValue((new Long(file_size)).intValue());
    361         int p_c = (new Double(progress.getPercentComplete() * 100)).intValue();
     360        progress.setValue((Long.valueOf(file_size)).intValue());
     361        int p_c = (Double.valueOf(progress.getPercentComplete() * 100)).intValue();
    362362        progress.setString(p_c + "%");
    363363        progress.setStringPainted(true);
  • main/trunk/gli/src/org/greenstone/gatherer/feedback/Movie.java

    r25158 r35665  
    171171        NumberFormatter formatter;
    172172    formatter = new NumberFormatter(numberFormat);
    173         formatter.setMinimum(new Integer(FPS_MIN));
    174         formatter.setMaximum(new Integer(FPS_MAX));
     173        formatter.setMinimum(Integer.valueOf(FPS_MIN));
     174        formatter.setMaximum(Integer.valueOf(FPS_MAX));
    175175
    176176        textField = new JFormattedTextField(formatter);
    177177    textField.setBackground(new Color(224,240,224));
    178         textField.setValue(new Integer(FPS_INIT));
     178        textField.setValue(Integer.valueOf(FPS_INIT));
    179179        textField.setColumns(5);
    180180        textField.addPropertyChangeListener(this);
     
    267267        if (!source.getValueIsAdjusting())
    268268        {
    269         textField.setValue(new Integer(fps));
     269        textField.setValue(Integer.valueOf(fps));
    270270        if (fps == 0)
    271271            {
  • main/trunk/gli/src/org/greenstone/gatherer/gems/MetadataSetModel.java

    r12837 r35665  
    9292    public void valueChanged(){
    9393        setChanged();
    94     notifyObservers(new Boolean(false));
     94    notifyObservers(Boolean.valueOf(false));
    9595    clearChanged();
    9696    }
  • main/trunk/gli/src/org/greenstone/gatherer/gui/Preferences.java

    r34115 r35665  
    581581    String port_value = Configuration.getString("general."+protocol+"_proxy_port", true);
    582582    if(port_value.length() > 0) {
    583        proxy_port_field = new JSpinner(new SpinnerNumberModel((new Integer(port_value)).intValue(), 0, 65535, 1));
     583       proxy_port_field = new JSpinner(new SpinnerNumberModel((Integer.valueOf(port_value)).intValue(), 0, 65535, 1));
    584584    }
    585585    else {
  • main/trunk/gli/src/org/greenstone/gatherer/gui/tree/DragTree.java

    r12045 r35665  
    7070    // For some reason these aren't set with Java 1.4.2 and the GTK look and feel?
    7171    if (UIManager.get("Tree.leftChildIndent") == null) {
    72         UIManager.put("Tree.leftChildIndent", new Integer(7));
     72        UIManager.put("Tree.leftChildIndent", Integer.valueOf(7));
    7373    }
    7474    if (UIManager.get("Tree.rightChildIndent") == null) {
    75         UIManager.put("Tree.rightChildIndent", new Integer(13));
     75        UIManager.put("Tree.rightChildIndent", Integer.valueOf(13));
    7676    }
    7777
  • main/trunk/gli/src/org/greenstone/gatherer/metadata/DocXMLFile.java

    r34510 r35665  
    321321            source_file_name_to_description_elements_mapping.put(gsdlsourcefilename_value, new ArrayList());
    322322        }
    323         ((ArrayList) source_file_name_to_description_elements_mapping.get(gsdlsourcefilename_value)).add(new Integer(description_element_start_gsdlsourcefilename_value));     
     323        ((ArrayList) source_file_name_to_description_elements_mapping.get(gsdlsourcefilename_value)).add(Integer.valueOf(description_element_start_gsdlsourcefilename_value));     
    324324       
    325325        // Next, if Windows, check if dealing with Win 8.3 Short Filename
  • main/trunk/gli/src/org/greenstone/gatherer/util/SafeProcess.java

    r35637 r35665  
    10771077        } else {
    10781078        long child_pid = sc.nextLong();
    1079         subprocs.push(new Long(child_pid));         
     1079        subprocs.push(Long.valueOf(child_pid));         
    10801080        }
    10811081    }
Note: See TracChangeset for help on using the changeset viewer.