Update of /cvsroot/roller/roller/src/org/roller/presentation/weblog/formbeans
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19384/src/org/roller/presentation/weblog/formbeans
Modified Files:
WeblogEntryFormEx.java
Log Message:
Fixed 381: If you delete an entry, and then try to add a new one, stack trace
occurs
http://opensource.atlassian.com/projects/roller/browse/ROL-381
Index: WeblogEntryFormEx.java
===================================================================
RCS file:
/cvsroot/roller/roller/src/org/roller/presentation/weblog/formbeans/WeblogEntryFormEx.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** WeblogEntryFormEx.java 25 May 2004 21:52:52 -0000 1.25
--- WeblogEntryFormEx.java 31 May 2004 17:45:00 -0000 1.26
***************
*** 69,89 ****
{
super.copyTo(entry, locale);
!
! final DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT,
locale);
! final Date newDate;
! try
{
! newDate = df.parse(getDateString());
! }
! catch (ParseException e)
{
! throw new RollerException("ERROR parsing date.");
}
- final Calendar cal = Calendar.getInstance(locale);
- cal.setTime(newDate);
- cal.set(Calendar.HOUR_OF_DAY, getHours().intValue());
- cal.set(Calendar.MINUTE, getMinutes().intValue());
- cal.set(Calendar.SECOND, getSeconds().intValue());
- entry.setPubTime(new Timestamp(cal.getTimeInMillis()));
entry.setPlugins( StringUtils.join(this.pluginsArray,",") );
--- 69,95 ----
{
super.copyTo(entry, locale);
! if (entry.getPubTime() != null)
{
! final DateFormat df =
DateFormat.getDateInstance(DateFormat.SHORT, locale);
! final Date newDate;
! try
! {
! newDate = df.parse(getDateString());
! }
! catch (ParseException e)
! {
! throw new RollerException("ERROR parsing date.");
! }
! final Calendar cal = Calendar.getInstance(locale);
! cal.setTime(newDate);
! cal.set(Calendar.HOUR_OF_DAY, getHours().intValue());
! cal.set(Calendar.MINUTE, getMinutes().intValue());
! cal.set(Calendar.SECOND, getSeconds().intValue());
! entry.setPubTime(new Timestamp(cal.getTimeInMillis()));
! }
! else
{
! entry.setPubTime(new Timestamp(new Date().getTime()));
}
entry.setPlugins( StringUtils.join(this.pluginsArray,",") );
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
|