<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>Syun -News&#38;Column- &#187; isobe</title>
	<atom:link href="http://blog.syun.co.jp/author/isobe/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.syun.co.jp</link>
	<description></description>
	<lastBuildDate>Wed, 21 Jul 2010 20:03:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.syun.co.jp/author/isobe/feed" />
		<item>
		<title>apache commons net 1.4.1の閏年処理バグ</title>
		<link>http://blog.syun.co.jp/2008/02/apache_commons_net_141.html</link>
		<comments>http://blog.syun.co.jp/2008/02/apache_commons_net_141.html#comments</comments>
		<pubDate>Fri, 29 Feb 2008 10:28:48 +0000</pubDate>
		<dc:creator>isobe</dc:creator>
				<category><![CDATA[Column]]></category>

		<guid isPermaLink="false">http://blog.syun.co.jp/wordpress/2008/02/apache-commons-net-141%e3%81%ae%e9%96%8f%e5%b9%b4%e5%87%a6%e7%90%86%e3%83%90%e3%82%b0.html </guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p>Calendar org.apache.commons.net.ftp.parser.FTPTimestampParserImpl.parseTimestamp(String timestampStr) throws ParseException<br />
には、以下の処理がある</p>
<pre>
<blockquote>

if (this.recentDateFormat != null) {
parsed = recentDateFormat.parse(timestampStr, pp);
}
</blockquote>
</pre>
<p>recentDateFormatはdefaultとして&#8221;MMM d HH:mm&#8221;の書式を持っており、コレを元にparseを行った後年号を推定するような処理となっている</p>
<p>ここで、SimpleDateFormat#parse(String text, ParsePosition pos)の処理を見ると、<br />
SUN JDKは年号の指定が無い場合Calendar.clear()した時間、即ちunix epoch timeを前提に時間の推定を行うよう実装されている</p>
<p>しかし、1970年はうるう年ではなかった為、SimpleDateFormat#setLenient(false)を呼んだparserでは、<br />
2007-02-29T18:00のような時間はparse不可能な物として排除されてしまう。</p>
<p>なら、他のJVMなら上手く動くかも?と予測するが今更テストする気にもならない。<br />
だって、既に2月29日になってしまっているのだから</p>
<p><span id="more-28"></span><br />
対応として、<a href="http://svn.apache.org/viewvc?view=rev&#038;revision=632584">fix</a>が出ているのでコレを当てると正常に動作する。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.syun.co.jp/2008/02/apache_commons_net_141.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://blog.syun.co.jp/2008/02/apache_commons_net_141.html" />
	</item>
	</channel>
</rss>
