@@ -98,30 +98,31 @@ void instantiateClassWithMoreArgsThanParameters() throws NoSuchMethodException {
98
98
Constructor <BeanWithPrimitiveTypes > constructor = getBeanWithPrimitiveTypesConstructor ();
99
99
100
100
assertThatExceptionOfType (BeanInstantiationException .class ).isThrownBy (() ->
101
- BeanUtils .instantiateClass (constructor , null , null , null , null , null , null , null , "foo" , null ));
101
+ BeanUtils .instantiateClass (constructor , null , null , null , null , null , null , null , null , "foo" , null ));
102
102
}
103
103
104
104
@ Test // gh-22531, gh-27390
105
105
void instantiateClassWithOptionalPrimitiveTypes () throws NoSuchMethodException {
106
106
Constructor <BeanWithPrimitiveTypes > constructor = getBeanWithPrimitiveTypesConstructor ();
107
107
108
- BeanWithPrimitiveTypes bean = BeanUtils .instantiateClass (constructor , null , null , null , null , null , null , null , "foo" );
108
+ BeanWithPrimitiveTypes bean = BeanUtils .instantiateClass (constructor , null , null , null , null , null , null , null , null , "foo" );
109
109
110
110
assertSoftly (softly -> {
111
- softly .assertThat (bean .isFlag ()).isEqualTo ( false );
111
+ softly .assertThat (bean .isFlag ()).isFalse ( );
112
112
softly .assertThat (bean .getByteCount ()).isEqualTo ((byte ) 0 );
113
113
softly .assertThat (bean .getShortCount ()).isEqualTo ((short ) 0 );
114
114
softly .assertThat (bean .getIntCount ()).isEqualTo (0 );
115
115
softly .assertThat (bean .getLongCount ()).isEqualTo (0L );
116
116
softly .assertThat (bean .getFloatCount ()).isEqualTo (0F );
117
117
softly .assertThat (bean .getDoubleCount ()).isEqualTo (0D );
118
+ softly .assertThat (bean .getCharacter ()).isEqualTo ('\0' );
118
119
softly .assertThat (bean .getText ()).isEqualTo ("foo" );
119
120
});
120
121
}
121
122
122
123
private Constructor <BeanWithPrimitiveTypes > getBeanWithPrimitiveTypesConstructor () throws NoSuchMethodException {
123
124
return BeanWithPrimitiveTypes .class .getConstructor (boolean .class , byte .class , short .class , int .class ,
124
- long .class , float .class , double .class , String .class );
125
+ long .class , float .class , double .class , char . class , String .class );
125
126
}
126
127
127
128
@ Test
@@ -659,19 +660,22 @@ private static class BeanWithPrimitiveTypes {
659
660
private long longCount ;
660
661
private float floatCount ;
661
662
private double doubleCount ;
663
+ private char character ;
662
664
private String text ;
663
665
664
666
665
667
@ SuppressWarnings ("unused" )
666
668
public BeanWithPrimitiveTypes (boolean flag , byte byteCount , short shortCount , int intCount , long longCount ,
667
- float floatCount , double doubleCount , String text ) {
669
+ float floatCount , double doubleCount , char character , String text ) {
670
+
668
671
this .flag = flag ;
669
672
this .byteCount = byteCount ;
670
673
this .shortCount = shortCount ;
671
674
this .intCount = intCount ;
672
675
this .longCount = longCount ;
673
676
this .floatCount = floatCount ;
674
677
this .doubleCount = doubleCount ;
678
+ this .character = character ;
675
679
this .text = text ;
676
680
}
677
681
@@ -703,6 +707,10 @@ public double getDoubleCount() {
703
707
return doubleCount ;
704
708
}
705
709
710
+ public char getCharacter () {
711
+ return character ;
712
+ }
713
+
706
714
public String getText () {
707
715
return text ;
708
716
}
0 commit comments