You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ag...@apache.org on 2005/11/03 21:02:37 UTC
svn commit: r330617 - in /incubator/roller/trunk/src/org/roller: business/
pojos/
Author: agilliland
Date: Thu Nov 3 12:02:30 2005
New Revision: 330617
URL: http://svn.apache.org/viewcvs?rev=330617&view=rev
Log:
fix for intermittent "null" bug (part II)
* changed attribute access levels to private
* changed setData() method to use getters instead of direct access
* changed equals() method to use getters instead of direct access
Modified:
incubator/roller/trunk/src/org/roller/business/HitCountData.java
incubator/roller/trunk/src/org/roller/pojos/AutoPingData.java
incubator/roller/trunk/src/org/roller/pojos/CommentData.java
incubator/roller/trunk/src/org/roller/pojos/PingQueueEntryData.java
incubator/roller/trunk/src/org/roller/pojos/PingTargetData.java
incubator/roller/trunk/src/org/roller/pojos/PlanetGroupData.java
incubator/roller/trunk/src/org/roller/pojos/PlanetGroupSubscriptionAssoc.java
incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryData.java
incubator/roller/trunk/src/org/roller/pojos/WeblogEntryData.java
incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java
Modified: incubator/roller/trunk/src/org/roller/business/HitCountData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/business/HitCountData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/business/HitCountData.java (original)
+++ incubator/roller/trunk/src/org/roller/business/HitCountData.java Thu Nov 3 12:02:30 2005
@@ -1,5 +1,7 @@
package org.roller.business;
+import org.roller.pojos.WebsiteData;
+
/**
* Hit count bean.
* @author David M Johnson
@@ -11,12 +13,12 @@
extends org.roller.pojos.PersistentObject
implements java.io.Serializable
{
- static final long serialVersionUID = -7998453141931097201L;
+ public static final long serialVersionUID = -7998453141931097201L;
- protected java.lang.String id;
- protected java.lang.Integer dayHitCount;
- protected java.lang.Integer totalHitCount;
- protected org.roller.pojos.WebsiteData website;
+ private String id = null;
+ private Integer dayHitCount = null;
+ private Integer totalHitCount = null;
+ private WebsiteData website = null;
public HitCountData()
{
@@ -32,9 +34,7 @@
public HitCountData( HitCountData otherData )
{
- this.id = otherData.id;
- this.totalHitCount = otherData.totalHitCount;
- this.dayHitCount = otherData.dayHitCount;
+ this.setData(otherData);
}
/** @castor:field set-method="setId"
@@ -111,27 +111,27 @@
if( this.id == null )
{
- lEquals = lEquals && ( lTest.id == null );
+ lEquals = lEquals && ( lTest.getId() == null );
}
else
{
- lEquals = lEquals && this.id.equals( lTest.id );
+ lEquals = lEquals && this.id.equals( lTest.getId());
}
if( this.dayHitCount == null )
{
- lEquals = lEquals && ( lTest.dayHitCount == null );
+ lEquals = lEquals && ( lTest.getDayHitCount() == null );
}
else
{
- lEquals = lEquals && this.dayHitCount.equals( lTest.dayHitCount );
+ lEquals = lEquals && this.dayHitCount.equals( lTest.getDayHitCount());
}
if( this.totalHitCount == null )
{
- lEquals = lEquals && ( lTest.totalHitCount == null );
+ lEquals = lEquals && ( lTest.getTotalHitCount() == null );
}
else
{
- lEquals= lEquals && this.totalHitCount.equals(lTest.totalHitCount);
+ lEquals= lEquals && this.totalHitCount.equals(lTest.getTotalHitCount());
}
return lEquals;
@@ -156,11 +156,11 @@
*/
public void setData( org.roller.pojos.PersistentObject otherData )
{
-
- this.id = ((HitCountData)otherData).id;
-
- this.dayHitCount = ((HitCountData)otherData).dayHitCount;
- this.totalHitCount = ((HitCountData)otherData).totalHitCount;
+ HitCountData other = (HitCountData)otherData;
+
+ this.id = other.getId();
+ this.dayHitCount = other.getDayHitCount();
+ this.totalHitCount = other.getTotalHitCount();
}
}
Modified: incubator/roller/trunk/src/org/roller/pojos/AutoPingData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/AutoPingData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/AutoPingData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/AutoPingData.java Thu Nov 3 12:02:30 2005
@@ -21,11 +21,11 @@
*/
public class AutoPingData extends PersistentObject implements Serializable
{
- protected String id;
- protected PingTargetData pingTarget;
- protected WebsiteData website;
+ private String id = null;
+ private PingTargetData pingTarget = null;
+ private WebsiteData website = null;
- static final long serialVersionUID = -9105985454111986435L;
+ public static final long serialVersionUID = -9105985454111986435L;
/**
* Default constructor. Leaves all fields null. Required for bean compliance.
@@ -54,9 +54,10 @@
public void setData(PersistentObject vo)
{
AutoPingData other = (AutoPingData)vo;
- id = other.id;
- website = other.website;
- pingTarget = other.pingTarget;
+
+ id = other.getId();
+ website = other.getWebsite();
+ pingTarget = other.getPingTarget();
}
/**
@@ -140,9 +141,9 @@
final AutoPingData autoPingData = (AutoPingData)o;
- if (id != null ? !id.equals(autoPingData.id) : autoPingData.id != null) return false;
- if (pingTarget != null ? !pingTarget.equals(autoPingData.pingTarget) : autoPingData.pingTarget != null) return false;
- if (website != null ? !website.equals(autoPingData.website) : autoPingData.website != null) return false;
+ if (id != null ? !id.equals(autoPingData.getId()) : autoPingData.getId() != null) return false;
+ if (pingTarget != null ? !pingTarget.equals(autoPingData.getPingTarget()) : autoPingData.getPingTarget() != null) return false;
+ if (website != null ? !website.equals(autoPingData.getWebsite()) : autoPingData.getWebsite() != null) return false;
return true;
}
Modified: incubator/roller/trunk/src/org/roller/pojos/CommentData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/CommentData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/CommentData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/CommentData.java Thu Nov 3 12:02:30 2005
@@ -1,5 +1,6 @@
package org.roller.pojos;
+import java.sql.Timestamp;
import org.roller.util.PojoUtil;
/**
@@ -14,18 +15,21 @@
public class CommentData extends org.roller.pojos.PersistentObject
implements java.io.Serializable
{
- static final long serialVersionUID = -6668122596726478462L;
- protected java.lang.String id;
- protected java.lang.String name;
- protected java.lang.String email;
- protected java.lang.String url;
- protected java.lang.String content;
- protected java.sql.Timestamp postTime;
- protected WeblogEntryData mWeblogEntry;
- protected Boolean spam;
- protected Boolean notify;
- protected String remoteHost;
+ public static final long serialVersionUID = -6668122596726478462L;
+
+ private String id = null;
+ private String name = null;
+ private String email = null;
+ private String url = null;
+ private String content = null;
+ private Timestamp postTime = null;
+ private Boolean spam = Boolean.FALSE;
+ private Boolean notify = Boolean.FALSE;
+ private String remoteHost = null;
+
+ private WeblogEntryData weblogEntry = null;
+
public CommentData()
{
spam = Boolean.FALSE;
@@ -46,21 +50,12 @@
this.spam = spam;
this.notify = notify;
- mWeblogEntry = entry;
+ weblogEntry = entry;
}
public CommentData(CommentData otherData)
{
- this.id = otherData.id;
- this.name = otherData.name;
- this.email = otherData.email;
- this.url = otherData.url;
- this.content = otherData.content;
- this.postTime = otherData.postTime;
- this.spam = otherData.spam;
- this.notify = otherData.notify;
-
- mWeblogEntry = otherData.mWeblogEntry;
+ this.setData(otherData);
}
/**
@@ -87,13 +82,13 @@
*/
public WeblogEntryData getWeblogEntry()
{
- return mWeblogEntry;
+ return weblogEntry;
}
/** @ejb:persistent-field */
public void setWeblogEntry(WeblogEntryData entry)
{
- mWeblogEntry = entry;
+ weblogEntry = entry;
}
/**
@@ -250,15 +245,15 @@
CommentData lTest = (CommentData) pOther;
boolean lEquals = true;
- lEquals = PojoUtil.equals(lEquals, this.id, lTest.id);
- lEquals = PojoUtil.equals(lEquals, this.mWeblogEntry, lTest.mWeblogEntry);
- lEquals = PojoUtil.equals(lEquals, this.name, lTest.name);
- lEquals = PojoUtil.equals(lEquals, this.email, lTest.email);
- lEquals = PojoUtil.equals(lEquals, this.url, lTest.url);
- lEquals = PojoUtil.equals(lEquals, this.content, lTest.content);
- lEquals = PojoUtil.equals(lEquals, this.postTime, lTest.postTime);
- lEquals = PojoUtil.equals(lEquals, this.spam, lTest.spam);
- lEquals = PojoUtil.equals(lEquals, this.notify, lTest.notify);
+ lEquals = PojoUtil.equals(lEquals, this.id, lTest.getId());
+ lEquals = PojoUtil.equals(lEquals, this.weblogEntry, lTest.getWeblogEntry());
+ lEquals = PojoUtil.equals(lEquals, this.name, lTest.getName());
+ lEquals = PojoUtil.equals(lEquals, this.email, lTest.getEmail());
+ lEquals = PojoUtil.equals(lEquals, this.url, lTest.getUrl());
+ lEquals = PojoUtil.equals(lEquals, this.content, lTest.getContent());
+ lEquals = PojoUtil.equals(lEquals, this.postTime, lTest.getPostTime());
+ lEquals = PojoUtil.equals(lEquals, this.spam, lTest.getSpam());
+ lEquals = PojoUtil.equals(lEquals, this.notify, lTest.getNotify());
return lEquals;
}
@@ -272,7 +267,7 @@
{
int result = 17;
result = PojoUtil.addHashCode(result, this.id);
- result = PojoUtil.addHashCode(result, this.mWeblogEntry);
+ result = PojoUtil.addHashCode(result, this.weblogEntry);
result = PojoUtil.addHashCode(result, this.name);
result = PojoUtil.addHashCode(result, this.email);
result = PojoUtil.addHashCode(result, this.url);
@@ -290,15 +285,16 @@
public void setData(org.roller.pojos.PersistentObject otherData)
{
CommentData otherComment = (CommentData) otherData;
- this.id = otherComment.id;
- this.mWeblogEntry = otherComment.mWeblogEntry;
- this.name = otherComment.name;
- this.email = otherComment.email;
- this.url = otherComment.url;
- this.content = otherComment.content;
- this.postTime = otherComment.postTime;
- this.spam = otherComment.spam;
- this.notify = otherComment.notify;
+
+ this.id = otherComment.getId();
+ this.weblogEntry = otherComment.getWeblogEntry();
+ this.name = otherComment.getName();
+ this.email = otherComment.getEmail();
+ this.url = otherComment.getUrl();
+ this.content = otherComment.getContent();
+ this.postTime = otherComment.getPostTime();
+ this.spam = otherComment.getSpam();
+ this.notify = otherComment.getNotify();
}
}
Modified: incubator/roller/trunk/src/org/roller/pojos/PingQueueEntryData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/PingQueueEntryData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/PingQueueEntryData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/PingQueueEntryData.java Thu Nov 3 12:02:30 2005
@@ -22,13 +22,13 @@
*/
public class PingQueueEntryData extends PersistentObject implements Serializable
{
- String id;
- Timestamp entryTime;
- PingTargetData pingTarget;
- WebsiteData website;
- int attempts;
+ private String id = null;
+ private Timestamp entryTime = null;
+ private PingTargetData pingTarget = null;
+ private WebsiteData website = null;
+ private int attempts = 0;
- static final long serialVersionUID = -1468021030819538243L;
+ public static final long serialVersionUID = -1468021030819538243L;
/**
* Default constructor. Leaves all fields at Java-specified default values.
@@ -61,11 +61,12 @@
public void setData(PersistentObject vo)
{
PingQueueEntryData other = (PingQueueEntryData) vo;
- id = other.id;
- entryTime = other.entryTime;
- pingTarget = other.pingTarget;
- website = other.website;
- attempts = other.attempts;
+
+ id = other.getId();
+ entryTime = other.getEntryTime();
+ pingTarget = other.getPingTarget();
+ website = other.getWebsite();
+ attempts = other.getAttempts();
}
/**
@@ -203,11 +204,11 @@
final PingQueueEntryData pingQueueEntryData = (PingQueueEntryData) o;
- if (attempts != pingQueueEntryData.attempts) return false;
- if (entryTime != null ? !entryTime.equals(pingQueueEntryData.entryTime) : pingQueueEntryData.entryTime != null) return false;
- if (id != null ? !id.equals(pingQueueEntryData.id) : pingQueueEntryData.id != null) return false;
- if (pingTarget != null ? !pingTarget.equals(pingQueueEntryData.pingTarget) : pingQueueEntryData.pingTarget != null) return false;
- if (website != null ? !website.equals(pingQueueEntryData.website) : pingQueueEntryData.website != null) return false;
+ if (attempts != pingQueueEntryData.getAttempts()) return false;
+ if (entryTime != null ? !entryTime.equals(pingQueueEntryData.getEntryTime()) : pingQueueEntryData.getEntryTime() != null) return false;
+ if (id != null ? !id.equals(pingQueueEntryData.getId()) : pingQueueEntryData.getId() != null) return false;
+ if (pingTarget != null ? !pingTarget.equals(pingQueueEntryData.getPingTarget()) : pingQueueEntryData.getPingTarget() != null) return false;
+ if (website != null ? !website.equals(pingQueueEntryData.getWebsite()) : pingQueueEntryData.getWebsite() != null) return false;
return true;
}
Modified: incubator/roller/trunk/src/org/roller/pojos/PingTargetData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/PingTargetData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/PingTargetData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/PingTargetData.java Thu Nov 3 12:02:30 2005
@@ -29,18 +29,18 @@
*/
public class PingTargetData extends PersistentObject implements Serializable
{
- protected String id;
- protected String name;
- protected String pingUrl;
- protected WebsiteData website;
- protected int conditionCode;
- protected Timestamp lastSuccess;
+ private String id = null;
+ private String name = null;
+ private String pingUrl = null;
+ private WebsiteData website = null;
+ private int conditionCode = -1;
+ private Timestamp lastSuccess = null;
public static final int CONDITION_OK = 0; // last use (after possible retrials) was successful
public static final int CONDITION_FAILING = 1; // last use failed after retrials
public static final int CONDITION_DISABLED = 2; // disabled by failure policy after failures - editing resets
- static final long serialVersionUID = -6354583200913127874L;
+ public static final long serialVersionUID = -6354583200913127874L;
/**
* Default empty constructor.
@@ -73,12 +73,13 @@
public void setData(PersistentObject vo)
{
PingTargetData other = (PingTargetData) vo;
- id = other.id;
- name = other.name;
- pingUrl = other.pingUrl;
- website = other.website;
- conditionCode = other.conditionCode;
- lastSuccess = other.lastSuccess;
+
+ id = other.getId();
+ name = other.getName();
+ pingUrl = other.getPingUrl();
+ website = other.getWebsite();
+ conditionCode = other.getConditionCode();
+ lastSuccess = other.getLastSuccess();
}
@@ -246,12 +247,12 @@
final PingTargetData pingTargetData = (PingTargetData) o;
- if (conditionCode != pingTargetData.conditionCode) return false;
- if (id != null ? !id.equals(pingTargetData.id) : pingTargetData.id != null) return false;
- if (lastSuccess != null ? !lastSuccess.equals(pingTargetData.lastSuccess) : pingTargetData.lastSuccess != null) return false;
- if (name != null ? !name.equals(pingTargetData.name) : pingTargetData.name != null) return false;
- if (pingUrl != null ? !pingUrl.equals(pingTargetData.pingUrl) : pingTargetData.pingUrl != null) return false;
- if (website != null ? !website.equals(pingTargetData.website) : pingTargetData.website != null) return false;
+ if (conditionCode != pingTargetData.getConditionCode()) return false;
+ if (id != null ? !id.equals(pingTargetData.getId()) : pingTargetData.getId() != null) return false;
+ if (lastSuccess != null ? !lastSuccess.equals(pingTargetData.getLastSuccess()) : pingTargetData.getLastSuccess() != null) return false;
+ if (name != null ? !name.equals(pingTargetData.getName()) : pingTargetData.getName() != null) return false;
+ if (pingUrl != null ? !pingUrl.equals(pingTargetData.getPingUrl()) : pingTargetData.getPingUrl() != null) return false;
+ if (website != null ? !website.equals(pingTargetData.getWebsite()) : pingTargetData.getWebsite() != null) return false;
return true;
}
Modified: incubator/roller/trunk/src/org/roller/pojos/PlanetGroupData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/PlanetGroupData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/PlanetGroupData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/PlanetGroupData.java Thu Nov 3 12:02:30 2005
@@ -35,28 +35,28 @@
transient private String[] catArray = null;
/** Database ID */
- protected String id;
+ private String id = null;
/** Unique handle by which group may be fetched */
- protected String handle;
+ private String handle = null;
/** Title of this group */
- protected String title;
+ private String title = null;
/** Description of this group */
- protected String description;
+ private String description = null;
/** Restrict group by this list of comma separated category names */
- protected String categoryRestriction;
+ private String categoryRestriction = null;
/** Max number of entries to show in HTML representation of this group */
- protected int maxPageEntries = 45;
+ private int maxPageEntries = 45;
/** Max number of entries to show in feed representation of this group */
- protected int maxFeedEntries = 45;
+ private int maxFeedEntries = 45;
/** Subscriptions in this group */
- protected List subscriptionAssocs = new ArrayList();
+ private List subscriptionAssocs = new ArrayList();
//------------------------------------------------------- persistent fields
Modified: incubator/roller/trunk/src/org/roller/pojos/PlanetGroupSubscriptionAssoc.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/PlanetGroupSubscriptionAssoc.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/PlanetGroupSubscriptionAssoc.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/PlanetGroupSubscriptionAssoc.java Thu Nov 3 12:02:30 2005
@@ -27,10 +27,10 @@
implements Serializable
{
/** Database ID */
- protected String id;
+ private String id = null;
- protected PlanetGroupData group;
- protected PlanetSubscriptionData subscription;
+ private PlanetGroupData group = null;
+ private PlanetSubscriptionData subscription = null;
//----------------------------------------------------------- persistent fields
/**
Modified: incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryData.java Thu Nov 3 12:02:30 2005
@@ -20,17 +20,18 @@
*/
public class WeblogCategoryData extends HierarchicalPersistentObject
{
- static final long serialVersionUID = 1435782148712018954L;
+ public static final long serialVersionUID = 1435782148712018954L;
- protected java.lang.String id = null;
- protected java.lang.String name;
- protected java.lang.String description;
- protected java.lang.String image;
+ private String id = null;
+ private String name = null;
+ private String description = null;
+ private String image = null;
- protected String cachedPath = null;
+ private String cachedPath = null;
- protected WebsiteData mWebsite;
- protected List mWeblogCategories;
+ private WebsiteData website = null;
+ private List weblogCategories = null;
+
public WeblogCategoryData()
{
@@ -45,7 +46,7 @@
java.lang.String image)
{
this.id = id;
- this.mWebsite = website;
+ this.website = website;
this.mNewParent = parent;
this.name = name;
this.description = description;
@@ -54,23 +55,25 @@
public WeblogCategoryData(WeblogCategoryData otherData)
{
- this.id = otherData.id;
- this.mWebsite = otherData.mWebsite;
- this.mNewParent = otherData.mNewParent;
- this.name = otherData.name;
- this.description = otherData.description;
- this.image = otherData.image;
+ this.setData(otherData);
}
/** Setter is needed in RollerImpl.storePersistentObject(). */
public void setData(org.roller.pojos.PersistentObject otherData)
{
- this.id = ((WeblogCategoryData) otherData).id;
- this.mWebsite = ((WeblogCategoryData) otherData).mWebsite;
- this.mNewParent = ((WeblogCategoryData) otherData).mNewParent;
- this.name = ((WeblogCategoryData) otherData).name;
- this.description = ((WeblogCategoryData) otherData).description;
- this.image = ((WeblogCategoryData) otherData).image;
+ WeblogCategoryData other = (WeblogCategoryData) otherData;
+
+ this.id = other.getId();
+ this.website = other.getWebsite();
+ this.name = other.getName();
+ this.description = other.getDescription();
+ this.image = other.getImage();
+
+ try {
+ this.mNewParent = other.getParent();
+ } catch(RollerException re) {
+ // why does this throw an exception?
+ }
}
public void save() throws RollerException
@@ -238,28 +241,14 @@
*/
public WebsiteData getWebsite()
{
- return mWebsite;
+ return website;
}
/** @ejb:persistent-field */
public void setWebsite(WebsiteData website)
{
- mWebsite = website;
+ this.website = website;
}
-// /**
-// * @ejb:persistent-field
-// *
-// * @hibernate.many-to-one column="websiteid" cascade="none" not-null="true"
-// */
-// public WeblogCategoryAssoc getWeblogCategoryAssoc()
-// {
-// return mWeblogCategoryAssoc;
-// }
-// /** @ejb:persistent-field */
-// public void setWeblogCategoryAssoc(WebsiteData website)
-// {
-// WeblogCategoryAssoc = weblogCategoryAssoc;
-// }
/**
* Return parent category, or null if category is root of hierarchy.
@@ -297,19 +286,19 @@
*/
public List getWeblogCategories() throws RollerException
{
- if (mWeblogCategories == null)
+ if (weblogCategories == null)
{
- mWeblogCategories = new LinkedList();
+ weblogCategories = new LinkedList();
List childAssocs = getChildAssocs();
Iterator childIter = childAssocs.iterator();
while (childIter.hasNext())
{
WeblogCategoryAssoc assoc =
(WeblogCategoryAssoc) childIter.next();
- mWeblogCategories.add(assoc.getCategory());
+ weblogCategories.add(assoc.getCategory());
}
}
- return mWeblogCategories;
+ return weblogCategories;
}
/**
@@ -443,7 +432,7 @@
result = 37 * result + ((this.id != null) ? this.id.hashCode() : 0);
result =
37 * result
- + ((this.mWebsite != null) ? this.mWebsite.hashCode() : 0);
+ + ((this.website != null) ? this.website.hashCode() : 0);
result = 37 * result + ((this.name != null) ? this.name.hashCode() : 0);
result =
37 * result
Modified: incubator/roller/trunk/src/org/roller/pojos/WeblogEntryData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/WeblogEntryData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/WeblogEntryData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/WeblogEntryData.java Thu Nov 3 12:02:30 2005
@@ -43,31 +43,31 @@
private static Log mLogger =
LogFactory.getFactory().getInstance(WeblogEntryData.class);
- static final long serialVersionUID = 2341505386843044125L;
+ public static final long serialVersionUID = 2341505386843044125L;
public static final String DRAFT = "DRAFT";
public static final String PENDING = "PENDING";
public static final String PUBLISHED = "PUBLISHED";
// Simple properies
- protected String id = null;
- protected String title = null;
- protected String link = null;
- protected String text = null;
- protected String anchor = null;
- protected Timestamp pubTime = null;
- protected Timestamp updateTime = null;
- protected String plugins = null;
- protected Boolean allowComments = Boolean.TRUE;
- protected Integer commentDays = new Integer(7);
- protected Boolean rightToLeft = Boolean.FALSE;
- protected Boolean pinnedToMain = Boolean.FALSE;
- protected String status = DRAFT;
+ private String id = null;
+ private String title = null;
+ private String link = null;
+ private String text = null;
+ private String anchor = null;
+ private Timestamp pubTime = null;
+ private Timestamp updateTime = null;
+ private String plugins = null;
+ private Boolean allowComments = Boolean.TRUE;
+ private Integer commentDays = new Integer(7);
+ private Boolean rightToLeft = Boolean.FALSE;
+ private Boolean pinnedToMain = Boolean.FALSE;
+ private String status = DRAFT;
// Associated objects
- protected UserData creator = null;
- protected WebsiteData website = null;
- protected WeblogCategoryData category = null;
+ private UserData creator = null;
+ private WebsiteData website = null;
+ private WeblogCategoryData category = null;
// Collection of name/value entry attributes
private Map attMap = new HashMap();
@@ -107,7 +107,7 @@
public WeblogEntryData(WeblogEntryData otherData)
{
- setData(otherData);
+ this.setData(otherData);
}
//---------------------------------------------------------- Initializaion
@@ -118,22 +118,23 @@
public void setData(org.roller.pojos.PersistentObject otherData)
{
WeblogEntryData other = (WeblogEntryData)otherData;
- this.id = other.id;
- this.category = other.category;
- this.website = other.website;
- this.creator = other.creator;
- this.title = other.title;
- this.link = other.link;
- this.text = other.text;
- this.anchor = other.anchor;
- this.pubTime = other.pubTime;
- this.updateTime = other.updateTime;
- this.status = other.status;
- this.plugins = other.plugins;
- this.allowComments = other.allowComments;
- this.commentDays = other.commentDays;
- this.rightToLeft = other.rightToLeft;
- this.pinnedToMain = other.pinnedToMain;
+
+ this.id = other.getId();
+ this.category = other.getCategory();
+ this.website = other.getWebsite();
+ this.creator = other.getCreator();
+ this.title = other.getTitle();
+ this.link = other.getLink();
+ this.text = other.getText();
+ this.anchor = other.getAnchor();
+ this.pubTime = other.getPubTime();
+ this.updateTime = other.getUpdateTime();
+ this.status = other.getStatus();
+ this.plugins = other.getPlugins();
+ this.allowComments = other.getAllowComments();
+ this.commentDays = other.getCommentDays();
+ this.rightToLeft = other.getRightToLeft();
+ this.pinnedToMain = other.getPinnedToMain();
}
//------------------------------------------------------ Simple properties
@@ -842,95 +843,95 @@
if (this.id == null)
{
- lEquals = lEquals && (lTest.id == null);
+ lEquals = lEquals && (lTest.getId() == null);
}
else
{
- lEquals = lEquals && this.id.equals(lTest.id);
+ lEquals = lEquals && this.id.equals(lTest.getId());
}
if (this.category == null)
{
- lEquals = lEquals && (lTest.category == null);
+ lEquals = lEquals && (lTest.getCategory() == null);
}
else
{
- lEquals = lEquals && this.category.equals(lTest.category);
+ lEquals = lEquals && this.category.equals(lTest.getCategory());
}
if (this.website == null)
{
- lEquals = lEquals && (lTest.website == null);
+ lEquals = lEquals && (lTest.getWebsite() == null);
}
else
{
- lEquals = lEquals && this.website.equals(lTest.website);
+ lEquals = lEquals && this.website.equals(lTest.getWebsite());
}
if (this.title == null)
{
- lEquals = lEquals && (lTest.title == null);
+ lEquals = lEquals && (lTest.getTitle() == null);
}
else
{
- lEquals = lEquals && this.title.equals(lTest.title);
+ lEquals = lEquals && this.title.equals(lTest.getTitle());
}
if (this.text == null)
{
- lEquals = lEquals && (lTest.text == null);
+ lEquals = lEquals && (lTest.getText() == null);
}
else
{
- lEquals = lEquals && this.text.equals(lTest.text);
+ lEquals = lEquals && this.text.equals(lTest.getText());
}
if (this.anchor == null)
{
- lEquals = lEquals && (lTest.anchor == null);
+ lEquals = lEquals && (lTest.getAnchor() == null);
}
else
{
- lEquals = lEquals && this.anchor.equals(lTest.anchor);
+ lEquals = lEquals && this.anchor.equals(lTest.getAnchor());
}
if (this.pubTime == null)
{
- lEquals = lEquals && (lTest.pubTime == null);
+ lEquals = lEquals && (lTest.getPubTime() == null);
}
else
{
- lEquals = lEquals && this.pubTime.equals(lTest.pubTime);
+ lEquals = lEquals && this.pubTime.equals(lTest.getPubTime());
}
if (this.updateTime == null)
{
- lEquals = lEquals && (lTest.updateTime == null);
+ lEquals = lEquals && (lTest.getUpdateTime() == null);
}
else
{
lEquals = lEquals &&
- this.updateTime.equals(lTest.updateTime);
+ this.updateTime.equals(lTest.getUpdateTime());
}
if (this.status == null)
{
- lEquals = lEquals && (lTest.status == null);
+ lEquals = lEquals && (lTest.getStatus() == null);
}
else
{
lEquals = lEquals &&
- this.status.equals(lTest.status);
+ this.status.equals(lTest.getStatus());
}
if (this.plugins == null)
{
- lEquals = lEquals && (lTest.plugins == null);
+ lEquals = lEquals && (lTest.getPlugins() == null);
}
else
{
lEquals = lEquals &&
- this.plugins.equals(lTest.plugins);
+ this.plugins.equals(lTest.getPlugins());
}
Modified: incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java?rev=330617&r1=330616&r2=330617&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/WebsiteData.java Thu Nov 3 12:02:30 2005
@@ -34,37 +34,37 @@
public class WebsiteData extends org.roller.pojos.PersistentObject
implements java.io.Serializable
{
- static final long serialVersionUID = 206437645033737127L;
+ public static final long serialVersionUID = 206437645033737127L;
private static Log mLogger =
LogFactory.getFactory().getInstance(WebsiteData.class);
// Simple properties
- protected String id;
- protected String handle;
- protected String name;
- protected String description;
- protected String defaultPageId;
- protected String weblogDayPageId;
- protected Boolean enableBloggerApi;
- protected String editorPage;
- protected String ignoreWords;
- protected Boolean allowComments;
- protected Boolean emailComments;
- protected String emailFromAddress;
- protected String emailAddress;
- protected String editorTheme;
- protected String locale;
- protected String timeZone;
- protected String mDefaultPlugins;
- protected Boolean enabled;
- protected Date dateCreated;
+ private String id = null;
+ private String handle = null;
+ private String name = null;
+ private String description = null;
+ private String defaultPageId = null;
+ private String weblogDayPageId = null;
+ private Boolean enableBloggerApi = Boolean.TRUE;
+ private String editorPage = null;
+ private String ignoreWords = null;
+ private Boolean allowComments = Boolean.TRUE;
+ private Boolean emailComments = Boolean.FALSE;
+ private String emailFromAddress = null;
+ private String emailAddress = null;
+ private String editorTheme = null;
+ private String locale = null;
+ private String timeZone = null;
+ private String defaultPlugins = null;
+ private Boolean enabled = Boolean.TRUE;
+ private Date dateCreated = null;
// Associated objects
- protected UserData mUser = null; // TODO: decide if website.user is needed
- protected List permissions = new ArrayList();
- protected WeblogCategoryData bloggerCategory;
- protected WeblogCategoryData defaultCategory;
+ private UserData creator = null; // TODO: decide if website.user is needed
+ private List permissions = new ArrayList();
+ private WeblogCategoryData bloggerCategory = null;
+ private WeblogCategoryData defaultCategory = null;
public WebsiteData()
@@ -94,7 +94,7 @@
this.name = name;
this.handle = handle;
this.description = description;
- this.mUser = user;
+ this.creator = user;
this.defaultPageId = defaultPageId;
this.weblogDayPageId = weblogDayPageId;
this.enableBloggerApi = enableBloggerApi;
@@ -427,13 +427,13 @@
*/
public org.roller.pojos.UserData getCreator()
{
- return mUser;
+ return creator;
}
/** @ejb:persistent-field */
public void setCreator( org.roller.pojos.UserData ud )
{
- mUser = ud;
+ creator = ud;
}
/**
@@ -713,13 +713,13 @@
*/
public String getDefaultPlugins()
{
- return mDefaultPlugins;
+ return defaultPlugins;
}
/** @ejb:persistent-field */
public void setDefaultPlugins(String string)
{
- mDefaultPlugins = string;
+ defaultPlugins = string;
}
/**
@@ -758,7 +758,7 @@
"editorTheme=" + editorTheme + " " +
"locale=" + locale + " " +
"timeZone=" + timeZone + " " +
- "defaultPlugins=" + mDefaultPlugins);
+ "defaultPlugins=" + defaultPlugins);
str.append('}');
return (str.toString());
@@ -856,7 +856,7 @@
result = PojoUtil.addHashCode(result, this.id);
result = PojoUtil.addHashCode(result, this.name);
result = PojoUtil.addHashCode(result, this.description);
- result = PojoUtil.addHashCode(result, this.mUser);
+ result = PojoUtil.addHashCode(result, this.creator);
result = PojoUtil.addHashCode(result, this.defaultPageId);
result = PojoUtil.addHashCode(result, this.weblogDayPageId);
result = PojoUtil.addHashCode(result, this.enableBloggerApi);
@@ -871,7 +871,7 @@
result = PojoUtil.addHashCode(result, this.editorTheme);
result = PojoUtil.addHashCode(result, this.locale);
result = PojoUtil.addHashCode(result, this.timeZone);
- result = PojoUtil.addHashCode(result, this.mDefaultPlugins);
+ result = PojoUtil.addHashCode(result, this.defaultPlugins);
return result;
}
@@ -883,28 +883,28 @@
{
WebsiteData other = (WebsiteData)otherData;
- this.id = other.id;
- this.name = other.name;
- this.handle = other.handle;
- this.description = other.description;
- this.mUser = other.mUser;
- this.defaultPageId = other.defaultPageId;
- this.weblogDayPageId = other.weblogDayPageId;
- this.enableBloggerApi = other.enableBloggerApi;
- this.bloggerCategory = other.bloggerCategory;
- this.defaultCategory = other.defaultCategory;
- this.editorPage = other.editorPage;
- this.ignoreWords = other.ignoreWords;
- this.allowComments = other.allowComments;
- this.emailComments = other.emailComments;
- this.emailAddress = other.emailAddress;
- this.emailFromAddress = other.emailFromAddress;
- this.editorTheme = other.editorTheme;
- this.locale = other.locale;
- this.timeZone = other.timeZone;
- this.mDefaultPlugins = other.mDefaultPlugins;
- this.enabled = other.enabled;
- this.dateCreated = dateCreated;
+ this.id = other.getId();
+ this.name = other.getName();
+ this.handle = other.getHandle();
+ this.description = other.getDescription();
+ this.creator = other.getCreator();
+ this.defaultPageId = other.getDefaultPageId();
+ this.weblogDayPageId = other.getWeblogDayPageId();
+ this.enableBloggerApi = other.getEnableBloggerApi();
+ this.bloggerCategory = other.getBloggerCategory();
+ this.defaultCategory = other.getDefaultCategory();
+ this.editorPage = other.getEditorPage();
+ this.ignoreWords = other.getIgnoreWords();
+ this.allowComments = other.getAllowComments();
+ this.emailComments = other.getEmailComments();
+ this.emailAddress = other.getEmailAddress();
+ this.emailFromAddress = other.getEmailFromAddress();
+ this.editorTheme = other.getEditorTheme();
+ this.locale = other.getLocale();
+ this.timeZone = other.getTimeZone();
+ this.defaultPlugins = other.getDefaultPlugins();
+ this.enabled = other.getEnabled();
+ this.dateCreated = getDateCreated();
}
/**