Removed cachedDescription and cachedContentEncoded

This commit is contained in:
daniel oeh 2013-08-08 12:50:48 +02:00
parent 24fdbba98b
commit ce9f87ff3e
2 changed files with 3 additions and 47 deletions

View File

@ -170,16 +170,7 @@ public class Feed extends FeedFile {
} else {
return download_url;
}
}
/** Calls cacheDescriptions on all items. */
protected void cacheDescriptionsOfItems() {
if (items != null) {
for (FeedItem item : items) {
item.cacheDescriptions();
}
}
}
}
public void updateFromOther(Feed other) {
super.updateFromOther(other);

View File

@ -25,19 +25,14 @@ public class FeedItem extends FeedComponent implements
private String itemIdentifier;
private String title;
/**
* The description of a feeditem. This field should only be set by the
* parser.
* The description of a feeditem.
*/
private String description;
/**
* The content of the content-encoded tag of a feeditem. This field should
* only be set by the parser.
* The content of the content-encoded tag of a feeditem.
*/
private String contentEncoded;
private SoftReference<String> cachedDescription;
private SoftReference<String> cachedContentEncoded;
private String link;
private Date pubDate;
private FeedMedia media;
@ -87,21 +82,6 @@ public class FeedItem extends FeedComponent implements
}
}
/**
* Moves the 'description' and 'contentEncoded' field of feeditem to their
* SoftReference fields.
*/
protected void cacheDescriptions() {
if (description != null) {
cachedDescription = new SoftReference<String>(description);
}
if (contentEncoded != null) {
cachedContentEncoded = new SoftReference<String>(contentEncoded);
}
description = null;
contentEncoded = null;
}
/**
* Returns the value that uniquely identifies this FeedItem. If the
* itemIdentifier attribute is not null, it will be returned. Else it will
@ -127,9 +107,6 @@ public class FeedItem extends FeedComponent implements
}
public String getDescription() {
if (description == null && cachedDescription != null) {
return cachedDescription.get();
}
return description;
}
@ -182,10 +159,6 @@ public class FeedItem extends FeedComponent implements
}
public String getContentEncoded() {
if (contentEncoded == null && cachedContentEncoded != null) {
return cachedContentEncoded.get();
}
return contentEncoded;
}
@ -228,14 +201,6 @@ public class FeedItem extends FeedComponent implements
return false;
}
public void setCachedDescription(String d) {
cachedDescription = new SoftReference<String>(d);
}
public void setCachedContentEncoded(String c) {
cachedContentEncoded = new SoftReference<String>(c);
}
@Override
public Callable<String> loadShownotes() {
return new Callable<String>() {