Add POSIX::strftime and POSIX::mktime Perl wrappers#302
Merged
Conversation
The Java implementations for strftime and mktime already exist in POSIX.java (registered as _strftime and _mktime), but the Perl wrapper functions were missing from POSIX.pm, causing "Undefined subroutine" errors when calling these functions. This fixes ExifTool Writer test 23 which uses DateFormat option (internally calls POSIX::strftime for date formatting). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
When ASM frame computation crashes during JVM bytecode generation, getBytecode() throws InterpreterFallbackException with the already- compiled InterpretedCode. Previously, createRuntimeCode() did not catch this exception specifically, so it propagated up to eval STRING handlers which treated it as a compilation error. This fix catches InterpreterFallbackException and returns its interpretedCode directly, allowing subroutines like IPTC::IptcTime to work correctly even when they trigger ASM crashes. Fixes ExifTool MWG test 3 (IPTC:TimeCreated was retaining original value instead of being updated because SetNewValue was failing). Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
strftimeandmktimein POSIX.pm_strftimeand_mktimein POSIX.java), but the Perl-side wrappers were missingProblem
Calling
POSIX::strftime()resulted in "Undefined subroutine" error because the wrapper function was not defined in POSIX.pm, even though the Java XS implementation was already registered.Fix
Added two wrapper functions to POSIX.pm:
Testing
./jperl -e 'use POSIX qw(strftime); print strftime("%Y-%m-%d", localtime())'now worksRemaining Issue
MWG test 3 still fails with a timezone conversion issue (time
15:13:44-04:00becomes02:11:11+01:00). This is a separate bug unrelated to strftime and will be addressed in a follow-up PR.Generated with Devin