Return-Path: Delivered-To: apmail-turbine-user-archive@www.apache.org Received: (qmail 6149 invoked from network); 14 Jun 2007 15:39:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 14 Jun 2007 15:39:55 -0000 Received: (qmail 53471 invoked by uid 500); 14 Jun 2007 15:39:57 -0000 Delivered-To: apmail-turbine-user-archive@turbine.apache.org Received: (qmail 53453 invoked by uid 500); 14 Jun 2007 15:39:57 -0000 Mailing-List: contact user-help@turbine.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Turbine Users List" Delivered-To: mailing list user@turbine.apache.org Received: (qmail 53437 invoked by uid 99); 14 Jun 2007 15:39:56 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2007 08:39:56 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: local policy) Received: from [64.79.231.74] (HELO blr02.bynum.com) (64.79.231.74) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 14 Jun 2007 08:39:51 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: Calendar vs GregorianCalendar Date: Thu, 14 Jun 2007 10:37:07 -0500 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Calendar vs GregorianCalendar Thread-Index: AcerqmZouRN40XnCQxeX8U8H95uUeQC6xUAA From: "jill han" To: "Turbine Users List" X-Virus-Checked: Checked by ClamAV on apache.org I know it is not related to turbine question, but I still count on your help. Here is a code snippet=20 **************** private List getResponsesToProcess() throws TorqueException { // get the current date and set the time to midnight Calendar today =3D Calendar.getInstance(); today.set(Calendar.HOUR_OF_DAY, 0); today.set(Calendar.MINUTE, 0); today.set(Calendar.HOUR_OF_DAY, 0); today.set(Calendar.MILLISECOND, 0); // select all responses that are email Criteria crit =3D new Criteria(); crit.addJoin(XXXPeer.DELIVERY_METHOD_ID, XXXXPeer.OBJECT_ID); .... crit.add(ResponsePeer.DELIVERY_DATE, today.getTime(), Criteria.LESS_EQUAL); List results =3D ResponsePeer.doSelect(crit); crit =3D new Criteria(); crit.addJoin(XXXPeer.DELIVERY_METHOD_ID, XXXXPeer.OBJECT_ID); ... results.addAll(XXXPeer.doSelect(crit)); return results; } ***************** However someone suggested to=20 "Synchronize the part of the code that uses the Calendar objects or create new objects of GregorianCalendar and avoid using Calender.getInstance unless that part of the code is synchronized" I didn't see why it needs synchronization and the applicable difference of GregorianCalendar and Calender object. I really appreciate if someone could give some insights into it=20 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@turbine.apache.org For additional commands, e-mail: user-help@turbine.apache.org