Changeset 35363 for main


Ignore:
Timestamp:
2021-09-11T14:11:31+12:00 (3 years ago)
Author:
kjdon
Message:

new Long(long) and new Integer(int) are deprecated. Use Integer.valueOf and Long.valueOf instead

Location:
main/trunk/greenstone3/src/java/org/greenstone/gsdl3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/action/DocumentAction.java

    r32546 r35363  
    14771477        if (phrase_query_term_variants_hierarchy.size() ==0) {
    14781478          for (int i = 0; i < word_matches.size(); i++) {
    1479             highlight_start_positions.add(new Integer(word_matches.get(i).start_position));
    1480             highlight_end_positions.add(new Integer(word_matches.get(i).end_position));
     1479            highlight_start_positions.add(Integer.valueOf(word_matches.get(i).start_position));
     1480            highlight_end_positions.add(Integer.valueOf(word_matches.get(i).end_position));
    14811481          }
    14821482        }
     
    15171517                            }
    15181518
    1519                             highlight_start_positions.add(new Integer(partial_phrase_match.start_position));
    1520                             highlight_end_positions.add(new Integer(word_match.end_position));
     1519                            highlight_start_positions.add(Integer.valueOf(partial_phrase_match.start_position));
     1520                            highlight_end_positions.add(Integer.valueOf(word_match.end_position));
    15211521                        }
    15221522                        // No, but add the partial match back into the list for next time
     
    15441544                    if (phrase_query_p_term_variants_list.size() == 1)
    15451545                    {
    1546                         highlight_start_positions.add(new Integer(word_match.start_position));
    1547                         highlight_end_positions.add(new Integer(word_match.end_position));
     1546                        highlight_start_positions.add(Integer.valueOf(word_match.start_position));
     1547                        highlight_end_positions.add(Integer.valueOf(word_match.end_position));
    15481548                    }
    15491549                    // Otherwise we have the start of a potential phrase match
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/core/OAIReceptionist.java

    r35225 r35363  
    7575    * NOTE: Being done with Integer instead of int because they're put into Vectors and they can only contain Objects not primitive data types.
    7676  */
    77   protected static final Integer DEACTIVATED = new Integer(0);
    78   protected static final Integer ACTIVE = new Integer(1);
     77  protected static final Integer DEACTIVATED = Integer.valueOf(0);
     78  protected static final Integer ACTIVE = Integer.valueOf(1);
    7979 
    8080  /** If this is true, then there are no OAI enabled collections, so can always return noRecordsMatch (after validating the request params) */
  • main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/OAIResumptionToken.java

    r31912 r35363  
    113113    data.put(OAIXML.METADATA_PREFIX, metadata_prefix);
    114114    stored_tokens.put(name, data);
    115     expiration_data.put(name, new Long(expiration));
     115    expiration_data.put(name, Long.valueOf(expiration));
    116116  }
    117117
     
    123123    stored_tokens.put(base_token_name, data);   
    124124    expiration_date += (OAIXML.getTokenExpiration());
    125     expiration_data.put(base_token_name, new Long(expiration_date));
     125    expiration_data.put(base_token_name, Long.valueOf(expiration_date));
    126126    String token_name = base_token_name+":" + cursor + ":" + current_set +":"+ current_cursor;
    127127    data.put(OAIXML.FROM, from);
Note: See TracChangeset for help on using the changeset viewer.