Skip to content

Commit a3914f3

Browse files
committed
fix spotbug and sonar most important issues
1 parent af37313 commit a3914f3

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/internal/LargeSNSMessageProcessor.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
public class LargeSNSMessageProcessor extends LargeMessageProcessor<SNSRecord> {
1010

11-
public LargeSNSMessageProcessor() {
12-
}
13-
1411
@Override
1512
protected String getMessageId(SNSRecord message) {
1613
return message.getSNS().getMessageId();

powertools-large-messages/src/main/java/software/amazon/lambda/powertools/largemessages/internal/LargeSQSMessageProcessor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ public class LargeSQSMessageProcessor extends LargeMessageProcessor<SQSMessage>
2727
private static final byte STRING_LIST_TYPE_FIELD_INDEX = 3;
2828
private static final byte BINARY_LIST_TYPE_FIELD_INDEX = 4;
2929

30-
public LargeSQSMessageProcessor() {
31-
}
32-
3330
@Override
3431
protected String getMessageId(SQSMessage message) {
3532
return message.getMessageId();
@@ -91,6 +88,7 @@ static Optional<String> calculateMessageBodyMd5(String messageBody) {
9188
* @param messageAttributes attributes of the SQS Message
9289
* @return the MD5 digest of the SQS Message attributes (or empty in case of error)
9390
*/
91+
@SuppressWarnings("squid:S4790") // MD5 algorithm is used by SQS, we must use MD5
9492
static Optional<String> calculateMessageAttributesMd5(final Map<String, MessageAttribute> messageAttributes) {
9593
List<String> sortedAttributeNames = new ArrayList<>(messageAttributes.keySet());
9694
Collections.sort(sortedAttributeNames);

spotbugs-exclude.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
<Class name="software.amazon.lambda.powertools.idempotency.Idempotency"/>
3737
<Method name="getConfig"/>
3838
</And>
39+
<And>
40+
<Class name="software.amazon.lambda.powertools.largemessages.LargeMessageConfig"/>
41+
<Method name="getS3Client"/>
42+
</And>
3943
</Or>
4044
</Match>
4145
<Match>
@@ -93,6 +97,10 @@
9397
<Class name="software.amazon.lambda.powertools.utilities.EventDeserializer$EventPart"/>
9498
<Field name="contentList"/>
9599
</And>
100+
<And>
101+
<Class name="software.amazon.lambda.powertools.largemessages.LargeMessageConfig"/>
102+
<Method name="s3Client"/>
103+
</And>
96104
</Or>
97105
</Match>
98106
<!--Functionally needed-->

0 commit comments

Comments
 (0)