Skip to content

Commit

Permalink
[SONAR]
Browse files Browse the repository at this point in the history
  • Loading branch information
kerny3d committed Aug 9, 2024
1 parent 5ecd043 commit ea7fbe3
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package it.eng.knowage.commons.zip;

import java.io.File;
import java.io.FileOutputStream;
import java.util.Enumeration;
import java.util.zip.ZipEntry;
import java.util.zip.ZipFile;
Expand All @@ -10,9 +9,7 @@
import org.apache.logging.log4j.Logger;

import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

public class SonarZipCommons {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
import javax.activation.DataHandler;
import javax.activation.FileDataSource;

import org.apache.commons.compress.archivers.zip.ZipFile;
import org.apache.commons.io.IOUtils;
import org.apache.log4j.LogMF;
import org.apache.log4j.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ private void calculateDatasets(String dataset, String fromAssociation, String fi
distinctValues.add(rs.getString(columnName));
}
Set<String> baseSet = associationValues.get(association);
Set<String> intersection = new HashSet<String>(CollectionUtils.intersection(baseSet, distinctValues));
Set<String> intersection = new HashSet<>(CollectionUtils.intersection(baseSet, distinctValues));
if (!intersection.equals(baseSet)) {
associationValues.put(association, intersection);
String inClauseValues = "'" + StringUtils.join(associationValues.get(association).iterator(), "','") + "'";
Expand Down Expand Up @@ -204,7 +204,7 @@ private void createStartingSets() throws Exception {
while (rs_d2.next()) {
gender_d3.add(rs_d2.getString("gender"));
}
Set<String> gender_intersection = new HashSet<String>(CollectionUtils.intersection(gender_d1, gender_d3));
Set<String> gender_intersection = new HashSet<>(CollectionUtils.intersection(gender_d1, gender_d3));
associationValues.put("GENDER", gender_intersection);
// -------------------------------------------------

Expand All @@ -220,7 +220,7 @@ private void createStartingSets() throws Exception {
while (rs_d3.next()) {
education_d3.add(rs_d3.getString("education"));
}
Set<String> education_intersection = new HashSet<String>(CollectionUtils.intersection(education_d1, education_d3));
Set<String> education_intersection = new HashSet<>(CollectionUtils.intersection(education_d1, education_d3));
associationValues.put("EDUCATION", education_intersection);
// -------------------------------------------------

Expand All @@ -236,7 +236,7 @@ private void createStartingSets() throws Exception {
while (rs_d3.next()) {
state_d3.add(rs_d3.getString("state_province"));
}
Set<String> state_intersection = new HashSet<String>(CollectionUtils.intersection(state_d1, state_d3));
Set<String> state_intersection = new HashSet<>(CollectionUtils.intersection(state_d1, state_d3));
associationValues.put("STATE", state_intersection);
// -------------------------------------------------
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ public Integer countSbiDataSet(String search, Integer[] ids) throws EMFUserError
Query hqlQuery = aSession.createQuery(hql);
hqlQuery.setParameter("search", "%" + search + "%");
Long temp = (Long) hqlQuery.uniqueResult();
resultNumber = Integer.valueOf(temp.intValue());
resultNumber = temp.intValue();

} catch (HibernateException he) {
logger.error("Error while loading the list of SbiDataSet", he);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
import com.jamonapi.Monitor;
import com.jamonapi.MonitorFactory;

import it.eng.spago.error.EMFUserError;
import it.eng.spagobi.tools.dataset.common.datareader.IDataReader;
import it.eng.spagobi.tools.dataset.common.datastore.IDataStore;
import it.eng.spagobi.tools.dataset.metasql.query.DatabaseDialect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
package it.eng.spagobi.tools.dataset.common.dataproxy;

import org.apache.jena.query.QueryExecution;
import org.apache.jena.query.QueryExecutionFactory;
import org.apache.jena.sparql.exec.http.QueryExecutionHTTP;
import org.apache.jena.query.ResultSet;
import org.apache.log4j.Logger;
Expand Down

0 comments on commit ea7fbe3

Please sign in to comment.