Skip to content

Commit 22fdc13

Browse files
committed
GH-1951: Fix Sonar Issues
1 parent 43c5671 commit 22fdc13

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-kafka/src/main/java/org/springframework/kafka/annotation/KafkaListenerAnnotationBeanPostProcessor.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1194,11 +1194,11 @@ public Set<ConvertiblePair> getConvertibleTypes() {
11941194
public Object convert(@Nullable Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {
11951195
byte[] bytes = (byte[]) source;
11961196
if (targetType.getType().equals(long.class) || targetType.getType().equals(Long.class)) {
1197-
Assert.state(bytes.length >= 8, "At least 8 bytes needed to convert a byte[] to a long");
1197+
Assert.state(bytes.length >= 8, "At least 8 bytes needed to convert a byte[] to a long"); // NOSONAR
11981198
return ByteBuffer.wrap(bytes).getLong();
11991199
}
12001200
else if (targetType.getType().equals(int.class) || targetType.getType().equals(Integer.class)) {
1201-
Assert.state(bytes.length >= 4, "At least 4 bytes needed to convert a byte[] to an integer");
1201+
Assert.state(bytes.length >= 4, "At least 4 bytes needed to convert a byte[] to an integer"); // NOSONAR
12021202
return ByteBuffer.wrap(bytes).getInt();
12031203
}
12041204
else if (targetType.getType().equals(short.class) || targetType.getType().equals(Short.class)) {
@@ -1216,7 +1216,7 @@ else if (targetType.getType().equals(byte.class) || targetType.getType().equals(
12161216
public boolean matches(TypeDescriptor sourceType, TypeDescriptor targetType) {
12171217
if (sourceType.getType().equals(byte[].class)) {
12181218
Class<?> target = targetType.getType();
1219-
return target.equals(long.class) || target.equals(int.class) || target.equals(short.class)
1219+
return target.equals(long.class) || target.equals(int.class) || target.equals(short.class) // NOSONAR
12201220
|| target.equals(byte.class) || target.equals(Long.class) || target.equals(Integer.class)
12211221
|| target.equals(Short.class) || target.equals(Byte.class);
12221222
}

0 commit comments

Comments
 (0)