Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 78104 invoked from network); 16 Jan 2011 13:42:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 16 Jan 2011 13:42:44 -0000 Received: (qmail 35324 invoked by uid 500); 16 Jan 2011 13:42:40 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 33581 invoked by uid 500); 16 Jan 2011 13:42:35 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 33559 invoked by uid 99); 16 Jan 2011 13:42:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Jan 2011 13:42:33 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aw@ice-sa.com designates 212.85.38.228 as permitted sender) Received: from [212.85.38.228] (HELO tor.combios.es) (212.85.38.228) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 16 Jan 2011 13:42:24 +0000 Received: from [192.168.245.129] (p549E190D.dip0.t-ipconnect.de [84.158.25.13]) by tor.combios.es (Postfix) with ESMTPA id 118CB226071 for ; Sun, 16 Jan 2011 14:35:05 +0100 (CET) Message-ID: <4D32F58B.5050305@ice-sa.com> Date: Sun, 16 Jan 2011 14:41:31 +0100 From: =?UTF-8?B?QW5kcsOpIFdhcm5pZXI=?= Reply-To: Tomcat Users List User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: [OT] Setting HTTP response headers caching for 1 year doesn't work References: <4D32D59B.8020402@ice-sa.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Ran Berenfeld wrote: > well ...no... first evaluate, then assign. and constants are int by default. > I think C/C++ would have the same problem... > Maybe. But then why does the fact of specifying just the first right-hand side constant in the calculation as a long, magically change the whole result into a long ? (1000 * 60 * 60 * 24 * 365) --> int (1000L * 60 * 60 * 24 * 365) --> long Note: my intention is not to start a rant or a flame on the way Java does things. I suppose that the Java syntax rules describe this accurately. But I find this unintuitive. Specially since it appears that in your first formula, the result is overflowing at some point in the calculation, without even a warning (?). If someone writes Long a = something then someone clearly expresses the desire to obtain a Long result. And if for some obscure reason that was really not the case, one could always write Long a = (int) something I suppose that there must be some implacable logic in the way it's done now, other than the evil intention to fool the unsuspecting programmer, but I honestly fail to see it. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org