Commit a5c39f0
authored
Implement java.io.File in vm/JavaAPI (#4324)
* Implement java.io.File in vm/JavaAPI with native methods and integration test.
Implemented `java.io.File` using native methods in `vm/ByteCodeTranslator/src/nativeMethods.m` utilizing `NSFileManager` for iOS compatibility. Added comprehensive `FileClassIntegrationTest` which verifies the implementation by compiling Java source to C, linking with a POSIX-based native mock (for Linux CI compatibility), and executing the resulting binary. The test ensures correct Java-to-Native binding and basic file system operations.
* Implement java.io.File in JavaAPI with native support for ParparVM
- Added full implementation of `java.io.File` in `vm/JavaAPI` delegating to native methods.
- Added native implementation in `vm/ByteCodeTranslator/src/java_io_File.m` supporting both iOS (`NSFileManager`) and Linux/POSIX.
- Updated `ByteCodeTranslator` to package the new native source file.
- Patched `vm/ByteCodeTranslator/src/nativeMethods.m` and `cn1_globals.m` to support compilation on Linux (added guards and stubs).
- Added `vm/tests/src/test/java/com/codename1/tools/translator/FileClassIntegrationTest.java` to verify the implementation.
- Fixed string concatenation issues in `vm/JavaAPI` exception constructors to resolve C compilation errors.
* Implement java.io.File in JavaAPI with native support for ParparVM
- Added full implementation of `java.io.File` in `vm/JavaAPI` delegating to native methods.
- Added native implementation in `vm/ByteCodeTranslator/src/java_io_File.m` supporting both iOS (`NSFileManager`) and Linux/POSIX.
- Updated `ByteCodeTranslator` to package the new native source file.
- Patched `vm/ByteCodeTranslator/src/nativeMethods.m` and `cn1_globals.m` to support compilation on Linux (added guards and stubs).
- Added `vm/tests/src/test/java/com/codename1/tools/translator/FileClassIntegrationTest.java` to verify the implementation.
- Fixed string concatenation issues in `vm/JavaAPI` exception constructors to resolve C compilation errors.
- Added `vm/JavaAPI/src/java/util/Objects.java` to resolve missing dependency during integration tests.
* Implement java.io.File in JavaAPI with native support for ParparVM
- Added full implementation of `java.io.File` in `vm/JavaAPI` delegating to native methods.
- Added native implementation in `vm/ByteCodeTranslator/src/java_io_File.m` supporting both iOS (`NSFileManager`) and Linux/POSIX.
- Updated `ByteCodeTranslator` to package the new native source file.
- Patched `vm/ByteCodeTranslator/src/nativeMethods.m` and `cn1_globals.m` to support compilation on Linux (added guards and stubs).
- Added `vm/tests/src/test/java/com/codename1/tools/translator/FileClassIntegrationTest.java` to verify the implementation.
- Fixed string concatenation issues in `vm/JavaAPI` exception constructors to resolve C compilation errors.
- Added `vm/JavaAPI/src/java/util/Objects.java` to resolve missing dependency during integration tests.
- Removed conflicting `java.util.Objects` stub generation from `LambdaIntegrationTest`.
* Implement java.io.File in JavaAPI with native support for ParparVM
- Added full implementation of `java.io.File` in `vm/JavaAPI` delegating to native methods.
- Added native implementation in `vm/ByteCodeTranslator/src/java_io_File.m` supporting both iOS (`NSFileManager`) and Linux/POSIX.
- Updated `ByteCodeTranslator` to package the new native source file.
- Patched `vm/ByteCodeTranslator/src/nativeMethods.m` and `cn1_globals.m` to support compilation on Linux (added guards and stubs).
- Refactored common native definitions (NSString helpers, NSLog) to `cn1_globals.h`.
- Guarded privacy-sensitive file system APIs with `CN1_ENABLE_FILE_SYSTEM_STATS`.
- Updated POSIX UTF-8 decoding in `nativeMethods.m` to use the DFA decoder.
- Added `vm/tests/src/test/java/com/codename1/tools/translator/FileClassIntegrationTest.java` to verify the implementation.
- Fixed string concatenation issues in `vm/JavaAPI` exception constructors to resolve C compilation errors.
- Added `vm/JavaAPI/src/java/util/Objects.java` to resolve missing dependency during integration tests.
- Removed conflicting `java.util.Objects` stub generation from `LambdaIntegrationTest`.
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>1 parent daa53ee commit a5c39f0
File tree
14 files changed
+1261
-153
lines changed- vm
- ByteCodeTranslator/src
- com/codename1/tools/translator
- JavaAPI/src/java
- io
- lang
- util
- tests/src/test/java/com/codename1/tools/translator
14 files changed
+1261
-153
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1024 | 1024 | | |
1025 | 1025 | | |
1026 | 1026 | | |
1027 | | - | |
| 1027 | + | |
1028 | 1028 | | |
1029 | 1029 | | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
1030 | 1035 | | |
1031 | 1036 | | |
1032 | 1037 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
70 | 75 | | |
71 | 76 | | |
72 | 77 | | |
73 | | - | |
| 78 | + | |
74 | 79 | | |
| 80 | + | |
75 | 81 | | |
76 | 82 | | |
77 | 83 | | |
| |||
85 | 91 | | |
86 | 92 | | |
87 | 93 | | |
88 | | - | |
| 94 | + | |
89 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| |||
674 | 683 | | |
675 | 684 | | |
676 | 685 | | |
| 686 | + | |
677 | 687 | | |
| 688 | + | |
678 | 689 | | |
679 | 690 | | |
680 | 691 | | |
| |||
706 | 717 | | |
707 | 718 | | |
708 | 719 | | |
| 720 | + | |
709 | 721 | | |
| 722 | + | |
710 | 723 | | |
711 | 724 | | |
| 725 | + | |
712 | 726 | | |
| 727 | + | |
713 | 728 | | |
714 | 729 | | |
715 | 730 | | |
| |||
719 | 734 | | |
720 | 735 | | |
721 | 736 | | |
| 737 | + | |
722 | 738 | | |
| 739 | + | |
723 | 740 | | |
724 | 741 | | |
725 | 742 | | |
| 743 | + | |
726 | 744 | | |
| 745 | + | |
727 | 746 | | |
728 | 747 | | |
729 | 748 | | |
| |||
756 | 775 | | |
757 | 776 | | |
758 | 777 | | |
| 778 | + | |
759 | 779 | | |
| 780 | + | |
760 | 781 | | |
761 | 782 | | |
| 783 | + | |
762 | 784 | | |
| 785 | + | |
763 | 786 | | |
764 | 787 | | |
765 | 788 | | |
766 | 789 | | |
767 | 790 | | |
768 | 791 | | |
769 | 792 | | |
| 793 | + | |
770 | 794 | | |
| 795 | + | |
771 | 796 | | |
772 | 797 | | |
773 | 798 | | |
| |||
796 | 821 | | |
797 | 822 | | |
798 | 823 | | |
| 824 | + | |
799 | 825 | | |
800 | 826 | | |
801 | 827 | | |
| |||
824 | 850 | | |
825 | 851 | | |
826 | 852 | | |
| 853 | + | |
827 | 854 | | |
828 | 855 | | |
829 | 856 | | |
| |||
1249 | 1276 | | |
1250 | 1277 | | |
1251 | 1278 | | |
| 1279 | + | |
1252 | 1280 | | |
1253 | 1281 | | |
1254 | 1282 | | |
| |||
1274 | 1302 | | |
1275 | 1303 | | |
1276 | 1304 | | |
| 1305 | + | |
1277 | 1306 | | |
1278 | 1307 | | |
1279 | 1308 | | |
| |||
1308 | 1337 | | |
1309 | 1338 | | |
1310 | 1339 | | |
| 1340 | + | |
1311 | 1341 | | |
1312 | 1342 | | |
1313 | 1343 | | |
| |||
1323 | 1353 | | |
1324 | 1354 | | |
1325 | 1355 | | |
| 1356 | + | |
1326 | 1357 | | |
1327 | 1358 | | |
1328 | 1359 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
| 247 | + | |
| 248 | + | |
247 | 249 | | |
248 | 250 | | |
249 | 251 | | |
| |||
299 | 301 | | |
300 | 302 | | |
301 | 303 | | |
| 304 | + | |
| 305 | + | |
302 | 306 | | |
303 | 307 | | |
304 | 308 | | |
| |||
0 commit comments