roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r330574 - /incubator/roller/trunk/src/org/roller/pojos/
Date Thu, 03 Nov 2005 16:10:08 GMT
Author: snoopdave
Date: Thu Nov  3 08:09:54 2005
New Revision: 330574

URL: http://svn.apache.org/viewcvs?rev=330574&view=rev
Log:
Fix to use getters in POJO setData() methods (part I)

Modified:
    incubator/roller/trunk/src/org/roller/pojos/BookmarkData.java
    incubator/roller/trunk/src/org/roller/pojos/EntryAttributeData.java
    incubator/roller/trunk/src/org/roller/pojos/FolderAssoc.java
    incubator/roller/trunk/src/org/roller/pojos/FolderData.java
    incubator/roller/trunk/src/org/roller/pojos/PingCategoryRestrictionData.java
    incubator/roller/trunk/src/org/roller/pojos/RefererData.java
    incubator/roller/trunk/src/org/roller/pojos/RoleData.java
    incubator/roller/trunk/src/org/roller/pojos/RollerPropertyData.java
    incubator/roller/trunk/src/org/roller/pojos/UserCookieData.java
    incubator/roller/trunk/src/org/roller/pojos/UserData.java
    incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryAssoc.java
    incubator/roller/trunk/src/org/roller/pojos/WeblogTemplate.java

Modified: incubator/roller/trunk/src/org/roller/pojos/BookmarkData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/BookmarkData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/BookmarkData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/BookmarkData.java Thu Nov  3 08:09:54 2005
@@ -399,15 +399,16 @@
      */
     public void setData(org.roller.pojos.PersistentObject otherData)
     {
-        this.id = ((BookmarkData) otherData).id;
-        this.name = ((BookmarkData) otherData).name;
-        this.description = ((BookmarkData) otherData).description;
-        this.url = ((BookmarkData) otherData).url;
-        this.weight = ((BookmarkData) otherData).weight;
-        this.priority = ((BookmarkData) otherData).priority;
-        this.folder = ((BookmarkData) otherData).folder;
-        this.image = ((BookmarkData) otherData).image;
-        this.feedUrl = ((BookmarkData) otherData).feedUrl;
+        BookmarkData other = (BookmarkData)otherData;
+        this.id = other.getId();
+        this.name = other.getName();
+        this.description = other.getDescription();
+        this.url = other.getUrl();
+        this.weight = other.getWeight();
+        this.priority = other.getPriority();
+        this.folder = other.getFolder();
+        this.image = other.getImage();
+        this.feedUrl = other.getUrl();
     }
 
     /** 

Modified: incubator/roller/trunk/src/org/roller/pojos/EntryAttributeData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/EntryAttributeData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/EntryAttributeData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/EntryAttributeData.java Thu Nov  3 08:09:54
2005
@@ -29,10 +29,7 @@
 
     public EntryAttributeData(EntryAttributeData otherData)
     {
-        this.id = otherData.id;
-        this.entry = otherData.entry;
-        this.name = otherData.name;
-        this.value = otherData.value;
+        setData(otherData);
     }
 
     /**
@@ -57,9 +54,9 @@
     public void setData(org.roller.pojos.PersistentObject otherData)
     {
         this.id = otherData.getId();
-        this.entry = ((EntryAttributeData) otherData).entry;
-        this.name = ((EntryAttributeData) otherData).name;
-        this.value = ((EntryAttributeData) otherData).value;
+        this.entry = ((EntryAttributeData) otherData).getEntry();
+        this.name = ((EntryAttributeData) otherData).getName();
+        this.value = ((EntryAttributeData) otherData).getValue();
     }
 
     /** 

Modified: incubator/roller/trunk/src/org/roller/pojos/FolderAssoc.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/FolderAssoc.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/FolderAssoc.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/FolderAssoc.java Thu Nov  3 08:09:54 2005
@@ -37,10 +37,7 @@
 
     public FolderAssoc(FolderAssoc otherData)
     {
-        this.id = otherData.id;
-        this.folder = otherData.folder;
-        this.ancestor = otherData.ancestor;
-        this.relation = otherData.relation;
+        setData(otherData);
     }
 
     /**

Modified: incubator/roller/trunk/src/org/roller/pojos/FolderData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/FolderData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/FolderData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/FolderData.java Thu Nov  3 08:09:54 2005
@@ -61,12 +61,12 @@
 
     public void setData(org.roller.pojos.PersistentObject otherData)
     {
-        mNewParent = ((FolderData) otherData).mNewParent;
-        this.bookmarks = ((FolderData) otherData).bookmarks;
-        this.id = ((FolderData) otherData).id;
-        this.name = ((FolderData) otherData).name;
-        this.description = ((FolderData) otherData).description;
-        this.website = ((FolderData) otherData).website;
+        mNewParent =       ((FolderData) otherData).mNewParent;
+        this.bookmarks =   ((FolderData) otherData).getBookmarks();
+        this.id =          ((FolderData) otherData).getId();
+        this.name =        ((FolderData) otherData).getName();
+        this.description = ((FolderData) otherData).getDescription();
+        this.website =     ((FolderData) otherData).getWebsite();
     }
 
     public void save() throws RollerException

Modified: incubator/roller/trunk/src/org/roller/pojos/PingCategoryRestrictionData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/PingCategoryRestrictionData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/PingCategoryRestrictionData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/PingCategoryRestrictionData.java Thu Nov 
3 08:09:54 2005
@@ -56,9 +56,9 @@
     public void setData(PersistentObject vo)
     {
         PingCategoryRestrictionData other = (PingCategoryRestrictionData)vo;
-        id = other.id;
-        autoPing = other.autoPing;
-        weblogCategory = other.weblogCategory;
+        id = other.getId();
+        autoPing = other.getAutoping();
+        weblogCategory = other.getWeblogCategory();
     }
 
     /**

Modified: incubator/roller/trunk/src/org/roller/pojos/RefererData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/RefererData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/RefererData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/RefererData.java Thu Nov  3 08:09:54 2005
@@ -63,19 +63,7 @@
 
     public RefererData(RefererData otherData)
     {
-        this.id = otherData.id;
-        this.website = otherData.website;
-        this.weblogEntry = otherData.weblogEntry;
-        this.dateString = otherData.dateString;
-        this.refererUrl = otherData.refererUrl;
-        this.refererPermalink = otherData.refererPermalink;
-        this.requestUrl = otherData.requestUrl;
-        this.title = otherData.title;
-        this.excerpt = otherData.excerpt;
-        this.visible = otherData.visible;
-        this.duplicate = otherData.duplicate;
-        this.dayHits = otherData.dayHits;
-        this.totalHits = otherData.totalHits;
+        setData(otherData);
     }
 
     //------------------------------------------------------- Simple properties
@@ -571,19 +559,19 @@
      */
     public void setData(org.roller.pojos.PersistentObject otherData)
     {
-        this.id = ((RefererData) otherData).id;
-        this.website = ((RefererData) otherData).website;
-        this.weblogEntry = ((RefererData) otherData).weblogEntry;
-        this.dateString = ((RefererData) otherData).dateString;
-        this.refererUrl = ((RefererData) otherData).refererUrl;
-        this.refererPermalink = ((RefererData) otherData).refererPermalink;
-        this.requestUrl = ((RefererData) otherData).requestUrl;
-        this.title = ((RefererData) otherData).title;
-        this.excerpt = ((RefererData) otherData).excerpt;
-        this.visible = ((RefererData) otherData).visible;
-        this.duplicate = ((RefererData) otherData).duplicate;
-        this.dayHits = ((RefererData) otherData).dayHits;
-        this.totalHits = ((RefererData) otherData).totalHits;
+        this.id = ((RefererData) otherData).getId();
+        this.website = ((RefererData) otherData).getWebsite();
+        this.weblogEntry = ((RefererData) otherData).getWeblogEntry();
+        this.dateString = ((RefererData) otherData).getDateString();
+        this.refererUrl = ((RefererData) otherData).getRefererUrl();
+        this.refererPermalink = ((RefererData) otherData).getRefererPermalink();
+        this.requestUrl = ((RefererData) otherData).getRequestUrl();
+        this.title = ((RefererData) otherData).getTitle();
+        this.excerpt = ((RefererData) otherData).getExcerpt();
+        this.visible = ((RefererData) otherData).getVisible();
+        this.duplicate = ((RefererData) otherData).getDuplicate();
+        this.dayHits = ((RefererData) otherData).getDayHits();
+        this.totalHits = ((RefererData) otherData).getTotalHits();
     }
 
     /**

Modified: incubator/roller/trunk/src/org/roller/pojos/RoleData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/RoleData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/RoleData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/RoleData.java Thu Nov  3 08:09:54 2005
@@ -35,11 +35,7 @@
 
    public RoleData( RoleData otherData )
    {
-      this.id = otherData.id;
-      this.userName = otherData.userName;
-      this.user = otherData.user;
-      this.role = otherData.role;
-
+       setData(otherData);
    }
 
    /** 
@@ -174,13 +170,10 @@
    public void setData( org.roller.pojos.PersistentObject otherData )
    {
 
-      this.id = ((RoleData)otherData).id;
-
-      this.userName = ((RoleData)otherData).userName;
-
-      this.user = ((RoleData)otherData).user;
-
-      this.role = ((RoleData)otherData).role;
+      this.id = ((RoleData)otherData).getId();
+      this.userName = ((RoleData)otherData).getUserName();
+      this.user = ((RoleData)otherData).getUser();
+      this.role = ((RoleData)otherData).getRole();
    }
 
 }

Modified: incubator/roller/trunk/src/org/roller/pojos/RollerPropertyData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/RollerPropertyData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/RollerPropertyData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/RollerPropertyData.java Thu Nov  3 08:09:54
2005
@@ -45,11 +45,11 @@
     
     public void setData(PersistentObject object)
     {
-	if (object instanceof RollerPropertyData)
+        if (object instanceof RollerPropertyData)
         {
             RollerPropertyData prop = (RollerPropertyData) object;
-            this.name = prop.name;
-            this.value = prop.value;
+            this.name = prop.getName();
+            this.value = prop.getValue();
         }
     }
     

Modified: incubator/roller/trunk/src/org/roller/pojos/UserCookieData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/UserCookieData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/UserCookieData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/UserCookieData.java Thu Nov  3 08:09:54 2005
@@ -38,10 +38,7 @@
 
     public UserCookieData( UserCookieData otherData )
     {
-        this.id = otherData.id;
-        this.username = otherData.username;
-        this.cookieId = otherData.cookieId;
-        this.dateCreated = (Date)otherData.dateCreated.clone();
+        setData(otherData);
     }
 
 
@@ -136,7 +133,7 @@
         this.id = newData.getId();
         this.username = newData.getUsername();
         this.cookieId = newData.getCookieId();
-        this.dateCreated = newData.getDateCreated();
+        this.dateCreated = newData.getDateCreated()!=null ? (Date)newData.getDateCreated().clone()
: null;
 	}
 
     /**

Modified: incubator/roller/trunk/src/org/roller/pojos/UserData.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/UserData.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/UserData.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/UserData.java Thu Nov  3 08:09:54 2005
@@ -76,13 +76,7 @@
 
 	public UserData( UserData otherData )
 	{
-		this.id = otherData.id;
-		this.userName = otherData.userName;
-		this.password = otherData.password;
-		this.fullName = otherData.fullName;
-		this.emailAddress = otherData.emailAddress;
-		this.dateCreated = (Date)otherData.dateCreated.clone();
-
+		setData(otherData);
 	}
 
     /** 
@@ -393,14 +387,15 @@
     */
    public void setData( org.roller.pojos.PersistentObject otherData )
    {
-      this.id = ((UserData)otherData).id;
-      this.userName = ((UserData)otherData).userName;
-      this.password = ((UserData)otherData).password;
-      this.fullName = ((UserData)otherData).fullName;
-      this.emailAddress = ((UserData)otherData).emailAddress;
-      this.locale = ((UserData)otherData).locale;
-      this.timeZone = ((UserData)otherData).timeZone;
-      this.dateCreated = ((UserData)otherData).dateCreated;
+      UserData other = (UserData)otherData;
+      this.id =       other.getId();
+      this.userName = other.getUserName();
+      this.password = other.getPassword();
+      this.fullName = other.getFullName();
+      this.emailAddress = other.getEmailAddress();
+      this.locale = other.getLocale();
+      this.timeZone = other.getTimeZone();
+      this.dateCreated = other.getDateCreated()!=null ? (Date)other.getDateCreated().clone()
: null;
    }
 
     /** 

Modified: incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryAssoc.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryAssoc.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryAssoc.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/WeblogCategoryAssoc.java Thu Nov  3 08:09:54
2005
@@ -51,10 +51,7 @@
 
     public WeblogCategoryAssoc(WeblogCategoryAssoc otherData)
     {
-        this.id = otherData.id;
-        this.category = otherData.category;
-        this.ancestor = otherData.ancestor;
-        this.relation = otherData.relation;
+        setData(otherData);
     }
 
     /**

Modified: incubator/roller/trunk/src/org/roller/pojos/WeblogTemplate.java
URL: http://svn.apache.org/viewcvs/incubator/roller/trunk/src/org/roller/pojos/WeblogTemplate.java?rev=330574&r1=330573&r2=330574&view=diff
==============================================================================
--- incubator/roller/trunk/src/org/roller/pojos/WeblogTemplate.java (original)
+++ incubator/roller/trunk/src/org/roller/pojos/WeblogTemplate.java Thu Nov  3 08:09:54 2005
@@ -58,14 +58,7 @@
 
    public WeblogTemplate( WeblogTemplate otherData )
    {
-      this.id = otherData.id;
-      this.mWebsite = otherData.mWebsite;
-      this.name = otherData.name;
-      this.description = otherData.description;
-      this.link = otherData.link;
-      this.contents = otherData.contents;
-      this.lastModified = otherData.lastModified;
-
+       setData(otherData);
    }
 
    /** 
@@ -277,20 +270,14 @@
     */
    public void setData( org.roller.pojos.PersistentObject otherData )
    {
-
-      this.id = ((WeblogTemplate) otherData).id;
-
-      this.mWebsite = ((WeblogTemplate) otherData).mWebsite;
-
-      this.name = ((WeblogTemplate) otherData).name;
-
-      this.description = ((WeblogTemplate) otherData).description;
-
-      this.link = ((WeblogTemplate) otherData).link;
-
-      this.contents = ((WeblogTemplate) otherData).contents;
-
-      this.lastModified = ((WeblogTemplate) otherData).lastModified;
+       WeblogTemplate other = (WeblogTemplate)otherData;
+      this.mWebsite =     other.getWebsite();
+      this.id =           other.getId();
+      this.name =         other.getName();
+      this.description =  other.getDescription();
+      this.link =         other.getLink();
+      this.contents =     other.getContents();
+      this.lastModified = other.getLastModified()!=null ? (Date)other.getLastModified().clone()
: null;
    }
 
    public boolean canSave() throws RollerException



Mime
View raw message