Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@ val spotbugsVersion: String by project

subprojects {
val isKotlinProject = project.name.contains("kotlin") || project.name.contains("ktor")
val isExampleProject = project.name.contains("example")
apply(plugin = "java-library")
apply(plugin = "jacoco")
apply(plugin = "org.unbroken-dome.test-sets")
if (!isKotlinProject) {
apply(plugin = "com.github.spotbugs")
if (!isExampleProject) {
apply(plugin = "com.github.spotbugs")
}
} else {
apply(plugin = "org.jlleitschuh.gradle.ktlint")
apply(plugin = "io.gitlab.arturbosch.detekt")
Expand All @@ -63,7 +66,7 @@ subprojects {
testImplementation("ch.qos.logback:logback-core:$logbackVersion")
testImplementation("ch.qos.logback:logback-classic:$logbackVersion")

if (!isKotlinProject) {
if (!isKotlinProject && !isExampleProject) {
// SpotBugs
spotbugs("com.github.spotbugs:spotbugs:$spotbugsVersion")
}
Expand All @@ -78,8 +81,10 @@ subprojects {
}

if (!isKotlinProject) {
spotbugs {
excludeFilter.set(file("${project.rootDir}/configuration/spotbugs/bugsExcludeFilter.xml"))
if (!isExampleProject) {
spotbugs {
excludeFilter.set(file("${project.rootDir}/configuration/spotbugs/bugsExcludeFilter.xml"))
}
}
} else {
detekt {
Expand Down
26 changes: 13 additions & 13 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# Versions
assertJVersion=3.17.2
avroVersion=1.10.0
assertJVersion=3.20.1
avroVersion=1.10.1
awsV1Version=1.0.8
awsVersion=2.15.9
awsVersion=2.16.87
awsXrayVersion=2.7.1
braveVersion=5.12.7
braveVersion=5.13.3
cglibVersion=3.3.0
elasticMqVersion=0.15.6
elasticMqVersion=0.15.8
guavaVersion=29.0-jre
immutablesVersion=2.8.8
jacksonVersion=2.11.3
junitJupiterVersion=5.7.0
ktorVersion=1.4.1
jacksonVersion=2.12.3
junitJupiterVersion=5.7.2
ktorVersion=1.6.0
logbackVersion=1.2.3
lombokVersion=1.18.16
mockitoVersion=3.5.13
lombokVersion=1.18.20
mockitoVersion=3.11.1
mockitoKotlinVersion=2.2.0
slf4jVersion=1.7.30
spotbugsVersion=4.1.2
springBootVersion=2.3.4.RELEASE
spotbugsVersion=4.2.3
springBootVersion=2.5.1
springCloudVersion=2.2.3.RELEASE
springCloudMessagingVersion=2.2.2.RELEASE
springCloudSchemaRegistryVersion=1.0.8.RELEASE
springCloudSchemaRegistryVersion=1.1.3
springJmsVersion=5.2.7.RELEASE
1 change: 1 addition & 0 deletions ktor/core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ dependencies {
testImplementation(project(":expected-test-exception"))
testImplementation("com.nhaarman.mockitokotlin2:mockito-kotlin:$mockitoKotlinVersion")
testImplementation("io.ktor:ktor-server-test-host:$ktorVersion")
testImplementation("io.ktor:ktor-server-netty:$ktorVersion")
}

tasks.withType<KotlinCompile>().configureEach {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ protected MessageListenerContainer wrapMethodContainingAnnotation(final Object b
private SqsAsyncClient getSqsAsyncClient(A annotation) {
final String sqsClient = getSqsClientIdentifier(annotation);

if (StringUtils.isEmpty(sqsClient)) {
if (!StringUtils.hasText(sqsClient)) {
return sqsAsyncClientProvider
.getDefaultClient()
.orElseThrow(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public boolean interruptThreadsProcessingMessagesOnShutdown() {
*/
protected Supplier<Integer> concurrencySupplier(final QueueListener annotation) {
final int concurrencyLevel;
if (StringUtils.isEmpty(annotation.concurrencyLevelString())) {
if (!StringUtils.hasText(annotation.concurrencyLevelString())) {
concurrencyLevel = annotation.concurrencyLevel();
} else {
concurrencyLevel = Integer.parseInt(environment.resolvePlaceholders(annotation.concurrencyLevelString()));
Expand Down Expand Up @@ -132,7 +132,7 @@ protected Supplier<Duration> concurrencyPollingRateSupplier(final QueueListener
*/
protected Supplier<Integer> batchSizeSupplier(final QueueListener annotation) {
final int batchSize;
if (StringUtils.isEmpty(annotation.batchSizeString())) {
if (!StringUtils.hasText(annotation.batchSizeString())) {
batchSize = annotation.batchSize();
} else {
batchSize = Integer.parseInt(environment.resolvePlaceholders(annotation.batchSizeString()));
Expand All @@ -152,7 +152,7 @@ protected Supplier<Integer> batchSizeSupplier(final QueueListener annotation) {
*/
protected Supplier<Duration> batchingPeriodSupplier(final QueueListener annotation) {
final Duration batchingPeriod;
if (StringUtils.isEmpty(annotation.batchingPeriodInMsString())) {
if (!StringUtils.hasText(annotation.batchingPeriodInMsString())) {
batchingPeriod = Duration.ofMillis(annotation.batchingPeriodInMs());
} else {
batchingPeriod = Duration.ofMillis(Integer.parseInt(environment.resolvePlaceholders(annotation.batchingPeriodInMsString())));
Expand Down Expand Up @@ -185,7 +185,7 @@ protected Supplier<Duration> errorBackoffTimeSupplier(final QueueListener annota
*/
protected Supplier<Duration> messageVisibilityTimeoutSupplier(final QueueListener annotation) {
final Duration messageVisibilityTimeout;
if (StringUtils.isEmpty(annotation.messageVisibilityTimeoutInSecondsString())) {
if (!StringUtils.hasText(annotation.messageVisibilityTimeoutInSecondsString())) {
final int visibilityTimeout = annotation.messageVisibilityTimeoutInSeconds();
if (visibilityTimeout < 0) {
messageVisibilityTimeout = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public boolean interruptThreadsProcessingMessagesOnShutdown() {
*/
protected Supplier<Integer> concurrencySupplier(final FifoQueueListener annotation) {
final int concurrencyLevel;
if (StringUtils.isEmpty(annotation.concurrencyLevelString())) {
if (!StringUtils.hasText(annotation.concurrencyLevelString())) {
concurrencyLevel = annotation.concurrencyLevel();
} else {
concurrencyLevel = Integer.parseInt(environment.resolvePlaceholders(annotation.concurrencyLevelString()));
Expand Down Expand Up @@ -119,7 +119,7 @@ protected Supplier<Duration> concurrencyPollingRateSupplier(final FifoQueueListe
*/
protected Supplier<Integer> maximumMessagesInGroupSupplier(final FifoQueueListener annotation) {
final int batchSize;
if (StringUtils.isEmpty(annotation.maximumMessagesInMessageGroupString())) {
if (!StringUtils.hasText(annotation.maximumMessagesInMessageGroupString())) {
batchSize = annotation.maximumMessagesInMessageGroup();
} else {
batchSize = Integer.parseInt(environment.resolvePlaceholders(annotation.maximumMessagesInMessageGroupString()));
Expand All @@ -139,7 +139,7 @@ protected Supplier<Integer> maximumMessagesInGroupSupplier(final FifoQueueListen
*/
protected Supplier<Integer> maximumCachedMessageGroupsSupplier(final FifoQueueListener annotation) {
final int maximumCachedMessageGroups;
if (StringUtils.isEmpty(annotation.maximumCachedMessageGroupsString())) {
if (!StringUtils.hasText(annotation.maximumCachedMessageGroupsString())) {
maximumCachedMessageGroups = annotation.maximumCachedMessageGroups();
} else {
maximumCachedMessageGroups = Integer.parseInt(environment.resolvePlaceholders(annotation.maximumCachedMessageGroupsString()));
Expand Down Expand Up @@ -172,7 +172,7 @@ protected Supplier<Duration> errorBackoffTimeSupplier(final FifoQueueListener an
*/
protected Supplier<Duration> messageVisibilityTimeoutSupplier(final FifoQueueListener annotation) {
final Duration messageVisibilityTimeout;
if (StringUtils.isEmpty(annotation.messageVisibilityTimeoutInSecondsString())) {
if (!StringUtils.hasText(annotation.messageVisibilityTimeoutInSecondsString())) {
if (annotation.messageVisibilityTimeoutInSeconds() <= 0) {
messageVisibilityTimeout = null;
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public boolean interruptThreadsProcessingMessagesOnShutdown() {
*/
protected Supplier<Integer> concurrencySupplier(final PrefetchingQueueListener annotation) {
final int concurrencyLevel;
if (StringUtils.isEmpty(annotation.concurrencyLevelString())) {
if (!StringUtils.hasText(annotation.concurrencyLevelString())) {
concurrencyLevel = annotation.concurrencyLevel();
} else {
concurrencyLevel = Integer.parseInt(environment.resolvePlaceholders(annotation.concurrencyLevelString()));
Expand Down Expand Up @@ -130,7 +130,7 @@ protected Supplier<Duration> concurrencyPollingRateSupplier(final PrefetchingQue
*/
protected Supplier<Integer> desiredMinPrefetchedMessagesSupplier(final PrefetchingQueueListener annotation) {
final int desiredMinPrefetchedMessages;
if (StringUtils.isEmpty(annotation.desiredMinPrefetchedMessagesString())) {
if (!StringUtils.hasText(annotation.desiredMinPrefetchedMessagesString())) {
desiredMinPrefetchedMessages = annotation.desiredMinPrefetchedMessages();
} else {
desiredMinPrefetchedMessages =
Expand All @@ -150,7 +150,7 @@ protected Supplier<Integer> desiredMinPrefetchedMessagesSupplier(final Prefetchi
*/
protected Supplier<Integer> maxPrefetchedMessagesSupplier(final PrefetchingQueueListener annotation) {
final int maxPrefetchedMessages;
if (StringUtils.isEmpty(annotation.maxPrefetchedMessagesString())) {
if (!StringUtils.hasText(annotation.maxPrefetchedMessagesString())) {
maxPrefetchedMessages = annotation.maxPrefetchedMessages();
} else {
maxPrefetchedMessages = Integer.parseInt(environment.resolvePlaceholders(annotation.maxPrefetchedMessagesString()));
Expand Down Expand Up @@ -183,7 +183,7 @@ protected Supplier<Duration> errorBackoffTimeSupplier(final PrefetchingQueueList
*/
protected Supplier<Duration> messageVisibilityTimeoutSupplier(final PrefetchingQueueListener annotation) {
final Duration messageVisibilityTimeout;
if (StringUtils.isEmpty(annotation.messageVisibilityTimeoutInSecondsString())) {
if (!StringUtils.hasText(annotation.messageVisibilityTimeoutInSecondsString())) {
final int visibilityTimeout = annotation.messageVisibilityTimeoutInSeconds();
if (visibilityTimeout < 0) {
messageVisibilityTimeout = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ private Duration getDurationFromSeconds(
final Supplier<Integer> integerSupplier
) {
final String stringPropertyValue = stringProperty.get();
if (!StringUtils.isEmpty(stringPropertyValue)) {
if (StringUtils.hasText(stringPropertyValue)) {
return Duration.ofSeconds(Integer.parseInt(environment.resolvePlaceholders(stringPropertyValue)));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class IdentifierUtils {
* @return an identifier for this class' method
*/
public String buildIdentifierForMethod(final String identifier, final Class<?> clazz, final Method method) {
if (StringUtils.isEmpty(identifier.trim())) {
if (!StringUtils.hasText(identifier.trim())) {
return toLowerHyphenCase(clazz.getSimpleName() + "-" + method.getName());
} else {
return identifier.trim();
Expand Down