程序中用了两次的 iterator.next:
@Test
public void test() {
Iterator iterator = System.getProperties().keySet().iterator();
while(iterator.hasNext()){
Logger.print(iterator.next() + "=" + properties.getProperty(iterator.next().toString()));
}
}
改为:
@Test
public void test() {
Iterator iterator = System.getProperties().keySet().iterator();
while(iterator.hasNext()){
String key = iterator.next().toString();
Logger.print(key + "=" + properties.getProperty(key));
}
}