Archive

Posts Tagged ‘dead loop’

一个死循环

September 29th, 2009 cashplk No comments

        同事在页面上写了个死循环,跟了半天才发现。具体代码如下:

for(Iterator it = XXXX.iterator(); it.hasNext();){
        if(XXX= XXX){
                    XX1 =true;
        }
          // OTHER CODE.
}

具体问题出现在这里, it.hasNext()。 如果使用 it.next(),就ok了。

Categories: Code Snippets, Java Tags: , ,

cashplk的心路历程 is Digg proof thanks to caching by WP Super Cache