File tree Expand file tree Collapse file tree 3 files changed +26
-12
lines changed
jaxb/src/main/java/com/fasterxml/jackson/module/jaxb Expand file tree Collapse file tree 3 files changed +26
-12
lines changed Original file line number Diff line number Diff line change @@ -433,21 +433,19 @@ public boolean hasAnySetterAnnotation(AnnotatedMethod am)
433
433
434
434
@ Override
435
435
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
440
440
XmlAttribute attr = m .getAnnotation (XmlAttribute .class );
441
- if (( attr != null ) && attr . required () ) {
442
- return Boolean . TRUE ;
441
+ if (attr != null ) {
442
+ return attr . required () ;
443
443
}
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 ();
449
447
}
450
- return Boolean . FALSE ;
448
+ return null ;
451
449
}
452
450
453
451
@ 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,
[email protected] : 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:
8
8
=== Releases ===
9
9
------------------------------------------------------------------------
10
10
11
+ 2.9.3 (not yet released)
12
+
13
+ #32: Fix introspector chaining in `JaxbAnnotationIntrospector.hasRequiredMarker()`
14
+ (reported by Vojtěch H)
15
+
11
16
2.9.2 (14-Oct-2017)
12
17
13
18
#30: (afterburner) `IncompatibleClassChangeError` deserializing interface
You can’t perform that action at this time.
0 commit comments