File tree Expand file tree Collapse file tree
src/test/java/org/msgpack Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -289,6 +289,7 @@ public void testModifiersFieldsClass() throws Exception {
289289 testModifiersFieldsClass (new ModifiersFieldsClass ());
290290 ModifiersFieldsClass v = new ModifiersFieldsClass ();
291291 v .f0 = 0 ;
292+ v .f4 = "muga" ;
292293 testModifiersFieldsClass (v );
293294 }
294295
@@ -297,9 +298,15 @@ public void testModifiersFieldsClass(ModifiersFieldsClass v) throws Exception {
297298
298299 public void testModifiersFieldsClassNotNullable () throws Exception {
299300 testModifiersFieldsClassNotNullable (null );
300- testModifiersFieldsClassNotNullable (new ModifiersFieldsClassNotNullable ());
301+ try {
302+ testModifiersFieldsClassNotNullable (new ModifiersFieldsClassNotNullable ());
303+ Assert .fail ();
304+ } catch (Throwable t ) {
305+ Assert .assertTrue (t instanceof MessageTypeException );
306+ }
301307 ModifiersFieldsClassNotNullable v = new ModifiersFieldsClassNotNullable ();
302308 v .f0 = 0 ;
309+ v .f4 = "muga" ;
303310 testModifiersFieldsClassNotNullable (v );
304311 }
305312
Original file line number Diff line number Diff line change 99public class ModifiersFieldsClass {
1010 public int f0 ;
1111
12- private int f1 ;
12+ private int f1 = 5 ;
1313
14- protected int f2 ;
14+ protected int f2 = 10 ;
1515
16- int f3 ;
16+ int f3 = 15 ;
1717
1818 public String f4 ;
1919
20- private String f5 ;
20+ private String f5 = "nishizawa" ;
2121
22- protected String f6 ;
22+ protected String f6 = "muga" ;
2323
24- String f7 ;
24+ String f7 = "hello" ;
2525
2626 public ModifiersFieldsClass () {}
2727
Original file line number Diff line number Diff line change @@ -12,13 +12,25 @@ public class ModifiersFieldsClassNotNullable {
1212 public int f0 ;
1313
1414 @ NotNullable
15- private int f1 ;
15+ private int f1 = 5 ;
1616
1717 @ NotNullable
18- protected int f2 ;
18+ protected int f2 = 10 ;
1919
2020 @ NotNullable
21- int f3 ;
21+ int f3 = 15 ;
22+
23+ @ NotNullable
24+ public String f4 ;
25+
26+ @ NotNullable
27+ private String f5 = "nishizawa" ;
28+
29+ @ NotNullable
30+ protected String f6 = "hello" ;
31+
32+ @ NotNullable
33+ String f7 = "muga" ;
2234
2335 public ModifiersFieldsClassNotNullable () {}
2436
@@ -52,6 +64,46 @@ public void setF3(int f3) {
5264 this .f3 = f3 ;
5365 }
5466
67+ @ NotNullable
68+ public String getF4 () {
69+ return f4 ;
70+ }
71+
72+ @ NotNullable
73+ public void setF4 (String f4 ) {
74+ this .f4 = f4 ;
75+ }
76+
77+ @ NotNullable
78+ public String getF5 () {
79+ return f5 ;
80+ }
81+
82+ @ NotNullable
83+ public void setF5 (String f5 ) {
84+ this .f5 = f5 ;
85+ }
86+
87+ @ NotNullable
88+ public String getF6 () {
89+ return f6 ;
90+ }
91+
92+ @ NotNullable
93+ public void setF6 (String f6 ) {
94+ this .f6 = f6 ;
95+ }
96+
97+ @ NotNullable
98+ public String getF7 () {
99+ return f7 ;
100+ }
101+
102+ @ NotNullable
103+ public void setF7 (String f7 ) {
104+ this .f7 = f7 ;
105+ }
106+
55107 @ Override
56108 public boolean equals (Object o ) {
57109 if (! (o instanceof ModifiersFieldsClassNotNullable )) {
@@ -70,6 +122,38 @@ public boolean equals(Object o) {
70122 if (f3 != that .f3 ) {
71123 return false ;
72124 }
125+ if (f4 == null ) {
126+ if (that .f4 != null ) {
127+ return false ;
128+ }
129+ }
130+ if (that .f4 != null && ! f4 .equals (that .f4 )) {
131+ return false ;
132+ }
133+ if (f5 == null ) {
134+ if (that .f5 != null ) {
135+ return false ;
136+ }
137+ }
138+ if (that .f5 != null && ! f5 .equals (that .f5 )) {
139+ return false ;
140+ }
141+ if (f6 == null ) {
142+ if (that .f6 != null ) {
143+ return false ;
144+ }
145+ }
146+ if (that .f6 != null && ! f6 .equals (that .f6 )) {
147+ return false ;
148+ }
149+ if (f7 == null ) {
150+ if (that .f7 != null ) {
151+ return false ;
152+ }
153+ }
154+ if (that .f7 != null && ! f7 .equals (that .f7 )) {
155+ return false ;
156+ }
73157 return true ;
74158 }
75159}
You can’t perform that action at this time.
0 commit comments