<?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/"
	>

<channel>
	<title>cashplk的心路历程 &#187; bad code</title>
	<atom:link href="http://cashplk.com/tag/bad-code/feed/" rel="self" type="application/rss+xml" />
	<link>http://cashplk.com</link>
	<description>学无止境，梦如夏花～</description>
	<lastBuildDate>Sat, 31 Jul 2010 10:15:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>一个死循环</title>
		<link>http://cashplk.com/2009/09/29/%e4%b8%80%e4%b8%aa%e6%ad%bb%e5%be%aa%e7%8e%af/</link>
		<comments>http://cashplk.com/2009/09/29/%e4%b8%80%e4%b8%aa%e6%ad%bb%e5%be%aa%e7%8e%af/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 07:10:00 +0000</pubDate>
		<dc:creator>cashplk</dc:creator>
				<category><![CDATA[Code Snippets]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[bad code]]></category>
		<category><![CDATA[dead loop]]></category>

		<guid isPermaLink="false">http://cashplk.com/2009/09/29/%e4%b8%80%e4%b8%aa%e6%ad%bb%e5%be%aa%e7%8e%af/</guid>
		<description><![CDATA[&#160;&#160;&#160;&#160;&#160;&#160;&#160; 同事在页面上写了个死循环，跟了半天才发现。具体代码如下： for&#40;Iterator it = XXXX.iterator&#40;&#41;; it.hasNext&#40;&#41;;&#41;&#123; if&#40;XXX= XXX&#41;&#123; XX1 =true; &#125; // OTHER CODE. &#125; 具体问题出现在这里， it.hasNext()。 如果使用 it.next()，就ok了。]]></description>
			<content:encoded><![CDATA[<p>&#160;&#160;&#160;&#160;&#160;&#160;&#160; 同事在页面上写了个死循环，跟了半天才发现。具体代码如下：</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span><span style="color: #003399;">Iterator</span> it <span style="color: #339933;">=</span> XXXX.<span style="color: #006633;">iterator</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> it.<span style="color: #006633;">hasNext</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>XXX<span style="color: #339933;">=</span> XXX<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                    XX1 <span style="color: #339933;">=</span><span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
          <span style="color: #666666; font-style: italic;">// OTHER CODE.</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>具体问题出现在这里， it.hasNext()。 如果使用 it.next()，就ok了。</p>
]]></content:encoded>
			<wfw:commentRss>http://cashplk.com/2009/09/29/%e4%b8%80%e4%b8%aa%e6%ad%bb%e5%be%aa%e7%8e%af/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->