Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

strptime fails on JRuby 9.2.9.0 #159

Closed
azumakuniyuki opened this issue Nov 29, 2019 · 3 comments
Closed

strptime fails on JRuby 9.2.9.0 #159

azumakuniyuki opened this issue Nov 29, 2019 · 3 comments
Labels
help wanted java Issue related to JRuby

Comments

@azumakuniyuki
Copy link
Member

azumakuniyuki commented Nov 29, 2019

strptime fails on JRuby 9.2.9.0

  • JRuby 9.2.9.0
  • macOS 10.14.6
  • Java 11.0.5 (2019-10-15 LTS)

lib/sisimai/data.rb

        begin
          # Convert from the date string to an object then calculate time
          # zone offset.
          t = Sisimai::Time.strptime(datestring, '%a, %d %b %Y %T')
          p['timestamp'] = (t.to_time.to_i - zoneoffset) || nil
        rescue StandardError => ce
          warn ' ***warning: Failed to strptime ' << datestring.to_s
          warn ce.to_s
        end
% /usr/local/jr/bin/jruby -Ilib -rsisimai -e 'print Sisimai.dump($*.shift)' set-of-emails/maildir/bsd/email-sendmail-32.eml
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules to method sun.nio.ch.NativeThread.signal(long)
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
 ***warning: Failed to strptime Thu, 1 Oct 2015 23:12:16
class org.jruby.ext.date.RubyDate cannot be cast to class org.jruby.ext.date.RubyDateTime (org.jruby.ext.date.RubyDate and org.jruby.ext.date.RubyDateTime are in unnamed module of loader 'bootstrap')
[]

strptime works well on JRuby 9.1.17.0

% /usr/local/jr/bin/jruby -Ilib -rsisimai -e 'print Sisimai.dump($*.shift)' set-of-emails/maildir/bsd/email-sendmail-32.eml
[{"catch":"","token":"b314cc8582c5f78c3381dbaf4b5e86d706d1c505","lhost":"c135.kyoto.example.ne.jp","rhost":"inbound-smtp.us-west-2.amazonaws.com","alias":"","listid":"","reason":"userunknown","action":"failed","subject":"Nyaaaan","messageid":"4CB0AF09-E358-4D06-82B8-B8344B55CE02@example.co.jp","replycode":"550","smtpagent":"Email::Sendmail","softbounce":0,"smtpcommand":"DATA","destination":"neko.example.jp","senderdomain":"example.co.jp","feedbacktype":"","diagnosticcode":"550 5.1.1 Requested action not taken: mailbox unavailable 503 Error: need RCPT command","diagnostictype":"SMTP","deliverystatus":"5.1.1","timezoneoffset":"+0900","addresser":"shironeko@example.co.jp","recipient":"nyaaan@neko.example.jp","timestamp":1443708736}]
@azumakuniyuki
Copy link
Member Author

#267

@azumakuniyuki
Copy link
Member Author

% /usr/local/jr/bin/jruby -v
jruby 9.3.2.0 (2.6.8) 2021-12-01 0b8223f905 Java HotSpot(TM) 64-Bit Server VM 11.0.5+10-LTS on 11.0.5+10-LTS +jit [darwin-x86_64]
% PATH="$PATH:/usr/local/jr/bin" /usr/local/jr/bin/rake test
Run options: --seed 64491

# Running:


11 public rhost engines, 5789 assertions, 0 failures
..........................
57 public lhost engines, 73080 assertions, 0 failures
................ ***warning: Sisimai.make will be removed at v5.1.0. Use Sisimai.rise instead
 ***warning: Sisimai.make will be removed at v5.1.0. Use Sisimai.rise instead
..........
57 private lhost engines, 324152 assertions, 0 failures
........................................................................ ***warning: Strange date format [Thu, 13 Cat 2000 22:22:22 +2222]
 ***warning: Strange date format [Thu, 22 Jun 2001 32:40:29 +0900]
 ***warning: Strange date format [Thu, 25 Jul 1995 00:86:00 +0900]
 ***warning: Strange date format [Thu, 31 Aug 2013 11:22:73 +0900]
 ***warning: Strange date format [Thu, 36 Sep 2009 11:22:33 +0900]
..................

Finished in 64.223237s, 2.2110 runs/s, 1152.9160 assertions/s.

142 runs, 74044 assertions, 0 failures, 0 errors, 0 skips

@azumakuniyuki
Copy link
Member Author

This issue resolved at v5.0.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted java Issue related to JRuby
Projects
None yet
Development

No branches or pull requests

1 participant