Skip to content

Commit 2ae8bd3

Browse files
author
pborissow
committed
Updated classes to handle new Date exceptions
git-svn-id: svn://192.168.0.80/JavaXT/javaxt-rss@146 2c7b0aa6-e0b2-3c4e-bb4a-8b65b6c465ff
1 parent 4c35d07 commit 2ae8bd3

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

src/javaxt/rss/Feed.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,14 @@ protected Feed(org.w3c.dom.Node node) {
7474
}
7575

7676
if (nodeName.equalsIgnoreCase("lastBuildDate")){
77-
if (nodeValue!=null) lastUpdate = new javaxt.utils.Date(nodeValue);
78-
if (lastUpdate.failedToParse()) lastUpdate = null;
77+
if (nodeValue!=null){
78+
try{
79+
lastUpdate = new javaxt.utils.Date(nodeValue);
80+
}
81+
catch(java.text.ParseException e){
82+
lastUpdate = null;
83+
}
84+
}
7985
}
8086

8187
if (nodeName.equals("ttl")){

src/javaxt/rss/Item.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
package javaxt.rss;
2-
3-
import java.util.ArrayList;
42
import org.w3c.dom.*;
53
import javaxt.xml.DOM;
64
import javaxt.geospatial.geometry.Geometry;
75
import javaxt.geospatial.coordinate.Parser;
86

9-
107
//******************************************************************************
118
//** RSS Item
129
//******************************************************************************
@@ -130,7 +127,14 @@ public java.net.URL getLink(){
130127
public javaxt.utils.Date getDate(){
131128
String date = pubDate;
132129
if (date.length()==0) date = dcDate;
133-
if (date.length()>0) return new javaxt.utils.Date(date);
130+
if (date.length()>0){
131+
try{
132+
return new javaxt.utils.Date(date);
133+
}
134+
catch(java.text.ParseException e){
135+
return null;
136+
}
137+
}
134138
else return null;
135139
}
136140

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy