Skip to content

Commit

Permalink
Update to Rome 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
elharo committed Nov 23, 2024
1 parent e3d743e commit c03ff78
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 23 deletions.
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -331,11 +331,11 @@ under the License.
<version>1.326</version>
</dependency>

<!-- for rss feed generation -->
<!-- for RSS feed generation -->
<dependency>
<groupId>rome</groupId>
<groupId>com.rometools</groupId>
<artifactId>rome</artifactId>
<version>1.0</version>
<version>2.1.0</version>
</dependency>

<!-- test dependencies -->
Expand Down
37 changes: 18 additions & 19 deletions src/main/java/org/apache/maven/plugins/changes/FeedGenerator.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
import java.util.Locale;
import java.util.ResourceBundle;

import com.sun.syndication.feed.synd.SyndContent;
import com.sun.syndication.feed.synd.SyndContentImpl;
import com.sun.syndication.feed.synd.SyndEntry;
import com.sun.syndication.feed.synd.SyndEntryImpl;
import com.sun.syndication.feed.synd.SyndFeed;
import com.sun.syndication.feed.synd.SyndFeedImpl;
import com.sun.syndication.io.FeedException;
import com.sun.syndication.io.SyndFeedOutput;
import com.rometools.rome.feed.synd.SyndContent;
import com.rometools.rome.feed.synd.SyndContentImpl;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndEntryImpl;
import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.feed.synd.SyndFeedImpl;
import com.rometools.rome.io.FeedException;
import com.rometools.rome.io.SyndFeedOutput;
import org.apache.maven.doxia.util.DoxiaUtils;
import org.apache.maven.plugins.changes.model.Release;

Expand All @@ -58,7 +58,7 @@ public class FeedGenerator {
/**
* Initialize feedGenerator for a given locale.
*
* @param locale a locale for i18n.
* @param locale a locale for i18n
*/
public FeedGenerator(final Locale locale) {
this.feed = new SyndFeedImpl();
Expand All @@ -69,7 +69,7 @@ public FeedGenerator(final Locale locale) {
/**
* The author of the feed.
*
* @return the author.
* @return the author
*/
public String getAuthor() {
return author;
Expand All @@ -78,7 +78,7 @@ public String getAuthor() {
/**
* Set the author of the feed.
*
* @param author not null.
* @param author not null
*/
public void setAuthor(final String author) {
this.author = author.trim(); // this also assures that author is not null.
Expand All @@ -87,7 +87,7 @@ public void setAuthor(final String author) {
/**
* The title of the feed.
*
* @return the title.
* @return the title
*/
public String getTitle() {
return title;
Expand All @@ -96,7 +96,7 @@ public String getTitle() {
/**
* Set the title of the feed.
*
* @param title not null.
* @param title not null
*/
public void setTitle(final String title) {
this.title = title.trim(); // this also assures that title is not null.
Expand All @@ -105,7 +105,7 @@ public void setTitle(final String title) {
/**
* The DateFormat.
*
* @return may be null.
* @return may be null
*/
public DateFormat getDateFormat() {
return dateFormat;
Expand All @@ -114,7 +114,7 @@ public DateFormat getDateFormat() {
/**
* Set the date format. This should match the date format used for the release dates in changes.xml.
*
* @param dateFormat may be null.
* @param dateFormat may be null
*/
public void setDateFormat(final DateFormat dateFormat) {
this.dateFormat = dateFormat;
Expand All @@ -123,7 +123,7 @@ public void setDateFormat(final DateFormat dateFormat) {
/**
* The main link of the feed.
*
* @return the link.
* @return the link
*/
public String getLink() {
return link;
Expand All @@ -132,7 +132,7 @@ public String getLink() {
/**
* Set the main link of the feed.
*
* @param link not null.
* @param link not null
*/
public void setLink(final String link) {
this.link = link.trim(); // this also assures that link is not null.
Expand Down Expand Up @@ -168,7 +168,7 @@ public List<String> getSupportedFeedTypes() {
* @param feedType The type of the feed to generate. See {@link #isSupportedFeedType(java.lang.String)} for
* supported values.
* @param writer a Writer. Note that this is not flushed nor closed upon exit.
* @throws IOException if an error occurs during export.
* @throws IOException if an error occurs during export
*/
public void export(final List<Release> releases, final String feedType, final Writer writer) throws IOException {
feed.setFeedType(feedType);
Expand Down Expand Up @@ -219,7 +219,6 @@ private static SyndContent getSyndContent(final Release release) {
sb.append("<p>").append(description).append("</p>");
}

// TODO: localize?
sb.append("<p>Version ").append(release.getVersion()).append(" is available with ");
sb.append(release.getActions().size()).append(" fixed issues.</p>");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void testExport() throws Exception {
generator.export(releases, "rss_0.9", new StringWriter(512));
fail("0 releases not allowed!");
} catch (IOException ex) {
assertNotNull(ex);
assertNotNull(ex.getMessage());
}

releases.add(release);
Expand Down

0 comments on commit c03ff78

Please sign in to comment.