Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 79029 invoked from network); 1 Mar 2005 23:10:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 1 Mar 2005 23:10:02 -0000 Received: (qmail 41114 invoked by uid 500); 1 Mar 2005 23:10:01 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 40766 invoked by uid 500); 1 Mar 2005 23:10:00 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 40753 invoked by uid 500); 1 Mar 2005 23:10:00 -0000 Received: (qmail 40749 invoked by uid 99); 1 Mar 2005 23:10:00 -0000 X-ASF-Spam-Status: No, hits=-9.8 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from minotaur.apache.org (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.28) with SMTP; Tue, 01 Mar 2005 15:09:59 -0800 Received: (qmail 78946 invoked by uid 1818); 1 Mar 2005 23:09:58 -0000 Date: 1 Mar 2005 23:09:58 -0000 Message-ID: <20050301230958.78945.qmail@minotaur.apache.org> From: mbenson@apache.org To: ant-cvs@apache.org Subject: cvs commit: ant WHATSNEW X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N mbenson 2005/03/01 15:09:58 Modified: src/main/org/apache/tools/ant/taskdefs Get.java src/testcases/org/apache/tools/ant/taskdefs GetTest.java src/etc/testcases/taskdefs get.xml . WHATSNEW Log: Get with usetimestamp did not work when local timestamp roughly >= now. Revision Changes Path 1.49 +3 -6 ant/src/main/org/apache/tools/ant/taskdefs/Get.java Index: Get.java =================================================================== RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/Get.java,v retrieving revision 1.48 retrieving revision 1.49 diff -u -r1.48 -r1.49 --- Get.java 25 Feb 2005 22:23:07 -0000 1.48 +++ Get.java 1 Mar 2005 23:09:58 -0000 1.49 @@ -160,20 +160,17 @@ if (connection instanceof HttpURLConnection) { HttpURLConnection httpConnection = (HttpURLConnection) connection; + long lastModified = httpConnection.getLastModified(); if (httpConnection.getResponseCode() == HttpURLConnection.HTTP_NOT_MODIFIED - //workaround: doesn't work on 1.2 - || (hasTimestamp - && JavaEnvUtils.isJavaVersion(JavaEnvUtils.JAVA_1_2) - && timestamp > httpConnection.getLastModified())) { + || (lastModified != 0 && hasTimestamp + && timestamp > lastModified)) { //not modified so no file download. just return //instead and trace out something so the user //doesn't think that the download happened when it //didn't log("Not modified - so not downloaded", logLevel); return false; - // also, if timestamp is roughly >= now, HTTP_NOT_MODIFIED is _not_ - // returned... We may want to remove the 1.2 qualifier above. } // test for 401 result (HTTP only) if (httpConnection.getResponseCode() 1.14 +4 -0 ant/src/testcases/org/apache/tools/ant/taskdefs/GetTest.java Index: GetTest.java =================================================================== RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/taskdefs/GetTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- GetTest.java 25 Feb 2005 23:07:19 -0000 1.13 +++ GetTest.java 1 Mar 2005 23:09:58 -0000 1.14 @@ -64,4 +64,8 @@ executeTarget("testUseTimestamp"); } + public void testUseTomorrow() { + executeTarget("testUseTomorrow"); + } + } 1.6 +16 -2 ant/src/etc/testcases/taskdefs/get.xml Index: get.xml =================================================================== RCS file: /home/cvs/ant/src/etc/testcases/taskdefs/get.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- get.xml 25 Feb 2005 22:23:07 -0000 1.5 +++ get.xml 1 Mar 2005 23:09:58 -0000 1.6 @@ -37,11 +37,25 @@ - + + + + + + + + + + + + + + + - + 1.760 +2 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.759 retrieving revision 1.760 diff -u -r1.759 -r1.760 --- WHATSNEW 1 Mar 2005 22:59:44 -0000 1.759 +++ WHATSNEW 1 Mar 2005 23:09:58 -0000 1.760 @@ -357,6 +357,8 @@ * Get with usetimestamp did not work on Java 1.2. +* Get with usetimestamp did not work when local timestamp roughly >= now. + Changes from Ant 1.6.1 to Ant 1.6.2 =================================== --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org