• R/O
  • SSH
  • HTTPS

orangesignal: Commit


Commit MetaInfo

Revision1722 (tree)
Time2010-03-27 18:46:28
Authorsugisawa

Log Message

CsvReader - close() 後の読込み操作で IOException がスローされず NullPointerException がスローされる不具合を修正

Change Summary

Incremental Difference

--- trunk/csv/changelog.txt (revision 1721)
+++ trunk/csv/changelog.txt (revision 1722)
@@ -3,6 +3,13 @@
33 http://orangesignal.sourceforge.jp/csv/
44
55
6+バージョン 1.3.1
7+----------------
8+
9+パッケージ jp.sf.orangesignal.csv
10+* CsvReader - close() 後の読込み操作で IOException がスローされず NullPointerException がスローされる不具合を修正
11+
12+
613 バージョン 1.3.0
714 ----------------
815
--- trunk/csv/src/test/java/jp/sf/orangesignal/csv/CsvReaderTest.java (revision 1721)
+++ trunk/csv/src/test/java/jp/sf/orangesignal/csv/CsvReaderTest.java (revision 1722)
@@ -534,13 +534,15 @@
534534 }
535535 }
536536
537-/*
538- @Test(expected = IOException.class)
537+ @Test
539538 public void testClosed() throws IOException {
539+ // Arrange
540+ exception.expect(IOException.class);
541+ exception.expectMessage("Stream closed");
540542 final CsvReader reader = new CsvReader(new StringReader(""), new CsvConfig());
541543 reader.close();
544+ // Act
542545 reader.readValues();
543546 }
544-*/
545547
546548 }
--- trunk/csv/src/main/java/jp/sf/orangesignal/csv/CsvReader.java (revision 1721)
+++ trunk/csv/src/main/java/jp/sf/orangesignal/csv/CsvReader.java (revision 1722)
@@ -268,7 +268,7 @@
268268 * @throws IOException 入出力エラーが発生した場合
269269 */
270270 private int read() throws IOException {
271- synchronized (in) {
271+ synchronized (this) {
272272 ensureOpen();
273273 if (endOfFile) {
274274 return -1;
@@ -309,7 +309,7 @@
309309 * @throws IOException 入出力エラーが発生した場合
310310 */
311311 public List<CsvToken> readTokens() throws IOException {
312- synchronized (in) {
312+ synchronized (this) {
313313 ensureOpen();
314314 if (endOfFile) {
315315 return null;
@@ -608,7 +608,7 @@
608608
609609 @Override
610610 public void close() throws IOException {
611- synchronized (in) {
611+ synchronized (this) {
612612 in.close();
613613 in = null;
614614 cfg = null;
Show on old repository browser