Commit 3de411a
committed
Make UtEnumConstModel and UtClassRefModel reference models #414
Historically `UtEnumConstModel` and `UtClassRefModel` have been
processed not as other reference models, but in a special way,
more like to primitive types. This approach leads to several
problems, especially to class cast errors when processing generic
collections with enums or class references as elements.
This commit makes `UtEnumConstModel` and `UtClassRefModel` subtypes of
`UtReferenceModel`.
* Concrete executor is modified to respect the identity of static
fields to avoid rewriting enum values and `Class<?>` instances.
* Special processing for enums is implemented.
When a new enum value is created, or an `Object` is being cast
to the enum type, static values for the enum class are initialized,
and the set of hard constraint is added to require that the new
instance has the same address and ordinal as any one of enum
constants to implement reference equality for enums.
* Corresponding changes in fuzzer model providers have been
implemented.1 parent 83341fd commit 3de411a
File tree
20 files changed
+434
-63
lines changed- utbot-framework-api/src/main/kotlin/org/utbot/framework/plugin/api
- utbot-framework/src
- main/kotlin/org/utbot
- engine
- symbolic
- util/statics/concrete
- external/api
- framework
- codegen/model/constructor/tree
- concrete
- test
- java/org/utbot/examples/manual
- kotlin/org/utbot/examples/enums
- utbot-fuzzers/src
- main/kotlin/org/utbot/fuzzer
- providers
- test/kotlin/org/utbot/framework/plugin/api
- utbot-sample/src/main/java/org/utbot/examples/enums
20 files changed
+434
-63
lines changedLines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
| 61 | + | |
| 62 | + | |
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| |||
282 | 284 | | |
283 | 285 | | |
284 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
285 | 297 | | |
286 | 298 | | |
287 | 299 | | |
| |||
323 | 335 | | |
324 | 336 | | |
325 | 337 | | |
| 338 | + | |
326 | 339 | | |
327 | 340 | | |
328 | | - | |
329 | | - | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
330 | 344 | | |
331 | 345 | | |
332 | 346 | | |
333 | 347 | | |
334 | 348 | | |
335 | 349 | | |
| 350 | + | |
336 | 351 | | |
337 | 352 | | |
338 | | - | |
339 | | - | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
340 | 356 | | |
341 | 357 | | |
342 | 358 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
401 | | - | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
373 | 374 | | |
374 | 375 | | |
375 | 376 | | |
376 | | - | |
| 377 | + | |
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
| |||
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
| 152 | + | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| |||
297 | 299 | | |
298 | 300 | | |
299 | 301 | | |
300 | | - | |
| 302 | + | |
| 303 | + | |
301 | 304 | | |
302 | 305 | | |
303 | 306 | | |
| |||
307 | 310 | | |
308 | 311 | | |
309 | 312 | | |
310 | | - | |
311 | 313 | | |
312 | 314 | | |
313 | 315 | | |
| |||
350 | 352 | | |
351 | 353 | | |
352 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
353 | 358 | | |
354 | 359 | | |
355 | 360 | | |
| |||
967 | 972 | | |
968 | 973 | | |
969 | 974 | | |
970 | | - | |
| 975 | + | |
| 976 | + | |
971 | 977 | | |
972 | 978 | | |
973 | 979 | | |
| |||
986 | 992 | | |
987 | 993 | | |
988 | 994 | | |
| 995 | + | |
989 | 996 | | |
| 997 | + | |
| 998 | + | |
| 999 | + | |
990 | 1000 | | |
991 | 1001 | | |
992 | 1002 | | |
| |||
Lines changed: 11 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
74 | 75 | | |
75 | 76 | | |
76 | 77 | | |
| |||
325 | 326 | | |
326 | 327 | | |
327 | 328 | | |
328 | | - | |
| 329 | + | |
329 | 330 | | |
330 | 331 | | |
331 | 332 | | |
| |||
437 | 438 | | |
438 | 439 | | |
439 | 440 | | |
440 | | - | |
| 441 | + | |
441 | 442 | | |
442 | 443 | | |
443 | 444 | | |
| |||
498 | 499 | | |
499 | 500 | | |
500 | 501 | | |
501 | | - | |
| 502 | + | |
502 | 503 | | |
503 | 504 | | |
504 | 505 | | |
| |||
615 | 616 | | |
616 | 617 | | |
617 | 618 | | |
618 | | - | |
| 619 | + | |
619 | 620 | | |
620 | 621 | | |
621 | 622 | | |
| |||
640 | 641 | | |
641 | 642 | | |
642 | 643 | | |
643 | | - | |
| 644 | + | |
644 | 645 | | |
645 | 646 | | |
646 | 647 | | |
| |||
795 | 796 | | |
796 | 797 | | |
797 | 798 | | |
798 | | - | |
| 799 | + | |
799 | 800 | | |
800 | 801 | | |
801 | 802 | | |
| |||
829 | 830 | | |
830 | 831 | | |
831 | 832 | | |
832 | | - | |
| 833 | + | |
833 | 834 | | |
834 | 835 | | |
835 | 836 | | |
| |||
903 | 904 | | |
904 | 905 | | |
905 | 906 | | |
906 | | - | |
| 907 | + | |
907 | 908 | | |
908 | 909 | | |
909 | 910 | | |
| |||
927 | 928 | | |
928 | 929 | | |
929 | 930 | | |
930 | | - | |
| 931 | + | |
931 | 932 | | |
932 | 933 | | |
933 | 934 | | |
| |||
976 | 977 | | |
977 | 978 | | |
978 | 979 | | |
979 | | - | |
980 | | - | |
| 980 | + | |
981 | 981 | | |
982 | 982 | | |
983 | 983 | | |
| |||
Lines changed: 62 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
497 | 497 | | |
498 | 498 | | |
499 | 499 | | |
500 | | - | |
| 500 | + | |
501 | 501 | | |
502 | 502 | | |
503 | 503 | | |
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
521 | | - | |
522 | | - | |
523 | | - | |
524 | | - | |
525 | | - | |
526 | | - | |
527 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
528 | 525 | | |
529 | 526 | | |
530 | 527 | | |
| |||
545 | 542 | | |
546 | 543 | | |
547 | 544 | | |
548 | | - | |
| 545 | + | |
549 | 546 | | |
550 | 547 | | |
551 | 548 | | |
| |||
564 | 561 | | |
565 | 562 | | |
566 | 563 | | |
567 | | - | |
| 564 | + | |
| 565 | + | |
568 | 566 | | |
569 | 567 | | |
570 | | - | |
571 | | - | |
572 | | - | |
573 | | - | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
574 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
575 | 583 | | |
576 | 584 | | |
577 | 585 | | |
| |||
1373 | 1381 | | |
1374 | 1382 | | |
1375 | 1383 | | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
1376 | 1417 | | |
1377 | 1418 | | |
1378 | 1419 | | |
| |||
1530 | 1571 | | |
1531 | 1572 | | |
1532 | 1573 | | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
1533 | 1579 | | |
1534 | 1580 | | |
1535 | 1581 | | |
| |||
1978 | 2024 | | |
1979 | 2025 | | |
1980 | 2026 | | |
1981 | | - | |
1982 | | - | |
| 2027 | + | |
1983 | 2028 | | |
1984 | 2029 | | |
1985 | 2030 | | |
1986 | 2031 | | |
1987 | 2032 | | |
| 2033 | + | |
1988 | 2034 | | |
1989 | 2035 | | |
1990 | 2036 | | |
| |||
0 commit comments