Small patch to org.netbeans.lib.cvsclient.command.log.LogInformation.java

Tim Pizey <[email protected]> Thu, 22 Sep 2005 10:57:43 +0100
Newsgroups gmane.comp.java.netbeans.modules.javacvs.devel
Message-ID <[email protected]>
Hi, 

Just joined, never submitted a patch to anything before, so please be gentle. 

The point of the patch is to report what is actually in the CVS file, not what 
we have modified it to, to give some chance of fixing/finding the problem 
with grep. 

I have also caught ParseException rather than Exception, as that is what we 
are expecting to be thrown. 

I think it is a shame to throw away the ParseException error and that it would 
be a big improvement to report what file this problem was being thrown 
within. 

yours
Tim P

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
patch.txt (text/plain, 1.8 KB)
Index: LogInformation.java
===================================================================
RCS file: /cvs/javacvs/libsrc/org/netbeans/lib/cvsclient/command/log/LogInformation.java,v
retrieving revision 1.18
diff -u -r1.18 LogInformation.java
--- LogInformation.java	25 Apr 2005 12:26:11 -0000	1.18
+++ LogInformation.java	22 Sep 2005 10:48:54 -0000
@@ -385,22 +385,25 @@
             return dateString;
         }
 
-        public void setDateString(String dateString) {
-            this.dateString = dateString;
+        public void setDateString(String dateStringP) {
+            this.dateString = dateStringP;
 
-            if (dateString == null) {
+            if (dateStringP == null) {
                 this.date = null;
                 return;
             }
 
             // Parse the date ...
             try {
-             // some servers use dashes to separate date components, so replace with slashes
-             // also add a default GMT timezone at the end, if the server already put one in this one will be ignored by the parser
-             dateString = dateString.replace('/', '-') + " +0000";
-             this.date = DATE_FORMAT.parse(dateString);
+             // some servers use dashes to separate date components, 
+             // so replace with slashes
+             // also add a default GMT timezone at the end, 
+             // if the server has already put one in this one will be ignored by the parser
+             String dateString2 = dateStringP.replace('/', '-');
+             dateString2 += " +0000";
+             this.date = DATE_FORMAT.parse(dateString2);
             }
-            catch (Exception ex) {
+            catch (ParseException ex) {
                 BugLog.getInstance().bug("Couldn't parse date " + dateString);
             }
         }