[JAVA-31658] Upgrade cactoos, jcabi-aspects, threetenbp, jodatime (#16293)

This commit is contained in:
vunamtien 2024-04-05 14:49:54 +07:00 committed by GitHub
parent bb544b9168
commit 9ff1e00b0e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
11 changed files with 43 additions and 22 deletions

View File

@ -86,7 +86,7 @@
<maven.compiler.target>1.8</maven.compiler.target>
<jcabi-aspects.version>0.22.6</jcabi-aspects.version>
<aspectjrt.version>1.9.20.1</aspectjrt.version>
<cactoos.version>0.43</cactoos.version>
<cactoos.version>0.55.0</cactoos.version>
<ea-async.version>1.2.3</ea-async.version>
<jcabi-maven-plugin.version>0.14.1</jcabi-maven-plugin.version>
<aspectjtools.version>1.9.20.1</aspectjtools.version>

View File

@ -168,7 +168,7 @@
</build>
<properties>
<jcabi-aspects.version>0.22.6</jcabi-aspects.version>
<jcabi-aspects.version>0.26.0</jcabi-aspects.version>
<aspectjrt.version>1.9.20.1</aspectjrt.version>
<jcabi-maven-plugin.version>0.14.1</jcabi-maven-plugin.version>
<aspectjtools.version>1.9.20.1</aspectjtools.version>

View File

@ -100,7 +100,7 @@
<javatuples.version>1.2</javatuples.version>
<multiverse.version>0.7.0</multiverse.version>
<chronicle.map.version>3.24ea1</chronicle.map.version>
<cactoos.version>0.43</cactoos.version>
<cactoos.version>0.55.0</cactoos.version>
<cache2k.version>1.2.3.Final</cache2k.version>
<pcollections.version>2.1.2</pcollections.version>
<eclipse-collections.version>8.2.0</eclipse-collections.version>

View File

@ -3,10 +3,13 @@ package com.baeldung.cactoos;
import java.util.Collection;
import java.util.List;
import org.cactoos.collection.Filtered;
import org.cactoos.func.FuncOf;
import org.cactoos.iterable.Filtered;
import org.cactoos.iterable.IterableOf;
import org.cactoos.iterable.Mapped;
import org.cactoos.list.ListOf;
import org.cactoos.scalar.And;
import org.cactoos.scalar.True;
import org.cactoos.text.FormattedText;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -16,13 +19,24 @@ public class CactoosCollectionUtils {
final Logger LOGGER = LoggerFactory.getLogger(CactoosCollectionUtils.class);
public void iterateCollection(List<String> strings) throws Exception {
new And((String input) -> LOGGER.info(new FormattedText("%s\n", input).asString()), strings).value();
new And(
new Mapped<>(
new FuncOf<>(
input -> System.out.printf("Item: %s\n", input),
new True()
),
strings
)
).value();
}
public Collection<String> getFilteredList(List<String> strings) {
Collection<String> filteredStrings = new ListOf<>(
new Filtered<>(string -> string.length() == 5, new IterableOf<>(strings)));
return filteredStrings;
return new ListOf<>(
new Filtered<>(
s -> s.length() == 5,
strings
)
);
}
}

View File

@ -10,17 +10,17 @@ import org.cactoos.text.Upper;
public class CactoosStringUtils {
public String createString() throws IOException {
public String createString() throws Exception {
String testString = new TextOf("Test String").asString();
return testString;
}
public String createdFormattedString(String stringToFormat) throws IOException {
public String createdFormattedString(String stringToFormat) throws Exception {
String formattedString = new FormattedText("Hello %s", stringToFormat).asString();
return formattedString;
}
public String toLowerCase(String testString) throws IOException {
public String toLowerCase(String testString) throws Exception {
String lowerCaseString = new Lowered(new TextOf(testString)).asString();
return lowerCaseString;
}

View File

@ -9,7 +9,7 @@ import org.junit.Test;
public class CactoosStringUtilsUnitTest {
@Test
public void whenFormattedTextIsPassedWithArgs_thenFormattedStringIsReturned() throws IOException {
public void whenFormattedTextIsPassedWithArgs_thenFormattedStringIsReturned() throws Exception {
CactoosStringUtils obj = new CactoosStringUtils();

View File

@ -100,9 +100,8 @@ ext {
jackson_databind_version = "2.10.1"
jackson_databind_nullable_version = "0.2.1"
spring_web_version = "4.3.9.RELEASE"
jodatime_version = "2.9.9"
junit_version = "4.13"
jackson_threeten_version = "2.9.10"
jackson_threeten_version = "2.15.2"
}
dependencies {

View File

@ -266,7 +266,7 @@
<jackson.version>2.11.1</jackson.version>
<!-- <jackson-databind-version>2.10.1</jackson-databind-version> -->
<jackson-databind-nullable.version>0.2.1</jackson-databind-nullable.version>
<jackson-threetenbp.version>2.9.10</jackson-threetenbp.version>
<jackson-threetenbp.version>2.15.2</jackson-threetenbp.version>
<maven-plugin.version>1.0.0</maven-plugin.version>
<junit-jupiter.version>5.8.1</junit-jupiter.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>

View File

@ -1,5 +1,6 @@
package com.baeldung.petstore.client.invoker;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonTokenId;
import com.fasterxml.jackson.databind.DeserializationContext;
@ -148,11 +149,18 @@ public class CustomInstantDeserializer<T extends Temporal>
}
@Override
protected JsonDeserializer<T> withDateFormat(DateTimeFormatter dtf) {
if (dtf == _formatter) {
return this;
protected ThreeTenDateTimeDeserializerBase<T> withDateFormat(DateTimeFormatter dateTimeFormatter) {
return null;
}
return new CustomInstantDeserializer<T>(this, dtf);
@Override
protected ThreeTenDateTimeDeserializerBase<T> withLeniency(Boolean aBoolean) {
return null;
}
@Override
protected ThreeTenDateTimeDeserializerBase<T> withShape(JsonFormat.Shape shape) {
return null;
}
@Override

View File

@ -97,7 +97,7 @@ ext {
swagger_annotations_version = "1.5.15"
jackson_version = "2.13.3"
spring_web_version = "4.3.9.RELEASE"
jodatime_version = "2.9.9"
jodatime_version = "2.12.7"
junit_version = "4.12"
}

View File

@ -190,7 +190,7 @@
<properties>
<swagger-annotations.version>1.5.15</swagger-annotations.version>
<spring-web.version>4.3.9.RELEASE</spring-web.version>
<jodatime.version>2.9.9</jodatime.version>
<jodatime.version>2.12.7</jodatime.version>
<javax.annotation-api.version>1.3.2</javax.annotation-api.version>
<maven-jar-plugin.version>2.2</maven-jar-plugin.version>
<maven-gpg-plugin.version>1.5</maven-gpg-plugin.version>