Skip to content

Commit 12c2a7d

Browse files
committed
more fixes in jackson, now ce-demo
1 parent 009749f commit 12c2a7d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

scripts/pit/lib/lib-patch-v25.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ applyv25patches() {
4949
patchImports 'import com.fasterxml.jackson.databind' 'import tools.jackson.databind'
5050
patchImports 'import org.springframework.boot.autoconfigure.domain.EntityScan;' 'import org.springframework.boot.persistence.autoconfigure.EntityScan;'
5151
patchImports 'import org.springframework.boot.autoconfigure.web.servlet.error.ErrorMvcAutoConfiguration;' 'import org.springframework.boot.webmvc.autoconfigure.error.ErrorMvcAutoConfiguration;'
52+
## ce-demo
53+
patchImports 'import com.fasterxml.jackson.core.JsonProcessingException;' ''
5254
patchMapper
5355

5456
diff_=`git diff $D $F | egrep '^[+-]'`
@@ -344,17 +346,17 @@ patchLumoImports() {
344346
## TODO: needs to be documented in vaadin migration guide to 25
345347
patchMapper() {
346348
# Find all Java files that contain the JavaTimeModule registration
347-
local java_files=$(grep -rl ".*mapper.registerModule.*JavaTimeModule.*" . --include="*.java" 2>/dev/null)
349+
local java_files=$(grep -rEl "(.*mapper.registerModule.*JavaTimeModule.*|.*Json.*Exception.*)" . --include="*.java" 2>/dev/null)
348350
[ -z "$java_files" ] && return 0
349351

350352
local file
351353
for file in $java_files; do
352-
[ -z "$TEST" ] && warn "patching ObjectMapper configuration in $file" || cmd "## patching ObjectMapper configuration in $file"
354+
[ -z "$TEST" ] && warn "patching jackson ussage in $file" || cmd "## patching jackson ussage in $file"
353355

354356
# Remove the JavaTimeModule registration line
355357
perl -pi -e 's|.*mapper.registerModule.*JavaTimeModule.*||' "$file"
356358

357-
# Replace IOException with Exception in the same file
358-
perl -pi -e 's|catch \(IOException|catch (Exception|g' "$file"
359+
# Replace IOException or Json.*Exception with Exception in the same file
360+
perl -pi -e 's/catch \((IOException|Json[A-z]*Exception)/catch (Exception/g' "$file"
359361
done
360362
}

0 commit comments

Comments
 (0)