You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by sn...@apache.org on 2007/09/17 05:14:38 UTC
svn commit: r576242 - in /roller/trunk: apps/planet/build.xml
apps/planet/src/java/org/apache/roller/planet/pojos/Subscription.java
tools/roller-core/roller-core.jar
tools/roller-planet/roller-planet-business.jar
Author: snoopdave
Date: Sun Sep 16 20:14:37 2007
New Revision: 576242
URL: http://svn.apache.org/viewvc?rev=576242&view=rev
Log:
Fixing subscription compare and JPA enhancement
Modified:
roller/trunk/apps/planet/build.xml
roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/Subscription.java
roller/trunk/tools/roller-core/roller-core.jar
roller/trunk/tools/roller-planet/roller-planet-business.jar
Modified: roller/trunk/apps/planet/build.xml
URL: http://svn.apache.org/viewvc/roller/trunk/apps/planet/build.xml?rev=576242&r1=576241&r2=576242&view=diff
==============================================================================
--- roller/trunk/apps/planet/build.xml (original)
+++ roller/trunk/apps/planet/build.xml Sun Sep 16 20:14:37 2007
@@ -200,18 +200,23 @@
<exclude name="**/*.png"/>
</fileset>
</copy>
+
<mkdir dir="${build.compile.business}/META-INF" />
<copy todir="${build.compile.business}/META-INF" file="src/java/META-INF/persistence.xml" />
<!-- OpenJPA bytecode enhancement -->
- <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="planet.business.path" />
- <openjpac>
+ <path id="openjpac.path">
+ <path refid="planet.business.path"/>
+ <pathelement path="${build.compile.business}" />
+ <pathelement path="${build.compile.business}/org/apache/roller/planet/pojos" />
+ </path>
+ <taskdef name="openjpac" classname="org.apache.openjpa.ant.PCEnhancerTask" classpathref="openjpac.path" />
+ <openjpac enforcePropertyRestrictions="false">
<config propertiesFile="src/java/META-INF/persistence.xml" />
- <fileset dir="src/java/org/apache/roller/planet/pojos" includes="*.java" />
- <classpath>
- <path refid="planet.business.path"/>
- <pathelement location="${build.compile.business}" />
- </classpath>
+ <fileset dir="${build.compile.business}">
+ <include name="**/pojos/*.class" />
+ </fileset>
+ <classpath refid="openjpac.path" />
</openjpac>
<!-- JPA/Toplink bytecode enhancement
Modified: roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/Subscription.java
URL: http://svn.apache.org/viewvc/roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/Subscription.java?rev=576242&r1=576241&r2=576242&view=diff
==============================================================================
--- roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/Subscription.java (original)
+++ roller/trunk/apps/planet/src/java/org/apache/roller/planet/pojos/Subscription.java Sun Sep 16 20:14:37 2007
@@ -47,17 +47,24 @@
public Subscription() {}
-
+ /**
+ * Compares subscriptions based on concatenation of title and feed URL.
+ * This ensures that feeds are sorted by title, but that identical titles
+ * don't make feeds equal.
+ */
public int compareTo(Object o) {
Subscription other = (Subscription) o;
- return getTitle().compareTo(other.getTitle());
+ String otherString = other.getTitle() + other.getFeedURL();
+ String thisString = getTitle() + getFeedURL();
+ return thisString.compareTo(otherString);
}
- public boolean equals(Object other) {
-
+ /**
+ * Determines if subscriotions are equal by comparing feed URLs.
+ */
+ public boolean equals(Object other) {
if(this == other) return true;
- if(!(other instanceof Subscription)) return false;
-
+ if(!(other instanceof Subscription)) return false;
final Subscription that = (Subscription) other;
return this.feedUrl.equals(that.getFeedURL());
}
Modified: roller/trunk/tools/roller-core/roller-core.jar
URL: http://svn.apache.org/viewvc/roller/trunk/tools/roller-core/roller-core.jar?rev=576242&r1=576241&r2=576242&view=diff
==============================================================================
Binary files - no diff available.
Modified: roller/trunk/tools/roller-planet/roller-planet-business.jar
URL: http://svn.apache.org/viewvc/roller/trunk/tools/roller-planet/roller-planet-business.jar?rev=576242&r1=576241&r2=576242&view=diff
==============================================================================
Binary files - no diff available.