File tree Expand file tree Collapse file tree
jaxb/src/main/java/com/fasterxml/jackson/module/jaxb Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -433,21 +433,19 @@ public boolean hasAnySetterAnnotation(AnnotatedMethod am)
433433
434434 @ Override
435435 public Boolean hasRequiredMarker (AnnotatedMember m ) {
436- XmlElement elem = m . getAnnotation ( XmlElement . class );
437- if (( elem != null ) && elem . required ()) {
438- return Boolean . TRUE ;
439- }
436+ // 17-Oct-2017, tatu: [modules-base#32]
437+ // Before 2.9.3, was handling `true` correctly,
438+ // but otherwise used confusing logic (probably in attempt to try to avoid
439+ // reporting not-required for default value case
440440 XmlAttribute attr = m .getAnnotation (XmlAttribute .class );
441- if (( attr != null ) && attr . required () ) {
442- return Boolean . TRUE ;
441+ if (attr != null ) {
442+ return attr . required () ;
443443 }
444- // 09-Sep-2015, tatu: Not 100% sure that we should ever return `false`
445- // here (as it blocks calls to secondary introspector), but since that
446- // was the existing behavior before 2.6, is retained for now.
447- if ((elem != null ) || (attr != null )) {
448- return null ;
444+ XmlElement elem = m .getAnnotation (XmlElement .class );
445+ if (elem != null ) {
446+ return elem .required ();
449447 }
450- return Boolean . FALSE ;
448+ return null ;
451449 }
452450
453451 @ Override
Original file line number Diff line number Diff line change 1+ Here are people who have contributed to development Jackson JSON processor
2+ Base modules
3+ (version numbers in brackets indicate release in which the problem was fixed)
4+ (NOTE: incomplete -- need to collect info from sub-projects, pre-2.9)
5+
6+ Tatu Saloranta, tatu.saloranta@iki.fi: author
7+
8+ Vojtěch Habarta (vojtechhabarta@gitub)
9+
10+ * Reported [JAXB#32]: Fix introspector chaining in `JaxbAnnotationIntrospector.hasRequiredMarker()`
11+ (2.9.3)
Original file line number Diff line number Diff line change @@ -8,6 +8,11 @@ Modules:
88=== Releases ===
99------------------------------------------------------------------------
1010
11+ 2.9.3 (not yet released)
12+
13+ #32: Fix introspector chaining in `JaxbAnnotationIntrospector.hasRequiredMarker()`
14+ (reported by Vojtěch H)
15+
11162.9.2 (14-Oct-2017)
1217
1318#30: (afterburner) `IncompatibleClassChangeError` deserializing interface
You can’t perform that action at this time.
0 commit comments