maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ltheu...@apache.org
Subject svn commit: r1091043 - in /maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia: document/ macro/ macro/snippet/ macro/toc/ parser/ sink/ util/ xsd/
Date Mon, 11 Apr 2011 11:44:39 GMT
Author: ltheussl
Date: Mon Apr 11 11:44:39 2011
New Revision: 1091043

URL: http://svn.apache.org/viewvc?rev=1091043&view=rev
Log:
move test sources to jdk5

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventAttributeSetTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventElement.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventTestingSink.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java
    maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java Mon Apr 11 11:44:39 2011
@@ -152,9 +152,9 @@ public class DocumentModelTest
 
     private void verifyDocumentCover( DocumentCover cover )
     {
-        List authors = cover.getAuthors();
+        List<DocumentAuthor> authors = cover.getAuthors();
         assertEquals( 1, authors.size() );
-        verifyAuthor( (DocumentAuthor) authors.get( 0 ), 1 );
+        verifyAuthor( authors.get( 0 ), 1 );
 
         assertEquals( "Author", cover.getAuthor() );
         assertEquals( "companyLogo", cover.getCompanyLogo() );
@@ -258,9 +258,9 @@ public class DocumentModelTest
     private void verifyDocumentMeta( DocumentMeta meta )
     {
         assertEquals( "author", meta.getAuthor() );
-        List authors = meta.getAuthors();
+        List<DocumentAuthor> authors = meta.getAuthors();
         assertEquals( 1, authors.size() );
-        verifyAuthor( (DocumentAuthor) authors.get( 0 ), 2 );
+        verifyAuthor( authors.get( 0 ), 2 );
 
         assertTrue( meta.isConfidential() );
         assertEquals( 1L, meta.getCreationDate().getTime() );

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java Mon Apr 11 11:44:39 2011
@@ -48,7 +48,7 @@ public class SwfMacroTest
             throws MacroExecutionException
     {
 
-        Map macroParameters = new HashMap();
+        Map<String, Object> macroParameters = new HashMap<String, Object>();
         macroParameters.put( "src", "src.swf" );
         macroParameters.put( "id", "Movie" );
         macroParameters.put( "width", "50" );
@@ -88,19 +88,19 @@ public class SwfMacroTest
 
         macro.execute( sink, request );
 
-        Iterator it = sink.getEventList().iterator();
-        SinkEventElement event = (SinkEventElement) it.next();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
+        SinkEventElement event = it.next();
 
         assertEquals( "rawText", event.getName() );
         assertFalse( it.hasNext() );
 
-        request = new MacroRequest( new HashMap(), new File( "." ) );
+        request = new MacroRequest( new HashMap<String, Object>(), new File( "." ) );
         sink.reset();
 
         macro.execute( sink, request );
 
         it = sink.getEventList().iterator();
-        event = (SinkEventElement) it.next();
+        event = it.next();
 
         assertEquals( "rawText", event.getName() );
         assertFalse( it.hasNext() );

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java Mon Apr 11 11:44:39 2011
@@ -49,7 +49,7 @@ public class SnippetMacroTest
             throws MacroExecutionException
     {
         File basedir = new File( getBasedir() );
-        Map macroParameters = new HashMap();
+        Map<String, Object> macroParameters = new HashMap<String, Object>();
         macroParameters.put( "file", "src/test/resources/macro/snippet/testSnippet.txt" );
 
         SinkEventTestingSink sink = new SinkEventTestingSink();
@@ -58,12 +58,12 @@ public class SnippetMacroTest
         SnippetMacro macro = new SnippetMacro();
         macro.execute( sink, request );
 
-        Iterator it = sink.getEventList().iterator();
-        assertEquals( "verbatim", ( (SinkEventElement) it.next() ).getName() );
-        SinkEventElement event = (SinkEventElement) it.next();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
+        assertEquals( "verbatim", ( it.next() ).getName() );
+        SinkEventElement event = it.next();
         assertEquals( "text", event.getName() );
         String snippet = (String) event.getArgs()[0];
-        assertEquals( "verbatim_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "verbatim_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
 
         assertTrue( snippet.indexOf( "preamble" ) != -1 );
@@ -81,11 +81,11 @@ public class SnippetMacroTest
         macro.execute( sink, request );
 
         it = sink.getEventList().iterator();
-        assertEquals( "verbatim", ( (SinkEventElement) it.next() ).getName() );
-        event = (SinkEventElement) it.next();
+        assertEquals( "verbatim", ( it.next() ).getName() );
+        event = it.next();
         assertEquals( "text", event.getName() );
         snippet = (String) event.getArgs()[0];
-        assertEquals( "verbatim_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "verbatim_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
 
         assertTrue( snippet.indexOf( "preamble" ) == -1 );
@@ -103,7 +103,7 @@ public class SnippetMacroTest
         macro.execute( sink, request );
 
         it = sink.getEventList().iterator();
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "rawText", event.getName() );
         snippet = (String) event.getArgs()[0];
         assertFalse( it.hasNext() );

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java Mon Apr 11 11:44:39 2011
@@ -58,7 +58,7 @@ public class TocMacroTest
         XhtmlBaseParser parser = new XhtmlBaseParser();
         parser.setSecondParsing( true );
 
-        Map macroParameters = new HashMap();
+        Map<String, Object> macroParameters = new HashMap<String, Object>();
         macroParameters.put( "parser", parser );
         macroParameters.put( "sourceContent", sourceContent );
         macroParameters.put( "section", "sec1" );
@@ -70,38 +70,38 @@ public class TocMacroTest
         TocMacro macro = new TocMacro();
         macro.execute( sink, request );
 
-        Iterator it = sink.getEventList().iterator();
-        assertEquals( "list", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list_", ( (SinkEventElement) it.next() ).getName() );
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
+        assertEquals( "list", ( it.next() ).getName() );
+        assertEquals( "listItem", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "listItem_", ( it.next() ).getName() );
+        assertEquals( "listItem", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "list", ( it.next() ).getName() );
+        assertEquals( "listItem", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "list", ( it.next() ).getName() );
+        assertEquals( "listItem", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "listItem_", ( it.next() ).getName() );
+        assertEquals( "list_", ( it.next() ).getName() );
+        assertEquals( "listItem_", ( it.next() ).getName() );
+        assertEquals( "list_", ( it.next() ).getName() );
+        assertEquals( "listItem_", ( it.next() ).getName() );
+        assertEquals( "listItem", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "listItem_", ( it.next() ).getName() );
+        assertEquals( "list_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
 
         // test parameters
@@ -120,28 +120,28 @@ public class TocMacroTest
         macro.execute( sink, request );
 
         it = sink.getEventList().iterator();
-        SinkEventElement event = (SinkEventElement) it.next();
+        SinkEventElement event = it.next();
         assertEquals( "list", event.getName() );
         SinkEventAttributeSet atts = (SinkEventAttributeSet) event.getArgs()[0];
         assertEquals( "myId", atts.getAttribute( "id" ) );
         assertEquals( "myClass", atts.getAttribute( "class" ) );
-        assertEquals( "listItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        event = (SinkEventElement) it.next();
+        assertEquals( "listItem", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "h22", (String) event.getArgs()[0] );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        event = (SinkEventElement) it.next();
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "list", ( it.next() ).getName() );
+        assertEquals( "listItem", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "h3", (String) event.getArgs()[0] );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "listItem_", ( it.next() ).getName() );
+        assertEquals( "list_", ( it.next() ).getName() );
+        assertEquals( "listItem_", ( it.next() ).getName() );
+        assertEquals( "list_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
     }
 
@@ -159,7 +159,7 @@ public class TocMacroTest
         XhtmlBaseParser parser = new XhtmlBaseParser();
         parser.setSecondParsing( true );
 
-        Map macroParameters = new HashMap();
+        Map<String, Object> macroParameters = new HashMap<String, Object>();
         macroParameters.put( "parser", parser );
         macroParameters.put( "sourceContent", sourceContent );
         macroParameters.put( "section", "sec1" );

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java Mon Apr 11 11:44:39 2011
@@ -41,7 +41,7 @@ public class XhtmlBaseParserTest
     private XhtmlBaseParser parser;
     private final SinkEventTestingSink sink = new SinkEventTestingSink();
 
-    /** {@inheritDoc} */
+    @Override
     protected void setUp() throws Exception
     {
         super.setUp();
@@ -51,12 +51,6 @@ public class XhtmlBaseParserTest
         sink.reset();
     }
 
-    /** {@inheritDoc} */
-    protected void tearDown() throws Exception
-    {
-        super.tearDown();
-    }
-
     /** @throws Exception  */
     public void testHeadingEventsList()
         throws Exception
@@ -65,36 +59,36 @@ public class XhtmlBaseParserTest
 
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "paragraph", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section1", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle1", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle1_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section2", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle2", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle2_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section3", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle3", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle3_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section4", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle4", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle4_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section5", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle5", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle5_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section5_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section4_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section3_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section2_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section1_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section1", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle1", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle1_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph", ( it.next() ).getName() );
+        assertEquals( "section1", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1_", ( it.next() ).getName() );
+        assertEquals( "section2", ( it.next() ).getName() );
+        assertEquals( "sectionTitle2", ( it.next() ).getName() );
+        assertEquals( "sectionTitle2_", ( it.next() ).getName() );
+        assertEquals( "section3", ( it.next() ).getName() );
+        assertEquals( "sectionTitle3", ( it.next() ).getName() );
+        assertEquals( "sectionTitle3_", ( it.next() ).getName() );
+        assertEquals( "section4", ( it.next() ).getName() );
+        assertEquals( "sectionTitle4", ( it.next() ).getName() );
+        assertEquals( "sectionTitle4_", ( it.next() ).getName() );
+        assertEquals( "section5", ( it.next() ).getName() );
+        assertEquals( "sectionTitle5", ( it.next() ).getName() );
+        assertEquals( "sectionTitle5_", ( it.next() ).getName() );
+        assertEquals( "section5_", ( it.next() ).getName() );
+        assertEquals( "section4_", ( it.next() ).getName() );
+        assertEquals( "section3_", ( it.next() ).getName() );
+        assertEquals( "section2_", ( it.next() ).getName() );
+        assertEquals( "section1_", ( it.next() ).getName() );
+        assertEquals( "section1", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1_", ( it.next() ).getName() );
         // this one is missing because we enclose everything in <p> which is not valid xhtml,
         // needs to be tested in overriding parser, eg XhtmlParser, XdocParser.
-        //assertEquals( "section1_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "paragraph_", ( (SinkEventElement) it.next() ).getName() );
+        //assertEquals( "section1_", ( it.next() ).getName() );
+        assertEquals( "paragraph_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
     }
 
@@ -107,34 +101,34 @@ public class XhtmlBaseParserTest
 
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "paragraph", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section1", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle1", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle1_", ( (SinkEventElement) it.next() ).getName() );
-
-        assertEquals( "section2", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section3", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section4", ( (SinkEventElement) it.next() ).getName() );
-
-        assertEquals( "section5", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle5", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle5_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section5_", ( (SinkEventElement) it.next() ).getName() );
-
-        assertEquals( "section4_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section3_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "section2_", ( (SinkEventElement) it.next() ).getName() );
-
-        assertEquals( "section2", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle2", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle2_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph", ( it.next() ).getName() );
+        assertEquals( "section1", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1_", ( it.next() ).getName() );
+
+        assertEquals( "section2", ( it.next() ).getName() );
+        assertEquals( "section3", ( it.next() ).getName() );
+        assertEquals( "section4", ( it.next() ).getName() );
+
+        assertEquals( "section5", ( it.next() ).getName() );
+        assertEquals( "sectionTitle5", ( it.next() ).getName() );
+        assertEquals( "sectionTitle5_", ( it.next() ).getName() );
+        assertEquals( "section5_", ( it.next() ).getName() );
+
+        assertEquals( "section4_", ( it.next() ).getName() );
+        assertEquals( "section3_", ( it.next() ).getName() );
+        assertEquals( "section2_", ( it.next() ).getName() );
+
+        assertEquals( "section2", ( it.next() ).getName() );
+        assertEquals( "sectionTitle2", ( it.next() ).getName() );
+        assertEquals( "sectionTitle2_", ( it.next() ).getName() );
         // these two are missing because we enclose everything in <p> which is not valid xhtml,
         // needs to be tested in overriding parser, eg XhtmlParser, XdocParser.
-        //assertEquals( "section2_", ( (SinkEventElement) it.next() ).getName() );
-        //assertEquals( "section1_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "paragraph_", ( (SinkEventElement) it.next() ).getName() );
+        //assertEquals( "section2_", ( it.next() ).getName() );
+        //assertEquals( "section1_", ( it.next() ).getName() );
+        assertEquals( "paragraph_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
     }
 
@@ -146,9 +140,9 @@ public class XhtmlBaseParserTest
 
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "figureGraphics", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "figureGraphics", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
     }
 
@@ -162,22 +156,22 @@ public class XhtmlBaseParserTest
 
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "table", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRows", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRow", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableHeaderCell", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableHeaderCell_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRow_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRow", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableCell", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableCell_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRow_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRows_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "table_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "table", ( it.next() ).getName() );
+        assertEquals( "tableRows", ( it.next() ).getName() );
+        assertEquals( "tableRow", ( it.next() ).getName() );
+        assertEquals( "tableHeaderCell", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "tableHeaderCell_", ( it.next() ).getName() );
+        assertEquals( "tableRow_", ( it.next() ).getName() );
+        assertEquals( "tableRow", ( it.next() ).getName() );
+        assertEquals( "tableCell", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "tableCell_", ( it.next() ).getName() );
+        assertEquals( "tableRow_", ( it.next() ).getName() );
+        assertEquals( "tableRows_", ( it.next() ).getName() );
+        assertEquals( "table_", ( it.next() ).getName() );
 
         assertFalse( it.hasNext() );
     }
@@ -191,21 +185,21 @@ public class XhtmlBaseParserTest
 
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "paragraph", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "bold", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "bold_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph", ( it.next() ).getName() );
+        assertEquals( "bold", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "bold_", ( it.next() ).getName() );
 
-        SinkEventElement el = (SinkEventElement) it.next();
+        SinkEventElement el = it.next();
         assertEquals( "text", el.getName() );
         assertEquals( " ",  (String) el.getArgs()[0] );
 
-        assertEquals( "italic", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "italic_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "paragraph_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "italic", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "italic_", ( it.next() ).getName() );
+        assertEquals( "paragraph_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
 
 
@@ -217,20 +211,20 @@ public class XhtmlBaseParserTest
         parser.parse( text, sink );
         it = sink.getEventList().iterator();
 
-        assertEquals( "paragraph", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "bold", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "bold_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph", ( it.next() ).getName() );
+        assertEquals( "bold", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "bold_", ( it.next() ).getName() );
 
-        el = (SinkEventElement) it.next();
+        el = it.next();
         assertEquals( "text", el.getName() );
         // according to section 2.11 of the XML spec, parsers must normalize line breaks to "\n"
         assertEquals( "\n",  (String) el.getArgs()[0] );
 
-        assertEquals( "italic", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "italic_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "paragraph_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "italic", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "italic_", ( it.next() ).getName() );
+        assertEquals( "paragraph_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
 
 
@@ -241,17 +235,17 @@ public class XhtmlBaseParserTest
         parser.parse( text, sink );
         it = sink.getEventList().iterator();
 
-        assertEquals( "paragraph", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "italic", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "italic_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "italic", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "italic_", ( it.next() ).getName() );
 
-        el = (SinkEventElement) it.next();
+        el = it.next();
         assertEquals( "text", el.getName() );
         assertEquals( ".",  (String) el.getArgs()[0] );
 
-        assertEquals( "paragraph_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
     }
 
@@ -263,12 +257,12 @@ public class XhtmlBaseParserTest
 
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
-        assertEquals( "verbatim", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "verbatim_", ( (SinkEventElement) it.next() ).getName() );
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
+        assertEquals( "verbatim", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "verbatim_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
 
         text = "<pre><![CDATA[<a href=\"what.html\">what</a>]]></pre>";
@@ -276,9 +270,9 @@ public class XhtmlBaseParserTest
         parser.parse( text, sink );
 
         it = sink.getEventList().iterator();
-        assertEquals( "verbatim", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "verbatim_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "verbatim", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "verbatim_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
 
         text = "<pre><![CDATA[<pre>what</pre>]]></pre>";
@@ -286,9 +280,9 @@ public class XhtmlBaseParserTest
         parser.parse( text, sink );
 
         it = sink.getEventList().iterator();
-        assertEquals( "verbatim", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "verbatim_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "verbatim", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "verbatim_", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
     }
 
@@ -302,17 +296,17 @@ public class XhtmlBaseParserTest
 
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "verbatim", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "text", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "verbatim_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "verbatim", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link", ( it.next() ).getName() );
+        assertEquals( "text", ( it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
+        assertEquals( "verbatim_", ( it.next() ).getName() );
     }
 
     /** @throws Exception  */
@@ -331,28 +325,28 @@ public class XhtmlBaseParserTest
         parser.setValidate( false );
         parser.parse( sb.toString(), sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        SinkEventElement event = (SinkEventElement) it.next();
+        SinkEventElement event = it.next();
         assertEquals( "bold", event.getName() );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "\u0159",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "\u00A0",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "\u0161",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "\uD835\uDFED",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "bold_", event.getName() );
     }
 
@@ -366,59 +360,59 @@ public class XhtmlBaseParserTest
         parser.setValidate( false );
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "section1", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "sectionTitle1", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "section1", ( it.next() ).getName() );
+        assertEquals( "sectionTitle1", ( it.next() ).getName() );
 
-        SinkEventElement textEvt = (SinkEventElement) it.next();
+        SinkEventElement textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "&", textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "\u0159", textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "\u0159", textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "\uD835\uDFED",  (String) textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "\uD835\uDFED", textEvt.getArgs()[0] );
 
-        assertEquals( "sectionTitle1_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "paragraph", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "sectionTitle1_", ( it.next() ).getName() );
+        assertEquals( "paragraph", ( it.next() ).getName() );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "&", textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "\u0159", textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "\u0159", textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "\uD835\uDFED",  (String) textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "\uD835\uDFED", textEvt.getArgs()[0] );
 
-        textEvt = (SinkEventElement) it.next();
+        textEvt = it.next();
         assertEquals( "text", textEvt.getName() );
         assertEquals( "A", textEvt.getArgs()[0] );
 
-        assertEquals( "paragraph_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph_", ( it.next() ).getName() );
 
         assertFalse( it.hasNext() );
     }
@@ -429,29 +423,29 @@ public class XhtmlBaseParserTest
     {
         String text = "<div><u>u</u><s>s</s><del>del</del><strike>strike</strike><sub>sub</sub><sup>sup</sup></div>";
         parser.parse( text, sink );
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        SinkEventElement event = (SinkEventElement) it.next();
+        SinkEventElement event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "u",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "s",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "del",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "strike",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "sub",  (String) event.getArgs()[0] );
 
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "text", event.getName() );
         assertEquals( "sup",  (String) event.getArgs()[0] );
 //        assertTrue( ( (SinkEventAttributeSet) event.getArgs()[1] )
@@ -464,26 +458,26 @@ public class XhtmlBaseParserTest
     {
         String text = "<div><ul><li></li></ul><ol><li></li></ol><dl><dt></dt><dd></dd></dl></div>";
         parser.parse( text, sink );
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "list", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "listItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "list_", ( (SinkEventElement) it.next() ).getName() );
-
-        assertEquals( "numberedList", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "numberedListItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "numberedListItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "numberedList_", ( (SinkEventElement) it.next() ).getName() );
-
-        assertEquals( "definitionList", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "definitionListItem", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "definedTerm", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "definedTerm_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "definition", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "definition_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "definitionListItem_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "definitionList_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "list", ( it.next() ).getName() );
+        assertEquals( "listItem", ( it.next() ).getName() );
+        assertEquals( "listItem_", ( it.next() ).getName() );
+        assertEquals( "list_", ( it.next() ).getName() );
+
+        assertEquals( "numberedList", ( it.next() ).getName() );
+        assertEquals( "numberedListItem", ( it.next() ).getName() );
+        assertEquals( "numberedListItem_", ( it.next() ).getName() );
+        assertEquals( "numberedList_", ( it.next() ).getName() );
+
+        assertEquals( "definitionList", ( it.next() ).getName() );
+        assertEquals( "definitionListItem", ( it.next() ).getName() );
+        assertEquals( "definedTerm", ( it.next() ).getName() );
+        assertEquals( "definedTerm_", ( it.next() ).getName() );
+        assertEquals( "definition", ( it.next() ).getName() );
+        assertEquals( "definition_", ( it.next() ).getName() );
+        assertEquals( "definitionListItem_", ( it.next() ).getName() );
+        assertEquals( "definitionList_", ( it.next() ).getName() );
     }
 
     /** @throws Exception  */
@@ -492,24 +486,24 @@ public class XhtmlBaseParserTest
     {
         String text = "<div><b></b><strong></strong><i></i><em></em><code></code><samp></samp><tt></tt></div>";
         parser.parse( text, sink );
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "bold", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "bold_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "bold", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "bold_", ( (SinkEventElement) it.next() ).getName() );
-
-        assertEquals( "italic", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "italic_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "italic", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "italic_", ( (SinkEventElement) it.next() ).getName() );
-
-        assertEquals( "monospaced", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "monospaced_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "monospaced", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "monospaced_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "monospaced", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "monospaced_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "bold", ( it.next() ).getName() );
+        assertEquals( "bold_", ( it.next() ).getName() );
+        assertEquals( "bold", ( it.next() ).getName() );
+        assertEquals( "bold_", ( it.next() ).getName() );
+
+        assertEquals( "italic", ( it.next() ).getName() );
+        assertEquals( "italic_", ( it.next() ).getName() );
+        assertEquals( "italic", ( it.next() ).getName() );
+        assertEquals( "italic_", ( it.next() ).getName() );
+
+        assertEquals( "monospaced", ( it.next() ).getName() );
+        assertEquals( "monospaced_", ( it.next() ).getName() );
+        assertEquals( "monospaced", ( it.next() ).getName() );
+        assertEquals( "monospaced_", ( it.next() ).getName() );
+        assertEquals( "monospaced", ( it.next() ).getName() );
+        assertEquals( "monospaced_", ( it.next() ).getName() );
     }
 
     /** @throws Exception  */
@@ -518,11 +512,11 @@ public class XhtmlBaseParserTest
     {
         String text = "<div><br/><hr/><img src=\"img.src\"/></div>";
         parser.parse( text, sink );
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "lineBreak", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "horizontalRule", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "figureGraphics", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "lineBreak", ( it.next() ).getName() );
+        assertEquals( "horizontalRule", ( it.next() ).getName() );
+        assertEquals( "figureGraphics", ( it.next() ).getName() );
     }
 
     /** @throws Exception  */
@@ -531,15 +525,15 @@ public class XhtmlBaseParserTest
     {
         String text = "<p><!-- a pagebreak: --><!-- PB -->&nbsp;&#160;<unknown /></p>";
         parser.parse( text, sink );
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "paragraph", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "comment", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "pageBreak", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "nonBreakingSpace", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "nonBreakingSpace", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph", ( it.next() ).getName() );
+        assertEquals( "comment", ( it.next() ).getName() );
+        assertEquals( "pageBreak", ( it.next() ).getName() );
+        assertEquals( "nonBreakingSpace", ( it.next() ).getName() );
+        assertEquals( "nonBreakingSpace", ( it.next() ).getName() );
         // unknown events are not reported by the base parser
-        assertEquals( "paragraph_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "paragraph_", ( it.next() ).getName() );
     }
 
     /** @throws Exception  */
@@ -548,27 +542,27 @@ public class XhtmlBaseParserTest
     {
         String text = "<table><caption></caption><tr><th></th></tr><tr><td></td></tr></table>";
         parser.parse( text, sink );
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "table", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "table", ( it.next() ).getName() );
 
         // DOXIA-374
-        SinkEventElement el = (SinkEventElement) it.next();
+        SinkEventElement el = it.next();
         assertEquals( "tableRows", el.getName() );
         assertFalse( ( (Boolean) el.getArgs()[1] ).booleanValue() );
 
-        assertEquals( "tableCaption", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableCaption_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRow", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableHeaderCell", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableHeaderCell_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRow_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRow", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableCell", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableCell_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRow_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "tableRows_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "table_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "tableCaption", ( it.next() ).getName() );
+        assertEquals( "tableCaption_", ( it.next() ).getName() );
+        assertEquals( "tableRow", ( it.next() ).getName() );
+        assertEquals( "tableHeaderCell", ( it.next() ).getName() );
+        assertEquals( "tableHeaderCell_", ( it.next() ).getName() );
+        assertEquals( "tableRow_", ( it.next() ).getName() );
+        assertEquals( "tableRow", ( it.next() ).getName() );
+        assertEquals( "tableCell", ( it.next() ).getName() );
+        assertEquals( "tableCell_", ( it.next() ).getName() );
+        assertEquals( "tableRow_", ( it.next() ).getName() );
+        assertEquals( "tableRows_", ( it.next() ).getName() );
+        assertEquals( "table_", ( it.next() ).getName() );
     }
 
     /** @throws Exception  */
@@ -577,13 +571,13 @@ public class XhtmlBaseParserTest
     {
         String text = "<div class=\"figure\"><p><img src=\"src.jpg\"/></p><p><i></i></p></div>";
         parser.parse( text, sink );
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        assertEquals( "figure", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "figureGraphics", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "figureCaption", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "figureCaption_", ( (SinkEventElement) it.next() ).getName() );
-        assertEquals( "figure_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "figure", ( it.next() ).getName() );
+        assertEquals( "figureGraphics", ( it.next() ).getName() );
+        assertEquals( "figureCaption", ( it.next() ).getName() );
+        assertEquals( "figureCaption_", ( it.next() ).getName() );
+        assertEquals( "figure_", ( it.next() ).getName() );
     }
 
     /** @throws Exception  */
@@ -599,42 +593,42 @@ public class XhtmlBaseParserTest
                 "<a id=\"1invalid\"></a></div>";
 
         parser.parse( text, sink );
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        SinkEventElement element = (SinkEventElement) it.next();
+        SinkEventElement element = it.next();
         assertEquals( "link", element.getName() );
         assertEquals( "", element.getArgs()[0] );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
 
-        element = (SinkEventElement) it.next();
+        element = it.next();
         assertEquals( "link", element.getName() );
         assertEquals( "valid", element.getArgs()[0] );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
 
-        element = (SinkEventElement) it.next();
+        element = it.next();
         assertEquals( "link", element.getName() );
         assertEquals( "#a1invalid", element.getArgs()[0] );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
 
-        element = (SinkEventElement) it.next();
+        element = it.next();
         assertEquals( "link", element.getName() );
         assertEquals( "http://www.fo.com/index.html#1invalid", element.getArgs()[0] );
-        assertEquals( "link_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "link_", ( it.next() ).getName() );
 
-        element = (SinkEventElement) it.next();
+        element = it.next();
         assertEquals( "anchor", element.getName() );
         assertEquals( "valid", element.getArgs()[0] );
-        assertEquals( "anchor_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "anchor_", ( it.next() ).getName() );
 
-        element = (SinkEventElement) it.next();
+        element = it.next();
         assertEquals( "anchor", element.getName() );
         assertEquals( "a1invalid", element.getArgs()[0] );
-        assertEquals( "anchor_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "anchor_", ( it.next() ).getName() );
 
-        element = (SinkEventElement) it.next();
+        element = it.next();
         assertEquals( "anchor", element.getName() );
         assertEquals( "a1invalid", element.getArgs()[0] );
-        assertEquals( "anchor_", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "anchor_", ( it.next() ).getName() );
     }
 
     /**
@@ -649,16 +643,16 @@ public class XhtmlBaseParserTest
 
         parser.parse( text, sink );
 
-        Iterator it = sink.getEventList().iterator();
+        Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
-        SinkEventElement event = (SinkEventElement) it.next();
+        SinkEventElement event = it.next();
 
         assertEquals( "unknown", event.getName() );
         assertEquals( "script", event.getArgs()[0] );
         SinkEventAttributeSet attribs = (SinkEventAttributeSet) event.getArgs()[2];
         // ampersand should be un-escaped
         assertEquals( "http://ex.com/ex.js?v=l&l=e", attribs.getAttribute( "src" ) );
-        assertEquals( "unknown", ( (SinkEventElement) it.next() ).getName() );
+        assertEquals( "unknown", ( it.next() ).getName() );
         assertFalse( it.hasNext() );
 
         sink.reset();
@@ -666,7 +660,7 @@ public class XhtmlBaseParserTest
         parser.parse( text, sink );
 
         it = sink.getEventList().iterator();
-        event = (SinkEventElement) it.next();
+        event = it.next();
         assertEquals( "figureGraphics", event.getName() );
         attribs = (SinkEventAttributeSet) event.getArgs()[1];
         // ampersand should be un-escaped

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/AbstractSinkTest.java Mon Apr 11 11:44:39 2011
@@ -46,6 +46,7 @@ public abstract class AbstractSinkTest
      *
      * @throws java.lang.Exception if something goes wrong.
      */
+    @Override
     protected void setUp()
         throws Exception
     {

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventAttributeSetTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventAttributeSetTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventAttributeSetTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventAttributeSetTest.java Mon Apr 11 11:44:39 2011
@@ -38,6 +38,7 @@ public class SinkEventAttributeSetTest e
     /**
      * @throws java.lang.Exception if any.
      */
+    @Override
     protected void setUp()
             throws Exception
     {
@@ -145,7 +146,7 @@ public class SinkEventAttributeSetTest e
     public void testGetAttributeNames()
     {
         sinkEventAttributeSet.addAttributes( SinkEventAttributeSet.UNDERLINE );
-        Enumeration result = sinkEventAttributeSet.getAttributeNames();
+        Enumeration<String> result = sinkEventAttributeSet.getAttributeNames();
         assertEquals( "decoration", result.nextElement() );
         assertFalse( result.hasMoreElements() );
     }

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventElement.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventElement.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventElement.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventElement.java Mon Apr 11 11:44:39 2011
@@ -79,6 +79,7 @@ public class SinkEventElement
      * {@inheritDoc}
      * @since 1.1.1
      */
+    @Override
     public String toString()
     {
         return ToStringBuilder.reflectionToString( this );

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventTestingSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventTestingSink.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventTestingSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/SinkEventTestingSink.java Mon Apr 11 11:44:39 2011
@@ -34,14 +34,14 @@ public class SinkEventTestingSink
     extends AbstractSink
 {
     /** The list of sink events. */
-    private final List events = new LinkedList();
+    private final List<SinkEventElement> events = new LinkedList<SinkEventElement>();
 
     /**
      * Return the collected list of SinkEventElements.
      *
      * @return the collected list of SinkEventElements.
      */
-    public List getEventList()
+    public List<SinkEventElement> getEventList()
     {
         return this.events;
     }

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/WellformednessCheckingSink.java Mon Apr 11 11:44:39 2011
@@ -34,9 +34,9 @@ import java.util.Stack;
 public class WellformednessCheckingSink
     extends AbstractSink
 {
-    private final Stack elements = new Stack();
+    private final Stack<String> elements = new Stack<String>();
 
-    private final List errors = new LinkedList();
+    private final List<String> errors = new LinkedList<String>();
 
     /** {@inheritDoc} */
     public void head()
@@ -603,7 +603,7 @@ public class WellformednessCheckingSink
             return null;
         }
 
-        return (String) errors.get( errors.size() - 1 );
+        return errors.get( errors.size() - 1 );
     }
 
     /**
@@ -611,7 +611,7 @@ public class WellformednessCheckingSink
      *
      * @return a list of String of error messages
      */
-    public List getOffenders()
+    public List<String> getOffenders()
     {
         return errors;
     }
@@ -624,7 +624,7 @@ public class WellformednessCheckingSink
      */
     private void checkWellformedness( String actual )
     {
-        String expected = (String) elements.pop();
+        String expected = elements.pop();
 
         if ( !expected.equals( actual ) )
         {

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/sink/XhtmlBaseSinkTest.java Mon Apr 11 11:44:39 2011
@@ -44,6 +44,7 @@ public class XhtmlBaseSinkTest
      *
      * @throws java.lang.Exception if any.
      */
+    @Override
     protected void setUp()
             throws Exception
     {

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/util/HtmlToolsTest.java Mon Apr 11 11:44:39 2011
@@ -109,6 +109,8 @@ public class HtmlToolsTest
 
     /**
      * Verify the expected results.
+     *
+     * @throws Exception should not happen.
      */
     public void testEncodeURL()
         throws Exception

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java Mon Apr 11 11:44:39 2011
@@ -81,6 +81,7 @@ public abstract class AbstractXmlValidat
         return false;
     }
 
+    @Override
     protected void tearDown()
             throws Exception
     {
@@ -102,20 +103,20 @@ public abstract class AbstractXmlValidat
     {
         final Logger logger = getContainer().getLoggerManager().getLoggerForComponent( Parser.ROLE );
 
-        for ( Iterator it = getTestDocuments().entrySet().iterator(); it.hasNext(); )
+        for ( Iterator<Map.Entry<String, String>> it = getTestDocuments().entrySet().iterator(); it.hasNext(); )
         {
-            Map.Entry entry = (Map.Entry) it.next();
+            Map.Entry<String, String> entry = it.next();
 
             if ( logger.isDebugEnabled() )
             {
                 logger.debug( "Validate '" + entry.getKey() + "'" );
             }
 
-            List errors = parseXML( entry.getValue().toString() );
+            List<ErrorMessage> errors = parseXML( entry.getValue().toString() );
 
-            for ( Iterator it2 = errors.iterator(); it2.hasNext(); )
+            for ( Iterator<ErrorMessage> it2 = errors.iterator(); it2.hasNext(); )
             {
-                ErrorMessage error = (ErrorMessage) it2.next();
+                ErrorMessage error = it2.next();
 
                 if ( isFailErrorMessage( error.getMessage() ) )
                 {
@@ -142,7 +143,7 @@ public abstract class AbstractXmlValidat
      * @return a Map &lt; filePath, fileContent &gt; of files to validate.
      * @throws IOException if any
      */
-    protected abstract Map getTestDocuments()
+    protected abstract Map<String,String> getTestDocuments()
             throws IOException;
 
     /**
@@ -193,7 +194,7 @@ public abstract class AbstractXmlValidat
      * @throws IOException is any
      * @throws SAXException if any
      */
-    private List parseXML( String content )
+    private List<ErrorMessage> parseXML( String content )
         throws IOException, SAXException
     {
         String xmlContent = addNamespaces( content );
@@ -272,6 +273,7 @@ public abstract class AbstractXmlValidat
         }
 
         /** {@inheritDoc} */
+        @Override
         public String toString()
         {
             StringBuffer sb = new StringBuffer( 512 );
@@ -287,6 +289,7 @@ public abstract class AbstractXmlValidat
         }
 
         /** {@inheritDoc} */
+        @Override
         public int hashCode()
         {
             final int prime = 31;
@@ -301,6 +304,7 @@ public abstract class AbstractXmlValidat
         }
 
         /** {@inheritDoc} */
+        @Override
         public boolean equals( Object obj )
         {
             if ( this == obj )
@@ -375,14 +379,15 @@ public abstract class AbstractXmlValidat
     private static class MessagesErrorHandler
         extends DefaultHandler
     {
-        private final List messages;
+        private final List<ErrorMessage> messages;
 
         MessagesErrorHandler()
         {
-            messages = new ArrayList( 8 );
+            messages = new ArrayList<ErrorMessage>( 8 );
         }
 
         /** {@inheritDoc} */
+        @Override
         public void warning( SAXParseException e )
             throws SAXException
         {
@@ -390,6 +395,7 @@ public abstract class AbstractXmlValidat
         }
 
         /** {@inheritDoc} */
+        @Override
         public void error( SAXParseException e )
             throws SAXException
         {
@@ -397,6 +403,7 @@ public abstract class AbstractXmlValidat
         }
 
         /** {@inheritDoc} */
+        @Override
         public void fatalError( SAXParseException e )
             throws SAXException
         {
@@ -412,7 +419,7 @@ public abstract class AbstractXmlValidat
             messages.add( error );
         }
 
-        protected List getMessages()
+        protected List<ErrorMessage> getMessages()
         {
             return Collections.unmodifiableList( messages );
         }

Modified: maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java?rev=1091043&r1=1091042&r2=1091043&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java Mon Apr 11 11:44:39 2011
@@ -57,7 +57,7 @@ public abstract class AbstractXmlValidat
 {
 
     /** Simple cache mechanism to load test documents. */
-    private static final Map CACHE_DOXIA_TEST_DOCUMENTS = new Hashtable();
+    private static final Map<String,String> CACHE_DOXIA_TEST_DOCUMENTS = new Hashtable<String,String>();
 
     /** Maven resource in the doxia-test-docs-XXX.jar */
     private static final String MAVEN_RESOURCE_PATH = "META-INF/maven/org.apache.maven.doxia/doxia-test-docs/";
@@ -78,20 +78,20 @@ public abstract class AbstractXmlValidat
      * @see #getIncludes()
      * @see #getAllTestDocuments()
      */
-    protected Map getTestDocuments()
+    protected Map<String, String> getTestDocuments()
         throws IOException
     {
         if ( getIncludes() == null )
         {
-            return Collections.EMPTY_MAP;
+            return Collections.emptyMap();
         }
 
-        Map testDocs = getAllTestDocuments();
-        Map ret = new Hashtable();
+        Map<String,String> testDocs = getAllTestDocuments();
+        Map<String,String> ret = new Hashtable<String,String>();
         ret.putAll( testDocs );
-        for ( Iterator it = testDocs.keySet().iterator(); it.hasNext(); )
+        for ( Iterator<String> it = testDocs.keySet().iterator(); it.hasNext(); )
         {
-            String key = it.next().toString();
+            String key = it.next();
 
             for ( int i = 0; i < getIncludes().length; i++ )
             {
@@ -130,7 +130,7 @@ public abstract class AbstractXmlValidat
      * </ul>
      * @throws IOException if any
      */
-    protected static Map getAllTestDocuments()
+    protected static Map<String,String> getAllTestDocuments()
         throws IOException
     {
         if ( CACHE_DOXIA_TEST_DOCUMENTS != null && !CACHE_DOXIA_TEST_DOCUMENTS.isEmpty() )
@@ -155,9 +155,9 @@ public abstract class AbstractXmlValidat
             {
             JarURLConnection conn = (JarURLConnection) testJar.openConnection();
             JarFile jarFile = conn.getJarFile();
-            for ( Enumeration e = jarFile.entries(); e.hasMoreElements(); )
+            for ( Enumeration<JarEntry> e = jarFile.entries(); e.hasMoreElements(); )
             {
-                JarEntry entry = (JarEntry) e.nextElement();
+                JarEntry entry = e.nextElement();
 
                 if ( entry.getName().startsWith( "META-INF" ) )
                 {
@@ -186,8 +186,8 @@ public abstract class AbstractXmlValidat
             // IDE projects
             File testDocsDir = FileUtils.toFile( testJar ).getParentFile();
 
-            List files = FileUtils.getFiles( testDocsDir, "**/*.*", FileUtils.getDefaultExcludesAsString(), true );
-            for ( Iterator it = files.iterator(); it.hasNext();)
+            List<File> files = FileUtils.getFiles( testDocsDir, "**/*.*", FileUtils.getDefaultExcludesAsString(), true );
+            for ( Iterator<File> it = files.iterator(); it.hasNext();)
             {
                 File file = new File( it.next().toString() );
 



Mime
View raw message