Skip to content

Commit

Permalink
Removed redundant handling of checked exceptions in copy method
Browse files Browse the repository at this point in the history
  • Loading branch information
benfortuna committed Mar 27, 2023
1 parent 822e191 commit d43f284
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Expand Up @@ -46,8 +46,7 @@ dependencies {
"org.apache.commons:commons-lang3:$commonsLangVersion",
"org.apache.commons:commons-collections4:$commonsCollectionsVersion",
"commons-validator:commons-validator:$commonsValidatorVersion",
"org.threeten:threeten-extra:$threetenExtraVersion",
"org.jooq:jool-java-8:$joolVersion"
"org.threeten:threeten-extra:$threetenExtraVersion"

// optional timezone caching..
implementation 'javax.cache:cache-api:1.1.1', optional
Expand Down
1 change: 0 additions & 1 deletion gradle.properties
Expand Up @@ -5,7 +5,6 @@ commonsLangVersion = 3.12.0
commonsCollectionsVersion = 4.4
commonsValidatorVersion = 1.7
threetenExtraVersion = 1.7.0
joolVersion = 0.9.14
jparsecVersion = 3.1
everitJsonSchemaVersion = 1.14.1

Expand Down
5 changes: 2 additions & 3 deletions src/main/java/net/fortuna/ical4j/model/Calendar.java
Expand Up @@ -42,7 +42,6 @@
import net.fortuna.ical4j.validate.Validator;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.jooq.lambda.Unchecked;

import java.io.Serializable;
import java.nio.charset.Charset;
Expand Down Expand Up @@ -294,9 +293,9 @@ private ValidationResult validateComponents() throws ValidationException {
public final Calendar copy() {
return new Calendar(
new PropertyList(getProperties().parallelStream()
.map(Unchecked.function(Property::copy)).collect(Collectors.toList())),
.map(Property::copy).collect(Collectors.toList())),
new ComponentList<>(getComponents().parallelStream()
.map(Unchecked.function(c -> (CalendarComponent) c.copy())).collect(Collectors.toList())));
.map(c -> (CalendarComponent) c.copy()).collect(Collectors.toList())));
}

/**
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/net/fortuna/ical4j/model/Component.java
Expand Up @@ -38,7 +38,6 @@
import net.fortuna.ical4j.validate.ValidationResult;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.jooq.lambda.Unchecked;

import java.io.Serializable;
import java.time.temporal.Temporal;
Expand Down Expand Up @@ -272,7 +271,7 @@ public int hashCode() {
*/
public <T extends Component> T copy() {
return (T) newFactory().createComponent(new PropertyList(getProperties().parallelStream()
.map(Unchecked.function(Property::copy)).collect(Collectors.toList())));
.map(Property::copy).collect(Collectors.toList())));
}

/**
Expand Down

0 comments on commit d43f284

Please sign in to comment.