Added sonar exceptions.
Signed-off-by: Kai Zimmermann <kai.zimmermann@bosch-si.com>
This commit is contained in:
@@ -236,6 +236,10 @@ public class DeviceSimulatorUpdater {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final File tempFile = File.createTempFile("uploadFile", null);
|
final File tempFile = File.createTempFile("uploadFile", null);
|
||||||
|
|
||||||
|
// Exception squid:S2070 - not used for hashing sensitive
|
||||||
|
// data
|
||||||
|
@SuppressWarnings("squid:S2070")
|
||||||
final MessageDigest md = MessageDigest.getInstance("SHA-1");
|
final MessageDigest md = MessageDigest.getInstance("SHA-1");
|
||||||
|
|
||||||
try (final DigestOutputStream dos = new DigestOutputStream(new FileOutputStream(tempFile), md)) {
|
try (final DigestOutputStream dos = new DigestOutputStream(new FileOutputStream(tempFile), md)) {
|
||||||
|
|||||||
@@ -205,6 +205,9 @@ public class ArtifactStore implements ArtifactRepository {
|
|||||||
throws NoSuchAlgorithmException, IOException {
|
throws NoSuchAlgorithmException, IOException {
|
||||||
String sha1Hash;
|
String sha1Hash;
|
||||||
// compute digest
|
// compute digest
|
||||||
|
// Exception squid:S2070 - not used for hashing sensitive
|
||||||
|
// data
|
||||||
|
@SuppressWarnings("squid:S2070")
|
||||||
final MessageDigest md = MessageDigest.getInstance("SHA-1");
|
final MessageDigest md = MessageDigest.getInstance("SHA-1");
|
||||||
try (final DigestOutputStream dos = new DigestOutputStream(os, md)) {
|
try (final DigestOutputStream dos = new DigestOutputStream(os, md)) {
|
||||||
ByteStreams.copy(stream, dos);
|
ByteStreams.copy(stream, dos);
|
||||||
|
|||||||
@@ -45,6 +45,8 @@ public class AfterTransactionCommitDefaultServiceExecutor extends TransactionSyn
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// Exception squid:S1217 - we want to run this synchronous
|
||||||
|
@SuppressWarnings("squid:S1217")
|
||||||
public void afterCommit(final Runnable runnable) {
|
public void afterCommit(final Runnable runnable) {
|
||||||
LOGGER.debug("Submitting new runnable {} to run after transaction commit", runnable);
|
LOGGER.debug("Submitting new runnable {} to run after transaction commit", runnable);
|
||||||
if (TransactionSynchronizationManager.isSynchronizationActive()) {
|
if (TransactionSynchronizationManager.isSynchronizationActive()) {
|
||||||
@@ -58,6 +60,7 @@ public class AfterTransactionCommitDefaultServiceExecutor extends TransactionSyn
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LOGGER.info("Transaction synchronization is NOT ACTIVE/ INACTIVE. Executing right now runnable {}", runnable);
|
LOGGER.info("Transaction synchronization is NOT ACTIVE/ INACTIVE. Executing right now runnable {}", runnable);
|
||||||
|
|
||||||
runnable.run();
|
runnable.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -68,6 +68,8 @@ public class JpaSoftwareModuleMetadata extends AbstractJpaMetaData implements So
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// exception squid:S2259 - obj is checked for null in super
|
||||||
|
@SuppressWarnings("squid:S2259")
|
||||||
public boolean equals(final Object obj) {
|
public boolean equals(final Object obj) {
|
||||||
if (!super.equals(obj)) {
|
if (!super.equals(obj)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ public class SystemSecurityContext {
|
|||||||
* the callable to call within the system security context
|
* the callable to call within the system security context
|
||||||
* @return the return value of the {@link Callable#call()} method.
|
* @return the return value of the {@link Callable#call()} method.
|
||||||
*/
|
*/
|
||||||
|
// Exception squid:S2221 - Callable declares Exception
|
||||||
|
@SuppressWarnings("squid:S2221")
|
||||||
public <T> T runAsSystem(final Callable<T> callable) {
|
public <T> T runAsSystem(final Callable<T> callable) {
|
||||||
final SecurityContext oldContext = SecurityContextHolder.getContext();
|
final SecurityContext oldContext = SecurityContextHolder.getContext();
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user