Skip to content

modernise code based on Java 17 norms - #896

Merged
cowtowncoder merged 1 commit into
FasterXML:3.xfrom
pjfanning:java17
Aug 18, 2026
Merged

modernise code based on Java 17 norms#896
cowtowncoder merged 1 commit into
FasterXML:3.xfrom
pjfanning:java17

Conversation

@pjfanning

Copy link
Copy Markdown
Member

Pattern matching instanceof — 22 edits in 13 files

  • Eliminated verbose instanceof + cast patterns across XmlAnnotationIntrospector, XmlFactory, XmlMapper, StaxUtil, AnnotationUtil, Stax2JacksonReaderAdapter, XmlRootNameLookup, XmlReadContext, XmlTokenStream, XmlBeanSerializerModifier, XmlBeanSerializerBase, XmlBeanPropertyWriter, XmlSerializationContext

Switch expressions/arrow notation — 11 conversions in 6 files

  • FromXmlParser: 5 switches converted (arrow notation + switch expressions with yield)
  • XmlTokenStream: 2 switches converted (switch expression + arrow notation with merged cases)
  • XmlTokenBuffer: 1 switch expression with yield blocks
  • XmlReadContext: 1 arrow notation conversion
  • XmlTypeResolverBuilder + DefaultingXmlTypeResolverBuilder: 2 switch expressions folding empty defaults

Minor idioms — 16 edits in 10 files

  • .length() == 0 → .isEmpty(): 6 locations
  • String.format() → .formatted(): 4 locations
  • Boolean null-guards → Boolean.TRUE.equals(): 3 locations
  • Null ternaries → Objects.requireNonNullElse(): 3 locations

Verification: 609 tests pass, 0 failures.

@github-actions

Copy link
Copy Markdown

🧪 Code Coverage Report

Metric Coverage Change
Instructions coverage 74.08% 📈 +0.030%
Branches branches 68.72% 📉 -0.110%

Coverage data generated from JaCoCo test results

@cowtowncoder
cowtowncoder merged commit 31c69e8 into FasterXML:3.x Aug 18, 2026
3 checks passed
@pjfanning
pjfanning deleted the java17 branch August 18, 2026 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants