Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix raw type warnings #3184

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions import/index_java/src/org/vufind/index/CreatorTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public Set<String> getValidRelators(DataField authorField,
}
} else {
// If we got this far, we need to figure out what type of relation they have
List permittedRoles = normalizeRelatorStringList(Arrays.asList(loadRelatorConfig(relatorConfig)));
List<String> permittedRoles = normalizeRelatorStringList(Arrays.asList(loadRelatorConfig(relatorConfig)));
relators.addAll(getValidRelatorsFromSubfields(subfieldE, permittedRoles, indexRawRelators.toLowerCase().equals("true")));
relators.addAll(getValidRelatorsFromSubfields(subfield4, permittedRoles, indexRawRelators.toLowerCase().equals("true")));
if (Arrays.asList(unknownRelatorAllowed).contains(tag)) {
Expand Down Expand Up @@ -422,11 +422,11 @@ public String getFirstAuthorFilteredByRelator(Record record, String tagList,
* @param firstOnly Return first result only?
* @return List result
*/
public List getRelatorsFilteredByRelator(Record record, String tagList,
public List<String> getRelatorsFilteredByRelator(Record record, String tagList,
String acceptWithoutRelator, String relatorConfig,
String acceptUnknownRelators, String indexRawRelators, Boolean firstOnly
) {
List result = new LinkedList();
List<String> result = new LinkedList<String>();
String[] noRelatorAllowed = acceptWithoutRelator.split(":");
String[] unknownRelatorAllowed = acceptUnknownRelators.split(":");
HashMap<String, Set<String>> parsedTagList = FieldSpecTools.getParsedTagList(tagList);
Expand Down Expand Up @@ -455,7 +455,7 @@ public List getRelatorsFilteredByRelator(Record record, String tagList,
* in the MARC or "false" to index mapped versions.
* @return List result
*/
public List getRelatorsFilteredByRelator(Record record, String tagList,
public List<String> getRelatorsFilteredByRelator(Record record, String tagList,
String acceptWithoutRelator, String relatorConfig,
String acceptUnknownRelators, String indexRawRelators
) {
Expand All @@ -481,7 +481,7 @@ public List getRelatorsFilteredByRelator(Record record, String tagList,
* should be indexed even if they are not listed in author-classification.ini.
* @return List result
*/
public List getRelatorsFilteredByRelator(Record record, String tagList,
public List<String> getRelatorsFilteredByRelator(Record record, String tagList,
String acceptWithoutRelator, String relatorConfig,
String acceptUnknownRelators
) {
Expand All @@ -505,7 +505,7 @@ public List getRelatorsFilteredByRelator(Record record, String tagList,
* defines which relator terms are acceptable (or a colon-delimited list)
* @return List result
*/
public List getRelatorsFilteredByRelator(Record record, String tagList,
public List<String> getRelatorsFilteredByRelator(Record record, String tagList,
String acceptWithoutRelator, String relatorConfig
) {
// default firstOnly to false!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ protected String getFormatFrom007(char formatCode, String formatString) {
* @param List formatCodes007
* @return String
*/
protected String getFormatFromBibLevel(Record record, char recordType, char bibLevel, ControlField marc008, boolean couldBeBook, List formatCodes007) {
protected String getFormatFromBibLevel(Record record, char recordType, char bibLevel, ControlField marc008, boolean couldBeBook, List<Character> formatCodes007) {
switch (bibLevel) {
// Component parts
case 'a':
Expand Down
12 changes: 6 additions & 6 deletions import/index_java/src/org/vufind/index/GeoTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public List<String> getDisplayCoordinates(Record record) {
* @param HashMap coords
* @param String error message
*/
public static void logErrorMessage(Record record, HashMap coords, String message) {
public static void logErrorMessage(Record record, HashMap<Character, String> coords, String message) {
// Initialize error logging variables
String msgError = message;
String recNum = "Not available";
Expand Down Expand Up @@ -213,7 +213,7 @@ public static String getLogPath() {
*/
protected HashMap<Character, String> getCoordinateValues(VariableField vf) {
DataField df = (DataField) vf;
HashMap<Character, String> coords = new HashMap();
HashMap<Character, String> coords = new HashMap<Character, String>();
for (char code = 'd'; code <= 'g'; code++) {
Subfield subfield = df.getSubfield(code);
if (subfield != null) {
Expand All @@ -231,7 +231,7 @@ protected HashMap<Character, String> getCoordinateValues(VariableField vf) {
* @param HashMap coords
* @return HashMap full_coords
*/
protected HashMap<Character, String> fillEmptyPointCoordinates(HashMap coords) {
protected HashMap<Character, String> fillEmptyPointCoordinates(HashMap<Character, String> coords) {
HashMap<Character, String> full_coords = coords;
if (coords.containsKey('d') && !coords.containsKey('e') && coords.containsKey('f') && !coords.containsKey('g')) {
full_coords.put('e', coords.get('d').toString());
Expand All @@ -251,7 +251,7 @@ protected HashMap<Character, String> fillEmptyPointCoordinates(HashMap coords) {
* @param HashMap coords
* @return boolean
*/
protected boolean validateCoordinateValues(Record record, HashMap coords) {
protected boolean validateCoordinateValues(Record record, HashMap<Character, String> coords) {
if (coords.containsKey('d') && coords.containsKey('e') && coords.containsKey('f') && coords.containsKey('g')) {
return true;
}
Expand Down Expand Up @@ -493,8 +493,8 @@ public boolean validateCoordinateDistance(Record record, Double west, Double eas
* @param Double west, east, north, south
* @return HashMap coords
*/
public HashMap buildCoordinateHashMap (Double west, Double east, Double north, Double south) {
HashMap<Character, String> coords = new HashMap();
public HashMap<Character, String> buildCoordinateHashMap (Double west, Double east, Double north, Double south) {
HashMap<Character, String> coords = new HashMap<Character, String>();
coords.put('d', Double.toString(west));
coords.put('e', Double.toString(east));
coords.put('f', Double.toString(north));
Expand Down
6 changes: 3 additions & 3 deletions import/index_java/src/org/vufind/index/LccnTools.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ public String getNormalizedLCCN(String lccn) {
* @param fieldSpec
* @return Set of normalized LCCNs
*/
public Set getNormalizedLCCNs(Record record, String fieldSpec) {
public Set<String> getNormalizedLCCNs(Record record, String fieldSpec) {
// Initialize return value:
Set result = new LinkedHashSet();
Set<String> result = new LinkedHashSet<String>();

// Loop through relevant fields and normalize everything:
for (String raw : SolrIndexer.instance().getFieldList(record, fieldSpec)) {
Expand All @@ -84,7 +84,7 @@ public Set getNormalizedLCCNs(Record record, String fieldSpec) {
* @param record
* @return Set of normalized LCCNs
*/
public Set getNormalizedLCCNs(Record record) {
public Set<String> getNormalizedLCCNs(Record record) {
// Send in a default fieldSpec if none was provided by the user:
return getNormalizedLCCNs(record, "010a");
}
Expand Down