You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by sl...@apache.org on 2019/05/04 16:08:20 UTC

[maven-doxia] branch DOXIA-591 updated (b5216e1 -> cc29ab6)

This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a change to branch DOXIA-591
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git.


 discard b5216e1  [DOXIA-591] Use Java 7 syntax
 discard b46435b  [DOXIA-591] Use never Java style
 discard b52f13d  [DOXIA-591] Update minimum Java version to 7
     new a1fae90  [DOXIA-591] Update minimum Java version to 7
     new cc29ab6  [DOXIA-591] Use Java 7 syntax

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (b5216e1)
            \
             N -- N -- N   refs/heads/DOXIA-591 (cc29ab6)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../org/apache/maven/doxia/index/IndexEntry.java   |  2 +-
 .../org/apache/maven/doxia/index/IndexingSink.java |  2 +-
 .../maven/doxia/parser/AbstractXmlParser.java      | 11 +--
 .../doxia/sink/impl/SinkEventAttributeSet.java     |  2 +-
 .../maven/doxia/sink/impl/Xhtml5BaseSink.java      |  6 +-
 .../maven/doxia/sink/impl/XhtmlBaseSink.java       |  6 +-
 .../org/apache/maven/doxia/util/DoxiaUtils.java    | 12 +---
 .../org/apache/maven/doxia/util/HtmlTools.java     | 27 +++-----
 .../maven/doxia/document/DocumentModelTest.java    | 11 +--
 .../doxia/macro/manager/MacroManagerTest.java      |  2 +-
 .../maven/doxia/parser/AbstractParserTest.java     | 29 ++------
 .../doxia/sink/impl/SinkEventAttributeSetTest.java |  2 +-
 .../maven/doxia/sink/impl/SinkUtilsTest.java       |  2 +-
 .../maven/doxia/sink/impl/Xhtml5BaseSinkTest.java  | 10 +--
 .../maven/doxia/sink/impl/XhtmlBaseSinkTest.java   | 10 +--
 .../apache/maven/doxia/util/DoxiaUtilsTest.java    |  7 +-
 .../maven/doxia/xsd/AbstractXmlValidator.java      |  3 +-
 .../maven/doxia/xsd/AbstractXmlValidatorTest.java  |  4 +-
 .../apache/maven/doxia/module/apt/AptMarkup.java   | 20 +++---
 .../apache/maven/doxia/module/apt/AptParser.java   |  2 +-
 .../org/apache/maven/doxia/module/apt/AptSink.java | 12 ++--
 .../maven/doxia/module/apt/AptParserTest.java      | 12 +---
 .../apache/maven/doxia/module/apt/AptSinkTest.java | 11 ++-
 .../confluence/parser/FigureBlockParser.java       |  2 +-
 .../confluence/parser/ParagraphBlockParser.java    |  2 +-
 .../confluence/parser/list/ListBlockParser.java    |  2 +-
 .../confluence/parser/table/TableBlockParser.java  |  2 +-
 .../module/confluence/ConfluenceParserTest.java    |  2 +-
 .../doxia/module/docbook/DocBookParserTest.java    |  2 +-
 .../apache/maven/doxia/module/fml/FmlParser.java   | 34 ++++-----
 .../maven/doxia/module/fml/FmlParserTest.java      | 12 +---
 .../maven/doxia/module/fo/FoAggregateSink.java     |  8 +--
 .../maven/doxia/module/fo/FoConfiguration.java     |  6 +-
 .../org/apache/maven/doxia/module/fo/FoSink.java   |  8 +--
 .../org/apache/maven/doxia/module/fo/FoUtils.java  |  2 +-
 doxia-modules/doxia-module-markdown/pom.xml        |  4 --
 .../doxia-module-markdown/src/site/apt/index.apt   | 24 -------
 .../doxia/module/markdown/MarkdownParserTest.java  | 15 ++--
 .../apache/maven/doxia/module/rtf/PBMReader.java   |  4 +-
 .../apache/maven/doxia/module/twiki/TWikiSink.java |  6 +-
 .../twiki/parser/GenericListBlockParser.java       |  2 +-
 .../doxia/module/twiki/parser/SectionBlock.java    |  2 +-
 .../module/twiki/parser/TableBlockParser.java      |  2 +-
 .../doxia/module/twiki/parser/TextParser.java      | 12 ++--
 .../doxia/module/twiki/parser/ParagraphTest.java   |  2 +-
 .../doxia/module/twiki/parser/SectionTest.java     |  2 +-
 .../doxia/module/twiki/parser/TwikiParserTest.java |  2 +-
 .../maven/doxia/module/twiki/parser/WordsTest.java | 81 +++++++++++-----------
 .../apache/maven/doxia/module/xdoc/XdocSink.java   | 13 ++--
 .../maven/doxia/module/xdoc/XdocIdentityTest.java  |  4 +-
 .../maven/doxia/module/xdoc/XdocParserTest.java    |  4 +-
 .../maven/doxia/module/xdoc/XdocSinkTest.java      |  2 +-
 .../doxia/module/xhtml/XhtmlIdentityTest.java      |  4 +-
 .../maven/doxia/module/xhtml/XhtmlParserTest.java  |  2 +-
 .../doxia/module/xhtml5/Xhtml5IdentityTest.java    |  4 +-
 .../doxia/module/xhtml5/Xhtml5ParserTest.java      |  2 +-
 pom.xml                                            |  1 -
 57 files changed, 179 insertions(+), 302 deletions(-)


[maven-doxia] 01/02: [DOXIA-591] Update minimum Java version to 7

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch DOXIA-591
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit a1fae90f265ce1db42bc9a73202dc5b12ba37a61
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat May 4 16:29:03 2019 +0200

    [DOXIA-591] Update minimum Java version to 7
---
 doxia-modules/doxia-module-markdown/pom.xml        |  4 ----
 .../doxia-module-markdown/src/site/apt/index.apt   | 24 ----------------------
 pom.xml                                            |  2 +-
 3 files changed, 1 insertion(+), 29 deletions(-)

diff --git a/doxia-modules/doxia-module-markdown/pom.xml b/doxia-modules/doxia-module-markdown/pom.xml
index d138b91..f11d774 100644
--- a/doxia-modules/doxia-module-markdown/pom.xml
+++ b/doxia-modules/doxia-module-markdown/pom.xml
@@ -51,10 +51,6 @@ under the License.
     </contributor>
   </contributors>
 
-  <properties>
-    <maven.compiler.target>1.7</maven.compiler.target><!-- required by flexmark -->
-  </properties>
-
   <dependencies>
     <dependency>
       <groupId>com.vladsch.flexmark</groupId>
diff --git a/doxia-modules/doxia-module-markdown/src/site/apt/index.apt b/doxia-modules/doxia-module-markdown/src/site/apt/index.apt
index cf06fa4..b896ffc 100644
--- a/doxia-modules/doxia-module-markdown/src/site/apt/index.apt
+++ b/doxia-modules/doxia-module-markdown/src/site/apt/index.apt
@@ -32,30 +32,6 @@ doxia-module-markdown
   It is supported by a large panel of websites, text editors/IDEs and converter tools.
   Markdown format is only supported as Doxia source format.
 
-* Notice
-
-  This Doxia module requires Java 7 for {{{http://github.com/vsch/flexmark-java}flexmark-java}} parser,
-  unlike other Doxia modules which require only Java 6.
-
-  If your project requires Java 6 to launch Maven, you may consider the use of doxia-module-markdown version 1.7.
-
-+----+
-  <plugin>
-    <groupId>org.apache.maven.plugins</groupId>
-    <artifactId>maven-site-plugin</artifactId>
-    <dependencies>
-      <dependency>
-        <groupId>org.apache.maven.doxia</groupId>
-        <artifactId>doxia-module-markdown</artifactId>
-        <version>1.7</version><!-- to keep Java 6 compatibility-->
-      </dependency>
-    </dependencies>
-  </plugin>
-+----+
-  
-  In this situation, you should be aware that Pegdown has known technical issues and that
-  {{{http://pegdown.org}"Pegdown has reached its end of life"}}.
-
 * References
 
    * {{{http://daringfireball.net/projects/markdown}Markdown project website}}
diff --git a/pom.xml b/pom.xml
index 07b4183..73200bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,8 +84,8 @@ under the License.
   </distributionManagement>
 
   <properties>
+    <javaVersion>7</javaVersion><!-- remove when upgrade to maven-parent 34 -->
     <maven.site.path>doxia-archives/doxia-LATEST</maven.site.path>
-    <surefire.version>2.21.0</surefire.version>
     <checkstyle.violation.ignore>RedundantThrows,NewlineAtEndOfFile,ParameterNumber,MethodLength,FileLength,MethodName,InnerAssignment,MagicNumber</checkstyle.violation.ignore>
   </properties>
 


[maven-doxia] 02/02: [DOXIA-591] Use Java 7 syntax

Posted by sl...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

slachiewicz pushed a commit to branch DOXIA-591
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git

commit cc29ab618d7ecc459c2a9578a06341ec77675fbb
Author: Sylwester Lachiewicz <sl...@apache.org>
AuthorDate: Sat May 4 16:31:18 2019 +0200

    [DOXIA-591] Use Java 7 syntax
    
    - 'for' loop replaceable with 'foreach'
    - 'indexOf()' replace with 'contains()'
    - replace StringBuffer with StringBuilder
    - remove unnecessary boxing/unboxing
    - use <>
    - collapse identical catch Exceptions
    - replace if with switch
---
 .../org/apache/maven/doxia/index/IndexEntry.java   |   6 +-
 .../org/apache/maven/doxia/index/IndexingSink.java |   4 +-
 .../org/apache/maven/doxia/macro/SwfMacro.java     | 149 ++++++++++-----------
 .../maven/doxia/macro/snippet/SnippetMacro.java    |  10 +-
 .../maven/doxia/macro/snippet/SnippetReader.java   |   2 +-
 .../maven/doxia/parser/AbstractXmlParser.java      |  17 +--
 .../maven/doxia/parser/Xhtml5BaseParser.java       |  44 +++---
 .../apache/maven/doxia/parser/XhtmlBaseParser.java |  42 +++---
 .../parser/module/DefaultParserModuleManager.java  |   2 +-
 .../maven/doxia/sink/impl/RandomAccessSink.java    |   4 +-
 .../doxia/sink/impl/SinkEventAttributeSet.java     |  10 +-
 .../maven/doxia/sink/impl/Xhtml5BaseSink.java      |  38 +++---
 .../maven/doxia/sink/impl/XhtmlBaseSink.java       |  36 ++---
 .../org/apache/maven/doxia/util/DoxiaUtils.java    |  20 +--
 .../org/apache/maven/doxia/util/HtmlTools.java     |  35 ++---
 .../org/apache/maven/doxia/util/XmlValidator.java  |   6 +-
 .../maven/doxia/document/DocumentModelTest.java    |  11 +-
 .../apache/maven/doxia/macro/EchoMacroTest.java    |   2 +-
 .../org/apache/maven/doxia/macro/SsiMacroTest.java |   2 +-
 .../org/apache/maven/doxia/macro/SwfMacroTest.java |   6 +-
 .../doxia/macro/manager/MacroManagerTest.java      |   2 +-
 .../doxia/macro/snippet/SnippetMacroTest.java      |   4 +-
 .../apache/maven/doxia/macro/toc/TocMacroTest.java |   4 +-
 .../maven/doxia/parser/AbstractParserTest.java     |  29 +---
 .../maven/doxia/parser/Xhtml5BaseParserTest.java   |   2 +-
 .../maven/doxia/parser/XhtmlBaseParserTest.java    |   2 +-
 .../doxia/sink/impl/SinkEventAttributeSetTest.java |   2 +-
 .../doxia/sink/impl/SinkEventTestingSink.java      |  10 +-
 .../maven/doxia/sink/impl/SinkUtilsTest.java       |   2 +-
 .../sink/impl/WellformednessCheckingSink.java      |   4 +-
 .../maven/doxia/sink/impl/Xhtml5BaseSinkTest.java  |  14 +-
 .../maven/doxia/sink/impl/XhtmlBaseSinkTest.java   |  14 +-
 .../apache/maven/doxia/util/DoxiaUtilsTest.java    |   7 +-
 .../maven/doxia/xsd/AbstractXmlValidator.java      |  13 +-
 .../maven/doxia/xsd/AbstractXmlValidatorTest.java  |  16 +--
 .../apache/maven/doxia/module/apt/AptMarkup.java   |  20 ++-
 .../apache/maven/doxia/module/apt/AptParser.java   |  12 +-
 .../org/apache/maven/doxia/module/apt/AptSink.java |  18 +--
 .../maven/doxia/module/apt/AptParserTest.java      |  20 +--
 .../apache/maven/doxia/module/apt/AptSinkTest.java |  11 +-
 .../doxia/module/confluence/ConfluenceParser.java  |   2 +-
 .../doxia/module/confluence/ConfluenceSink.java    |   6 +-
 .../confluence/parser/ChildBlocksBuilder.java      |  10 +-
 .../parser/DefinitionListBlockParser.java          |   2 +-
 .../confluence/parser/FigureBlockParser.java       |   4 +-
 .../confluence/parser/ParagraphBlockParser.java    |   5 +-
 .../confluence/parser/list/ListBlockParser.java    |   2 +-
 .../confluence/parser/list/TreeComponent.java      |   2 +-
 .../confluence/parser/list/TreeListBuilder.java    |   4 +-
 .../confluence/parser/table/TableBlockParser.java  |  16 +--
 .../module/confluence/ConfluenceParserTest.java    |   6 +-
 .../maven/doxia/module/docbook/DocBookParser.java  |  60 ++++-----
 .../maven/doxia/module/docbook/DocBookSink.java    |  12 +-
 .../doxia/module/docbook/DocBookParserTest.java    |   2 +-
 .../apache/maven/doxia/module/fml/FmlParser.java   |  42 +++---
 .../maven/doxia/module/fml/FmlParserTest.java      |  14 +-
 .../maven/doxia/module/fml/FmlValidatorTest.java   |   2 +-
 .../maven/doxia/module/fo/FoAggregateSink.java     |  18 +--
 .../maven/doxia/module/fo/FoConfiguration.java     |  13 +-
 .../org/apache/maven/doxia/module/fo/FoSink.java   |  44 +++---
 .../org/apache/maven/doxia/module/fo/FoUtils.java  |   2 +-
 .../maven/doxia/module/fo/FoAggregateSinkTest.java |  28 ++--
 .../apache/maven/doxia/module/itext/ITextSink.java |  14 +-
 .../apache/maven/doxia/module/itext/ITextUtil.java |  10 +-
 .../doxia/module/itext/SinkActionContext.java      |   6 +-
 .../apache/maven/doxia/module/latex/LatexSink.java |   8 +-
 .../module/markdown/FlexmarkDoxiaExtension.java    |   2 +-
 .../module/markdown/FlexmarkDoxiaLinkResolver.java |   2 +-
 .../module/markdown/FlexmarkDoxiaNodeRenderer.java |  34 +++--
 .../doxia/module/markdown/MarkdownParser.java      |   2 +-
 .../doxia/module/markdown/MarkdownParserTest.java  |  15 +--
 .../apache/maven/doxia/module/rtf/PBMReader.java   |   4 +-
 .../org/apache/maven/doxia/module/rtf/RtfSink.java |  29 ++--
 .../apache/maven/doxia/module/rtf/WMFWriter.java   |   8 +-
 .../maven/doxia/module/twiki/TWikiParser.java      |   2 +-
 .../apache/maven/doxia/module/twiki/TWikiSink.java |  14 +-
 .../module/twiki/parser/AbstractFatherBlock.java   |   8 +-
 .../module/twiki/parser/FormatedTextParser.java    |   4 +-
 .../twiki/parser/GenericListBlockParser.java       |   6 +-
 .../module/twiki/parser/ParagraphBlockParser.java  |   6 +-
 .../doxia/module/twiki/parser/SectionBlock.java    |   2 +-
 .../module/twiki/parser/SectionBlockParser.java    |   2 +-
 .../module/twiki/parser/TableBlockParser.java      |   6 +-
 .../doxia/module/twiki/parser/TextParser.java      |  18 +--
 .../module/twiki/parser/VerbatimBlockParser.java   |   2 +-
 .../maven/doxia/module/twiki/parser/ListTest.java  |   3 +-
 .../doxia/module/twiki/parser/ParagraphTest.java   |   2 +-
 .../doxia/module/twiki/parser/SectionTest.java     |   2 +-
 .../doxia/module/twiki/parser/TwikiParserTest.java |   2 +-
 .../maven/doxia/module/twiki/parser/WordsTest.java |  81 ++++++-----
 .../apache/maven/doxia/module/xdoc/XdocParser.java |   6 +-
 .../apache/maven/doxia/module/xdoc/XdocSink.java   |  13 +-
 .../maven/doxia/module/xdoc/XdocIdentityTest.java  |   4 +-
 .../maven/doxia/module/xdoc/XdocParserTest.java    |  10 +-
 .../maven/doxia/module/xdoc/XdocSinkTest.java      |   2 +-
 .../maven/doxia/module/xdoc/XdocValidatorTest.java |   2 +-
 .../maven/doxia/module/xhtml/XhtmlParser.java      |   4 +-
 .../doxia/module/xhtml/XhtmlIdentityTest.java      |   4 +-
 .../maven/doxia/module/xhtml/XhtmlParserTest.java  |   2 +-
 .../maven/doxia/module/xhtml/XhtmlSinkTest.java    |  12 +-
 .../maven/doxia/module/xhtml5/Xhtml5Parser.java    |   4 +-
 .../doxia/module/xhtml5/Xhtml5IdentityTest.java    |   4 +-
 .../doxia/module/xhtml5/Xhtml5ParserTest.java      |   2 +-
 .../maven/doxia/module/xhtml5/Xhtml5SinkTest.java  |  12 +-
 104 files changed, 599 insertions(+), 724 deletions(-)

diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
index 0f1d49e..086d225 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexEntry.java
@@ -51,7 +51,7 @@ public class IndexEntry
     /**
      * The child entries.
      */
-    private List<IndexEntry> childEntries = new ArrayList<IndexEntry>();
+    private List<IndexEntry> childEntries = new ArrayList<>();
 
     /**
      * System-dependent EOL.
@@ -155,7 +155,7 @@ public class IndexEntry
     {
         if ( entries == null )
         {
-            childEntries = new ArrayList<IndexEntry>();
+            childEntries = new ArrayList<>();
         }
 
         this.childEntries = entries;
@@ -301,7 +301,7 @@ public class IndexEntry
 
         message.append( EOL );
 
-        StringBuilder indent = new StringBuilder( "" );
+        StringBuilder indent = new StringBuilder();
 
         for ( int i = 0; i < depth; i++ )
         {
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
index 3dd3fb8..3a78b63 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/index/IndexingSink.java
@@ -77,7 +77,7 @@ public class IndexingSink
      */
     public IndexingSink( IndexEntry sectionEntry )
     {
-        stack = new Stack<IndexEntry>();
+        stack = new Stack<>();
         stack.push( sectionEntry );
 
         init();
@@ -257,7 +257,7 @@ public class IndexingSink
                 // -----------------------------------------------------------------------
 
                 // append text to current entry
-                IndexEntry entry = (IndexEntry) stack.lastElement();
+                IndexEntry entry = stack.lastElement();
 
                 String title = entry.getTitle() + text;
                 title = title.replaceAll( "[\\r\\n]+", "" );
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java b/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java
index d03f75f..896f612 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/macro/SwfMacro.java
@@ -59,91 +59,86 @@ public class SwfMacro
                 continue;
             }
             String str = (String) parameterObject;
-            if ( key.equals( "src" ) )
+            switch ( key )
             {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    src = str;
-                }
-            }
-            else if ( key.equals( "id" ) )
-            {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    id = str;
-                }
-            }
-            else if ( key.equals( "width" ) )
-            {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    width = str;
-                }
-            }
-            else if ( key.equals( "height" ) )
-            {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    height = str;
-                }
-            }
-            else if ( key.equals( "quality" ) )
-            {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    quality = str;
-                }
-            }
-            else if ( key.equals( "menu" ) )
-            {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    menu = str;
-                }
-            }
-            else if ( key.equals( "loop" ) )
-            {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    loop = str;
-                }
-            }
-            else if ( key.equals( "play" ) )
-            {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    play = str;
-                }
-            }
-            else if ( key.equals( "version" ) )
-            {
-                // enable version shorthand
-                // TODO: put in other shorthand versions
-                if ( str.equals( "6" ) )
-                {
-                    version = "6,0,29,0";
-                }
-                else
-                {
-                    if ( str.equals( "9" ) )
+                case "src":
+                    if ( StringUtils.isNotEmpty( str ) )
+                    {
+                        src = str;
+                    }
+                    break;
+                case "id":
+                    if ( StringUtils.isNotEmpty( str ) )
+                    {
+                        id = str;
+                    }
+                    break;
+                case "width":
+                    if ( StringUtils.isNotEmpty( str ) )
+                    {
+                        width = str;
+                    }
+                    break;
+                case "height":
+                    if ( StringUtils.isNotEmpty( str ) )
+                    {
+                        height = str;
+                    }
+                    break;
+                case "quality":
+                    if ( StringUtils.isNotEmpty( str ) )
                     {
-                        version = "9,0,45,0";
+                        quality = str;
+                    }
+                    break;
+                case "menu":
+                    if ( StringUtils.isNotEmpty( str ) )
+                    {
+                        menu = str;
+                    }
+                    break;
+                case "loop":
+                    if ( StringUtils.isNotEmpty( str ) )
+                    {
+                        loop = str;
+                    }
+                    break;
+                case "play":
+                    if ( StringUtils.isNotEmpty( str ) )
+                    {
+                        play = str;
+                    }
+                    break;
+                case "version":
+                    // enable version shorthand
+                    // TODO: put in other shorthand versions
+                    if ( str.equals( "6" ) )
+                    {
+                        version = "6,0,29,0";
                     }
                     else
                     {
-                        if ( StringUtils.isNotEmpty( str ) )
+                        if ( str.equals( "9" ) )
+                        {
+                            version = "9,0,45,0";
+                        }
+                        else
                         {
-                            version = str;
+                            if ( StringUtils.isNotEmpty( str ) )
+                            {
+                                version = str;
+                            }
                         }
                     }
-                }
-            }
-            else if ( key.equals( "allowScript" ) )
-            {
-                if ( StringUtils.isNotEmpty( str ) )
-                {
-                    allowScript = str;
-                }
+                    break;
+                case "allowScript":
+                    if ( StringUtils.isNotEmpty( str ) )
+                    {
+                        allowScript = str;
+                    }
+                    break;
+                 default:
+                        // ignore all other
             }
         }
 
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java b/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
index ae85ca8..2166a3e 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
@@ -47,7 +47,7 @@ public class SnippetMacro
     /**
      * Holds the cache.
      */
-    private static Map<String, String> cache = new HashMap<String, String>();
+    private static Map<String, String> cache = new HashMap<>();
 
     private static final int HOUR = 60;
 
@@ -59,7 +59,7 @@ public class SnippetMacro
     /**
      * Holds the time cache.
      */
-    private static Map<String, Long> timeCached = new HashMap<String, Long>();
+    private static Map<String, Long> timeCached = new HashMap<>();
 
     /**
      * Debug.
@@ -103,7 +103,7 @@ public class SnippetMacro
 
         if ( verbatimParam != null && !"".equals( verbatimParam ) )
         {
-            verbatim = Boolean.valueOf( verbatimParam ).booleanValue();
+            verbatim = Boolean.valueOf( verbatimParam );
         }
 
         String encoding = (String) request.getParameter( "encoding" );
@@ -274,7 +274,7 @@ public class SnippetMacro
     {
         String globalId = globalSnippetId( url, id );
 
-        return timeCached.containsKey( globalId ) ? timeCached.get( globalId ).longValue() : 0;
+        return timeCached.containsKey( globalId ) ? timeCached.get( globalId ) : 0;
     }
 
     /**
@@ -321,7 +321,7 @@ public class SnippetMacro
     {
         cache.put( globalSnippetId( url, id ), content );
 
-        timeCached.put( globalSnippetId( url, id ), Long.valueOf( System.currentTimeMillis() ) );
+        timeCached.put( globalSnippetId( url, id ), System.currentTimeMillis() );
     }
 
     /**
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java b/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
index 4ae468a..12d3e22 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetReader.java
@@ -145,7 +145,7 @@ public class SnippetReader
             reader = new BufferedReader( new InputStreamReader( source.openStream(), encoding ) );
         }
 
-        List<String> lines = new ArrayList<String>();
+        List<String> lines = new ArrayList<>();
         try
         {
             boolean capture = false;
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
index ec25f19..dbeed05 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/AbstractXmlParser.java
@@ -427,7 +427,7 @@ public abstract class AbstractXmlParser
      */
     protected void handleUnknown( XmlPullParser parser, Sink sink, int type )
     {
-        Object[] required = new Object[] { Integer.valueOf( type ) };
+        Object[] required = new Object[] { type };
 
         SinkEventAttributeSet attribs = getAttributesFromParser( parser );
 
@@ -565,7 +565,7 @@ public abstract class AbstractXmlParser
     {
         if ( entities == null )
         {
-            entities = new LinkedHashMap<String, String>();
+            entities = new LinkedHashMap<>();
         }
 
         return entities;
@@ -673,11 +673,10 @@ public abstract class AbstractXmlParser
         if ( entitiesCount > 0 )
         {
             final String txt = StringUtils.replace( text, ENTITY_START, "\n" + ENTITY_START );
-            BufferedReader reader = new BufferedReader( new StringReader( txt ) );
-            String line;
-            String tmpLine = "";
-            try
+            try ( BufferedReader reader = new BufferedReader( new StringReader( txt ) ) )
             {
+                String line;
+                String tmpLine = "";
                 Matcher matcher;
                 while ( ( line = reader.readLine() ) != null )
                 {
@@ -709,10 +708,6 @@ public abstract class AbstractXmlParser
             {
                 // nop
             }
-            finally
-            {
-                IOUtil.close( reader );
-            }
         }
     }
 
@@ -724,7 +719,7 @@ public abstract class AbstractXmlParser
         implements EntityResolver
     {
         /** Map with systemId as key and the content of systemId as byte[]. */
-        protected static final Map<String, byte[]> ENTITY_CACHE = new Hashtable<String, byte[]>();
+        protected static final Map<String, byte[]> ENTITY_CACHE = new Hashtable<>();
 
         /** {@inheritDoc} */
         public InputSource resolveEntity( String publicId, String systemId )
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java
index 70dac8d..58c45c8 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/Xhtml5BaseParser.java
@@ -70,7 +70,7 @@ public class Xhtml5BaseParser
     private boolean inVerbatim;
 
     /** Used to keep track of closing tags for content events */
-    private Stack<String> divStack = new Stack<String>();
+    private Stack<String> divStack = new Stack<>();
 
     /** Used to wrap the definedTerm with its definition, even when one is omitted */
     boolean hasDefinitionListItem = false;
@@ -804,7 +804,7 @@ public class Xhtml5BaseParser
 
         if ( isScriptBlock() )
         {
-            sink.unknown( CDATA, new Object[] { Integer.valueOf( CDATA_TYPE ), text}, null );
+            sink.unknown( CDATA, new Object[] { CDATA_TYPE, text }, null );
         }
         else
         {
@@ -1163,25 +1163,25 @@ public class Xhtml5BaseParser
 
         if ( style != null )
         {
-            if ( "list-style-type: upper-alpha".equals( style ) )
+            switch ( style )
             {
-                numbering = Sink.NUMBERING_UPPER_ALPHA;
-            }
-            else if ( "list-style-type: lower-alpha".equals( style ) )
-            {
-                numbering = Sink.NUMBERING_LOWER_ALPHA;
-            }
-            else if ( "list-style-type: upper-roman".equals( style ) )
-            {
-                numbering = Sink.NUMBERING_UPPER_ROMAN;
-            }
-            else if ( "list-style-type: lower-roman".equals( style ) )
-            {
-                numbering = Sink.NUMBERING_LOWER_ROMAN;
-            }
-            else if ( "list-style-type: decimal".equals( style ) )
-            {
-                numbering = Sink.NUMBERING_DECIMAL;
+                case "list-style-type: upper-alpha":
+                    numbering = Sink.NUMBERING_UPPER_ALPHA;
+                    break;
+                case "list-style-type: lower-alpha":
+                    numbering = Sink.NUMBERING_LOWER_ALPHA;
+                    break;
+                case "list-style-type: upper-roman":
+                    numbering = Sink.NUMBERING_UPPER_ROMAN;
+                    break;
+                case "list-style-type: lower-roman":
+                    numbering = Sink.NUMBERING_LOWER_ROMAN;
+                    break;
+                case "list-style-type: decimal":
+                    numbering = Sink.NUMBERING_DECIMAL;
+                    break;
+                default:
+                    // ignore all other
             }
         }
 
@@ -1275,13 +1275,13 @@ public class Xhtml5BaseParser
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( log );
         warnMessages.put( key, set );
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
index b2424fe..4cfab7b 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
@@ -814,7 +814,7 @@ public class XhtmlBaseParser
 
         if ( isScriptBlock() )
         {
-            sink.unknown( CDATA, new Object[] { Integer.valueOf( CDATA_TYPE ), text}, null );
+            sink.unknown( CDATA, new Object[] { CDATA_TYPE, text }, null );
         }
         else
         {
@@ -1172,25 +1172,25 @@ public class XhtmlBaseParser
 
         if ( style != null )
         {
-            if ( "list-style-type: upper-alpha".equals( style ) )
+            switch ( style )
             {
-                numbering = Sink.NUMBERING_UPPER_ALPHA;
-            }
-            else if ( "list-style-type: lower-alpha".equals( style ) )
-            {
-                numbering = Sink.NUMBERING_LOWER_ALPHA;
-            }
-            else if ( "list-style-type: upper-roman".equals( style ) )
-            {
-                numbering = Sink.NUMBERING_UPPER_ROMAN;
-            }
-            else if ( "list-style-type: lower-roman".equals( style ) )
-            {
-                numbering = Sink.NUMBERING_LOWER_ROMAN;
-            }
-            else if ( "list-style-type: decimal".equals( style ) )
-            {
-                numbering = Sink.NUMBERING_DECIMAL;
+                case "list-style-type: upper-alpha":
+                    numbering = Sink.NUMBERING_UPPER_ALPHA;
+                    break;
+                case "list-style-type: lower-alpha":
+                    numbering = Sink.NUMBERING_LOWER_ALPHA;
+                    break;
+                case "list-style-type: upper-roman":
+                    numbering = Sink.NUMBERING_UPPER_ROMAN;
+                    break;
+                case "list-style-type: lower-roman":
+                    numbering = Sink.NUMBERING_LOWER_ROMAN;
+                    break;
+                case "list-style-type: decimal":
+                    numbering = Sink.NUMBERING_DECIMAL;
+                    break;
+                default:
+                    // ignore all other
             }
         }
 
@@ -1275,13 +1275,13 @@ public class XhtmlBaseParser
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( log );
         warnMessages.put( key, set );
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/parser/module/DefaultParserModuleManager.java b/doxia-core/src/main/java/org/apache/maven/doxia/parser/module/DefaultParserModuleManager.java
index 8f0e179..7b88cb6 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/parser/module/DefaultParserModuleManager.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/parser/module/DefaultParserModuleManager.java
@@ -45,7 +45,7 @@ public class DefaultParserModuleManager
     {
         if ( parserModulesValues == null )
         {
-            Map<Class<?>, ParserModule> parserModulesTmp = new LinkedHashMap<Class<?>, ParserModule>();
+            Map<Class<?>, ParserModule> parserModulesTmp = new LinkedHashMap<>();
             for ( ParserModule module : parserModules.values() )
             {
                 parserModulesTmp.put( module.getClass(), module );
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/RandomAccessSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/RandomAccessSink.java
index 4a873d4..62f6e07 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/RandomAccessSink.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/RandomAccessSink.java
@@ -52,9 +52,9 @@ public class RandomAccessSink
 
     private Sink coreSink;
 
-    private List<Sink> sinks = new ArrayList<Sink>();
+    private List<Sink> sinks = new ArrayList<>();
 
-    private List<ByteArrayOutputStream> outputStreams = new ArrayList<ByteArrayOutputStream>();
+    private List<ByteArrayOutputStream> outputStreams = new ArrayList<>();
 
     private Sink currentSink;
 
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkEventAttributeSet.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkEventAttributeSet.java
index 9374dbd..818f6b5 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkEventAttributeSet.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkEventAttributeSet.java
@@ -96,7 +96,7 @@ public class SinkEventAttributeSet
 
     static
     {
-        UNDERLINE = new SinkEventAttributeSet( new String[] {DECORATION, "underline"} ).unmodifiable();
+        UNDERLINE = new SinkEventAttributeSet( DECORATION, "underline" ).unmodifiable();
         OVERLINE = new SinkEventAttributeSet( new String[] {DECORATION, "overline"} ).unmodifiable();
         LINETHROUGH = new SinkEventAttributeSet( new String[] {DECORATION, "line-through"} ).unmodifiable();
         BOXED = new SinkEventAttributeSet( new String[] {DECORATION, "boxed"} ).unmodifiable();
@@ -130,7 +130,7 @@ public class SinkEventAttributeSet
      */
     public SinkEventAttributeSet( int size )
     {
-        attribs = new LinkedHashMap<String, Object>( size );
+        attribs = new LinkedHashMap<>( size );
     }
 
     /**
@@ -149,7 +149,7 @@ public class SinkEventAttributeSet
             throw new IllegalArgumentException( "Missing attribute!" );
         }
 
-        attribs = new LinkedHashMap<String, Object>( n / 2 );
+        attribs = new LinkedHashMap<>( n / 2 );
 
         for ( int i = 0; i < n; i += 2 )
         {
@@ -165,7 +165,7 @@ public class SinkEventAttributeSet
      */
     public SinkEventAttributeSet( AttributeSet attributes )
     {
-        attribs = new LinkedHashMap<String, Object>( attributes.getAttributeCount() );
+        attribs = new LinkedHashMap<>( attributes.getAttributeCount() );
 
         Enumeration<?> names = attributes.getAttributeNames();
 
@@ -362,7 +362,7 @@ public class SinkEventAttributeSet
     public Object clone()
     {
         SinkEventAttributeSet attr = new SinkEventAttributeSet( attribs.size() );
-        attr.attribs = new LinkedHashMap<String, Object>( attribs );
+        attr.attribs = new LinkedHashMap<>( attribs );
 
         if ( resolveParent != null )
         {
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java
index 4ad403a..6be2d56 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSink.java
@@ -67,10 +67,10 @@ public class Xhtml5BaseSink
     private boolean headFlag;
 
     /** Keep track of the main and div tags for content events. */
-    protected Stack<Tag> contentStack = new Stack<Tag>();
+    protected Stack<Tag> contentStack = new Stack<>();
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<Tag>> inlineStack = new Stack<List<Tag>>();
+    protected Stack<List<Tag>> inlineStack = new Stack<>();
 
     /** An indication on if we're inside a paragraph flag. */
     private boolean paragraphFlag;
@@ -135,13 +135,13 @@ public class Xhtml5BaseSink
     {
         this.writer = new PrintWriter( out );
 
-        this.cellJustifStack = new LinkedList<int[]>();
-        this.isCellJustifStack = new LinkedList<Boolean>();
-        this.cellCountStack = new LinkedList<Integer>();
-        this.tableContentWriterStack = new LinkedList<StringWriter>();
-        this.tableCaptionWriterStack = new LinkedList<StringWriter>();
-        this.tableCaptionXMLWriterStack = new LinkedList<PrettyPrintXMLWriter>();
-        this.tableCaptionStack = new LinkedList<String>();
+        this.cellJustifStack = new LinkedList<>();
+        this.isCellJustifStack = new LinkedList<>();
+        this.cellCountStack = new LinkedList<>();
+        this.tableContentWriterStack = new LinkedList<>();
+        this.tableCaptionWriterStack = new LinkedList<>();
+        this.tableCaptionXMLWriterStack = new LinkedList<>();
+        this.tableCaptionStack = new LinkedList<>();
 
         init();
     }
@@ -1414,7 +1414,7 @@ public class Xhtml5BaseSink
 
         if ( boxed )
         {
-            divAtts = new SinkEventAttributeSet( new String[] { Attribute.CLASS.toString(), "source" } );
+            divAtts = new SinkEventAttributeSet( Attribute.CLASS.toString(), "source" );
         }
 
         atts.removeAttribute( SinkEventAttributes.DECORATION );
@@ -1526,14 +1526,14 @@ public class Xhtml5BaseSink
         String tableCaption = null;
         if ( !this.tableCaptionStack.isEmpty() && this.tableCaptionStack.getLast() != null )
         {
-            tableCaption = this.tableCaptionStack.removeLast().toString();
+            tableCaption = this.tableCaptionStack.removeLast();
         }
 
         if ( tableCaption != null )
         {
             // DOXIA-177
             StringBuilder sb = new StringBuilder();
-            sb.append( tableContent.substring( 0, tableContent.indexOf( Markup.GREATER_THAN ) + 1 ) );
+            sb.append( tableContent, 0, tableContent.indexOf( Markup.GREATER_THAN ) + 1 );
             sb.append( tableCaption );
             sb.append( tableContent.substring( tableContent.indexOf( Markup.GREATER_THAN ) + 1 ) );
 
@@ -1580,7 +1580,7 @@ public class Xhtml5BaseSink
 
         writeStartTag( HtmlMarkup.TABLE, att );
 
-        this.cellCountStack.addLast( Integer.valueOf( 0 ) );
+        this.cellCountStack.addLast( 0 );
     }
 
     /** {@inheritDoc} */
@@ -1647,7 +1647,7 @@ public class Xhtml5BaseSink
         if ( !this.cellCountStack.isEmpty() )
         {
             this.cellCountStack.removeLast();
-            this.cellCountStack.addLast( Integer.valueOf( 0 ) );
+            this.cellCountStack.addLast( 0 );
         }
     }
 
@@ -1761,7 +1761,7 @@ public class Xhtml5BaseSink
             && !this.cellCountStack.isEmpty() )
         {
             int cellCount = Integer.parseInt( this.cellCountStack.removeLast().toString() );
-            this.cellCountStack.addLast( Integer.valueOf( ++cellCount ) );
+            this.cellCountStack.addLast( ++cellCount );
         }
     }
 
@@ -1976,7 +1976,7 @@ public class Xhtml5BaseSink
     {
         if ( !headFlag )
         {
-            List<Tag> tags = new ArrayList<Tag>();
+            List<Tag> tags = new ArrayList<>();
 
             if ( attributes != null )
             {
@@ -2288,7 +2288,7 @@ public class Xhtml5BaseSink
             return;
         }
 
-        int tagType = ( (Integer) requiredParams[0] ).intValue();
+        int tagType = (Integer) requiredParams[0];
 
         if ( tagType == ENTITY_TYPE )
         {
@@ -2512,13 +2512,13 @@ public class Xhtml5BaseSink
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( mesg );
         warnMessages.put( key, set );
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java
index bf6c28a..74dcc60 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSink.java
@@ -129,7 +129,7 @@ public class XhtmlBaseSink
     protected boolean tableRows = false;
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<Tag>> inlineStack = new Stack<List<Tag>>();
+    protected Stack<List<Tag>> inlineStack = new Stack<>();
 
     /** Map of warn messages with a String as key to describe the error type and a Set as value.
      * Using to reduce warn messages. */
@@ -148,13 +148,13 @@ public class XhtmlBaseSink
     {
         this.writer = new PrintWriter( out );
 
-        this.cellJustifStack = new LinkedList<int[]>();
-        this.isCellJustifStack = new LinkedList<Boolean>();
-        this.cellCountStack = new LinkedList<Integer>();
-        this.tableContentWriterStack = new LinkedList<StringWriter>();
-        this.tableCaptionWriterStack = new LinkedList<StringWriter>();
-        this.tableCaptionXMLWriterStack = new LinkedList<PrettyPrintXMLWriter>();
-        this.tableCaptionStack = new LinkedList<String>();
+        this.cellJustifStack = new LinkedList<>();
+        this.isCellJustifStack = new LinkedList<>();
+        this.cellCountStack = new LinkedList<>();
+        this.tableContentWriterStack = new LinkedList<>();
+        this.tableCaptionWriterStack = new LinkedList<>();
+        this.tableCaptionXMLWriterStack = new LinkedList<>();
+        this.tableCaptionStack = new LinkedList<>();
 
         init();
     }
@@ -1232,7 +1232,7 @@ public class XhtmlBaseSink
 
         if ( boxed )
         {
-            divAtts = new SinkEventAttributeSet( new String[] { Attribute.CLASS.toString(), "source" } );
+            divAtts = new SinkEventAttributeSet( Attribute.CLASS.toString(), "source" );
         }
 
         atts.removeAttribute( SinkEventAttributes.DECORATION );
@@ -1344,14 +1344,14 @@ public class XhtmlBaseSink
         String tableCaption = null;
         if ( !this.tableCaptionStack.isEmpty() && this.tableCaptionStack.getLast() != null )
         {
-            tableCaption = this.tableCaptionStack.removeLast().toString();
+            tableCaption = this.tableCaptionStack.removeLast();
         }
 
         if ( tableCaption != null )
         {
             // DOXIA-177
             StringBuilder sb = new StringBuilder();
-            sb.append( tableContent.substring( 0, tableContent.indexOf( Markup.GREATER_THAN ) + 1 ) );
+            sb.append( tableContent, 0, tableContent.indexOf( Markup.GREATER_THAN ) + 1 );
             sb.append( tableCaption );
             sb.append( tableContent.substring( tableContent.indexOf( Markup.GREATER_THAN ) + 1 ) );
 
@@ -1398,7 +1398,7 @@ public class XhtmlBaseSink
 
         writeStartTag( HtmlMarkup.TABLE, att );
 
-        this.cellCountStack.addLast( Integer.valueOf( 0 ) );
+        this.cellCountStack.addLast( 0 );
     }
 
     /** {@inheritDoc} */
@@ -1465,7 +1465,7 @@ public class XhtmlBaseSink
         if ( !this.cellCountStack.isEmpty() )
         {
             this.cellCountStack.removeLast();
-            this.cellCountStack.addLast( Integer.valueOf( 0 ) );
+            this.cellCountStack.addLast( 0 );
         }
     }
 
@@ -1579,7 +1579,7 @@ public class XhtmlBaseSink
             && !this.cellCountStack.isEmpty() )
         {
             int cellCount = Integer.parseInt( this.cellCountStack.removeLast().toString() );
-            this.cellCountStack.addLast( Integer.valueOf( ++cellCount ) );
+            this.cellCountStack.addLast( ++cellCount );
         }
     }
 
@@ -1794,7 +1794,7 @@ public class XhtmlBaseSink
     {
         if ( !headFlag )
         {
-            List<Tag> tags = new ArrayList<Tag>();
+            List<Tag> tags = new ArrayList<>();
 
             if ( attributes != null )
             {
@@ -2073,7 +2073,7 @@ public class XhtmlBaseSink
             return;
         }
 
-        int tagType = ( (Integer) requiredParams[0] ).intValue();
+        int tagType = (Integer) requiredParams[0];
 
         if ( tagType == ENTITY_TYPE )
         {
@@ -2297,13 +2297,13 @@ public class XhtmlBaseSink
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( mesg );
         warnMessages.put( key, set );
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java b/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
index 155586b..c35628c 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/util/DoxiaUtils.java
@@ -23,10 +23,10 @@ import java.awt.image.BufferedImage;
 
 import java.io.File;
 import java.io.IOException;
-import java.io.UnsupportedEncodingException;
 
 import java.net.URL;
 
+import java.nio.charset.StandardCharsets;
 import java.text.ParseException;
 import java.text.ParsePosition;
 import java.text.SimpleDateFormat;
@@ -246,21 +246,13 @@ public class DoxiaUtils
             }
             else if ( !chop )
             {
-                byte[] bytes;
 
-                try
-                {
-                    bytes = String.valueOf( c ).getBytes( "UTF8" );
-                }
-                catch ( UnsupportedEncodingException cannotHappen )
-                {
-                    bytes = new byte[0];
-                }
+                byte[] bytes = String.valueOf( c ).getBytes( StandardCharsets.UTF_8 );
 
-                for ( int j = 0; j < bytes.length; ++j )
+                for ( byte aByte : bytes )
                 {
                     buffer.append( '.' );
-                    buffer.append( String.format( "%02X", bytes[j] ) );
+                    buffer.append( String.format( "%02X", aByte ) );
                 }
             }
         }
@@ -361,9 +353,9 @@ public class DoxiaUtils
             return new Date();
         }
 
-        for ( int i = 0; i < DATE_PATTERNS.length; i++ )
+        for ( String datePattern : DATE_PATTERNS )
         {
-            DATE_PARSER.applyPattern( DATE_PATTERNS[i] );
+            DATE_PARSER.applyPattern( datePattern );
             DATE_PARSE_POSITION.setIndex( 0 );
             final Date date = DATE_PARSER.parse( str, DATE_PARSE_POSITION );
 
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java b/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
index 37c9ad8..c60ad85 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
@@ -19,7 +19,7 @@ package org.apache.maven.doxia.util;
  * under the License.
  */
 
-import java.io.UnsupportedEncodingException;
+import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
@@ -62,7 +62,7 @@ public class HtmlTools
         HtmlMarkup.TR, HtmlMarkup.TT, HtmlMarkup.U, HtmlMarkup.UL, HtmlMarkup.VAR
     };
 
-    private static final Map<String, Tag> TAG_MAP = new HashMap<String, Tag>( ALL_TAGS.length );
+    private static final Map<String, Tag> TAG_MAP = new HashMap<>( ALL_TAGS.length );
 
     private static final int ASCII = 0x7E;
 
@@ -88,9 +88,7 @@ public class HtmlTools
      */
     public static Tag getHtmlTag( String tagName )
     {
-        Object t =  TAG_MAP.get( tagName );
-
-        return (Tag) t;
+        return TAG_MAP.get( tagName );
     }
 
     /**
@@ -254,7 +252,7 @@ public class HtmlTools
         }
 
         String tmp = unescaped;
-        List<String> entities = new ArrayList<String>();
+        List<String> entities = new ArrayList<>();
         while ( true )
         {
             int i = tmp.indexOf( "&#x" );
@@ -345,29 +343,22 @@ public class HtmlTools
                     {
                         byte[] bytes;
 
-                        try
+                        if ( isHighSurrogate( c ) )
                         {
-                            if ( isHighSurrogate( c ) )
-                            {
-                                int codePoint = toCodePoint( c, url.charAt( ++i ) );
-                                unicode = toChars( codePoint );
-                                bytes = ( new String( unicode, 0, unicode.length ) ).getBytes( "UTF8" );
-                            }
-                            else
-                            {
-                                unicode[0] = c;
-                                bytes = ( new String( unicode, 0, 1 ) ).getBytes( "UTF8" );
-                            }
+                            int codePoint = toCodePoint( c, url.charAt( ++i ) );
+                            unicode = toChars( codePoint );
+                            bytes = ( new String( unicode, 0, unicode.length ) ).getBytes( StandardCharsets.UTF_8 );
                         }
-                        catch ( UnsupportedEncodingException cannotHappen )
+                        else
                         {
-                            bytes = new byte[0];
+                            unicode[0] = c;
+                            bytes = ( new String( unicode, 0, 1 ) ).getBytes( StandardCharsets.UTF_8 );
                         }
 
-                        for ( int j = 0; j < bytes.length; ++j )
+                        for ( byte aByte : bytes )
                         {
                             encoded.append( '%' );
-                            encoded.append( String.format( "%02X", bytes[j] ) );
+                            encoded.append( String.format( "%02X", aByte ) );
                         }
                     }
             }
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/util/XmlValidator.java b/doxia-core/src/main/java/org/apache/maven/doxia/util/XmlValidator.java
index 2595b49..3a870de 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/util/XmlValidator.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/util/XmlValidator.java
@@ -107,11 +107,7 @@ public class XmlValidator
             getLog().debug( "Validating the content..." );
             getXmlReader( hasXsd && hasDoctype ).parse( new InputSource( new StringReader( content ) ) );
         }
-        catch ( IOException e )
-        {
-            throw new ParseException( "Error validating the model: " + e.getMessage(), e );
-        }
-        catch ( SAXException e )
+        catch ( IOException | SAXException e )
         {
             throw new ParseException( "Error validating the model: " + e.getMessage(), e );
         }
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
index 130f085..01657ed 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/document/DocumentModelTest.java
@@ -350,20 +350,13 @@ public class DocumentModelTest
 
         DocumentModel documentModel;
 
-        Reader reader = null;
-
-        try
+        try ( Reader reader = ReaderFactory.newXmlReader( testFile ) )
         {
-            reader = ReaderFactory.newXmlReader( testFile );
             documentModel = new DocumentXpp3Reader().read( reader );
         }
         catch ( XmlPullParserException e )
         {
-            throw (IOException) new IOException( "Error parsing document descriptor" ).initCause( e );
-        }
-        finally
-        {
-            IOUtil.close( reader );
+            throw new IOException( "Error parsing document descriptor", e );
         }
 
         return documentModel;
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/macro/EchoMacroTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/macro/EchoMacroTest.java
index 33b5f3f..0825af5 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/macro/EchoMacroTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/macro/EchoMacroTest.java
@@ -44,7 +44,7 @@ public class EchoMacroTest
      */
     public void testExecute()
     {
-        final Map<String,Object> macroParameters = new HashMap<String,Object>();
+        final Map<String,Object> macroParameters = new HashMap<>();
         macroParameters.put( "paramName", "paramValue" );
         macroParameters.put( "parser", "parserValue" );
         macroParameters.put( "sourceContent", "sourceContentValue" );
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/macro/SsiMacroTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/macro/SsiMacroTest.java
index e30bf92..b5c157e 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/macro/SsiMacroTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/macro/SsiMacroTest.java
@@ -44,7 +44,7 @@ public class SsiMacroTest
         throws MacroExecutionException
     {
 
-        Map<String, Object> macroParameters = new HashMap<String, Object>();
+        Map<String, Object> macroParameters = new HashMap<>();
         macroParameters.put( "function", "include" );
         macroParameters.put( "file", "include-file.html" );
 
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java
index 2fd13d0..2580cec 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/macro/SwfMacroTest.java
@@ -48,7 +48,7 @@ public class SwfMacroTest
             throws MacroExecutionException
     {
 
-        Map<String, Object> macroParameters = new HashMap<String, Object>();
+        Map<String, Object> macroParameters = new HashMap<>();
         macroParameters.put( "src", "src.swf" );
         macroParameters.put( "id", "Movie" );
         macroParameters.put( "width", "50" );
@@ -115,7 +115,7 @@ public class SwfMacroTest
             throws MacroExecutionException
     {
 
-        Map<String, Object> macroParameters = new HashMap<String, Object>();
+        Map<String, Object> macroParameters = new HashMap<>();
         macroParameters.put( "src", "src.swf" );
         macroParameters.put( "id", "Movie" );
         macroParameters.put( "width", "50" );
@@ -126,7 +126,7 @@ public class SwfMacroTest
         macroParameters.put( "play", "false" );
         macroParameters.put( "version", "6" );
         macroParameters.put( "allowScript", "always" );
-        macroParameters.put( "notAString", new Integer(0) );
+        macroParameters.put( "notAString", 0 );
 
 
         SinkEventTestingSink sink = new SinkEventTestingSink();
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/macro/manager/MacroManagerTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/macro/manager/MacroManagerTest.java
index 699c8c9..e1a6462 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/macro/manager/MacroManagerTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/macro/manager/MacroManagerTest.java
@@ -35,7 +35,7 @@ public class MacroManagerTest
     public void testMacroManager()
         throws Exception
     {
-        MacroManager mm = (MacroManager) lookup( MacroManager.ROLE );
+        MacroManager mm = lookup( MacroManager.ROLE );
 
         assertNotNull( mm );
 
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java
index b89d81d..b4cb0c2 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/macro/snippet/SnippetMacroTest.java
@@ -48,7 +48,7 @@ public class SnippetMacroTest
     public void testExecute()
         throws MacroExecutionException
     {
-        Map<String, Object> macroParameters = new HashMap<String, Object>();
+        Map<String, Object> macroParameters = new HashMap<>();
         macroParameters.put( "file", "src/test/resources/macro/snippet/testSnippet.txt" );
         macroParameters.put( "encoding", "UTF-8" );
 
@@ -140,7 +140,7 @@ public class SnippetMacroTest
     public void testIgnoreDownloadError()
         throws Exception
     {
-        Map<String, Object> macroParameters = new HashMap<String, Object>();
+        Map<String, Object> macroParameters = new HashMap<>();
         macroParameters.put( "debug", "true" );
         macroParameters.put( "ignoreDownloadError", "true" );
         macroParameters.put( "url", "http://foo.bar.com/wine.txt" );
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java
index 6c8140b..3a59a66 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/macro/toc/TocMacroTest.java
@@ -58,7 +58,7 @@ public class TocMacroTest
         XhtmlBaseParser parser = new XhtmlBaseParser();
         parser.setSecondParsing( true );
 
-        Map<String, Object> macroParameters = new HashMap<String, Object>();
+        Map<String, Object> macroParameters = new HashMap<>();
         macroParameters.put( "parser", parser );
         macroParameters.put( "sourceContent", sourceContent );
         macroParameters.put( "section", "sec1" );
@@ -159,7 +159,7 @@ public class TocMacroTest
         XhtmlBaseParser parser = new XhtmlBaseParser();
         parser.setSecondParsing( true );
 
-        Map<String, Object> macroParameters = new HashMap<String, Object>();
+        Map<String, Object> macroParameters = new HashMap<>();
         macroParameters.put( "parser", parser );
         macroParameters.put( "sourceContent", sourceContent );
         macroParameters.put( "section", "sec1" );
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java
index 9dbbf81..f4120c1 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/parser/AbstractParserTest.java
@@ -75,19 +75,12 @@ public abstract class AbstractParserTest
     {
         WellformednessCheckingSink sink = new WellformednessCheckingSink();
 
-        Reader reader = null;
-        try
+        try ( Reader reader = getTestReader( "test", outputExtension() ) )
         {
-            reader = getTestReader( "test", outputExtension() );
-
             createParser().parse( reader, sink );
 
-            assertTrue( "Parser output not well-formed, last offending element: "
-                + sink.getOffender(), sink.isWellformed() );
-        }
-        finally
-        {
-            IOUtil.close( reader );
+            assertTrue( "Parser output not well-formed, last offending element: " + sink.getOffender(),
+                    sink.isWellformed() );
         }
     }
 
@@ -102,24 +95,12 @@ public abstract class AbstractParserTest
     public final void testDocument()
         throws IOException, ParseException
     {
-        Writer writer = null;
-        Reader reader = null;
-
-        try
+        try ( Writer writer = getTestWriter( "test", "txt" );
+              Reader reader = getTestReader( "test", outputExtension() ) )
         {
-            writer = getTestWriter( "test", "txt" );
-
-            reader = getTestReader( "test", outputExtension() );
-
             Sink sink = new TextSink( writer );
-
             createParser().parse( reader, sink );
         }
-        finally
-        {
-            IOUtil.close( reader );
-            IOUtil.close( writer );
-        }
     }
 
     protected void assertEquals( SinkEventElement element, String name, Object... args )
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
index ee1ac18..853d37c 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/parser/Xhtml5BaseParserTest.java
@@ -708,7 +708,7 @@ public class Xhtml5BaseParserTest
         // DOXIA-374
         SinkEventElement el = it.next();
         assertEquals( "tableRows", el.getName() );
-        assertFalse( ( (Boolean) el.getArgs()[1] ).booleanValue() );
+        assertFalse( (Boolean) el.getArgs()[1] );
 
         assertEquals( "tableCaption", it.next().getName() );
         assertEquals( "tableCaption_", it.next().getName() );
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
index 45f8a3d..6b8b8e7 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/parser/XhtmlBaseParserTest.java
@@ -618,7 +618,7 @@ public class XhtmlBaseParserTest
         // DOXIA-374
         SinkEventElement el = it.next();
         assertEquals( "tableRows", el.getName() );
-        assertFalse( ( (Boolean) el.getArgs()[1] ).booleanValue() );
+        assertFalse( (Boolean) el.getArgs()[1] );
 
         assertEquals( "tableCaption", it.next().getName() );
         assertEquals( "tableCaption_", it.next().getName() );
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventAttributeSetTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventAttributeSetTest.java
index b580976..3fd137a 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventAttributeSetTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventAttributeSetTest.java
@@ -56,7 +56,7 @@ public class SinkEventAttributeSetTest extends TestCase
     {
         try
         {
-            SinkEventAttributeSet aset = new SinkEventAttributeSet( new String[] {"key"} );
+            SinkEventAttributeSet aset = new SinkEventAttributeSet( "key" );
             fail( "missing attribute value!" );
         }
         catch ( IllegalArgumentException e )
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventTestingSink.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventTestingSink.java
index b9d4651..851ab3e 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventTestingSink.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkEventTestingSink.java
@@ -37,7 +37,7 @@ public class SinkEventTestingSink
     extends AbstractSink
 {
     /** The list of sink events. */
-    private final List<SinkEventElement> events = new LinkedList<SinkEventElement>();
+    private final List<SinkEventElement> events = new LinkedList<>();
 
     /**
      * Return the collected list of SinkEventElements.
@@ -218,7 +218,7 @@ public class SinkEventTestingSink
     @Override
     public void numberedList( int numbering )
     {
-        addEvent( "numberedList", new Object[] {new Integer( numbering )} );
+        addEvent( "numberedList", new Object[] { numbering } );
     }
 
     @Override
@@ -302,7 +302,7 @@ public class SinkEventTestingSink
     @Override
     public void tableRows( int[] justification, boolean grid )
     {
-        addEvent( "tableRows", new Object[] {justification, new Boolean( grid )} );
+        addEvent( "tableRows", new Object[] { justification, grid } );
     }
 
     @Override
@@ -554,7 +554,7 @@ public class SinkEventTestingSink
     @Override
     public void verbatim( boolean boxed )
     {
-        addEvent( "verbatim", new Object[] {new Boolean( boxed )} );
+        addEvent( "verbatim", new Object[] { boxed } );
     }
 
     @Override
@@ -879,7 +879,7 @@ public class SinkEventTestingSink
     @Override
     public void numberedList( int numbering, SinkEventAttributes attributes )
     {
-        addEvent( "numberedList", new Object[] {new Integer( numbering ), attributes} );
+        addEvent( "numberedList", new Object[] { numbering, attributes } );
     }
 
     @Override
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkUtilsTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkUtilsTest.java
index cf5fa22..964610b 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkUtilsTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/SinkUtilsTest.java
@@ -54,7 +54,7 @@ public class SinkUtilsTest
         result = SinkUtils.getAttributeString( at );
         assertEquals( expResult, result );
 
-        att = new SinkEventAttributeSet( new String[] {"color", "red", "margin-left", "20px"} );
+        att = new SinkEventAttributeSet( "color", "red", "margin-left", "20px" );
 
         at = new SinkEventAttributeSet();
         at.addAttribute( SinkEventAttributeSet.STYLE, att );
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/WellformednessCheckingSink.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/WellformednessCheckingSink.java
index 01ddaef..2ad1a5a 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/WellformednessCheckingSink.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/WellformednessCheckingSink.java
@@ -37,9 +37,9 @@ import org.apache.maven.doxia.sink.impl.AbstractSink;
 public class WellformednessCheckingSink
     extends AbstractSink
 {
-    private final Stack<String> elements = new Stack<String>();
+    private final Stack<String> elements = new Stack<>();
 
-    private final List<String> errors = new LinkedList<String>();
+    private final List<String> errors = new LinkedList<>();
 
     @Override
     public void head()
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java
index 4d0723f..0ef7c34 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/Xhtml5BaseSinkTest.java
@@ -324,8 +324,8 @@ public class Xhtml5BaseSinkTest
     public void testSectionAttributes()
     {
         final int level = Xhtml5BaseSink.SECTION_LEVEL_1;
-        final SinkEventAttributeSet set = new SinkEventAttributeSet(
-            new String[] {"name", "section name", "class", "foo", "id", "bar"} );
+        final SinkEventAttributeSet set = new SinkEventAttributeSet( "name", "section name", "class", "foo", "id",
+                "bar" );
 
         try
         {
@@ -952,7 +952,7 @@ public class Xhtml5BaseSinkTest
         checkVerbatimAttributes( attributes, "<div>" + LS + "<pre style=\"bold\"></pre></div>" );
 
         final SinkEventAttributes att =
-            new SinkEventAttributeSet( new String[] {SinkEventAttributes.ID, "id"} );
+            new SinkEventAttributeSet( SinkEventAttributes.ID, "id" );
         checkVerbatimAttributes( att, "<div>" + LS + "<pre id=\"id\"></pre></div>" );
 
         att.addAttribute( Attribute.CLASS, "class" );
@@ -1399,11 +1399,11 @@ public class Xhtml5BaseSinkTest
      */
     public void testAttributeEntities()
     {
-        final Object[] startTag = new Object[] { new Integer( Xhtml5BaseSink.TAG_TYPE_START ) };
-        final Object[] endTag = new Object[] { new Integer( Xhtml5BaseSink.TAG_TYPE_END ) };
+        final Object[] startTag = new Object[] { Xhtml5BaseSink.TAG_TYPE_START };
+        final Object[] endTag = new Object[] { Xhtml5BaseSink.TAG_TYPE_END };
         final String script = Xhtml5BaseSink.SCRIPT.toString();
-        final SinkEventAttributes src = new SinkEventAttributeSet(
-                new String[] {SinkEventAttributes.SRC.toString(), "http://ex.com/ex.js?v=l&l=e"} );
+        final SinkEventAttributes src = new SinkEventAttributeSet( SinkEventAttributes.SRC.toString(),
+                "http://ex.com/ex.js?v=l&l=e" );
 
         try
         {
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java
index 0efe53a..ce71988 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/sink/impl/XhtmlBaseSinkTest.java
@@ -218,8 +218,8 @@ public class XhtmlBaseSinkTest
     public void testSectionAttributes()
     {
         final int level = XhtmlBaseSink.SECTION_LEVEL_1;
-        final SinkEventAttributeSet set = new SinkEventAttributeSet(
-            new String[] {"name", "section name", "class", "foo", "id", "bar"} );
+        final SinkEventAttributeSet set = new SinkEventAttributeSet( "name", "section name", "class", "foo", "id",
+                "bar" );
 
         try
         {
@@ -584,7 +584,7 @@ public class XhtmlBaseSinkTest
         checkVerbatimAttributes( attributes, "<div>" + LS + "<pre style=\"bold\"></pre></div>" );
 
         final SinkEventAttributes att =
-            new SinkEventAttributeSet( new String[] {SinkEventAttributes.ID, "id"} );
+            new SinkEventAttributeSet( SinkEventAttributes.ID, "id" );
         checkVerbatimAttributes( att, "<div>" + LS + "<pre id=\"id\"></pre></div>" );
 
         att.addAttribute( Attribute.CLASS, "class" );
@@ -952,11 +952,11 @@ public class XhtmlBaseSinkTest
      */
     public void testAttributeEntities()
     {
-        final Object[] startTag = new Object[] { new Integer( XhtmlBaseSink.TAG_TYPE_START ) };
-        final Object[] endTag = new Object[] { new Integer( XhtmlBaseSink.TAG_TYPE_END ) };
+        final Object[] startTag = new Object[] { XhtmlBaseSink.TAG_TYPE_START };
+        final Object[] endTag = new Object[] { XhtmlBaseSink.TAG_TYPE_END };
         final String script = XhtmlBaseSink.SCRIPT.toString();
-        final SinkEventAttributes src = new SinkEventAttributeSet(
-                new String[] {SinkEventAttributes.SRC.toString(), "http://ex.com/ex.js?v=l&l=e"} );
+        final SinkEventAttributes src = new SinkEventAttributeSet( SinkEventAttributes.SRC.toString(),
+                "http://ex.com/ex.js?v=l&l=e" );
 
         try
         {
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
index 7b28d8e..b7a6fda 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/util/DoxiaUtilsTest.java
@@ -21,6 +21,7 @@ package org.apache.maven.doxia.util;
 
 import java.text.ParseException;
 
+import java.util.Calendar;
 import java.util.Date;
 import java.util.GregorianCalendar;
 
@@ -198,7 +199,7 @@ public class DoxiaUtilsTest
     public void testParseDate()
     {
         final int year = 1973;
-        final int month = 1;
+        final int month = Calendar.FEBRUARY;
         final int day = 27;
 
         try
@@ -215,9 +216,9 @@ public class DoxiaUtilsTest
             assertEquals( feb27, DoxiaUtils.parseDate( "February 27, 1973" ) );
             assertEquals( feb27, DoxiaUtils.parseDate( "19730227" ) );
 
-            assertEquals( new GregorianCalendar( year, 0, 1 ).getTime(), DoxiaUtils.parseDate( "1973" ) );
+            assertEquals( new GregorianCalendar( year, Calendar.JANUARY, 1 ).getTime(), DoxiaUtils.parseDate( "1973" ) );
 
-            final Date feb1 = new GregorianCalendar( year, 1, 1 ).getTime();
+            final Date feb1 = new GregorianCalendar( year, Calendar.FEBRUARY, 1 ).getTime();
             assertEquals( feb1, DoxiaUtils.parseDate( "February 1973" ) );
             assertEquals( feb1, DoxiaUtils.parseDate( "Feb. 1973" ) );
             assertEquals( feb1, DoxiaUtils.parseDate( "February '73" ) );
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java b/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java
index 69a78f3..7290559 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidator.java
@@ -23,7 +23,6 @@ import java.io.IOException;
 import java.io.StringReader;
 import java.util.ArrayList;
 import java.util.Collections;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -103,21 +102,17 @@ public abstract class AbstractXmlValidator
         final Logger logger =
             ( (DefaultPlexusContainer) getContainer() ).getLoggerManager().getLoggerForComponent( Parser.ROLE );
 
-        for ( Iterator<Map.Entry<String, String>> it = getTestDocuments().entrySet().iterator(); it.hasNext(); )
+        for ( Map.Entry<String, String> entry : getTestDocuments().entrySet() )
         {
-            Map.Entry<String, String> entry = it.next();
-
             if ( logger.isDebugEnabled() )
             {
                 logger.debug( "Validate '" + entry.getKey() + "'" );
             }
 
-            List<ErrorMessage> errors = parseXML( entry.getValue().toString() );
+            List<ErrorMessage> errors = parseXML( entry.getValue() );
 
-            for ( Iterator<ErrorMessage> it2 = errors.iterator(); it2.hasNext(); )
+            for ( ErrorMessage error : errors )
             {
-                ErrorMessage error = it2.next();
-
                 if ( isFailErrorMessage( error.getMessage() ) )
                 {
                     fail( entry.getKey() + EOL + error.toString() );
@@ -399,7 +394,7 @@ public abstract class AbstractXmlValidator
 
         MessagesErrorHandler()
         {
-            messages = new ArrayList<ErrorMessage>( 8 );
+            messages = new ArrayList<>( 8 );
         }
 
         /** {@inheritDoc} */
diff --git a/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java b/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java
index 89d69eb..4a4a6ea 100644
--- a/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java
+++ b/doxia-core/src/test/java/org/apache/maven/doxia/xsd/AbstractXmlValidatorTest.java
@@ -28,7 +28,6 @@ import java.net.URL;
 import java.util.Collections;
 import java.util.Enumeration;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -57,7 +56,7 @@ public abstract class AbstractXmlValidatorTest
 {
 
     /** Simple cache mechanism to load test documents. */
-    private static final Map<String,String> CACHE_DOXIA_TEST_DOCUMENTS = new Hashtable<String,String>();
+    private static final Map<String,String> CACHE_DOXIA_TEST_DOCUMENTS = new Hashtable<>();
 
     /** 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/";
@@ -87,12 +86,9 @@ public abstract class AbstractXmlValidatorTest
         }
 
         Map<String,String> testDocs = getAllTestDocuments();
-        Map<String,String> ret = new Hashtable<String,String>();
-        ret.putAll( testDocs );
-        for ( Iterator<String> it = testDocs.keySet().iterator(); it.hasNext(); )
+        Map<String, String> ret = new Hashtable<>( testDocs );
+        for ( String key : testDocs.keySet() )
         {
-            String key = it.next();
-
             for ( int i = 0; i < getIncludes().length; i++ )
             {
                 if ( !SelectorUtils.matchPath( getIncludes()[i], key.toLowerCase( Locale.ENGLISH ) ) )
@@ -187,9 +183,9 @@ public abstract class AbstractXmlValidatorTest
             File testDocsDir = FileUtils.toFile( testJar ).getParentFile();
 
             List<File> files = FileUtils.getFiles( testDocsDir, "**/*.*", FileUtils.getDefaultExcludesAsString(), true );
-            for ( Iterator<File> it = files.iterator(); it.hasNext();)
+            for ( File file1 : files )
             {
-                File file = new File( it.next().toString() );
+                File file = new File( file1.toString() );
 
                 if ( file.getAbsolutePath().contains( "META-INF" ) )
                 {
@@ -197,7 +193,7 @@ public abstract class AbstractXmlValidatorTest
                 }
 
                 Reader reader = null;
-                if ( XmlUtil.isXml( file ))
+                if ( XmlUtil.isXml( file ) )
                 {
                     reader = ReaderFactory.newXmlReader( file );
                 }
diff --git a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java
index b05230e..70e97b2 100644
--- a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java
+++ b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptMarkup.java
@@ -86,11 +86,10 @@ public interface AptMarkup
     String BOLD_START_MARKUP = StringUtils.repeat( String.valueOf( LESS_THAN ), 2 );
 
     /** Syntax for the boxed verbatim start: "+------+" */
-    String BOXED_VERBATIM_START_MARKUP = String.valueOf( PLUS )
-        + StringUtils.repeat( String.valueOf( MINUS ), 6 ) + String.valueOf( PLUS );
+    String BOXED_VERBATIM_START_MARKUP = PLUS + StringUtils.repeat( String.valueOf( MINUS ), 6 ) + PLUS;
 
     /** Syntax for the header start: " -----" */
-    String HEADER_START_MARKUP = String.valueOf( SPACE ) + StringUtils.repeat( String.valueOf( MINUS ), 5 );
+    String HEADER_START_MARKUP = SPACE + StringUtils.repeat( String.valueOf( MINUS ), 5 );
 
     /** Syntax for the horizontal rule: "========" */
     String HORIZONTAL_RULE_MARKUP = StringUtils.repeat( String.valueOf( EQUAL ), 8 );
@@ -111,7 +110,7 @@ public interface AptMarkup
     String LINK_START_2_MARKUP = String.valueOf( RIGHT_CURLY_BRACKET );
 
     /** Syntax for the list end: "[]" */
-    String LIST_END_MARKUP = String.valueOf( LEFT_SQUARE_BRACKET ) + String.valueOf( RIGHT_SQUARE_BRACKET );
+    String LIST_END_MARKUP = String.valueOf( LEFT_SQUARE_BRACKET ) + RIGHT_SQUARE_BRACKET;
 
     /** Syntax for the list start: "*" */
     String LIST_START_MARKUP = String.valueOf( STAR );
@@ -126,7 +125,7 @@ public interface AptMarkup
     String NON_BOXED_VERBATIM_START_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 6 );
 
     /** Syntax for the non breaking space: "\ " */
-    String NON_BREAKING_SPACE_MARKUP = String.valueOf( BACKSLASH ) + String.valueOf( SPACE );
+    String NON_BREAKING_SPACE_MARKUP = String.valueOf( BACKSLASH ) + SPACE;
 
     /** Syntax for the page break: "\f" */
     String PAGE_BREAK_MARKUP = String.valueOf( PAGE_BREAK );
@@ -138,22 +137,19 @@ public interface AptMarkup
     String TABLE_CELL_SEPARATOR_MARKUP = String.valueOf( PIPE );
 
     /** Syntax for the table column, centered style: "-*" */
-    String TABLE_COL_CENTERED_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 )
-        + String.valueOf( STAR );
+    String TABLE_COL_CENTERED_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 ) + STAR;
 
     /** Syntax for the table column, left style: "-+" */
-    String TABLE_COL_LEFT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 )
-        + String.valueOf( PLUS );
+    String TABLE_COL_LEFT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 ) + PLUS;
 
     /** Syntax for the table column, right style: "-:" */
-    String TABLE_COL_RIGHT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 )
-        + String.valueOf( COLON );
+    String TABLE_COL_RIGHT_ALIGNED_MARKUP = StringUtils.repeat( String.valueOf( MINUS ), 2 ) + COLON;
 
     /** Syntax for the table row end: "|" */
     String TABLE_ROW_SEPARATOR_MARKUP = String.valueOf( PIPE );
 
     /** Syntax for the table row start: "*--" */
-    String TABLE_ROW_START_MARKUP = String.valueOf( STAR ) + StringUtils.repeat( String.valueOf( MINUS ), 2 );
+    String TABLE_ROW_START_MARKUP = STAR + StringUtils.repeat( String.valueOf( MINUS ), 2 );
 
     /** Syntax for the boxed verbatim end: "+------+" */
     String BOXED_VERBATIM_END_MARKUP = BOXED_VERBATIM_START_MARKUP;
diff --git a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
index b69e4e1..479865c 100644
--- a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
+++ b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptParser.java
@@ -113,7 +113,7 @@ public class AptParser
     private static final int COMMENT_BLOCK = 17;
 
     /** String representations of event ids */
-    private static final String TYPE_NAMES[] = {
+    private static final String[] TYPE_NAMES = {
         "TITLE",
         "SECTION1",
         "SECTION2",
@@ -1622,13 +1622,13 @@ public class AptParser
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( msg );
         warnMessages.put( key, set );
@@ -2616,9 +2616,9 @@ public class AptParser
         {
             // Skip empty row (a decorative line).
             boolean traversed = false;
-            for ( int i = 0; i < cells.length; ++i )
+            for ( StringBuilder cell1 : cells )
             {
-                if ( cells[i].length() > 0 )
+                if ( cell1.length() > 0 )
                 {
                     traversed = true;
                     break;
@@ -2906,7 +2906,7 @@ public class AptParser
 
             String macroId = params[0];
 
-            Map<String, Object> parameters = new HashMap<String, Object>();
+            Map<String, Object> parameters = new HashMap<>();
 
             for ( int i = 1; i < params.length; i++ )
             {
diff --git a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
index b232c4e..2fa1d27 100644
--- a/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
+++ b/doxia-modules/doxia-module-apt/src/main/java/org/apache/maven/doxia/module/apt/AptSink.java
@@ -96,7 +96,7 @@ public class AptSink
     private final PrintWriter writer;
 
     /**  justification of table cells. */
-    private int cellJustif[];
+    private int[] cellJustif;
 
     /**  a line of a row in a table. */
     private String rowLine;
@@ -108,7 +108,7 @@ public class AptSink
     private final Stack<String> listStyles;
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<String>> inlineStack = new Stack<List<String>>();
+    protected Stack<List<String>> inlineStack = new Stack<>();
 
     // ----------------------------------------------------------------------
     // Public protected methods
@@ -123,7 +123,7 @@ public class AptSink
     protected AptSink( Writer writer )
     {
         this.writer = new PrintWriter( writer );
-        this.listStyles = new Stack<String>();
+        this.listStyles = new Stack<>();
 
         init();
     }
@@ -453,13 +453,13 @@ public class AptSink
         String style = listStyles.peek();
         if ( style.equals( String.valueOf( STAR ) ) )
         {
-            write( EOL + listNestingIndent + String.valueOf( STAR ) + String.valueOf( SPACE ) );
+            write( EOL + listNestingIndent + STAR + SPACE );
         }
         else
         {
-            write( EOL + listNestingIndent + String.valueOf( LEFT_SQUARE_BRACKET )
-                + String.valueOf( LEFT_SQUARE_BRACKET ) + style + String.valueOf( RIGHT_SQUARE_BRACKET )
-                + String.valueOf( RIGHT_SQUARE_BRACKET ) + String.valueOf( SPACE ) );
+            write( EOL + listNestingIndent + LEFT_SQUARE_BRACKET
+                + LEFT_SQUARE_BRACKET + style + RIGHT_SQUARE_BRACKET
+                + RIGHT_SQUARE_BRACKET + SPACE );
         }
         itemFlag = true;
     }
@@ -617,7 +617,7 @@ public class AptSink
     }
 
     /** {@inheritDoc} */
-    public void tableRows( int justification[], boolean grid )
+    public void tableRows( int[] justification, boolean grid )
     {
         cellJustif = justification;
         gridFlag = grid;
@@ -827,7 +827,7 @@ public class AptSink
     {
         if ( !headerFlag )
         {
-            List<String> tags = new ArrayList<String>();
+            List<String> tags = new ArrayList<>();
 
             if ( attributes != null )
             {
diff --git a/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java b/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
index 25b2e5f..d9aa56f 100644
--- a/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
+++ b/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptParserTest.java
@@ -51,7 +51,7 @@ public class AptParserTest
     {
         super.setUp();
 
-        parser = (AptParser) lookup( Parser.ROLE, "apt" );
+        parser = lookup( Parser.ROLE, "apt" );
     }
 
     /** {@inheritDoc} */
@@ -88,7 +88,7 @@ public class AptParserTest
     {
         String linebreak = parseFileToAptSink( "test/linebreak" );
 
-        assertTrue( linebreak.indexOf( "Line\\" + EOL + "break." ) != -1 );
+        assertTrue( linebreak.contains( "Line\\" + EOL + "break." ) );
     }
 
     /** @throws Exception  */
@@ -97,7 +97,7 @@ public class AptParserTest
     {
         String macro = parseFileToAptSink( "test/macro" );
 
-        assertTrue( macro.indexOf( "<modelVersion\\>4.0.0\\</modelVersion\\>" ) != -1 );
+        assertTrue( macro.contains( "<modelVersion\\>4.0.0\\</modelVersion\\>" ) );
     }
 
     /** @throws Exception  */
@@ -116,19 +116,11 @@ public class AptParserTest
     {
         // DOXIA-259
 
-        Reader reader = null;
         SinkEventTestingSink sink = new SinkEventTestingSink();
-
-        try
+        try ( Reader reader = getTestReader( "test/snippet" ) )
         {
-            reader = getTestReader( "test/snippet" );
-
             createParser().parse( reader, sink );
         }
-        finally
-        {
-            IOUtil.close( reader );
-        }
 
         Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
@@ -161,8 +153,8 @@ public class AptParserTest
         String toc = parseFileToAptSink( "test/toc" );
 
         // No section, only subsection 1 and 2
-        assertTrue( toc.indexOf( "* {{{SubSection_1.1}SubSection 1.1}}" ) != -1 );
-        assertTrue( toc.indexOf( "* {{{SubSection_1.1.2.1.1}SubSection 1.1.2.1.1}}" ) == -1 );
+        assertTrue( toc.contains( "* {{{SubSection_1.1}SubSection 1.1}}" ) );
+        assertTrue( !toc.contains( "* {{{SubSection_1.1.2.1.1}SubSection 1.1.2.1.1}}" ) );
     }
 
     /**
diff --git a/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java b/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
index 2a946b8..e41855c 100644
--- a/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
+++ b/doxia-modules/doxia-module-apt/src/test/java/org/apache/maven/doxia/module/apt/AptSinkTest.java
@@ -121,22 +121,19 @@ public class AptSinkTest extends AbstractSinkTest
     /** {@inheritDoc} */
     protected String getSection3Block( String title )
     {
-        return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 2 )
-                + title + EOL + EOL + EOL;
+        return EOL + StringUtils.repeat( AptMarkup.SECTION_TITLE_START_MARKUP, 2 ) + title + EOL + EOL + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getSection4Block( String title )
     {
-        return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 3 )
-                + title + EOL + EOL + EOL;
+        return EOL + StringUtils.repeat( AptMarkup.SECTION_TITLE_START_MARKUP, 3 ) + title + EOL + EOL + EOL;
     }
 
     /** {@inheritDoc} */
     protected String getSection5Block( String title )
     {
-        return EOL + StringUtils.repeat( String.valueOf( AptMarkup.SECTION_TITLE_START_MARKUP ), 4 )
-                + title + EOL + EOL + EOL;
+        return EOL + StringUtils.repeat( AptMarkup.SECTION_TITLE_START_MARKUP, 4 ) + title + EOL + EOL + EOL;
     }
 
     /** {@inheritDoc} */
@@ -313,7 +310,7 @@ public class AptSinkTest extends AbstractSinkTest
     /** {@inheritDoc} */
     protected String getLineBreakBlock()
     {
-        return String.valueOf( AptMarkup.BACKSLASH ) + EOL;
+        return AptMarkup.BACKSLASH + EOL;
     }
 
     /** {@inheritDoc} */
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java
index da3d868..f63acd0 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceParser.java
@@ -68,7 +68,7 @@ public class ConfluenceParser
     {
         init();
 
-        List<Block> blocks = new ArrayList<Block>();
+        List<Block> blocks = new ArrayList<>();
 
         String line;
 
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSink.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSink.java
index 4aa968a..0f9e657 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSink.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/ConfluenceSink.java
@@ -65,7 +65,7 @@ public class ConfluenceSink
     private boolean monospacedFlag;
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<String>> inlineStack = new Stack<List<String>>();
+    protected Stack<List<String>> inlineStack = new Stack<>();
 
     /** An indication on if we're in verbatim box mode. */
     private boolean verbatimBoxedFlag;
@@ -88,7 +88,7 @@ public class ConfluenceSink
     protected ConfluenceSink( Writer writer )
     {
         this.out = new PrintWriter( writer );
-        this.listStyles = new Stack<String>();
+        this.listStyles = new Stack<>();
 
         init();
     }
@@ -433,7 +433,7 @@ public class ConfluenceSink
     {
         if ( !headFlag )
         {
-            List<String> tags = new ArrayList<String>();
+            List<String> tags = new ArrayList<>();
 
             if ( attributes != null )
             {
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
index 738d279..dfaef5f 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ChildBlocksBuilder.java
@@ -49,7 +49,7 @@ public class ChildBlocksBuilder
 
     private boolean insideSup = false;
 
-    private List<Block> blocks = new ArrayList<Block>();
+    private List<Block> blocks = new ArrayList<>();
 
     private StringBuilder text = new StringBuilder();
 
@@ -74,7 +74,7 @@ public class ChildBlocksBuilder
      */
     public List<Block> getBlocks()
     {
-        List<Block> specialBlocks = new ArrayList<Block>();
+        List<Block> specialBlocks = new ArrayList<>();
 
         for ( int i = 0; i < input.length(); i++ )
         {
@@ -382,7 +382,7 @@ public class ChildBlocksBuilder
 
     private List<Block> getList( Block block, List<Block> currentBlocks )
     {
-        List<Block> list = new ArrayList<Block>();
+        List<Block> list = new ArrayList<>();
 
         if ( insideBold || insideItalic || insideMonospaced )
         {
@@ -400,10 +400,10 @@ public class ChildBlocksBuilder
 
         if ( currentBlocks.isEmpty() && StringUtils.isEmpty( txt ) )
         {
-            return new ArrayList<Block>();
+            return new ArrayList<>();
         }
 
-        ArrayList<Block> list = new ArrayList<Block>();
+        ArrayList<Block> list = new ArrayList<>();
 
         if ( !insideBold && !insideItalic && !insideMonospaced )
         {
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/DefinitionListBlockParser.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/DefinitionListBlockParser.java
index 93b4948..acd70a1 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/DefinitionListBlockParser.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/DefinitionListBlockParser.java
@@ -54,7 +54,7 @@ public class DefinitionListBlockParser
         {
             line = line.substring( index + 6 );
 
-            while ( !( line.indexOf( "}" ) >= 0 ) && line != null )
+            while ( !( line.contains( "}" ) ) && line != null )
             {
                 append( title, line );
                 line = source.getNextLine();
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/FigureBlockParser.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/FigureBlockParser.java
index 32df7fb..9e63242 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/FigureBlockParser.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/FigureBlockParser.java
@@ -42,7 +42,7 @@ public class FigureBlockParser
         throws ParseException
     {
         String image = line.substring( 1, line.lastIndexOf( "!" ) );
-        if ( image.indexOf( "|" ) >= 0 )
+        if ( image.contains( "|" ) )
         {
             // DOXIA-303: handle figure attributes
             image = image.substring( 0, image.indexOf( "|" ) );
@@ -95,7 +95,7 @@ public class FigureBlockParser
             }
             else
             {
-                text.append( " " + line.trim() );
+                text.append( " " ).append( line.trim() );
             }
 
         }
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java
index 0bcdb86..59735c5 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/ParagraphBlockParser.java
@@ -106,9 +106,8 @@ public class ParagraphBlockParser
             }
 
             boolean accepted = false;
-            for ( int i = 0; i < parsers.length; i++ )
+            for ( BlockParser parser : parsers )
             {
-                BlockParser parser = parsers[i];
                 if ( parser.accept( line, source ) )
                 {
                     accepted = true;
@@ -129,7 +128,7 @@ public class ParagraphBlockParser
             }
             else
             {
-                text.append( " " + line.trim() );
+                text.append( " " ).append( line.trim() );
             }
 
         }
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java
index d65d292..2ca8cbe 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/ListBlockParser.java
@@ -77,7 +77,7 @@ public class ListBlockParser
             }
             else
             {
-                text.append( " " + line.trim() );
+                text.append( " " ).append( line.trim() );
             }
 
         }
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java
index 52cf20d..1b3297a 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeComponent.java
@@ -30,7 +30,7 @@ class TreeComponent
 {
     private static final String EOL = System.getProperty( "line.separator" );
 
-    private List<TreeComponent> children = new ArrayList<TreeComponent>();
+    private List<TreeComponent> children = new ArrayList<>();
 
     private String text;
 
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeListBuilder.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeListBuilder.java
index 74695e7..c775f1a 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeListBuilder.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/list/TreeListBuilder.java
@@ -110,11 +110,11 @@ public class TreeListBuilder
 
     private List<Block> getListItems( TreeComponent tc )
     {
-        List<Block> blocks = new ArrayList<Block>();
+        List<Block> blocks = new ArrayList<>();
 
         for ( TreeComponent child : tc.getChildren() )
         {
-            List<Block> childBlocks = new ArrayList<Block>();
+            List<Block> childBlocks = new ArrayList<>();
 
             if ( child.getFather() != null )
             {
diff --git a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java
index 34f3e4e..6c104a2 100644
--- a/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java
+++ b/doxia-modules/doxia-module-confluence/src/main/java/org/apache/maven/doxia/module/confluence/parser/table/TableBlockParser.java
@@ -85,7 +85,7 @@ public class TableBlockParser
             throw new IllegalAccessError( "call accept before this ;)" );
         }
 
-        List<Block> rows = new ArrayList<Block>();
+        List<Block> rows = new ArrayList<>();
 
         String l = line;
 
@@ -93,19 +93,19 @@ public class TableBlockParser
         {
             l = l.substring( 0, l.lastIndexOf( "|" ) );
 
-            List<Block> cells = new ArrayList<Block>();
+            List<Block> cells = new ArrayList<>();
 
             if ( l.startsWith( "||" ) )
             {
                 String[] text = StringUtils.split( l, "||" );
 
-                for ( int i = 0; i < text.length; i++ )
+                for ( String s : text )
                 {
-                    List<Block> textBlocks = new ArrayList<Block>();
+                    List<Block> textBlocks = new ArrayList<>();
 
-                    textBlocks.add( parseLine( text[i], new ByLineReaderSource( new StringReader( EMPTY_STRING ) ) ) );
+                    textBlocks.add( parseLine( s, new ByLineReaderSource( new StringReader( EMPTY_STRING ) ) ) );
 
-                    List<Block> blocks = new ArrayList<Block>();
+                    List<Block> blocks = new ArrayList<>();
 
                     blocks.add( new BoldBlock( textBlocks ) );
 
@@ -116,7 +116,7 @@ public class TableBlockParser
             {
                 int it = 0;
                 String[] text = StringUtils.split( l, "|" );
-                List<String> texts = new LinkedList<String>();
+                List<String> texts = new LinkedList<>();
 
                 while ( it < text.length )
                 {
@@ -135,7 +135,7 @@ public class TableBlockParser
 
                 for ( String pText : texts )
                 {
-                    List<Block> blocks = new ArrayList<Block>();
+                    List<Block> blocks = new ArrayList<>();
 
                     blocks.add( parseLine( pText, new ByLineReaderSource( new StringReader( EMPTY_STRING ) ) ) );
 
diff --git a/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java b/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java
index 3b39610..5028dd4 100644
--- a/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java
+++ b/doxia-modules/doxia-module-confluence/src/test/java/org/apache/maven/doxia/module/confluence/ConfluenceParserTest.java
@@ -58,7 +58,7 @@ public class ConfluenceParserTest
     {
         super.setUp();
 
-        parser = (ConfluenceParser) lookup( Parser.ROLE, "confluence" );
+        parser = lookup( Parser.ROLE, "confluence" );
 
         output = null;
         reader = null;
@@ -667,11 +667,11 @@ public class ConfluenceParserTest
         lines = StringUtils.replace( lines, "\n", EOL );
         if ( message != null )
         {
-            assertTrue( message, result.indexOf( lines ) != -1 );
+            assertTrue( message, result.contains( lines ) );
         }
         else
         {
-            assertTrue( result.indexOf( lines ) != -1 );
+            assertTrue( result.contains( lines ) );
         }
     }
 
diff --git a/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookParser.java b/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookParser.java
index 1043c23..5267118 100644
--- a/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookParser.java
+++ b/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookParser.java
@@ -68,50 +68,50 @@ public class DocBookParser
     /**
      * A selective stack of parent elements
      */
-    private final Stack<String> parent = new Stack<String>();
+    private final Stack<String> parent = new Stack<>();
 
     /**
      * The list of DocBook elements that introduce a new level of hierarchy.
      */
-    private static final Collection<String> HIER_ELEMENTS = new HashSet<String>();
+    private static final Collection<String> HIER_ELEMENTS = new HashSet<>();
 
     /**
      * Simplified DocBook elements that are direct children of &lt;article&gt;
      * and that should be emitted into the Sink's head.
      */
-    private static final Collection<String> META_ELEMENTS = new HashSet<String>();
+    private static final Collection<String> META_ELEMENTS = new HashSet<>();
 
     /**
      * Simplified DocBook elements that occur within &lt;articleinfo&gt;
      * and that are currently recognized by the parser.
      */
-    private static final Collection<String> ARTICLEINFO_ELEMENTS = new HashSet<String>();
+    private static final Collection<String> ARTICLEINFO_ELEMENTS = new HashSet<>();
 
     /**
      * The list of DocBook elements that will be rendered verbatim
      */
-    private static final Collection<String> VERBATIM_ELEMENTS = new HashSet<String>();
+    private static final Collection<String> VERBATIM_ELEMENTS = new HashSet<>();
 
     /**
      * The list of DocBook elements that will be rendered inline and bold
      */
-    private static final Collection<String> BOLD_ELEMENTS = new HashSet<String>();
+    private static final Collection<String> BOLD_ELEMENTS = new HashSet<>();
 
     /**
      * The list of DocBook elements that will be rendered inline and italic
      */
-    private static final Collection<String> ITALIC_ELEMENTS = new HashSet<String>();
+    private static final Collection<String> ITALIC_ELEMENTS = new HashSet<>();
 
     /**
      * The list of DocBook elements that will be rendered inline and monospace
      */
-    private static final Collection<String> MONOSPACE_ELEMENTS = new HashSet<String>();
+    private static final Collection<String> MONOSPACE_ELEMENTS = new HashSet<>();
 
     /**
      * The list of DocBook elements that may be ignored, either because they don't
      * require any special processing or because they are not yet implemented.
      */
-    private static final Collection<String> IGNORABLE_ELEMENTS = new HashSet<String>();
+    private static final Collection<String> IGNORABLE_ELEMENTS = new HashSet<>();
     static
     {
         META_ELEMENTS.add( SimplifiedDocbookMarkup.ARTICLEINFO_TAG.toString() );
@@ -495,28 +495,26 @@ public class DocBookParser
     {
         final String text = parser.getText();
 
-        if ( "PB".equals( text.trim() ) )
-        {
-            sink.pageBreak();
-        }
-        else if ( "HR".equals( text.trim() ) )
-        {
-            sink.horizontalRule();
-        }
-        else if ( "LB".equals( text.trim() ) )
-        {
-            sink.lineBreak();
-        }
-        else if ( "anchor_end".equals( text.trim() ) )
-        {
-            sink.anchor_();
-        }
-        else
-        {
-            if ( isEmitComments() )
-            {
-                sink.comment( text );
-            }
+        switch ( text.trim() )
+        {
+            case "PB":
+                sink.pageBreak();
+                break;
+            case "HR":
+                sink.horizontalRule();
+                break;
+            case "LB":
+                sink.lineBreak();
+                break;
+            case "anchor_end":
+                sink.anchor_();
+                break;
+            default:
+                if ( isEmitComments() )
+                {
+                    sink.comment( text );
+                }
+                break;
         }
     }
 
diff --git a/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java b/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
index da91a8e..683cf8f 100644
--- a/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
+++ b/doxia-modules/doxia-module-docbook-simple/src/main/java/org/apache/maven/doxia/module/docbook/DocBookSink.java
@@ -154,7 +154,7 @@ public class DocBookSink
     private String encoding;
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<String>> inlineStack = new Stack<List<String>>();
+    protected Stack<List<String>> inlineStack = new Stack<>();
 
     /** Map of warn messages with a String as key to describe the error type and a Set as value.
      * Using to reduce warn messages. */
@@ -1297,10 +1297,10 @@ public class DocBookSink
 
         writeStartTag( SimplifiedDocbookMarkup.TGROUP_TAG, att );
 
-        for ( int i = 0; i < justification.length; ++i )
+        for ( int i1 : justification )
         {
             String justif;
-            switch ( justification[i] )
+            switch ( i1 )
             {
                 case Sink.JUSTIFY_LEFT:
                     justif = "left";
@@ -1544,7 +1544,7 @@ public class DocBookSink
     /** {@inheritDoc} */
     public void inline( SinkEventAttributes attributes )
     {
-        List<String> tags = new ArrayList<String>();
+        List<String> tags = new ArrayList<>();
 
         if ( attributes != null )
         {
@@ -1797,13 +1797,13 @@ public class DocBookSink
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( msg );
         warnMessages.put( key, set );
diff --git a/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java b/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java
index 3c90c92..06dd69a 100644
--- a/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java
+++ b/doxia-modules/doxia-module-docbook-simple/src/test/java/org/apache/maven/doxia/module/docbook/DocBookParserTest.java
@@ -48,7 +48,7 @@ public class DocBookParserTest extends AbstractParserTest
     {
         super.setUp();
 
-        parser = (DocBookParser) lookup( Parser.ROLE, "docbook" );
+        parser = lookup( Parser.ROLE, "docbook" );
     }
 
     /** {@inheritDoc} */
diff --git a/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java b/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
index c2a296e..595e6ec 100644
--- a/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
+++ b/doxia-modules/doxia-module-fml/src/main/java/org/apache/maven/doxia/module/fml/FmlParser.java
@@ -87,7 +87,7 @@ public class FmlParser
     private String macroName;
 
     /** The macro parameters. */
-    private Map<String, Object> macroParameters = new HashMap<String, Object>();
+    private Map<String, Object> macroParameters = new HashMap<>();
 
     /** {@inheritDoc} */
     public void parse( Reader source, Sink sink )
@@ -185,9 +185,7 @@ public class FmlParser
         else if ( parser.getName().equals( TITLE.toString() ) )
         {
             buffer = new StringBuilder();
-
-            buffer.append( String.valueOf( LESS_THAN ) ).append( parser.getName() )
-                .append( String.valueOf( GREATER_THAN ) );
+            buffer.append( LESS_THAN ).append( parser.getName() ).append( GREATER_THAN );
         }
         else if ( parser.getName().equals( FAQ_TAG.toString() ) )
         {
@@ -213,16 +211,12 @@ public class FmlParser
         else if ( parser.getName().equals( QUESTION_TAG.toString() ) )
         {
             buffer = new StringBuilder();
-
-            buffer.append( String.valueOf( LESS_THAN ) ).append( parser.getName() )
-                .append( String.valueOf( GREATER_THAN ) );
+            buffer.append( LESS_THAN ).append( parser.getName() ).append( GREATER_THAN );
         }
         else if ( parser.getName().equals( ANSWER_TAG.toString() ) )
         {
             buffer = new StringBuilder();
-
-            buffer.append( String.valueOf( LESS_THAN ) ).append( parser.getName() )
-                .append( String.valueOf( GREATER_THAN ) );
+            buffer.append( LESS_THAN ).append( parser.getName() ).append( GREATER_THAN );
 
         }
 
@@ -240,23 +234,23 @@ public class FmlParser
         }
         else if ( buffer != null )
         {
-            buffer.append( String.valueOf( LESS_THAN ) ).append( parser.getName() );
+            buffer.append( LESS_THAN ).append( parser.getName() );
 
             int count = parser.getAttributeCount();
 
             for ( int i = 0; i < count; i++ )
             {
-                buffer.append( String.valueOf( SPACE ) ).append( parser.getAttributeName( i ) );
+                buffer.append( SPACE ).append( parser.getAttributeName( i ) );
 
-                buffer.append( String.valueOf( EQUAL ) ).append( String.valueOf( QUOTE ) );
+                buffer.append( EQUAL ).append( QUOTE );
 
                 // TODO: why are attribute values HTML-encoded?
                 buffer.append( HtmlTools.escapeHTML( parser.getAttributeValue( i ) ) );
 
-                buffer.append( String.valueOf( QUOTE ) );
+                buffer.append( QUOTE );
             }
 
-            buffer.append( String.valueOf( GREATER_THAN ) );
+            buffer.append( GREATER_THAN );
         }
     }
 
@@ -295,8 +289,7 @@ public class FmlParser
                     + parser.getLineNumber() + ":" + parser.getColumnNumber() + ")" );
             }
 
-            buffer.append( String.valueOf( LESS_THAN ) ).append( String.valueOf( SLASH ) )
-                .append( parser.getName() ).append( String.valueOf( GREATER_THAN ) );
+            buffer.append( LESS_THAN ).append( SLASH ).append( parser.getName() ).append( GREATER_THAN );
 
             currentFaq.setQuestion( buffer.toString() );
 
@@ -310,8 +303,7 @@ public class FmlParser
                     + parser.getLineNumber() + ":" + parser.getColumnNumber() + ")" );
             }
 
-            buffer.append( String.valueOf( LESS_THAN ) ).append( String.valueOf( SLASH ) )
-                .append( parser.getName() ).append( String.valueOf( GREATER_THAN ) );
+            buffer.append( LESS_THAN ).append( SLASH ).append( parser.getName() ).append( GREATER_THAN );
 
             currentFaq.setAnswer( buffer.toString() );
 
@@ -325,8 +317,7 @@ public class FmlParser
                     + parser.getLineNumber() + ":" + parser.getColumnNumber() + ")" );
             }
 
-            buffer.append( String.valueOf( LESS_THAN ) ).append( String.valueOf( SLASH ) )
-                .append( parser.getName() ).append( String.valueOf( GREATER_THAN ) );
+            buffer.append( LESS_THAN ).append( SLASH ).append( parser.getName() ).append( GREATER_THAN );
 
             currentPart.setTitle( buffer.toString() );
 
@@ -355,8 +346,7 @@ public class FmlParser
                 buffer.deleteCharAt( buffer.length() - 1 );
             }
 
-            buffer.append( String.valueOf( LESS_THAN ) ).append( String.valueOf( SLASH ) )
-                .append( parser.getName() ).append( String.valueOf( GREATER_THAN ) );
+            buffer.append( LESS_THAN ).append( SLASH ).append( parser.getName() ).append( GREATER_THAN );
         }
     }
 
@@ -463,7 +453,7 @@ public class FmlParser
 
             if ( macroParameters == null )
             {
-                macroParameters = new HashMap<String, Object>();
+                macroParameters = new HashMap<>();
             }
 
             if ( StringUtils.isEmpty( macroName ) )
@@ -719,13 +709,13 @@ public class FmlParser
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( msg );
         warnMessages.put( key, set );
diff --git a/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java b/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
index 176650c..b32c171 100644
--- a/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
+++ b/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlParserTest.java
@@ -26,7 +26,6 @@ import java.io.Reader;
 import java.io.Writer;
 
 import java.util.Iterator;
-import java.util.List;
 import java.util.regex.Pattern;
 
 import org.apache.maven.doxia.parser.AbstractParserTest;
@@ -53,7 +52,7 @@ public class FmlParserTest
     {
         super.setUp();
 
-        parser = (FmlParser) lookup( Parser.ROLE, "fml" );
+        parser = lookup( Parser.ROLE, "fml" );
 
         // AbstractXmlParser.CachedFileEntityResolver downloads DTD/XSD files in ${java.io.tmpdir}
         // Be sure to delete them
@@ -95,17 +94,10 @@ public class FmlParserTest
     {
         SinkEventTestingSink sink = new SinkEventTestingSink();
 
-        Reader reader = null;
-        try
+        try ( Reader reader = getTestReader( "simpleFaq" ) )
         {
-            reader = getTestReader( "simpleFaq" );
-
             createParser().parse( reader, sink );
         }
-        finally
-        {
-            IOUtil.close( reader );
-        }
 
         Iterator<SinkEventElement> it = sink.getEventList().iterator();
 
@@ -299,7 +291,7 @@ public class FmlParserTest
             IOUtil.close( reader );
         }
 
-        assertTrue( content.indexOf( "<a name=\"macro-definition\">Macro Question</a>" ) != -1 );
+        assertTrue( content.contains( "<a name=\"macro-definition\">Macro Question</a>" ) );
     }
 
     private void assertTextEvent( SinkEventElement textEvt, String string )
diff --git a/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlValidatorTest.java b/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlValidatorTest.java
index d5d2c49..d783e70 100644
--- a/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlValidatorTest.java
+++ b/doxia-modules/doxia-module-fml/src/test/java/org/apache/maven/doxia/module/fml/FmlValidatorTest.java
@@ -56,7 +56,7 @@ public class FmlValidatorTest
             String root = matcher.group( 1 );
             String value = matcher.group( 2 );
 
-            if ( value.indexOf( FML_XSD.getName() ) == -1 )
+            if ( !value.contains( FML_XSD.getName() ) )
             {
                 String faqs =
                     "<" + root + " xmlns=\"" + FmlMarkup.FML_NAMESPACE + "\""
diff --git a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
index af42ce9..8852e66 100644
--- a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
+++ b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoAggregateSink.java
@@ -124,7 +124,7 @@ public class FoAggregateSink
     /**
      * Used to get the current position in the TOC.
      */
-    private final Stack<NumberedListItem> tocStack = new Stack<NumberedListItem>();
+    private final Stack<NumberedListItem> tocStack = new Stack<>();
 
     /**
      * Constructor.
@@ -346,7 +346,7 @@ public class FoAggregateSink
             DocumentTOCItem tocItem = new DocumentTOCItem();
             tocItem.setName( this.docModel.getToc().getName() );
             tocItem.setRef( "./toc" );
-            List<DocumentTOCItem> items = new LinkedList<DocumentTOCItem>();
+            List<DocumentTOCItem> items = new LinkedList<>();
             if ( this.tocPosition == TOC_START )
             {
                 items.add( tocItem );
@@ -389,7 +389,7 @@ public class FoAggregateSink
             idName = idName.substring( 0, idName.lastIndexOf( "." ) );
         }
 
-        while ( idName.indexOf( "//" ) != -1 )
+        while ( idName.contains( "//" ) )
         {
             idName = StringUtils.replace( idName, "//", "/" );
         }
@@ -493,7 +493,7 @@ public class FoAggregateSink
             return;
         }
 
-        while ( name.indexOf( "//" ) != -1 )
+        while ( name.contains( "//" ) )
         {
             name = StringUtils.replace( name, "//", "/" );
         }
@@ -567,7 +567,7 @@ public class FoAggregateSink
 
         String base = docName.substring( 0, docName.lastIndexOf( "/" ) );
 
-        if ( base.indexOf( "/" ) != -1 )
+        if ( base.contains( "/" ) )
         {
             while ( anchor.startsWith( "../" ) )
             {
@@ -611,7 +611,7 @@ public class FoAggregateSink
                 else
                 {
                     anchor = anchor.substring( 0, dot ) + "#" + HtmlTools.encodeId(
-                        anchor.substring( hash + 1, anchor.length() ) );
+                        anchor.substring( hash + 1 ) );
                 }
             }
             else
@@ -726,7 +726,7 @@ public class FoAggregateSink
      */
     protected String getHeaderText()
     {
-        return Integer.toString( chapter ) + "   " + docTitle;
+        return chapter + "   " + docTitle;
     }
 
     /**
@@ -767,7 +767,7 @@ public class FoAggregateSink
     @Override
     protected String getChapterString()
     {
-        return Integer.toString( chapter ) + ".";
+        return chapter + ".";
     }
 
     @Override
@@ -1279,7 +1279,7 @@ public class FoAggregateSink
 
         if ( atts == null )
         {
-            return new SinkEventAttributeSet( new String[]{ SinkEventAttributes.HEIGHT, COVER_HEADER_HEIGHT } );
+            return new SinkEventAttributeSet( SinkEventAttributes.HEIGHT, COVER_HEADER_HEIGHT );
         }
 
         // FOP dpi: 72
diff --git a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
index 93ddd50..9895eaa 100644
--- a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
+++ b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoConfiguration.java
@@ -83,9 +83,7 @@ public class FoConfiguration
         }
         catch ( ConfigurationException cex )
         {
-            IOException ioe = new IOException();
-            ioe.initCause( cex );
-            throw ioe;
+            throw new IOException( cex );
         }
 
         loadDefaultConfig(); // this adds default values that are missing from above
@@ -153,7 +151,7 @@ public class FoConfiguration
     private void addAttributes( String attributeId )
     {
         int index = sets.indexOf( attributeId );
-        String keybase = "xsl:attribute-set(" + String.valueOf( index ) + ")";
+        String keybase = "xsl:attribute-set(" + index + ")";
 
         Object prop = config.getProperty( keybase + ".xsl:attribute" );
 
@@ -189,16 +187,11 @@ public class FoConfiguration
         {
             config.load( ReaderFactory.newXmlReader( getClass().getResourceAsStream( "/fo-styles.xslt" ) ) );
         }
-        catch ( ConfigurationException cex )
+        catch ( ConfigurationException | IOException cex )
         {
             // this should not happen
             throw new RuntimeException( cex );
         }
-        catch ( IOException e )
-        {
-            // this should not happen
-            throw new RuntimeException( e );
-        }
 
         this.sets = config.getList( "xsl:attribute-set[@name]" );
         reset();
diff --git a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
index 2a448a3..8e2cf26 100644
--- a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
+++ b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
@@ -116,7 +116,7 @@ public class FoSink
     private final LinkedList<String> tableCaptionStack;
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<Tag>> inlineStack = new Stack<List<Tag>>();
+    protected Stack<List<Tag>> inlineStack = new Stack<>();
 
     /** Map of warn messages with a String as key to describe the error type and a Set as value.
      * Using to reduce warn messages. */
@@ -167,15 +167,15 @@ public class FoSink
         this.languageId = languageId;
         this.config = new FoConfiguration();
 
-        this.listStack = new Stack<NumberedListItem>();
-        this.tableGridStack = new LinkedList<Boolean>();
-        this.cellJustifStack = new LinkedList<int[]>();
-        this.isCellJustifStack = new LinkedList<Boolean>();
-        this.cellCountStack = new LinkedList<Integer>();
-        this.tableContentWriterStack = new LinkedList<StringWriter>();
-        this.tableCaptionWriterStack = new LinkedList<StringWriter>();
-        this.tableCaptionXMLWriterStack = new LinkedList<PrettyPrintXMLWriter>();
-        this.tableCaptionStack = new LinkedList<String>();
+        this.listStack = new Stack<>();
+        this.tableGridStack = new LinkedList<>();
+        this.cellJustifStack = new LinkedList<>();
+        this.isCellJustifStack = new LinkedList<>();
+        this.cellCountStack = new LinkedList<>();
+        this.tableContentWriterStack = new LinkedList<>();
+        this.tableCaptionWriterStack = new LinkedList<>();
+        this.tableCaptionXMLWriterStack = new LinkedList<>();
+        this.tableCaptionStack = new LinkedList<>();
 
         setNameSpace( "fo" );
     }
@@ -965,7 +965,7 @@ public class FoSink
         if ( !this.tableCaptionStack.isEmpty() && this.tableCaptionStack.getLast() != null )
         {
             paragraph( SinkEventAttributeSet.CENTER );
-            write( this.tableCaptionStack.removeLast().toString() );
+            write( this.tableCaptionStack.removeLast() );
             paragraph_();
         }
     }
@@ -973,10 +973,10 @@ public class FoSink
     /** {@inheritDoc} */
     public void tableRows( int[] justification, boolean grid )
     {
-        this.tableGridStack.addLast( Boolean.valueOf( grid ) );
+        this.tableGridStack.addLast( grid );
         this.cellJustifStack.addLast( justification );
-        this.isCellJustifStack.addLast( Boolean.valueOf( true ) );
-        this.cellCountStack.addLast( Integer.valueOf( 0 ) );
+        this.isCellJustifStack.addLast( Boolean.TRUE );
+        this.cellCountStack.addLast( 0 );
         writeEOL();
         writeStartTag( TABLE_BODY_TAG );
     }
@@ -997,7 +997,7 @@ public class FoSink
         // TODO spacer rows
         writeStartTag( TABLE_ROW_TAG, "table.body.row" );
         this.cellCountStack.removeLast();
-        this.cellCountStack.addLast( Integer.valueOf( 0 ) );
+        this.cellCountStack.addLast( 0 );
     }
 
     /** {@inheritDoc} */
@@ -1127,7 +1127,7 @@ public class FoSink
         if ( this.isCellJustifStack.getLast().equals( Boolean.TRUE ) )
         {
             int cellCount = Integer.parseInt( this.cellCountStack.removeLast().toString() );
-            this.cellCountStack.addLast( Integer.valueOf( ++cellCount ) );
+            this.cellCountStack.addLast( ++cellCount );
         }
     }
 
@@ -1266,7 +1266,7 @@ public class FoSink
     /** {@inheritDoc} */
     public void inline( SinkEventAttributes attributes )
     {
-        List<Tag> tags = new ArrayList<Tag>();
+        List<Tag> tags = new ArrayList<>();
 
         if ( attributes != null )
         {
@@ -1548,7 +1548,7 @@ public class FoSink
     protected void writeStartTag( Tag tag, String id, String name )
     {
         writeEOL();
-        MutableAttributeSet att = new SinkEventAttributeSet( new String[] {id, name} );
+        MutableAttributeSet att = new SinkEventAttributeSet( id, name );
 
         writeStartTag( tag, att );
     }
@@ -1586,7 +1586,7 @@ public class FoSink
      */
     protected void writeEmptyTag( Tag tag, String id, String name )
     {
-        MutableAttributeSet att = new SinkEventAttributeSet( new String[] {id, name} );
+        MutableAttributeSet att = new SinkEventAttributeSet( id, name );
 
         writeEOL();
         writeSimpleTag( tag, att );
@@ -1686,7 +1686,7 @@ public class FoSink
                     buffer.append( EOL );
                     if ( verb )
                     {
-                        buffer.append( "<fo:block/>" + EOL );
+                        buffer.append( "<fo:block/>" ).append( EOL );
                     }
                     break;
                 default:
@@ -1844,13 +1844,13 @@ public class FoSink
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( msg );
         warnMessages.put( key, set );
diff --git a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java
index 3432fd1..3cdbc83 100644
--- a/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java
+++ b/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoUtils.java
@@ -173,7 +173,7 @@ public class FoUtils
     public static void convertFO2PDF( File fo, File pdf, String resourceDir )
         throws TransformerException
     {
-        convertFO2PDF( fo, pdf, resourceDir, (DocumentModel) null );
+        convertFO2PDF( fo, pdf, resourceDir, null );
     }
 
     /**
diff --git a/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java b/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java
index 9e6792e..b7ef2b6 100644
--- a/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java
+++ b/doxia-modules/doxia-module-fo/src/test/java/org/apache/maven/doxia/module/fo/FoAggregateSinkTest.java
@@ -83,7 +83,7 @@ public class FoAggregateSinkTest
             sink.close();
         }
 
-        assertTrue( writer.toString().indexOf( "<fo:block id=\"./folder/documentName\">" ) != -1 );
+        assertTrue( writer.toString().contains( "<fo:block id=\"./folder/documentName\">" ) );
     }
 
     /**
@@ -103,7 +103,7 @@ public class FoAggregateSinkTest
             sink.close();
         }
 
-        assertTrue( writer.toString().indexOf( "<fo:block id=\"./folder/documentName\">" ) != -1 );
+        assertTrue( writer.toString().contains( "<fo:block id=\"./folder/documentName\">" ) );
     }
     
     /**
@@ -151,7 +151,7 @@ public class FoAggregateSinkTest
             {
                 SAXParseException sax = (SAXParseException) e.getCause();
 
-                StringBuffer sb = new StringBuffer();
+                StringBuilder sb = new StringBuilder();
                 sb.append( "Error creating PDF from " ).append( foFile.getAbsolutePath() ).append( ":" ).append( sax.getLineNumber() ).append( ":" ).append( sax.getColumnNumber() ).append( "\n" );
                 sb.append( e.getMessage() );
 
@@ -205,8 +205,8 @@ public class FoAggregateSinkTest
             sink.close();
         }
 
-        assertTrue( writer.toString().indexOf( "<fo:inline id=\"#invalid_Anchor\">" ) != -1 );
-        assertTrue( writer.toString().indexOf( "<fo:inline id=\"./folder/docName#validAnchor\">" ) != -1 );
+        assertTrue( writer.toString().contains( "<fo:inline id=\"#invalid_Anchor\">" ) );
+        assertTrue( writer.toString().contains( "<fo:inline id=\"./folder/docName#validAnchor\">" ) );
     }
 
     /**
@@ -247,13 +247,13 @@ public class FoAggregateSinkTest
 
         String result = writer.toString();
 
-        assertTrue( result.indexOf( "<fo:basic-link external-destination=\"http://www.example.com/\">" ) != -1 );
-        assertTrue( result.indexOf( "<fo:basic-link internal-destination=\"./folder/docName#anchor\">" ) != -1 );
-        assertTrue( result.indexOf( "<fo:basic-link internal-destination=\"./folder/index\">" ) != -1 );
-        assertTrue( result.indexOf( "<fo:basic-link internal-destination=\"./download\">" ) != -1 );
-        assertTrue( result.indexOf( "<fo:basic-link internal-destination=\"./folder/test\">" ) != -1 );
-        assertTrue( result.indexOf( "<fo:basic-link internal-destination=\"./folder/whatsnew-1.1\">" ) != -1 );
-        assertTrue( result.indexOf( "<fo:block id=\"./whatsnew-1.1\">" ) != -1 );
+        assertTrue( result.contains( "<fo:basic-link external-destination=\"http://www.example.com/\">" ) );
+        assertTrue( result.contains( "<fo:basic-link internal-destination=\"./folder/docName#anchor\">" ) );
+        assertTrue( result.contains( "<fo:basic-link internal-destination=\"./folder/index\">" ) );
+        assertTrue( result.contains( "<fo:basic-link internal-destination=\"./download\">" ) );
+        assertTrue( result.contains( "<fo:basic-link internal-destination=\"./folder/test\">" ) );
+        assertTrue( result.contains( "<fo:basic-link internal-destination=\"./folder/whatsnew-1.1\">" ) );
+        assertTrue( result.contains( "<fo:block id=\"./whatsnew-1.1\">" ) );
 
         writer = new StringWriter();
         try
@@ -276,7 +276,7 @@ public class FoAggregateSinkTest
 
         result = writer.toString();
 
-        assertTrue( result.indexOf( "<fo:basic-link internal-destination=\"./root\">" ) != -1 );
-        assertTrue( result.indexOf( "<fo:basic-link internal-destination=\"./outside\">" ) != -1 );
+        assertTrue( result.contains( "<fo:basic-link internal-destination=\"./root\">" ) );
+        assertTrue( result.contains( "<fo:basic-link internal-destination=\"./outside\">" ) );
     }
 }
diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
index 7dd32ec..92771c0 100644
--- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
+++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextSink.java
@@ -123,7 +123,7 @@ public class ITextSink
     private boolean figureDefined = false;
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<String>> inlineStack = new Stack<List<String>>();
+    protected Stack<List<String>> inlineStack = new Stack<>();
 
     /** Map of warn messages with a String as key to describe the error type and a Set as value.
      * Using to reduce warn messages. */
@@ -1283,7 +1283,7 @@ public class ITextSink
     /** {@inheritDoc} */
     public void inline( SinkEventAttributes attributes )
     {
-        List<String> tags = new ArrayList<String>();
+        List<String> tags = new ArrayList<>();
 
         if ( attributes != null )
         {
@@ -1828,11 +1828,11 @@ public class ITextSink
     {
         String[] strings = StringUtils.split( aString, " " );
         StringBuilder sb = new StringBuilder();
-        for ( int i = 0; i < strings.length; i++ )
+        for ( String string : strings )
         {
-            if ( strings[i].trim().length() != 0 )
+            if ( string.trim().length() != 0 )
             {
-                sb.append( strings[i].trim() );
+                sb.append( string.trim() );
                 sb.append( " " );
             }
         }
@@ -1873,13 +1873,13 @@ public class ITextSink
 
         if ( warnMessages == null )
         {
-            warnMessages = new HashMap<String, Set<String>>();
+            warnMessages = new HashMap<>();
         }
 
         Set<String> set = warnMessages.get( key );
         if ( set == null )
         {
-            set = new TreeSet<String>();
+            set = new TreeSet<>();
         }
         set.add( msg );
         warnMessages.put( key, set );
diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java
index 3bddb50..c82e0d8 100644
--- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java
+++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/ITextUtil.java
@@ -69,9 +69,8 @@ public class ITextUtil
     public static String getPageSize( Rectangle rect )
     {
         Field[] fields = PageSize.class.getFields();
-        for ( int i = 0; i < fields.length; i++ )
+        for ( Field currentField : fields )
         {
-            Field currentField = fields[i];
             try
             {
                 if ( currentField.getType().equals( Rectangle.class ) )
@@ -102,11 +101,10 @@ public class ITextUtil
     public static boolean isPageSizeSupported( String aPageSize )
     {
         Field[] fields = PageSize.class.getFields();
-        for ( int i = 0; i < fields.length; i++ )
+        for ( Field currentField : fields )
         {
-            Field currentField = fields[i];
-            if ( ( currentField.getName().equalsIgnoreCase( aPageSize ) )
-                && ( currentField.getType().equals( Rectangle.class ) ) )
+            if ( ( currentField.getName().equalsIgnoreCase( aPageSize ) ) && ( currentField.getType().equals(
+                    Rectangle.class ) ) )
             {
                 return true;
             }
diff --git a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java
index 49fbd15..7d7f1d7 100644
--- a/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java
+++ b/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java
@@ -114,7 +114,7 @@ public class SinkActionContext
     /** Constant <code>UNDEFINED=82</code> */
     public static final int UNDEFINED = 82;
 
-    private Stack<Integer> stack = new Stack<Integer>();
+    private Stack<Integer> stack = new Stack<>();
 
     private int currentAction;
 
@@ -132,7 +132,7 @@ public class SinkActionContext
         }
         else
         {
-            return stack.peek().intValue();
+            return stack.peek();
         }
     }
 
@@ -154,6 +154,6 @@ public class SinkActionContext
     {
         //currentAction = action;
 
-        stack.push( Integer.valueOf( action ) );
+        stack.push( action );
     }
 }
diff --git a/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java b/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
index 9566af4..ba73aa6 100644
--- a/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
+++ b/doxia-modules/doxia-module-latex/src/main/java/org/apache/maven/doxia/module/latex/LatexSink.java
@@ -84,7 +84,7 @@ public class LatexSink
     private String title;
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<String>> inlineStack = new Stack<List<String>>();
+    protected Stack<List<String>> inlineStack = new Stack<>();
 
     // ----------------------------------------------------------------------
     //
@@ -798,13 +798,13 @@ public class LatexSink
 
     {
         StringBuilder justif = new StringBuilder();
-        for ( int i = 0; i < justification.length; ++i )
+        for ( int i1 : justification )
         {
             if ( grid )
             {
                 justif.append( '|' );
             }
-            switch ( justification[i] )
+            switch ( i1 )
             {
                 case Sink.JUSTIFY_CENTER:
                     justif.append( 'c' );
@@ -1141,7 +1141,7 @@ public class LatexSink
     /** {@inheritDoc} */
     public void inline( SinkEventAttributes attributes )
     {
-        List<String> tags = new ArrayList<String>();
+        List<String> tags = new ArrayList<>();
 
         if ( attributes != null )
         {
diff --git a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaExtension.java b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaExtension.java
index bfd89b7..9233148 100644
--- a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaExtension.java
+++ b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaExtension.java
@@ -29,7 +29,7 @@ import com.vladsch.flexmark.util.options.MutableDataHolder;
  */
 class FlexmarkDoxiaExtension implements HtmlRenderer.HtmlRendererExtension
 {
-    public static final DataKey<String> INPUT_FILE_EXTENSION = new DataKey<String>( "INPUT_FILE_EXTENSION", "md" );
+    public static final DataKey<String> INPUT_FILE_EXTENSION = new DataKey<>( "INPUT_FILE_EXTENSION", "md" );
 
     @Override
     public void rendererOptions( final MutableDataHolder options )
diff --git a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaLinkResolver.java b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaLinkResolver.java
index 10810af..cab9b2d 100644
--- a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaLinkResolver.java
+++ b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaLinkResolver.java
@@ -90,7 +90,7 @@ public class FlexmarkDoxiaLinkResolver implements LinkResolver
         @Override
         public Set<Class<? extends LinkResolverFactory>> getBeforeDependents()
         {
-            Set<Class<? extends LinkResolverFactory>> set = new HashSet<Class<? extends LinkResolverFactory>>();
+            Set<Class<? extends LinkResolverFactory>> set = new HashSet<>();
             set.add( WikiLinkLinkResolver.Factory.class );
             return set;
         }
diff --git a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaNodeRenderer.java b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaNodeRenderer.java
index 090008e..aea3316 100644
--- a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaNodeRenderer.java
+++ b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/FlexmarkDoxiaNodeRenderer.java
@@ -48,24 +48,22 @@ class FlexmarkDoxiaNodeRenderer implements NodeRenderer
     {
         //noinspection unchecked
         return new HashSet<NodeRenderingHandler<?>>( Arrays.asList(
-                new NodeRenderingHandler<IndentedCodeBlock>( IndentedCodeBlock.class,
-                        new CustomNodeRenderer<IndentedCodeBlock>()
-                        {
-                            @Override
-                            public void render( IndentedCodeBlock node, NodeRendererContext context, HtmlWriter html )
-                            {
-                                FlexmarkDoxiaNodeRenderer.this.render( node, context, html );
-                            }
-                        } ),
-                new NodeRenderingHandler<FencedCodeBlock>( FencedCodeBlock.class,
-                        new CustomNodeRenderer<FencedCodeBlock>()
-                        {
-                            @Override
-                            public void render( FencedCodeBlock node, NodeRendererContext context, HtmlWriter html )
-                            {
-                                FlexmarkDoxiaNodeRenderer.this.render( node, context, html );
-                            }
-                        } )
+                new NodeRenderingHandler<>( IndentedCodeBlock.class, new CustomNodeRenderer<IndentedCodeBlock>()
+                {
+                    @Override
+                    public void render( IndentedCodeBlock node, NodeRendererContext context, HtmlWriter html )
+                    {
+                        FlexmarkDoxiaNodeRenderer.this.render( node, context, html );
+                    }
+                } ),
+                new NodeRenderingHandler<>( FencedCodeBlock.class, new CustomNodeRenderer<FencedCodeBlock>()
+                {
+                    @Override
+                    public void render( FencedCodeBlock node, NodeRendererContext context, HtmlWriter html )
+                    {
+                        FlexmarkDoxiaNodeRenderer.this.render( node, context, html );
+                    }
+                } )
         ) );
     }
 
diff --git a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java
index fa1454f..b9a2e14 100644
--- a/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java
+++ b/doxia-modules/doxia-module-markdown/src/main/java/org/apache/maven/doxia/module/markdown/MarkdownParser.java
@@ -130,7 +130,7 @@ public class MarkdownParser
         String text = IOUtil.toString( source );
         MutableDataHolder flexmarkOptions = PegdownOptionsAdapter.flexmarkOptions(
                 Extensions.ALL & ~( Extensions.HARDWRAPS | Extensions.ANCHORLINKS ) ).toMutable();
-        ArrayList<Extension> extensions = new ArrayList<Extension>();
+        ArrayList<Extension> extensions = new ArrayList<>();
         for ( Extension extension : flexmarkOptions.get( com.vladsch.flexmark.parser.Parser.EXTENSIONS ) )
         {
             extensions.add( extension );
diff --git a/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java b/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java
index b1fb22c..f14bed7 100644
--- a/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java
+++ b/doxia-modules/doxia-module-markdown/src/test/java/org/apache/maven/doxia/module/markdown/MarkdownParserTest.java
@@ -1,5 +1,6 @@
 package org.apache.maven.doxia.module.markdown;
 
+import java.io.IOException;
 import java.io.Reader;
 import java.util.Iterator;
 import java.util.List;
@@ -26,7 +27,6 @@ import java.util.List;
 import org.apache.maven.doxia.parser.AbstractParserTest;
 import org.apache.maven.doxia.parser.ParseException;
 import org.apache.maven.doxia.parser.Parser;
-import org.apache.maven.doxia.sink.Sink;
 import org.apache.maven.doxia.sink.impl.SinkEventAttributeSet;
 import org.apache.maven.doxia.sink.impl.SinkEventElement;
 import org.apache.maven.doxia.sink.impl.SinkEventTestingSink;
@@ -55,7 +55,7 @@ public class MarkdownParserTest
         throws Exception
     {
         super.setUp();
-        parser = (MarkdownParser) lookup( Parser.ROLE, MarkdownParser.ROLE_HINT );
+        parser = lookup( Parser.ROLE, MarkdownParser.ROLE_HINT );
     }
 
     /**
@@ -307,21 +307,14 @@ public class MarkdownParserTest
      * @return a sink to test parsing events.
      * @throws ParseException if the document parsing failed.
      */
-    protected SinkEventTestingSink parseFileToEventTestingSink( String file )
-        throws ParseException
+    protected SinkEventTestingSink parseFileToEventTestingSink( String file ) throws ParseException, IOException
     {
-        Reader reader = null;
         SinkEventTestingSink sink = null;
-        try
+        try ( Reader reader = getTestReader( file ) )
         {
-            reader = getTestReader( file );
             sink = new SinkEventTestingSink();
             parser.parse( reader, sink );
         }
-        finally
-        {
-            IOUtil.close( reader );
-        }
 
         return sink;
     }
diff --git a/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/PBMReader.java b/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/PBMReader.java
index 58f3868..81fd495 100644
--- a/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/PBMReader.java
+++ b/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/PBMReader.java
@@ -27,6 +27,7 @@ import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.Reader;
+import java.nio.charset.StandardCharsets;
 
 /**
  * <a href="http://en.wikipedia.org/wiki/Portable_pixmap">PBM</a> images reader.
@@ -182,7 +183,8 @@ class PBMReader
         {
             String field;
 
-            reader = new BufferedReader( new InputStreamReader( new FileInputStream( fileName ), "US-ASCII" ) );
+            reader = new BufferedReader( new InputStreamReader(
+                    new FileInputStream( fileName ), StandardCharsets.US_ASCII ) );
             offset = 0;
 
             field = getField();
diff --git a/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java b/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
index 24da5ba..68195d2 100644
--- a/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
+++ b/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
@@ -30,7 +30,6 @@ import java.io.Writer;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.Hashtable;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -218,7 +217,7 @@ public class RtfSink
     protected OutputStream stream; // for raw image data
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<Integer>> inlineStack = new Stack<List<Integer>>();
+    protected Stack<List<Integer>> inlineStack = new Stack<>();
 
     /** Map of warn messages with a String as key to describe the error type and a Set as value.
      * Using to reduce warn messages. */
@@ -703,7 +702,7 @@ public class RtfSink
     /** {@inheritDoc} */
     public void numberedList( int numbering )
     {
-        this.numbering.addElement( Integer.valueOf( numbering ) );
+        this.numbering.addElement( numbering );
         itemNumber.addElement( new Counter( 0 ) );
 
         indentation.add( LIST_INDENT );
@@ -757,7 +756,7 @@ public class RtfSink
 
     private String getItemHeader()
     {
-        int nmb = ( (Integer) this.numbering.lastElement() ).intValue();
+        int nmb = (Integer) this.numbering.lastElement();
         int iNmb = ( (Counter) this.itemNumber.lastElement() ).get();
         StringBuilder buf = new StringBuilder();
 
@@ -1458,7 +1457,7 @@ public class RtfSink
     /** {@inheritDoc} */
     public void inline( SinkEventAttributes attributes )
     {
-        List<Integer> tags = new ArrayList<Integer>();
+        List<Integer> tags = new ArrayList<>();
 
         if ( attributes != null )
         {
@@ -1780,15 +1779,15 @@ public class RtfSink
 
         if ( getLog().isWarnEnabled() && this.warnMessages != null )
         {
-            for ( Iterator it = this.warnMessages.entrySet().iterator(); it.hasNext(); )
+            for ( Object o1 : this.warnMessages.entrySet() )
             {
-                Map.Entry entry = (Map.Entry) it.next();
+                Map.Entry entry = (Map.Entry) o1;
 
                 Set set = (Set) entry.getValue();
 
-                for ( Iterator it2 = set.iterator(); it2.hasNext(); )
+                for ( Object o : set )
                 {
-                    String msg = (String) it2.next();
+                    String msg = (String) o;
 
                     getLog().warn( msg );
                 }
@@ -1901,7 +1900,7 @@ public class RtfSink
 
         void set( int context )
         {
-            stack.addElement( Integer.valueOf( this.context ) );
+            stack.addElement( this.context );
             this.context = context;
         }
 
@@ -1909,7 +1908,7 @@ public class RtfSink
         {
             if ( !stack.isEmpty() )
             {
-                context = ( (Integer) stack.lastElement() ).intValue();
+                context = (Integer) stack.lastElement();
                 stack.removeElementAt( stack.size() - 1 );
             }
         }
@@ -2040,7 +2039,7 @@ public class RtfSink
 
         void set( int space /*twips*/ )
         {
-            stack.addElement( Integer.valueOf( this.space ) );
+            stack.addElement( this.space );
             this.space = space;
             next = space;
         }
@@ -2054,7 +2053,7 @@ public class RtfSink
         {
             if ( !stack.isEmpty() )
             {
-                space = ( (Integer) stack.lastElement() ).intValue();
+                space = (Integer) stack.lastElement();
                 stack.removeElementAt( stack.size() - 1 );
                 next = space;
             }
@@ -2101,7 +2100,7 @@ public class RtfSink
 
         void set( int indent /*twips*/ )
         {
-            stack.addElement( Integer.valueOf( this.indent ) );
+            stack.addElement( this.indent );
             this.indent = indent;
         }
 
@@ -2114,7 +2113,7 @@ public class RtfSink
         {
             if ( !stack.isEmpty() )
             {
-                indent = ( (Integer) stack.lastElement() ).intValue();
+                indent = (Integer) stack.lastElement();
                 stack.removeElementAt( stack.size() - 1 );
             }
         }
diff --git a/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/WMFWriter.java b/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/WMFWriter.java
index 43ea91c..c87d9d7 100644
--- a/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/WMFWriter.java
+++ b/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/WMFWriter.java
@@ -262,9 +262,9 @@ class WMFWriter
             write16( function, out );
             if ( parameters != null )
             {
-                for ( int i = 0; i < parameters.length; ++i )
+                for ( short parameter : parameters )
                 {
-                    write16( parameters[i], out );
+                    write16( parameter, out );
                 }
             }
         }
@@ -276,9 +276,9 @@ class WMFWriter
             print16( function, out );
             if ( parameters != null )
             {
-                for ( int i = 0; i < parameters.length; ++i )
+                for ( short parameter : parameters )
                 {
-                    print16( parameters[i], out );
+                    print16( parameter, out );
                 }
             }
         }
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiParser.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiParser.java
index 8e90cf6..82c0d71 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiParser.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiParser.java
@@ -106,7 +106,7 @@ public class TWikiParser
     public final List<Block> parse( final ByLineSource source )
         throws ParseException
     {
-        final List<Block> ret = new ArrayList<Block>();
+        final List<Block> ret = new ArrayList<>();
 
         String line;
         while ( ( line = source.getNextLine() ) != null )
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiSink.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiSink.java
index dffbcb6..c6dddf3 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiSink.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/TWikiSink.java
@@ -68,10 +68,10 @@ public class TWikiSink
     private final Stack<String> listStyles;
 
     /** Keep track of the nested bold flag. */
-    protected Stack<Boolean> boldStack = new Stack<Boolean>();
+    protected Stack<Boolean> boldStack = new Stack<>();
 
     /** Keep track of the closing tags for inline events. */
-    protected Stack<List<String>> inlineStack = new Stack<List<String>>();
+    protected Stack<List<String>> inlineStack = new Stack<>();
 
     /**
      * Constructor, initialize the Writer and the variables.
@@ -82,7 +82,7 @@ public class TWikiSink
     protected TWikiSink( Writer writer )
     {
         this.out = new PrintWriter( writer );
-        this.listStyles = new Stack<String>();
+        this.listStyles = new Stack<>();
 
         init();
     }
@@ -301,7 +301,7 @@ public class TWikiSink
     /** {@inheritDoc} */
     public void figure()
     {
-        write( String.valueOf( LESS_THAN ) + Tag.IMG.toString() + SPACE );
+        write( LESS_THAN + Tag.IMG.toString() + SPACE );
     }
 
     /** {@inheritDoc} */
@@ -346,7 +346,7 @@ public class TWikiSink
     /** {@inheritDoc} */
     public void figureGraphics( String name )
     {
-        write( Attribute.SRC.toString() + EQUAL + QUOTE + name + QUOTE + String.valueOf( SPACE ) );
+        write( Attribute.SRC.toString() + EQUAL + QUOTE + name + QUOTE + SPACE );
     }
 
     /** {@inheritDoc} */
@@ -405,7 +405,7 @@ public class TWikiSink
     /** {@inheritDoc} */
     public void inline( SinkEventAttributes attributes )
     {
-        List<String> tags = new ArrayList<String>();
+        List<String> tags = new ArrayList<>();
 
         boldStack.push( boldFlag );
 
@@ -621,7 +621,7 @@ public class TWikiSink
     public void numberedListItem()
     {
         writeEOL( true );
-        String style = (String) listStyles.peek();
+        String style = listStyles.peek();
         String indent = StringUtils.repeat( THREE_SPACES_MARKUP, levelList );
         write( indent + style + SPACE );
     }
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/AbstractFatherBlock.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/AbstractFatherBlock.java
index 09f63f4..b574b38 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/AbstractFatherBlock.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/AbstractFatherBlock.java
@@ -77,10 +77,8 @@ abstract class AbstractFatherBlock
     public final void traverse( final Sink sink )
     {
         before( sink );
-        for ( int i = 0; i < childBlocks.length; i++ )
+        for ( Block block : childBlocks )
         {
-            Block block = childBlocks[i];
-
             block.traverse( sink );
         }
         after( sink );
@@ -127,9 +125,9 @@ abstract class AbstractFatherBlock
         int result = 1;
         if ( childBlocks != null )
         {
-            for ( int i = 0; i < childBlocks.length; i++ )
+            for ( Block childBlock : childBlocks )
             {
-                result += childBlocks[i].hashCode();
+                result += childBlock.hashCode();
             }
         }
 
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/FormatedTextParser.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/FormatedTextParser.java
index 039ca2d..919605f 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/FormatedTextParser.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/FormatedTextParser.java
@@ -40,7 +40,7 @@ public class FormatedTextParser
     /**
      * map used to create blocks dependening on the text format
      */
-    private static final Map<String, FormatBlockFactory> FACTORY_MAP = new HashMap<String, FormatBlockFactory>();
+    private static final Map<String, FormatBlockFactory> FACTORY_MAP = new HashMap<>();
 
     /**
      * creates bold blocks
@@ -163,7 +163,7 @@ public class FormatedTextParser
      */
     private List<Block> parseFormat( final String line )
     {
-        final List<Block> ret = new ArrayList<Block>();
+        final List<Block> ret = new ArrayList<>();
         final int[] lhOffsets = new int[SPECIAL_CHAR.length];
         final int[] rhOffsets = new int[SPECIAL_CHAR.length];
 
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/GenericListBlockParser.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/GenericListBlockParser.java
index 9716582..c9ea1f6 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/GenericListBlockParser.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/GenericListBlockParser.java
@@ -375,7 +375,7 @@ class TreeListBuilder
      */
     private List<ListItemBlock> getListItems( final TreeComponent tc )
     {
-        final List<ListItemBlock> blocks = new ArrayList<ListItemBlock>();
+        final List<ListItemBlock> blocks = new ArrayList<>();
 
         for ( int i = 0; i < tc.getChildren().length; i++ )
         {
@@ -411,7 +411,7 @@ class TreeListBuilder
         /**
          * childrens
          */
-        private List<TreeComponent> children = new ArrayList<TreeComponent>();
+        private List<TreeComponent> children = new ArrayList<>();
 
         /**
          * node text
@@ -447,7 +447,7 @@ class TreeListBuilder
          */
         TreeComponent[] getChildren()
         {
-            return (TreeComponent[]) children.toArray( new TreeComponent[] {} );
+            return children.toArray( new TreeComponent[] {} );
         }
 
         /**
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ParagraphBlockParser.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ParagraphBlockParser.java
index 5d155fd..4c28331 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ParagraphBlockParser.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/ParagraphBlockParser.java
@@ -90,7 +90,7 @@ public class ParagraphBlockParser
         throws ParseException
     {
         StringBuilder sb = new StringBuilder();
-        List<Block> childs = new ArrayList<Block>();
+        List<Block> childs = new ArrayList<>();
 
         boolean sawText = false;
 
@@ -133,11 +133,11 @@ public class ParagraphBlockParser
                 {
                     sb.append( l );
                     // specific
-                    if ( l.indexOf( "<pre>" ) != -1 )
+                    if ( l.contains( "<pre>" ) )
                     {
                         pre = true;
                     }
-                    if ( l.indexOf( "</pre>" ) != -1 )
+                    if ( l.contains( "</pre>" ) )
                     {
                         pre = false;
                     }
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlock.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlock.java
index ce977ea..4e1af88 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlock.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlock.java
@@ -110,7 +110,7 @@ public class SectionBlock
     {
         try
         {
-            final Method m = sink.getClass().getMethod( name, new Class[] {} );
+            final Method m = sink.getClass().getMethod( name );
             m.invoke( sink, Collections.EMPTY_LIST.toArray() );
         }
         catch ( Exception e )
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlockParser.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlockParser.java
index 2ac84e2..9906772 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlockParser.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/SectionBlockParser.java
@@ -75,7 +75,7 @@ public class SectionBlockParser
         }
 
         String newLine;
-        final ArrayList<Block> blocks = new ArrayList<Block>();
+        final ArrayList<Block> blocks = new ArrayList<>();
 
         while ( ( newLine = source.getNextLine() ) != null && !accept( newLine ) )
         {
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableBlockParser.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableBlockParser.java
index b2d9667..d1aae14 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableBlockParser.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TableBlockParser.java
@@ -63,7 +63,7 @@ public class TableBlockParser
             throw new IllegalAccessError( "call accept before this ;)" );
         }
 
-        final List<Block> rows = new ArrayList<Block>();
+        final List<Block> rows = new ArrayList<>();
         String l = line;
 
         do
@@ -71,7 +71,7 @@ public class TableBlockParser
             final Matcher m = TABLE_PATTERN.matcher( l );
             if ( m.lookingAt() )
             {
-                final List<Block> cells = new ArrayList<Block>();
+                final List<Block> cells = new ArrayList<>();
 
                 /* for each cell... */
                 for ( int lh = l.indexOf( '|' ) + 1, rh; ( rh = l.indexOf( '|', lh ) ) != -1; lh = rh + 1 )
@@ -87,7 +87,7 @@ public class TableBlockParser
                         cells.add( new TableCellBlock( bs ) );
                     }
                 }
-                rows.add( new TableRowBlock( (Block[]) cells.toArray( new Block[] {} ) ) );
+                rows.add( new TableRowBlock( cells.toArray( new Block[] {} ) ) );
             }
 
         }
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TextParser.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TextParser.java
index db06697..2fc143d 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TextParser.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/TextParser.java
@@ -99,7 +99,7 @@ public class TextParser
      */
     public final List<Block> parse( final String line )
     {
-        final List<Block> ret = new ArrayList<Block>();
+        final List<Block> ret = new ArrayList<>();
 
         final Matcher linkMatcher = SPECIFICLINK_PATTERN.matcher( line );
         final Matcher wikiMatcher = WIKIWORD_PATTERN.matcher( line );
@@ -169,7 +169,7 @@ public class TextParser
         ret.addAll( parse( line.substring( 0, imageTagMatcher.start() ) ) );
         final String src = imageTagMatcher.group( 2 );
         ret.add( new ImageBlock( src ) );
-        ret.addAll( parse( line.substring( imageTagMatcher.end(), line.length() ) ) );
+        ret.addAll( parse( line.substring( imageTagMatcher.end() ) ) );
     }
 
     /**
@@ -191,7 +191,7 @@ public class TextParser
         {
             ret.add( new LinkBlock( url, new TextBlock( url ) ) );
         }
-        ret.addAll( parse( line.substring( urlMatcher.end(), line.length() ) ) );
+        ret.addAll( parse( line.substring( urlMatcher.end() ) ) );
     }
 
     /**
@@ -204,7 +204,7 @@ public class TextParser
     {
         ret.addAll( parse( line.substring( 0, anchorMatcher.start() ) ) );
         ret.add( new AnchorBlock( anchorMatcher.group( 1 ) ) );
-        ret.addAll( parse( line.substring( anchorMatcher.end(), line.length() ) ) );
+        ret.addAll( parse( line.substring( anchorMatcher.end() ) ) );
     }
 
     /**
@@ -240,7 +240,7 @@ public class TextParser
             {
                 ret.addAll( parse( line.substring( 0, forcedLinkMatcher.start() ) ) );
                 ret.add( createLink( showText, showText ) );
-                ret.addAll( parse( line.substring( forcedLinkMatcher.end(), line.length() ) ) );
+                ret.addAll( parse( line.substring( forcedLinkMatcher.end() ) ) );
             }
         }
     }
@@ -298,7 +298,7 @@ public class TextParser
         {
             ret.add( new WikiWordBlock( wikiWord, wikiWordLinkResolver ) );
         }
-        ret.addAll( parse( line.substring( wikiMatcher.end(), line.length() ) ) );
+        ret.addAll( parse( line.substring( wikiMatcher.end() ) ) );
     }
 
     /**
@@ -318,7 +318,7 @@ public class TextParser
         {
             ret.add( createLink( linkMatcher.group( 1 ), linkMatcher.group( 2 ) ) );
         }
-        ret.addAll( parse( line.substring( linkMatcher.end(), line.length() ) ) );
+        ret.addAll( parse( line.substring( linkMatcher.end() ) ) );
     }
 
     /**
@@ -331,7 +331,7 @@ public class TextParser
     private void parseXHTML( final String line, final List<Block> ret, final Matcher xhtmlMatcher )
     {
         ret.addAll( parse( line.substring( 0, xhtmlMatcher.start() ) ) );
-        if ( xhtmlMatcher.group( 1 ).indexOf( "noautolink" ) != -1 )
+        if ( xhtmlMatcher.group( 1 ).contains( "noautolink" ) )
         {
             noautolink = true;
         }
@@ -342,7 +342,7 @@ public class TextParser
 
         ret.addAll( parse( xhtmlMatcher.group( 2 ) ) );
 
-        if ( xhtmlMatcher.group( 1 ).indexOf( "noautolink" ) != -1 )
+        if ( xhtmlMatcher.group( 1 ).contains( "noautolink" ) )
         {
             noautolink = false;
         }
diff --git a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/VerbatimBlockParser.java b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/VerbatimBlockParser.java
index 52c11c9..5dc7028 100644
--- a/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/VerbatimBlockParser.java
+++ b/doxia-modules/doxia-module-twiki/src/main/java/org/apache/maven/doxia/module/twiki/parser/VerbatimBlockParser.java
@@ -61,7 +61,7 @@ public class VerbatimBlockParser
             throw new IllegalAccessError( "call accept before this ;)" );
         }
 
-        final List<Block> lines = new ArrayList<Block>();
+        final List<Block> lines = new ArrayList<>();
         Matcher matcher = VERBATIM_START_PATTERN.matcher( line );
         matcher.find();
         String l = line.substring( matcher.end() );
diff --git a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ListTest.java b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ListTest.java
index 0e25c35..b4e9c8c 100644
--- a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ListTest.java
+++ b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ListTest.java
@@ -57,9 +57,8 @@ public class ListTest
         final int numberOfChild = 4;
         assertEquals( numberOfChild, firstLevelBlocks.length );
 
-        for ( int i = 0; i < firstLevelBlocks.length; i++ )
+        for ( Block block : firstLevelBlocks )
         {
-            Block block = firstLevelBlocks[i];
             assertEquals( ListItemBlock.class, block.getClass() );
         }
 
diff --git a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ParagraphTest.java b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ParagraphTest.java
index 0c584a0..3511c14 100644
--- a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ParagraphTest.java
+++ b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/ParagraphTest.java
@@ -163,7 +163,7 @@ public class ParagraphTest
         expected =
             new Block[] { new ParagraphBlock( new Block[] { new TextBlock( "Some text" ) } ),
                 new HorizontalRuleBlock(), new ParagraphBlock( new Block[] { new TextBlock( "More text" ) } ) };
-        blocks = (Block[]) twikiParser.parse( source ).toArray( new Block[] {} );
+        blocks = twikiParser.parse( source ).toArray( new Block[] {} );
         assertTrue( Arrays.equals( expected, blocks ) );
     }
 }
diff --git a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/SectionTest.java b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/SectionTest.java
index 6849111..09a07de 100644
--- a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/SectionTest.java
+++ b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/SectionTest.java
@@ -170,7 +170,7 @@ public class SectionTest
             new Block[] { new SectionBlock( "Title", 1, new Block[] {
                 new ParagraphBlock( new Block[] { new TextBlock( "Some text" ) } ), new HorizontalRuleBlock(),
                 new ParagraphBlock( new Block[] { new TextBlock( "More text" ) } ) } ) };
-        blocks = (Block[]) twikiParser.parse( source ).toArray( new Block[] {} );
+        blocks = twikiParser.parse( source ).toArray( new Block[] {} );
         assertTrue( Arrays.equals( expected, blocks ) );
     }
 }
diff --git a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/TwikiParserTest.java b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/TwikiParserTest.java
index f3840e9..367e2c9 100644
--- a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/TwikiParserTest.java
+++ b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/TwikiParserTest.java
@@ -42,7 +42,7 @@ public class TwikiParserTest
     {
         super.setUp();
 
-        this.parser = (TWikiParser) lookup( Parser.ROLE, id );
+        this.parser = lookup( Parser.ROLE, id );
     }
 
     @Override
diff --git a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/WordsTest.java b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/WordsTest.java
index 66a3acd..a8ba000 100644
--- a/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/WordsTest.java
+++ b/doxia-modules/doxia-module-twiki/src/test/java/org/apache/maven/doxia/module/twiki/parser/WordsTest.java
@@ -48,7 +48,7 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new TextBlock( "     Some text    " ) };
-        blocks = (Block[]) textParser.parse( "     Some text    " ).toArray( TOARRAY );
+        blocks = textParser.parse( "     Some text    " ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -60,24 +60,24 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new WikiWordBlock( "WikiWord", resolver ) };
-        blocks = (Block[]) textParser.parse( "WikiWord" ).toArray( TOARRAY );
+        blocks = textParser.parse( "WikiWord" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         // this is not a wiki word
         expected = new Block[] { new TextBlock( "Wiki" ) };
-        blocks = (Block[]) textParser.parse( "Wiki" ).toArray( TOARRAY );
+        blocks = textParser.parse( "Wiki" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected = new Block[] { new TextBlock( "Web." ) };
-        blocks = (Block[]) textParser.parse( "Web." ).toArray( TOARRAY );
+        blocks = textParser.parse( "Web." ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected = new Block[] { new TextBlock( "fooWikiBar" ) };
-        blocks = (Block[]) textParser.parse( "fooWikiBar" ).toArray( TOARRAY );
+        blocks = textParser.parse( "fooWikiBar" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected = new Block[] { new WikiWordBlock( "WikiWord", resolver ), new TextBlock( "...." ) };
-        blocks = (Block[]) textParser.parse( "WikiWord...." ).toArray( TOARRAY );
+        blocks = textParser.parse( "WikiWord...." ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -89,11 +89,11 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new WikiWordBlock( "Web.WikiWord", resolver ) };
-        blocks = (Block[]) textParser.parse( "Web.WikiWord" ).toArray( TOARRAY );
+        blocks = textParser.parse( "Web.WikiWord" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected = new Block[] { new WikiWordBlock( "My1Web.WikiWord", resolver ) };
-        blocks = (Block[]) textParser.parse( "My1Web.WikiWord" ).toArray( TOARRAY );
+        blocks = textParser.parse( "My1Web.WikiWord" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -105,11 +105,11 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new WikiWordBlock( "WikiWord#anchor", resolver ) };
-        blocks = (Block[]) textParser.parse( "WikiWord#anchor" ).toArray( TOARRAY );
+        blocks = textParser.parse( "WikiWord#anchor" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected = new Block[] { new WikiWordBlock( "MyWeb.WikiWord#anchor", resolver ) };
-        blocks = (Block[]) textParser.parse( "MyWeb.WikiWord#anchor" ).toArray( TOARRAY );
+        blocks = textParser.parse( "MyWeb.WikiWord#anchor" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
     }
@@ -122,19 +122,19 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new LinkBlock( "http://reference.com", new TextBlock( "text" ) ) };
-        blocks = (Block[]) textParser.parse( "[[http://reference.com][text]]" ).toArray( TOARRAY );
+        blocks = textParser.parse( "[[http://reference.com][text]]" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected =
             new Block[] { new TextBlock( "foo" ),
                 new LinkBlock( "http://reference.com", new TextBlock( "text" ) ), new TextBlock( "bar" ) };
-        blocks = (Block[]) textParser.parse( "foo[[http://reference.com][text]]bar" ).toArray( TOARRAY );
+        blocks = textParser.parse( "foo[[http://reference.com][text]]bar" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected =
             new Block[] { new TextBlock( " foo " ),
                 new LinkBlock( "http://reference.com", new TextBlock( "text" ) ), new TextBlock( " bar " ) };
-        blocks = (Block[]) textParser.parse( " foo [[http://reference.com][text]] bar " ).toArray( TOARRAY );
+        blocks = textParser.parse( " foo [[http://reference.com][text]] bar " ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected =
@@ -143,11 +143,10 @@ public class WordsTest
                                new TextBlock( "Apache License, version 2.0" ) ),
                 new TextBlock( ". You can download it " ),
                 new WikiWordBlock( "DoxiaDownload", new TextBlock( "here" ), resolver ) };
-        blocks =
-            (Block[]) textParser.parse(
-                                        "[[http://www.apache.org/licenses/LICENSE-2.0]"
-                                            + "[Apache License, version 2.0]]. You can download it "
-                                            + "[[DoxiaDownload][here]]" ).toArray( TOARRAY );
+        blocks = textParser.parse(
+                                    "[[http://www.apache.org/licenses/LICENSE-2.0]"
+                                        + "[Apache License, version 2.0]]. You can download it "
+                                        + "[[DoxiaDownload][here]]" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
     }
@@ -160,19 +159,19 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new WikiWordBlock( "Reference", new TextBlock( "text" ), resolver ) };
-        blocks = (Block[]) textParser.parse( "[[reference][text]]" ).toArray( TOARRAY );
+        blocks = textParser.parse( "[[reference][text]]" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected =
             new Block[] { new TextBlock( "foo" ),
                 new WikiWordBlock( "ReferenceLink", new TextBlock( "text" ), resolver ), new TextBlock( "bar" ) };
-        blocks = (Block[]) textParser.parse( "foo[[referenceLink][text]]bar" ).toArray( TOARRAY );
+        blocks = textParser.parse( "foo[[referenceLink][text]]bar" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected =
             new Block[] { new TextBlock( " foo " ),
                 new WikiWordBlock( "ReferenceLink", new TextBlock( "text" ), resolver ), new TextBlock( " bar " ) };
-        blocks = (Block[]) textParser.parse( " foo [[reference link][text]] bar " ).toArray( TOARRAY );
+        blocks = textParser.parse( " foo [[reference link][text]] bar " ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -184,7 +183,7 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new TextBlock( "[[reference][text]]" ) };
-        blocks = (Block[]) textParser.parse( "![[reference][text]]" ).toArray( TOARRAY );
+        blocks = textParser.parse( "![[reference][text]]" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -196,11 +195,11 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new TextBlock( " " ), new TextBlock( "WikiWord" ), new TextBlock( " " ) };
-        blocks = (Block[]) textParser.parse( " !WikiWord " ).toArray( TOARRAY );
+        blocks = textParser.parse( " !WikiWord " ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected = new Block[] { new TextBlock( " !!WikiWord " ) };
-        blocks = (Block[]) textParser.parse( " !!WikiWord " ).toArray( TOARRAY );
+        blocks = textParser.parse( " !!WikiWord " ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -212,24 +211,24 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new WikiWordBlock( "WikiSyntax", new TextBlock( "wiki syntax" ), resolver ) };
-        blocks = (Block[]) textParser.parse( "[[wiki syntax]]" ).toArray( TOARRAY );
+        blocks = textParser.parse( "[[wiki syntax]]" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected = new Block[] { new TextBlock( "[[wiki syntax]]" ) };
-        blocks = (Block[]) textParser.parse( "![[wiki syntax]]" ).toArray( TOARRAY );
+        blocks = textParser.parse( "![[wiki syntax]]" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected =
             new Block[] { new TextBlock( "foo" ),
                 new WikiWordBlock( "WikiSyntax", new TextBlock( "wiki syntax" ), resolver ),
                 new TextBlock( "bar" ) };
-        blocks = (Block[]) textParser.parse( "foo[[wiki syntax]]bar" ).toArray( TOARRAY );
+        blocks = textParser.parse( "foo[[wiki syntax]]bar" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected =
             new Block[] { new TextBlock( "foo" ),
                 new LinkBlock( "http://twiki.com", new TextBlock( "http://twiki.com" ) ), new TextBlock( "bar" ) };
-        blocks = (Block[]) textParser.parse( "foo[[http://twiki.com]]bar" ).toArray( TOARRAY );
+        blocks = textParser.parse( "foo[[http://twiki.com]]bar" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -241,7 +240,7 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new LinkBlock( "mailto:a@z.com", new TextBlock( "Mail" ) ) };
-        blocks = (Block[]) textParser.parse( "[[mailto:a@z.com Mail]]" ).toArray( TOARRAY );
+        blocks = textParser.parse( "[[mailto:a@z.com Mail]]" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -253,17 +252,17 @@ public class WordsTest
         Block[] blocks, expected;
 
         expected = new Block[] { new TextBlock( "mary has #anchor a little lamb" ) };
-        blocks = (Block[]) textParser.parse( "mary has #anchor a little lamb" ).toArray( TOARRAY );
+        blocks = textParser.parse( "mary has #anchor a little lamb" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected =
             new Block[] { new TextBlock( "mary has " ), new AnchorBlock( "AnchorName" ),
                 new TextBlock( " a little lamb" ) };
-        blocks = (Block[]) textParser.parse( "mary has #AnchorName a little lamb" ).toArray( TOARRAY );
+        blocks = textParser.parse( "mary has #AnchorName a little lamb" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
 
         expected = new Block[] { new TextBlock( "mary has #AnchorName1233 a little lamb" ) };
-        blocks = (Block[]) textParser.parse( "mary has #AnchorName1233 a little lamb" ).toArray( TOARRAY );
+        blocks = textParser.parse( "mary has #AnchorName1233 a little lamb" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -278,7 +277,7 @@ public class WordsTest
             new Block[] { new TextBlock( "Go to " ),
                 new LinkBlock( "http://twiki.com", new TextBlock( "http://twiki.com" ) ),
                 new TextBlock( " and ..." ) };
-        blocks = (Block[]) textParser.parse( "Go to http://twiki.com and ..." ).toArray( TOARRAY );
+        blocks = textParser.parse( "Go to http://twiki.com and ..." ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -289,7 +288,7 @@ public class WordsTest
 
         expected =
             new Block[] { new LinkBlock( "http://twiki.org", new ImageBlock( "http://twiki.org/logo.png" ) ) };
-        blocks = (Block[]) textParser.parse( "[[http://twiki.org][http://twiki.org/logo.png]]" ).toArray( TOARRAY );
+        blocks = textParser.parse( "[[http://twiki.org][http://twiki.org/logo.png]]" ).toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -301,9 +300,8 @@ public class WordsTest
         expected =
             new Block[] { new TextBlock( "Go to " ), new ImageBlock( "http://twiki.com/image.png" ),
                 new TextBlock( " thisisnotanimage.png and ..." ) };
-        blocks =
-            (Block[]) textParser.parse( "Go to http://twiki.com/image.png " + "thisisnotanimage.png and ..." )
-                                .toArray( TOARRAY );
+        blocks = textParser.parse( "Go to http://twiki.com/image.png " + "thisisnotanimage.png and ..." )
+                            .toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 
@@ -317,11 +315,10 @@ public class WordsTest
         expected =
             new Block[] { new TextBlock( "My summer house: " ), new ImageBlock( "images/summerhouse.png" ),
                 new TextBlock( " isn't it great?!" ) };
-        blocks =
-            (Block[]) textParser
-                                .parse(
-                                        "My summer house: <img class=\"some_class\" src=\"images/summerhouse.png\"/> isn't it great?!" )
-                                .toArray( TOARRAY );
+        blocks = textParser
+                            .parse(
+                                    "My summer house: <img class=\"some_class\" src=\"images/summerhouse.png\"/> isn't it great?!" )
+                            .toArray( TOARRAY );
         assertArrayEquals( expected, blocks );
     }
 }
diff --git a/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java b/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
index 32f062f..a5140a3 100644
--- a/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
+++ b/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
@@ -73,7 +73,7 @@ public class XdocParser
     /**
      * The macro parameters.
      */
-    private Map<String, Object> macroParameters = new HashMap<String, Object>();
+    private Map<String, Object> macroParameters = new HashMap<>();
 
     /**
      * Indicates that we're inside &lt;properties&gt; or &lt;head&gt;.
@@ -410,7 +410,7 @@ public class XdocParser
 
             if ( macroParameters == null )
             {
-                macroParameters = new HashMap<String, Object>();
+                macroParameters = new HashMap<>();
             }
 
             if ( StringUtils.isEmpty( macroName ) )
@@ -441,7 +441,7 @@ public class XdocParser
         }
         else
         {
-            sink.unknown( "meta", new Object[]{ Integer.valueOf( TAG_TYPE_SIMPLE ) }, attribs );
+            sink.unknown( "meta", new Object[]{ TAG_TYPE_SIMPLE }, attribs );
         }
     }
 
diff --git a/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java b/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
index 0ab2722..b6a9d93 100644
--- a/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
+++ b/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocSink.java
@@ -281,17 +281,17 @@ public class XdocSink
     {
         if ( depth == SECTION_LEVEL_1 )
         {
-            write( String.valueOf( LESS_THAN ) + SECTION_TAG.toString()
+            write( LESS_THAN + SECTION_TAG.toString()
                     + SinkUtils.getAttributeString(
                         SinkUtils.filterAttributes( attributes, SinkUtils.SINK_BASE_ATTRIBUTES ) )
-                    + String.valueOf( SPACE ) + Attribute.NAME + String.valueOf( EQUAL ) + String.valueOf( QUOTE ) );
+                    + SPACE + Attribute.NAME + EQUAL + QUOTE );
         }
         else if ( depth == SECTION_LEVEL_2 )
         {
-            write( String.valueOf( LESS_THAN ) + SUBSECTION_TAG.toString()
+            write( LESS_THAN + SUBSECTION_TAG.toString()
                     + SinkUtils.getAttributeString(
                         SinkUtils.filterAttributes( attributes, SinkUtils.SINK_BASE_ATTRIBUTES  ) )
-                    + String.valueOf( SPACE ) + Attribute.NAME + String.valueOf( EQUAL ) + String.valueOf( QUOTE ) );
+                    + SPACE + Attribute.NAME + EQUAL + QUOTE );
         }
     }
 
@@ -353,7 +353,7 @@ public class XdocSink
     {
         if ( depth == SECTION_LEVEL_1 || depth == SECTION_LEVEL_2 )
         {
-            write( String.valueOf( QUOTE ) + String.valueOf( GREATER_THAN ) );
+            write( String.valueOf( QUOTE ) + GREATER_THAN );
         }
         else if ( depth == SECTION_LEVEL_3 )
         {
@@ -395,8 +395,7 @@ public class XdocSink
 
         if ( atts.isDefined( SinkEventAttributes.DECORATION ) )
         {
-            boxed = "boxed".equals(
-                (String) atts.getAttribute( SinkEventAttributes.DECORATION ) );
+            boxed = "boxed".equals( atts.getAttribute( SinkEventAttributes.DECORATION ) );
         }
 
         boxedFlag = boxed;
diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocIdentityTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocIdentityTest.java
index 25278f0..b216b7a 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocIdentityTest.java
+++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocIdentityTest.java
@@ -74,8 +74,8 @@ public class XdocIdentityTest
             expected.substring( 0, iStartCaption ).lastIndexOf( "begin:tableRows" ) + "begin:tableRows".length();
 
         StringBuilder text = new StringBuilder();
-        text.append( expected.substring( 0, iStartTableRows ) );
-        text.append( EOL + EOL + EOL );
+        text.append( expected, 0, iStartTableRows );
+        text.append( EOL ).append( EOL ).append( EOL );
         text.append( captionTag.subSequence( 0, captionTag.indexOf( "end:tableCaption" )
             + "end:tableCaption".length() ) );
         text.append( expected.substring( iStartTableRows ) );
diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
index a369033..c31367c 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
+++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocParserTest.java
@@ -54,7 +54,7 @@ public class XdocParserTest
     {
         super.setUp();
 
-        parser = (XdocParser) lookup( Parser.ROLE, "xdoc" );
+        parser = lookup( Parser.ROLE, "xdoc" );
 
         // AbstractXmlParser.CachedFileEntityResolver downloads DTD/XSD files in ${java.io.tmpdir}
         // Be sure to delete them
@@ -133,7 +133,7 @@ public class XdocParserTest
             IOUtil.close( reader );
         }
 
-        assertTrue( content.indexOf( "&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;" ) != -1 );
+        assertTrue( content.contains( "&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;" ) );
     }
 
     /** @throws Exception  */
@@ -173,8 +173,8 @@ public class XdocParserTest
         }
 
         // No section, only subsection 1 and 2
-        assertTrue( content.indexOf( "<a href=\"#Section_11\">Section 11</a>" ) != -1 );
-        assertTrue( content.indexOf( "<a href=\"#Section_1211\">Section 1211</a>" ) == -1 );
+        assertTrue( content.contains( "<a href=\"#Section_11\">Section 11</a>" ) );
+        assertTrue( !content.contains( "<a href=\"#Section_1211\">Section 1211</a>" ) );
     }
 
     private Iterator<SinkEventElement> parseText( String text )
@@ -276,7 +276,7 @@ public class XdocParserTest
 
         next = it.next();
         assertEquals( "sectionTitle1", next.getName() );
-        assertNull( (SinkEventAttributeSet) next.getArgs()[0] );
+        assertNull( next.getArgs()[0] );
 
         assertEquals( it, "text", "sectionTitle1_", "section1_" );
     }
diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
index ae2fba5..f465831 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
+++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocSinkTest.java
@@ -355,7 +355,7 @@ public class XdocSinkTest
             sink.verbatim_();
             sink.verbatim( SinkEventAttributeSet.BOXED );
             sink.verbatim_();
-            sink.verbatim( new SinkEventAttributeSet( new String[] {SinkEventAttributeSet.WIDTH, "20%"} ) );
+            sink.verbatim( new SinkEventAttributeSet( SinkEventAttributeSet.WIDTH, "20%" ) );
             sink.verbatim_();
         }
         finally
diff --git a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocValidatorTest.java b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocValidatorTest.java
index 8af1e6a..4a7ea38 100644
--- a/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocValidatorTest.java
+++ b/doxia-modules/doxia-module-xdoc/src/test/java/org/apache/maven/doxia/module/xdoc/XdocValidatorTest.java
@@ -56,7 +56,7 @@ public class XdocValidatorTest
             String root = matcher.group( 1 );
             String value = matcher.group( 2 );
 
-            if ( value.indexOf( XDOC_XSD.getName() ) == -1 )
+            if ( !value.contains( XDOC_XSD.getName() ) )
             {
                 String faqs =
                     "<" + root + " xmlns=\"http://maven.apache.org/XDOC/2.0\""
diff --git a/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java b/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java
index fe1a814..3ea1a4a 100644
--- a/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java
+++ b/doxia-modules/doxia-module-xhtml/src/main/java/org/apache/maven/doxia/module/xhtml/XhtmlParser.java
@@ -108,7 +108,7 @@ public class XhtmlParser
             }
             else
             {
-                sink.unknown( "meta", new Object[] { Integer.valueOf( TAG_TYPE_SIMPLE ) }, attribs );
+                sink.unknown( "meta", new Object[] { TAG_TYPE_SIMPLE }, attribs );
             }
         }
         /*
@@ -247,7 +247,7 @@ public class XhtmlParser
         String[] params = StringUtils.split( s, "|" );
         String macroName = params[0];
 
-        Map<String, Object> parameters = new HashMap<String, Object>();
+        Map<String, Object> parameters = new HashMap<>();
         for ( int i = 1; i < params.length; i++ )
         {
             String[] param = StringUtils.split( params[i], "=" );
diff --git a/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlIdentityTest.java b/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlIdentityTest.java
index d4969d9..f7a28b9 100644
--- a/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlIdentityTest.java
+++ b/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlIdentityTest.java
@@ -74,8 +74,8 @@ public class XhtmlIdentityTest
             expected.substring( 0, iStartCaption ).lastIndexOf( "begin:tableRows" ) + "begin:tableRows".length();
 
         StringBuilder text = new StringBuilder();
-        text.append( expected.substring( 0, iStartTableRows ) );
-        text.append( EOL + EOL + EOL );
+        text.append( expected, 0, iStartTableRows );
+        text.append( EOL ).append( EOL ).append( EOL );
         text.append( captionTag.subSequence( 0, captionTag.indexOf( "end:tableCaption" )
             + "end:tableCaption".length() ) );
         text.append( expected.substring( iStartTableRows ) );
diff --git a/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java b/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
index 6c836e7..5ef7f9e 100644
--- a/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
+++ b/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlParserTest.java
@@ -44,7 +44,7 @@ public class XhtmlParserTest
     {
         super.setUp();
 
-        parser = (XhtmlParser) lookup( Parser.ROLE, "xhtml" );
+        parser = lookup( Parser.ROLE, "xhtml" );
 
         // AbstractXmlParser.CachedFileEntityResolver downloads DTD/XSD files in ${java.io.tmpdir}
         // Be sure to delete them
diff --git a/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java b/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
index 1bb7507..cc96103 100644
--- a/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
+++ b/doxia-modules/doxia-module-xhtml/src/test/java/org/apache/maven/doxia/module/xhtml/XhtmlSinkTest.java
@@ -84,10 +84,10 @@ public class XhtmlSinkTest
         }
 
         String actual = writer.toString();
-        assertTrue( actual.indexOf( "<a class=\"externalLink\" href=\"http:/www.xdoc.com\"></a>" ) != -1 );
-        assertTrue( actual.indexOf( "<a href=\"./index.html#anchor\"></a>" ) != -1 );
-        assertTrue( actual.indexOf( "<a href=\"../index.html#anchor\"></a>" ) != -1 );
-        assertTrue( actual.indexOf( "<a href=\"index.html\"></a>" ) != -1 );
+        assertTrue( actual.contains( "<a class=\"externalLink\" href=\"http:/www.xdoc.com\"></a>" ) );
+        assertTrue( actual.contains( "<a href=\"./index.html#anchor\"></a>" ) );
+        assertTrue( actual.contains( "<a href=\"../index.html#anchor\"></a>" ) );
+        assertTrue( actual.contains( "<a href=\"index.html\"></a>" ) );
     }
 
     /** {@inheritDoc} */
@@ -432,7 +432,7 @@ public class XhtmlSinkTest
             sink.author_();
             SinkEventAttributeSet atts = new SinkEventAttributeSet( 1 );
             atts.addAttribute( "href", "http://maven.apache.org/" );
-            sink.unknown( "base", new Object[] {new Integer( HtmlMarkup.TAG_TYPE_SIMPLE )}, atts );
+            sink.unknown( "base", new Object[] { HtmlMarkup.TAG_TYPE_SIMPLE }, atts );
             sink.head_();
         }
         finally
@@ -444,7 +444,7 @@ public class XhtmlSinkTest
             "<head>\n<title>Title</title><!--A comment--><meta name=\"author\" content=\"&#x123;&amp;\" />"
                 + "<base href=\"http://maven.apache.org/\" /></head>";
         String actual = writer.toString();
-        assertTrue( actual, actual.indexOf( expected ) != -1 );
+        assertTrue( actual, actual.contains( expected ) );
     }
 
     /** {@inheritDoc} */
diff --git a/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Parser.java b/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Parser.java
index fac80bd..1f4f5c7 100644
--- a/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Parser.java
+++ b/doxia-modules/doxia-module-xhtml5/src/main/java/org/apache/maven/doxia/module/xhtml5/Xhtml5Parser.java
@@ -109,7 +109,7 @@ public class Xhtml5Parser
             }
             else
             {
-                sink.unknown( "meta", new Object[] { Integer.valueOf( TAG_TYPE_SIMPLE ) }, attribs );
+                sink.unknown( "meta", new Object[] { TAG_TYPE_SIMPLE }, attribs );
             }
         }
         /*
@@ -248,7 +248,7 @@ public class Xhtml5Parser
         String[] params = StringUtils.split( s, "|" );
         String macroName = params[0];
 
-        Map<String, Object> parameters = new HashMap<String, Object>();
+        Map<String, Object> parameters = new HashMap<>();
         for ( int i = 1; i < params.length; i++ )
         {
             String[] param = StringUtils.split( params[i], "=" );
diff --git a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5IdentityTest.java b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5IdentityTest.java
index 0cf827e..9ea44c9 100644
--- a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5IdentityTest.java
+++ b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5IdentityTest.java
@@ -76,8 +76,8 @@ public class Xhtml5IdentityTest
             expected.substring( 0, iStartCaption ).lastIndexOf( "begin:tableRows" ) + "begin:tableRows".length();
 
         StringBuilder text = new StringBuilder();
-        text.append( expected.substring( 0, iStartTableRows ) );
-        text.append( EOL + EOL + EOL );
+        text.append( expected, 0, iStartTableRows );
+        text.append( EOL ).append( EOL ).append( EOL );
         text.append( captionTag.subSequence( 0, captionTag.indexOf( "end:tableCaption" )
             + "end:tableCaption".length() ) );
         text.append( expected.substring( iStartTableRows ) );
diff --git a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5ParserTest.java b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5ParserTest.java
index fa4c836..20720c0 100644
--- a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5ParserTest.java
+++ b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5ParserTest.java
@@ -41,7 +41,7 @@ public class Xhtml5ParserTest
     {
         super.setUp();
 
-        parser = (Xhtml5Parser) lookup( Parser.ROLE, Xhtml5Parser.ROLE_HINT );
+        parser = lookup( Parser.ROLE, Xhtml5Parser.ROLE_HINT );
 
         // AbstractXmlParser.CachedFileEntityResolver downloads DTD/XSD files in ${java.io.tmpdir}
         // Be sure to delete them
diff --git a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java
index 133d7aa..54ce04a 100644
--- a/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java
+++ b/doxia-modules/doxia-module-xhtml5/src/test/java/org/apache/maven/doxia/module/xhtml5/Xhtml5SinkTest.java
@@ -80,10 +80,10 @@ public class Xhtml5SinkTest
         }
 
         String actual = writer.toString();
-        assertTrue( actual.indexOf( "<a class=\"externalLink\" href=\"http:/www.xdoc.com\"></a>" ) != -1 );
-        assertTrue( actual.indexOf( "<a href=\"./index.html#anchor\"></a>" ) != -1 );
-        assertTrue( actual.indexOf( "<a href=\"../index.html#anchor\"></a>" ) != -1 );
-        assertTrue( actual.indexOf( "<a href=\"index.html\"></a>" ) != -1 );
+        assertTrue( actual.contains( "<a class=\"externalLink\" href=\"http:/www.xdoc.com\"></a>" ) );
+        assertTrue( actual.contains( "<a href=\"./index.html#anchor\"></a>" ) );
+        assertTrue( actual.contains( "<a href=\"../index.html#anchor\"></a>" ) );
+        assertTrue( actual.contains( "<a href=\"index.html\"></a>" ) );
     }
 
     /** {@inheritDoc} */
@@ -426,7 +426,7 @@ public class Xhtml5SinkTest
             sink.author_();
             SinkEventAttributeSet atts = new SinkEventAttributeSet( 1 );
             atts.addAttribute( "href", "http://maven.apache.org/" );
-            sink.unknown( "base", new Object[] {new Integer( HtmlMarkup.TAG_TYPE_SIMPLE )}, atts );
+            sink.unknown( "base", new Object[] { HtmlMarkup.TAG_TYPE_SIMPLE }, atts );
             sink.head_();
         }
         finally
@@ -438,7 +438,7 @@ public class Xhtml5SinkTest
             "<head>\n<title>Title</title><!--A comment--><meta name=\"author\" content=\"&#x123;&amp;\" />"
                 + "<base href=\"http://maven.apache.org/\" /></head>";
         String actual = writer.toString();
-        assertTrue( actual, actual.indexOf( expected ) != -1 );
+        assertTrue( actual, actual.contains( expected ) );
     }
 
     /** {@inheritDoc} */