Skip to content

Commit

Permalink
Check for clonable before calling clone for java17 #1058
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala authored and temi committed Feb 14, 2025
1 parent 438f123 commit 1017083
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions grails-app/services/au/org/ala/ecodata/ParatooService.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -1059,10 +1059,10 @@ class ParatooService {
cleanedDefinition << cleanSwaggerDefinition(value)
}
} else {
try {
cleanedDefinition = definition?.clone()
if (definition instanceof Cloneable) {
cleanedDefinition = definition.clone()
}
catch (CloneNotSupportedException e) {
else {
// if not cloneable, then it is a primitive type
cleanedDefinition = definition
}
Expand Down

0 comments on commit 1017083

Please sign in to comment.