Skip to content

Commit

Permalink
Implement SonarCloud quality suggestions #159
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 8, 2023
1 parent 0e220bb commit d5e1df7
Showing 3 changed files with 6 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/main/java/de/gwdg/metadataqa/api/calculator/Indexer.java
Original file line number Diff line number Diff line change
@@ -42,9 +42,7 @@ public List<MetricResult> measure(Selector cache) {
resultMap.put(solrField.getSolrField(), values);
}
solrClient.indexMap(recordId, resultMap);
} catch (IOException e) {
e.printStackTrace();
} catch (SolrServerException e) {
} catch (IOException | SolrServerException e) {
e.printStackTrace();
} catch (Exception e) {
e.printStackTrace();
Original file line number Diff line number Diff line change
@@ -7,11 +7,12 @@
import de.gwdg.metadataqa.api.uniqueness.SolrConfiguration;
import org.apache.commons.lang3.StringUtils;

import java.io.Serializable;
import java.util.LinkedHashMap;
import java.util.Map;

public class MeasurementConfiguration {

public class MeasurementConfiguration implements Serializable {
private static final long serialVersionUID = 7754969792852694442L;
/**
* Flag whether or not the field extractor is enabled (default: false).
*/
Original file line number Diff line number Diff line change
@@ -183,9 +183,7 @@ public void indexMap(String id, Map<String, List<String>> objectMap) throws IOEx
public void commit() {
try {
solr.commit();
} catch (SolrServerException e) {
e.printStackTrace();
} catch (IOException e) {
} catch (SolrServerException | IOException e) {
e.printStackTrace();
}
}
@@ -194,9 +192,7 @@ public void commit() {
public void deleteAll() {
try {
solr.deleteByQuery("*:*");
} catch (SolrServerException e) {
e.printStackTrace();
} catch (IOException e) {
} catch (SolrServerException | IOException e) {
e.printStackTrace();
}
commit();

0 comments on commit d5e1df7

Please sign in to comment.