Skip to content
Snippets Groups Projects
Unverified Commit 2327c7c2 authored by Jayaram Sreevalsan's avatar Jayaram Sreevalsan Committed by GitHub
Browse files

Merge pull request #2854 from APriestman/sonarqube_aug18

Sonarqube
parents 244002e3 26d4737a
Branches
Tags
No related merge requests found
......@@ -295,7 +295,7 @@ public List<DataSource> getDataSourcesForHost(Host host) throws TskCoreException
return dataSources;
} catch (SQLException | TskDataException ex) {
throw new TskCoreException(String.format("Error getting data sources for host " + host.getName()), ex);
throw new TskCoreException(String.format("Error getting data sources for host %s", host.getName()), ex);
} finally {
db.releaseSingleUserCaseReadLock();
}
......
......@@ -117,7 +117,7 @@ public class SlackFile extends FsContent {
*/
@Override
@SuppressWarnings("deprecation")
protected int readInt(byte[] buf, long offset, long len) throws TskCoreException {
protected synchronized int readInt(byte[] buf, long offset, long len) throws TskCoreException {
if (offset == 0 && size == 0) {
//special case for 0-size file
return 0;
......
......@@ -10090,16 +10090,16 @@ public void setImagePaths(long obj_id, List<String> paths) throws TskCoreExcepti
* within tsk core and the update fails
*/
@Beta
public void setImagePaths(long obj_id, List<String> paths, CaseDbTransaction trans) throws TskCoreException {
public void setImagePaths(long objId, List<String> paths, CaseDbTransaction trans) throws TskCoreException {
try {
PreparedStatement statement = trans.getConnection().getPreparedStatement(PREPARED_STATEMENT.DELETE_IMAGE_NAME);
statement.clearParameters();
statement.setLong(1, obj_id);
statement.setLong(1, objId);
trans.getConnection().executeUpdate(statement);
for (int i = 0; i < paths.size(); i++) {
statement = trans.getConnection().getPreparedStatement(PREPARED_STATEMENT.INSERT_IMAGE_NAME);
statement.clearParameters();
statement.setLong(1, obj_id);
statement.setLong(1, objId);
statement.setString(2, paths.get(i));
statement.setLong(3, i);
trans.getConnection().executeUpdate(statement);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment