Skip to content

Commit 6636cbf

Browse files
authored
Fix/bug #91 part 1 n others (#92)
* Fix corrupt code at test case * Fix #91 part 1 But Old dat need manual replace date at recordList.dat / bookmarkList.dat
1 parent c8e47e8 commit 6636cbf

File tree

4 files changed

+15
-7
lines changed

4 files changed

+15
-7
lines changed

src/main/java/jcomicdownloader/table/BookmarkTableModel.java

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
* 定義書籤頁面的表格
2020
*/
2121
public class BookmarkTableModel extends DefaultTableModel {
22+
23+
Class[] types = { Integer.class, String.class, String.class,
24+
Date.class, String.class };
2225

2326
public BookmarkTableModel(Vector columnNames, int rowCount) {
2427
super( columnNames, rowCount) ;

src/main/java/jcomicdownloader/table/RecordTableModel.java

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
*/
2121
public class RecordTableModel extends DefaultTableModel {
2222

23+
Class[] types = { Integer.class, String.class, String.class,
24+
Date.class };
2325
public RecordTableModel(Vector columnNames, int rowCount) {
2426
super( columnNames, rowCount) ;
2527
}

src/main/java/jcomicdownloader/tools/CommonGUI.java

+9-6
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
import java.awt.*;
1515
import java.io.File;
1616
import java.io.InputStream;
17-
import java.lang.reflect.Method;
1817
import java.net.MalformedURLException;
1918
import java.net.URL;
2019
import java.net.URLClassLoader;
2120
import java.text.DateFormat;
21+
import java.text.SimpleDateFormat;
2222
import java.util.ArrayList;
2323
import java.util.Date;
2424
import java.util.List;
@@ -213,9 +213,11 @@ public static Vector<Object> getDownDataRow( int order, String title, String[] v
213213
public static Vector<Object> getBookmarkDataRow( int order, String title, String url )
214214
{
215215
Date date = new Date(); // 取得目前時間
216-
DateFormat shortFormat = DateFormat.getDateTimeInstance(
217-
DateFormat.SHORT, DateFormat.SHORT );
216+
// DateFormat shortFormat = DateFormat.getDateTimeInstance(
217+
// DateFormat.SHORT, DateFormat.SHORT );
218+
DateFormat shortFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
218219

220+
219221
Vector<Object> row = new Vector<Object>();
220222

221223
row.add( new Integer( order ) );
@@ -230,9 +232,10 @@ public static Vector<Object> getBookmarkDataRow( int order, String title, String
230232
public static Vector<Object> getRecordDataRow( int order, String title, String url )
231233
{
232234
Date date = new Date(); // 取得目前時間
233-
DateFormat shortFormat = DateFormat.getDateTimeInstance(
234-
DateFormat.SHORT, DateFormat.SHORT );
235-
235+
//DateFormat shortFormat = DateFormat.getDateTimeInstance(
236+
// DateFormat.SHORT, DateFormat.SHORT );
237+
DateFormat shortFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
238+
236239
Vector<Object> row = new Vector<Object>();
237240

238241
row.add( new Integer( order ) );

src/test/java/jcomicdownloader/TestURL.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public static Collection<Object[]> getParameters() {
5656
// {6,"http://www.dm5.com/manhua-kissxdeath/","jcomicdownloader.module.ParseDM5"}
5757
// ,
5858
// {7,"https://tieba.baidu.com/p/4941848745","jcomicdownloader.module.ParseBAIDU"}
59-
,
59+
// ,
6060
{8,"https://tieba.baidu.com/p/4978124556","jcomicdownloader.module.ParseBAIDU"}
6161

6262
}

0 commit comments

Comments
 (0)