diff --git a/src/main/java/crawlercommons/sitemaps/extension/VideoAttributes.java b/src/main/java/crawlercommons/sitemaps/extension/VideoAttributes.java index 45a61db..b625946 100644 --- a/src/main/java/crawlercommons/sitemaps/extension/VideoAttributes.java +++ b/src/main/java/crawlercommons/sitemaps/extension/VideoAttributes.java @@ -426,15 +426,15 @@ public class VideoAttributes extends ExtensionMetadata { */ private Float price; - public VideoPrice(final String currency, final Float price) { + public VideoPrice(String currency, Float price) { this(currency, price, VideoPriceType.own); } - public VideoPrice(final String currency, final Float price, final VideoPriceType type) { + public VideoPrice(String currency, Float price, VideoPriceType type) { this(currency, price, type, null); } - public VideoPrice(final String currency, final Float price, final VideoPriceType type, final VideoPriceResolution resolution) { + public VideoPrice(String currency, Float price, VideoPriceType type, VideoPriceResolution resolution) { this.currency = currency; this.price = price; this.type = type; @@ -486,7 +486,7 @@ public class VideoAttributes extends ExtensionMetadata { public VideoAttributes() { } - public VideoAttributes(final URL thumbnailLoc, final String title, final String description, final URL contentLoc, final URL playerLoc) { + public VideoAttributes(URL thumbnailLoc, String title, String description, URL contentLoc, URL playerLoc) { this.thumbnailLoc = thumbnailLoc; this.title = title; this.description = description; diff --git a/src/test/java/crawlercommons/sitemaps/SiteMapParserExtensionTest.java b/src/test/java/crawlercommons/sitemaps/SiteMapParserExtensionTest.java index 8670bfd..283164c 100644 --- a/src/test/java/crawlercommons/sitemaps/SiteMapParserExtensionTest.java +++ b/src/test/java/crawlercommons/sitemaps/SiteMapParserExtensionTest.java @@ -83,6 +83,9 @@ public class SiteMapParserExtensionTest { assertEquals(expectedVideoAttributes, attr); // locale-specific number format in , test #220 + // The current expected behavior is to not handle non-US locale price + // values and set the price value to null if parsing as float value + // fails. expectedVideoAttributes = new VideoAttributes(new URL("http://www.example.com/thumbs/123-2.jpg"), "Grilling steaks for summer, episode 2", "Alkis shows you how to get perfectly done steaks every time", new URL("http://www.example.com/video123-2.flv"), null); expectedVideoAttributes.setPrices(new VideoAttributes.VideoPrice[] { new VideoAttributes.VideoPrice("EUR", null, VideoAttributes.VideoPriceType.own) });