You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by lt...@apache.org on 2011/10/18 08:58:50 UTC

svn commit: r1185508 - in /maven/doxia/doxia-sitetools/trunk: doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/ doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/ doxia-doc-re...

Author: ltheussl
Date: Tue Oct 18 06:58:50 2011
New Revision: 1185508

URL: http://svn.apache.org/viewvc?rev=1185508&view=rev
Log:
some jdk5 updates

Modified:
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/URIPathDescriptor.java
    maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
    maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
    maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java
    maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/AbstractITextRender.java
    maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java
    maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/ITextPdfRenderer.java
    maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/docrenderer/DocumentRendererTest.java
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
    maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/URIPathDescriptor.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/URIPathDescriptor.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/URIPathDescriptor.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/main/java/org/apache/maven/doxia/site/decoration/inheritance/URIPathDescriptor.java Tue Oct 18 06:58:50 2011
@@ -233,6 +233,7 @@ public class URIPathDescriptor
      *
      * @return this URIPathDescriptor as a String.
      */
+    @Override
     public String toString()
     {
         return resolveLink().toString();

Modified: maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-decoration-model/src/test/java/org/apache/maven/doxia/site/decoration/inheritance/DecorationModelInheritenceAssemblerTest.java Tue Oct 18 06:58:50 2011
@@ -50,6 +50,11 @@ public class DecorationModelInheritenceA
 
     private static final String NAME = "Name";
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testInheritence()
         throws IOException, XmlPullParserException
     {
@@ -71,6 +76,11 @@ public class DecorationModelInheritenceA
         assertEquals( "Modified parent!", readModel( "parent.xml" ), parentModel );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testPathsResolvedWhenEmpty()
         throws IOException, XmlPullParserException
     {
@@ -93,6 +103,11 @@ public class DecorationModelInheritenceA
         assertEquals( "Modified parent!", readModel( "empty.xml" ), parentModel );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testPathsNotResolvedForExternalUrls()
         throws IOException, XmlPullParserException
     {
@@ -123,21 +138,26 @@ public class DecorationModelInheritenceA
         assertEquals( "check right banner image", "http://jakarta.apache.org/commons/images/logo.png",
                       childModel.getBannerRight().getSrc() );
 
-        Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+        Logo poweredBy = childModel.getPoweredBy().get( 0 );
         assertEquals( "check powered by logo href", "http://tomcat.apache.org/", poweredBy.getHref() );
         assertEquals( "check powered by logo image", "http://tomcat.apache.org/logo.gif", poweredBy.getImg() );
 
-        LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 );
+        LinkItem breadcrumb = childModel.getBody().getBreadcrumbs().get( 0 );
         assertEquals( "check breadcrumb href", "http://www.apache.org/", breadcrumb.getHref() );
 
-        LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+        LinkItem link = childModel.getBody().getLinks().get( 0 );
         assertEquals( "check link href", "http://www.bouncycastle.org", link.getHref() );
 
-        Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
-        LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+        Menu menu = childModel.getBody().getMenus().get( 0 );
+        LinkItem menuItem = menu.getItems().get( 0 );
         assertEquals( "check menu item href", "http://www.apache.org/special/", menuItem.getHref() );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testPathsResolvedForRelativeUrls()
         throws IOException, XmlPullParserException
     {
@@ -165,21 +185,26 @@ public class DecorationModelInheritenceA
         assertEquals( "check right banner href", "../banner/right/", childModel.getBannerRight().getHref() );
         assertEquals( "check right banner image", "../commons/images/logo.png", childModel.getBannerRight().getSrc() );
 
-        Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+        Logo poweredBy = childModel.getPoweredBy().get( 0 );
         assertEquals( "check powered by logo href", "../tomcat", poweredBy.getHref() );
         assertEquals( "check powered by logo image", "../tomcat/logo.gif", poweredBy.getImg() );
 
-        LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 );
+        LinkItem breadcrumb = childModel.getBody().getBreadcrumbs().get( 0 );
         assertEquals( "check breadcrumb href", "../apache", breadcrumb.getHref() );
 
-        LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+        LinkItem link = childModel.getBody().getLinks().get( 0 );
         assertEquals( "check link href", "../bouncycastle/", link.getHref() );
 
-        Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
-        LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+        Menu menu = childModel.getBody().getMenus().get( 0 );
+        LinkItem menuItem = menu.getItems().get( 0 );
         assertEquals( "check menu item href", "../special/", menuItem.getHref() );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testPathsResolvedForSubsiteUrls()
         throws IOException, XmlPullParserException
     {
@@ -210,21 +235,26 @@ public class DecorationModelInheritenceA
         assertEquals( "check right banner href", "../banner/right/", childModel.getBannerRight().getHref() );
         assertEquals( "check right banner image", "../commons/images/logo.png", childModel.getBannerRight().getSrc() );
 
-        Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+        Logo poweredBy = childModel.getPoweredBy().get( 0 );
         assertEquals( "check powered by logo href", "../tomcat", poweredBy.getHref() );
         assertEquals( "check powered by logo image", "../tomcat/logo.gif", poweredBy.getImg() );
 
-        LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 );
+        LinkItem breadcrumb = childModel.getBody().getBreadcrumbs().get( 0 );
         assertEquals( "check breadcrumb href", "../apache", breadcrumb.getHref() );
 
-        LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+        LinkItem link = childModel.getBody().getLinks().get( 0 );
         assertEquals( "check link href", "../bouncycastle/", link.getHref() );
 
-        Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
-        LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+        Menu menu = childModel.getBody().getMenus().get( 0 );
+        LinkItem menuItem = menu.getItems().get( 0 );
         assertEquals( "check menu item href", "../special/", menuItem.getHref() );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testPathsResolvedForRelativeUrlsDepthOfTwo()
         throws IOException, XmlPullParserException
     {
@@ -253,21 +283,26 @@ public class DecorationModelInheritenceA
         assertEquals( "check right banner image", "../../commons/images/logo.png",
                       childModel.getBannerRight().getSrc() );
 
-        Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+        Logo poweredBy = childModel.getPoweredBy().get( 0 );
         assertEquals( "check powered by logo href", "../../tomcat", poweredBy.getHref() );
         assertEquals( "check powered by logo image", "../../tomcat/logo.gif", poweredBy.getImg() );
 
-        LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 );
+        LinkItem breadcrumb = childModel.getBody().getBreadcrumbs().get( 0 );
         assertEquals( "check breadcrumb href", "../../apache", breadcrumb.getHref() );
 
-        LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+        LinkItem link = childModel.getBody().getLinks().get( 0 );
         assertEquals( "check link href", "../../bouncycastle/", link.getHref() );
 
-        Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
-        LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+        Menu menu = childModel.getBody().getMenus().get( 0 );
+        LinkItem menuItem = menu.getItems().get( 0 );
         assertEquals( "check menu item href", "../../special/", menuItem.getHref() );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testPathsResolvedForReverseRelativeUrls()
         throws IOException, XmlPullParserException
     {
@@ -296,21 +331,26 @@ public class DecorationModelInheritenceA
         assertEquals( "check right banner image", "doxia/commons/images/logo.png",
                       childModel.getBannerRight().getSrc() );
 
-        Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+        Logo poweredBy = childModel.getPoweredBy().get( 0 );
         assertEquals( "check powered by logo href", "doxia/tomcat", poweredBy.getHref() );
         assertEquals( "check powered by logo image", "doxia/tomcat/logo.gif", poweredBy.getImg() );
 
-        LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 );
+        LinkItem breadcrumb = childModel.getBody().getBreadcrumbs().get( 0 );
         assertEquals( "check breadcrumb href", "doxia/apache", breadcrumb.getHref() );
 
-        LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+        LinkItem link = childModel.getBody().getLinks().get( 0 );
         assertEquals( "check link href", "doxia/bouncycastle/", link.getHref() );
 
-        Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
-        LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+        Menu menu = childModel.getBody().getMenus().get( 0 );
+        LinkItem menuItem = menu.getItems().get( 0 );
         assertEquals( "check menu item href", "doxia/special/", menuItem.getHref() );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testPathsResolvedForReverseRelativeUrlsDepthOfTwo()
         throws IOException, XmlPullParserException
     {
@@ -340,21 +380,26 @@ public class DecorationModelInheritenceA
         assertEquals( "check right banner image", "doxia/core/commons/images/logo.png",
                       childModel.getBannerRight().getSrc() );
 
-        Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+        Logo poweredBy = childModel.getPoweredBy().get( 0 );
         assertEquals( "check powered by logo href", "doxia/core/tomcat", poweredBy.getHref() );
         assertEquals( "check powered by logo image", "doxia/core/tomcat/logo.gif", poweredBy.getImg() );
 
-        LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 );
+        LinkItem breadcrumb = childModel.getBody().getBreadcrumbs().get( 0 );
         assertEquals( "check breadcrumb href", "doxia/core/apache", breadcrumb.getHref() );
 
-        LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+        LinkItem link = childModel.getBody().getLinks().get( 0 );
         assertEquals( "check link href", "doxia/core/bouncycastle/", link.getHref() );
 
-        Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
-        LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+        Menu menu = childModel.getBody().getMenus().get( 0 );
+        LinkItem menuItem = menu.getItems().get( 0 );
         assertEquals( "check menu item href", "doxia/core/special/", menuItem.getHref() );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testPathsResolvedForUnrelatedRelativeUrls()
         throws IOException, XmlPullParserException
     {
@@ -386,21 +431,26 @@ public class DecorationModelInheritenceA
         assertEquals( "check right banner image", "http://jakarta.apache.org/commons/images/logo.png",
                       childModel.getBannerRight().getSrc() );
 
-        Logo poweredBy = (Logo) childModel.getPoweredBy().get( 0 );
+        Logo poweredBy = childModel.getPoweredBy().get( 0 );
         assertEquals( "check powered by logo href", "http://jakarta.apache.org/tomcat", poweredBy.getHref() );
         assertEquals( "check powered by logo image", "http://jakarta.apache.org/tomcat/logo.gif", poweredBy.getImg() );
 
-        LinkItem breadcrumb = (LinkItem) childModel.getBody().getBreadcrumbs().get( 0 );
+        LinkItem breadcrumb = childModel.getBody().getBreadcrumbs().get( 0 );
         assertEquals( "check breadcrumb href", "http://jakarta.apache.org/apache", breadcrumb.getHref() );
 
-        LinkItem link = (LinkItem) childModel.getBody().getLinks().get( 0 );
+        LinkItem link = childModel.getBody().getLinks().get( 0 );
         assertEquals( "check link href", "http://jakarta.apache.org/bouncycastle/", link.getHref() );
 
-        Menu menu = (Menu) childModel.getBody().getMenus().get( 0 );
-        LinkItem menuItem = (LinkItem) menu.getItems().get( 0 );
+        Menu menu = childModel.getBody().getMenus().get( 0 );
+        LinkItem menuItem = menu.getItems().get( 0 );
         assertEquals( "check menu item href", "http://jakarta.apache.org/special/", menuItem.getHref() );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testNullParent()
         throws IOException, XmlPullParserException
     {
@@ -419,6 +469,11 @@ public class DecorationModelInheritenceA
         assertEquals( "Check scp result", mergedModel, childModel );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testFullyPopulatedChild()
         throws IOException, XmlPullParserException
     {
@@ -440,6 +495,11 @@ public class DecorationModelInheritenceA
         assertEquals( "Modified parent!", readModel( "fully-populated-child.xml" ), parentModel );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testFullyPopulatedParentAndEmptyChild()
         throws IOException, XmlPullParserException
     {
@@ -467,6 +527,11 @@ public class DecorationModelInheritenceA
         assertEquals( "Modified parent!", readModel( "fully-populated-child.xml" ), parentModel );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testResolvingAllExternalUrls()
         throws IOException, XmlPullParserException
     {
@@ -478,6 +543,11 @@ public class DecorationModelInheritenceA
         assertEquals( "Check result", mergedModel, model );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testResolvingAllRelativeUrls()
         throws IOException, XmlPullParserException
     {
@@ -490,6 +560,11 @@ public class DecorationModelInheritenceA
         assertEquals( "Check result", resolvedModel, model );
     }
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testResolvingAllSiteUrls()
         throws IOException, XmlPullParserException
     {
@@ -537,6 +612,11 @@ public class DecorationModelInheritenceA
 
 */
 
+    /**
+     *
+     * @throws IOException
+     * @throws XmlPullParserException
+     */
     public void testResolvingEmptyDescriptor()
         throws IOException, XmlPullParserException
     {
@@ -547,6 +627,9 @@ public class DecorationModelInheritenceA
         assertEquals( "Check result", mergedModel, model );
     }
 
+    /**
+     *
+     */
     public void testDuplicateParentElements()
     {
         DecorationModel model = new DecorationModel();
@@ -570,6 +653,9 @@ public class DecorationModelInheritenceA
                       child.getPoweredBy().get( 0 ) );
     }
 
+    /**
+     *
+     */
     public void testDuplicateChildElements()
     {
         DecorationModel model = new DecorationModel();
@@ -595,6 +681,9 @@ public class DecorationModelInheritenceA
         assertEquals( "Modified parent!", new DecorationModel(), parent );
     }
 
+    /**
+     *
+     */
     public void testBadHref()
     {
         final DecorationModel model = new DecorationModel();
@@ -606,6 +695,9 @@ public class DecorationModelInheritenceA
             model.getBody().getBreadcrumbs().get( 0 ) );
     }
 
+    /**
+     *
+     */
     public void testBreadcrumbWithoutHref()
     {
         DecorationModel model = new DecorationModel();
@@ -616,6 +708,9 @@ public class DecorationModelInheritenceA
         assertEquals( "Check item", createLinkItem( "Foo", null ), model.getBody().getBreadcrumbs().get( 0 ) );
     }
 
+    /**
+     *
+     */
     public void testBreadcrumbs()
     {
         String parentHref = "http://parent.com/index.html";
@@ -660,7 +755,7 @@ public class DecorationModelInheritenceA
 
         // now with file url
         parentHref = "file://parent.com/index.html";
-        ( (LinkItem) parent.getBody().getBreadcrumbs().get( 0 ) ).setHref( parentHref );
+        ( parent.getBody().getBreadcrumbs().get( 0 ) ).setHref( parentHref );
         child = new DecorationModel();
         assembler.assembleModelInheritance( "childName", child, parent,
                 "file://parent.com/child/", "file://parent.com/" );
@@ -669,7 +764,7 @@ public class DecorationModelInheritenceA
 
         // now with scp url
         parentHref = "scp://parent.com/index.html";
-        ( (LinkItem) parent.getBody().getBreadcrumbs().get( 0 ) ).setHref( parentHref );
+        ( parent.getBody().getBreadcrumbs().get( 0 ) ).setHref( parentHref );
         child = new DecorationModel();
         assembler.assembleModelInheritance( "childName", child, parent,
                 "scp://parent.com/child/", "scp://parent.com/" );
@@ -684,6 +779,9 @@ public class DecorationModelInheritenceA
         assertEquals( "Check child item", createLinkItem( childName, "" ), breadcrumbs.get( 1 ) );
     }
 
+    /**
+     *
+     */
     public void testBannerWithoutHref()
     {
         DecorationModel model = new DecorationModel();
@@ -698,6 +796,9 @@ public class DecorationModelInheritenceA
         assertEquals( "Check banner", createBanner( "Left", null, "images/src.gif", "alt" ), model.getBannerLeft() );
     }
 
+    /**
+     *
+     */
     public void testLogoWithoutImage()
     {
         // This should actually be validated in the model, it doesn't really make sense

Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/AbstractDocumentRenderer.java Tue Oct 18 06:58:50 2011
@@ -277,6 +277,7 @@ public abstract class AbstractDocumentRe
             if ( moduleBasedir.exists() )
             {
                 // TODO: handle in/excludes
+                @SuppressWarnings ( "unchecked" )
                 List<String> allFiles = FileUtils.getFileNames( moduleBasedir, "**/*.*", null, false );
 
                 String lowerCaseExtension = module.getExtension().toLowerCase( Locale.ENGLISH );
@@ -309,9 +310,9 @@ public abstract class AbstractDocumentRe
                 {
                     filePath = filePath.trim();
 
-                    if ( filePath.lastIndexOf( "." ) > 0 )
+                    if ( filePath.lastIndexOf( '.') > 0 )
                     {
-                        String key = filePath.substring( 0, filePath.lastIndexOf( "." ) );
+                        String key = filePath.substring( 0, filePath.lastIndexOf( '.') );
 
                         if ( duplicatesFiles.containsKey( key ) )
                         {

Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/DocumentRendererContext.java Tue Oct 18 06:58:50 2011
@@ -105,12 +105,12 @@ public class DocumentRendererContext
      */
     public boolean containsKey( Object key )
     {
-        if ( key == null )
+        if ( !( key instanceof String ) ) // this includes null check
         {
             return false;
         }
 
-        return context.containsKey( key );
+        return context.containsKey( key.toString() );
     }
 
     /**
@@ -131,11 +131,11 @@ public class DocumentRendererContext
      */
     public Object remove( Object key )
     {
-        if ( key == null )
+        if ( !( key instanceof String ) ) // this includes null check
         {
             return null;
         }
 
-        return context.remove( key );
+        return context.remove( key.toString() );
     }
 }

Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/AbstractITextRender.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/AbstractITextRender.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/AbstractITextRender.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/itext/AbstractITextRender.java Tue Oct 18 06:58:50 2011
@@ -114,6 +114,7 @@ public abstract class AbstractITextRende
 
             if ( moduleBasedir.exists() )
             {
+                @SuppressWarnings ( "unchecked" )
                 List<String> docs =
                     FileUtils.getFileNames( moduleBasedir, "**/*." + module.getExtension(), null, false );
 
@@ -121,13 +122,13 @@ public abstract class AbstractITextRende
                 {
                     String fullPathDoc = new File( moduleBasedir, doc ).getPath();
 
-                    String outputITextName = doc.substring( 0, doc.indexOf( "." ) + 1 ) + "xml";
+                    String outputITextName = doc.substring( 0, doc.indexOf( '.') + 1 ) + "xml";
                     File outputITextFile = new File( outputDirectory, outputITextName );
                     if ( !outputITextFile.getParentFile().exists() )
                     {
                         outputITextFile.getParentFile().mkdirs();
                     }
-                    String iTextOutputName = doc.substring( 0, doc.indexOf( "." ) + 1 ) + getOutputExtension();
+                    String iTextOutputName = doc.substring( 0, doc.indexOf( '.') + 1 ) + getOutputExtension();
                     File iTextOutputFile = new File( outputDirectory, iTextOutputName );
                     if ( !iTextOutputFile.getParentFile().exists() )
                     {
@@ -201,6 +202,7 @@ public abstract class AbstractITextRende
 
             if ( moduleBasedir.exists() )
             {
+                @SuppressWarnings ( "unchecked" )
                 List<String> docs =
                     FileUtils.getFileNames( moduleBasedir, "**/*." + module.getExtension(), null, false );
 
@@ -208,7 +210,7 @@ public abstract class AbstractITextRende
                 {
                     String fullPathDoc = new File( moduleBasedir, doc ).getPath();
 
-                    String outputITextName = doc.substring( 0, doc.lastIndexOf( "." ) + 1 ) + "xml";
+                    String outputITextName = doc.substring( 0, doc.lastIndexOf( '.') + 1 ) + "xml";
                     File outputITextFile = new File( outputDirectory, outputITextName );
 
                     if ( ( documentModel.getToc() == null ) || ( documentModel.getToc().getItems() == null ) )
@@ -238,12 +240,12 @@ public abstract class AbstractITextRende
                             }
 
                             String outTmp = StringUtils.replace( outputITextFile.getAbsolutePath(), "\\", "/" );
-                            outTmp = outTmp.substring( 0, outTmp.lastIndexOf( "." ) );
+                            outTmp = outTmp.substring( 0, outTmp.lastIndexOf( '.') );
 
                             String outRef = StringUtils.replace( tocItem.getRef(), "\\", "/" );
-                            if ( outRef.lastIndexOf( "." ) != -1 )
+                            if ( outRef.lastIndexOf( '.') != -1 )
                             {
-                                outRef = outRef.substring( 0, outRef.lastIndexOf( "." ) );
+                                outRef = outRef.substring( 0, outRef.lastIndexOf( '.') );
                             }
                             else
                             {

Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/fo/FoPdfRenderer.java Tue Oct 18 06:58:50 2011
@@ -70,6 +70,7 @@ public class FoPdfRenderer
     }
 
     /** {@inheritDoc} */
+    @Override
     public void render( Map<String, SiteModule> filesToProcess, File outputDirectory, DocumentModel documentModel )
         throws DocumentRendererException, IOException
     {
@@ -77,6 +78,7 @@ public class FoPdfRenderer
     }
 
     /** {@inheritDoc} */
+    @Override
     public void render( Map<String, SiteModule> filesToProcess, File outputDirectory, DocumentModel documentModel,
                         DocumentRendererContext context )
         throws DocumentRendererException, IOException
@@ -177,6 +179,8 @@ public class FoPdfRenderer
     }
 
     /** {@inheritDoc} */
+    @Override
+    @SuppressWarnings ( "deprecation" )
     public void renderIndividual( Map<String, SiteModule> filesToProcess, File outputDirectory )
         throws DocumentRendererException, IOException
     {
@@ -184,6 +188,7 @@ public class FoPdfRenderer
     }
 
     /** {@inheritDoc} */
+    @Override
     public void renderIndividual( Map<String, SiteModule> filesToProcess, File outputDirectory,
                                   DocumentRendererContext context )
         throws DocumentRendererException, IOException
@@ -262,9 +267,9 @@ public class FoPdfRenderer
             }
 
             String href = StringUtils.replace( tocItem.getRef(), "\\", "/" );
-            if ( href.lastIndexOf( "." ) != -1 )
+            if ( href.lastIndexOf( '.') != -1 )
             {
-                href = href.substring( 0, href.lastIndexOf( "." ) );
+                href = href.substring( 0, href.lastIndexOf( '.') );
             }
 
             renderModules( href, sink, tocItem, context );
@@ -340,7 +345,7 @@ public class FoPdfRenderer
             {
                 SAXParseException sax = (SAXParseException) e.getCause();
 
-                StringBuffer sb = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 sb.append( "Error creating PDF from " ).append( inputFile.getAbsolutePath() ).append( ":" )
                   .append( sax.getLineNumber() ).append( ":" ).append( sax.getColumnNumber() ).append( "\n" );
                 sb.append( e.getMessage() );

Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/ITextPdfRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/ITextPdfRenderer.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/ITextPdfRenderer.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/main/java/org/apache/maven/doxia/docrenderer/pdf/itext/ITextPdfRenderer.java Tue Oct 18 06:58:50 2011
@@ -132,6 +132,7 @@ public class ITextPdfRenderer
     }
 
     /** {@inheritDoc} */
+    @Override
     public void render( Map<String, SiteModule> filesToProcess, File outputDirectory, DocumentModel documentModel )
         throws DocumentRendererException, IOException
     {
@@ -139,6 +140,7 @@ public class ITextPdfRenderer
     }
 
     /** {@inheritDoc} */
+    @Override
     public void render( Map<String, SiteModule> filesToProcess, File outputDirectory, DocumentModel documentModel,
                         DocumentRendererContext context )
         throws DocumentRendererException, IOException
@@ -194,6 +196,8 @@ public class ITextPdfRenderer
     }
 
     /** {@inheritDoc} */
+    @Override
+    @SuppressWarnings ( "deprecation" )
     public void renderIndividual( Map<String, SiteModule> filesToProcess, File outputDirectory )
         throws DocumentRendererException, IOException
     {
@@ -201,6 +205,7 @@ public class ITextPdfRenderer
     }
 
     /** {@inheritDoc} */
+    @Override
     public void renderIndividual( Map<String, SiteModule> filesToProcess, File outputDirectory,
                                   DocumentRendererContext context )
         throws DocumentRendererException, IOException
@@ -546,7 +551,7 @@ public class ITextPdfRenderer
             SiteModule module = entry.getValue();
             File fullDoc = new File( getBaseDir(), module.getSourceDirectory() + File.separator + key );
 
-            String outputITextName = key.substring( 0, key.lastIndexOf( "." ) + 1 ) + "xml";
+            String outputITextName = key.substring( 0, key.lastIndexOf( '.') + 1 ) + "xml";
             File outputITextFileTmp = new File( outputDirectory, outputITextName );
             outputITextFileTmp.deleteOnExit();
             if ( !outputITextFileTmp.getParentFile().exists() )
@@ -586,9 +591,9 @@ public class ITextPdfRenderer
             }
 
             String href = StringUtils.replace( tocItem.getRef(), "\\", "/" );
-            if ( href.lastIndexOf( "." ) != -1 )
+            if ( href.lastIndexOf( '.') != -1 )
             {
-                href = href.substring( 0, href.lastIndexOf( "." ) );
+                href = href.substring( 0, href.lastIndexOf( '.') );
             }
 
             Collection<SiteModule> modules = siteModuleManager.getSiteModules();
@@ -617,7 +622,7 @@ public class ITextPdfRenderer
 
                     if ( source.exists() )
                     {
-                        String outputITextName = doc.substring( 0, doc.lastIndexOf( "." ) + 1 ) + "xml";
+                        String outputITextName = doc.substring( 0, doc.lastIndexOf( '.') + 1 ) + "xml";
                         File outputITextFileTmp = new File( outputDirectory, outputITextName );
                         outputITextFileTmp.deleteOnExit();
                         if ( !outputITextFileTmp.getParentFile().exists() )

Modified: maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/docrenderer/DocumentRendererTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/docrenderer/DocumentRendererTest.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/docrenderer/DocumentRendererTest.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-doc-renderer/src/test/java/org/apache/maven/doxia/docrenderer/DocumentRendererTest.java Tue Oct 18 06:58:50 2011
@@ -41,6 +41,7 @@ public class DocumentRendererTest
     private File siteDirectoryFile;
 
     /** @throws java.lang.Exception */
+    @Override
     protected void setUp()
         throws Exception
     {
@@ -50,6 +51,7 @@ public class DocumentRendererTest
     }
 
     /** @throws java.lang.Exception */
+    @Override
     protected void tearDown()
         throws Exception
     {
@@ -85,6 +87,7 @@ public class DocumentRendererTest
         renderAggregatedImpl( "itext" );
     }
 
+    @SuppressWarnings ( "unchecked" )
     private void renderImpl( String implementation )
         throws Exception
     {
@@ -100,6 +103,7 @@ public class DocumentRendererTest
 
         docRenderer.render( siteDirectoryFile, outputDirectory, null );
 
+        @SuppressWarnings ( "unchecked" )
         List<String> files =
             FileUtils.getFileNames( new File( siteDirectoryFile, "apt" ), "**/*.apt",
                                     FileUtils.getDefaultExcludesAsString(), false );

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/main/java/org/apache/maven/doxia/siterenderer/DefaultSiteRenderer.java Tue Oct 18 06:58:50 2011
@@ -198,6 +198,7 @@ public class DefaultSiteRenderer
     {
         if ( moduleBasedir.exists() )
         {
+            @SuppressWarnings ( "unchecked" )
             List<String> allFiles = FileUtils.getFileNames( moduleBasedir, "**/*.*", excludes, false );
 
             String lowerCaseExtension = module.getExtension().toLowerCase( Locale.ENGLISH );
@@ -474,7 +475,7 @@ public class DefaultSiteRenderer
 
         context.put( "locale", locale );
         context.put( "supportedLocales", Collections.unmodifiableList( siteRenderingContext.getSiteLocales() ) );
-                                        
+
         // Add user properties
         Map<String, ?> templateProperties = siteRenderingContext.getTemplateProperties();
 

Modified: maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java?rev=1185508&r1=1185507&r2=1185508&view=diff
==============================================================================
--- maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java (original)
+++ maven/doxia/doxia-sitetools/trunk/doxia-site-renderer/src/test/java/org/apache/maven/doxia/siterenderer/DefaultSiteRendererTest.java Tue Oct 18 06:58:50 2011
@@ -71,6 +71,7 @@ public class DefaultSiteRendererTest
      * @throws java.lang.Exception if something goes wrong.
      * @see org.codehaus.plexus.PlexusTestCase#setUp()
      */
+    @Override
     protected void setUp()
         throws Exception
     {
@@ -104,6 +105,7 @@ public class DefaultSiteRendererTest
      * @throws java.lang.Exception if something goes wrong.
      * @see org.codehaus.plexus.PlexusTestCase#tearDown()
      */
+    @Override
     protected void tearDown()
         throws Exception
     {
@@ -160,7 +162,7 @@ public class DefaultSiteRendererTest
         ctxt.setTemplateName( "default-site.vm" );
         ctxt.setTemplateClassLoader( getClassLoader() );
         ctxt.setUsingDefaultTemplate( true );
-        Map templateProp = new HashMap();
+        final Map<String, String> templateProp = new HashMap<String, String>();
         templateProp.put( "outputEncoding", "UTF-8" );
         ctxt.setTemplateProperties( templateProp );
         ctxt.setDecoration( decoration );
@@ -349,17 +351,18 @@ public class DefaultSiteRendererTest
         }
 
         /** {@inheritDoc} */
-        protected Map getTestDocuments()
+        protected Map<String,String> getTestDocuments()
             throws IOException
         {
-            Map testDocs = new HashMap();
+            Map<String,String> testDocs = new HashMap<String,String>();
 
             File dir = new File( getBasedir(), "target/output" );
 
-            List l = FileUtils.getFileNames( dir, getIncludes()[0], FileUtils.getDefaultExcludesAsString(), true );
-            for ( Iterator it = l.iterator(); it.hasNext(); )
+            @SuppressWarnings ( "unchecked" )
+            List<String> l = FileUtils.getFileNames( dir, getIncludes()[0], FileUtils.getDefaultExcludesAsString(), true );
+            for ( Iterator<String> it = l.iterator(); it.hasNext(); )
             {
-                String file = it.next().toString();
+                String file = it.next();
                 file = StringUtils.replace( file, "\\", "/" );
 
                 Reader reader = ReaderFactory.newXmlReader( new File( file ) );
@@ -377,6 +380,7 @@ public class DefaultSiteRendererTest
         }
 
         /** {@inheritDoc} */
+        @Override
         protected boolean isFailErrorMessage( String message )
         {
             return true;