You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by ol...@apache.org on 2013/01/25 00:28:23 UTC
svn commit: r1438263 - in /maven/doxia/doxia/trunk:
doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/
doxia-core/src/main/java/org/apache/maven/doxia/parser/
doxia-core/src/main/java/org/apache/maven/doxia/sink/
doxia-modules/doxia-module-...
Author: olamy
Date: Thu Jan 24 23:28:22 2013
New Revision: 1438263
URL: http://svn.apache.org/viewvc?rev=1438263&view=rev
Log:
use Integer.valueOf rather than new Integer
Modified:
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java?rev=1438263&r1=1438262&r2=1438263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/macro/snippet/SnippetMacro.java Thu Jan 24 23:28:22 2013
@@ -312,7 +312,7 @@ public class SnippetMacro
{
cache.put( globalSnippetId( url, id ), content );
- timeCached.put( globalSnippetId( url, id ), new Long( System.currentTimeMillis() ) );
+ timeCached.put( globalSnippetId( url, id ), Long.valueOf( System.currentTimeMillis() ) );
}
/**
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java?rev=1438263&r1=1438262&r2=1438263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/parser/XhtmlBaseParser.java Thu Jan 24 23:28:22 2013
@@ -786,7 +786,7 @@ public class XhtmlBaseParser
if ( isScriptBlock() )
{
- sink.unknown( CDATA, new Object[] {new Integer( CDATA_TYPE ), text}, null );
+ sink.unknown( CDATA, new Object[] { Integer.valueOf( CDATA_TYPE ), text}, null );
}
else
{
Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java?rev=1438263&r1=1438262&r2=1438263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java Thu Jan 24 23:28:22 2013
@@ -1294,7 +1294,7 @@ public class XhtmlBaseSink
writeStartTag( HtmlMarkup.TABLE, att );
- this.cellCountStack.addLast( new Integer( 0 ) );
+ this.cellCountStack.addLast( Integer.valueOf( 0 ) );
}
/** {@inheritDoc} */
@@ -1361,7 +1361,7 @@ public class XhtmlBaseSink
if ( !this.cellCountStack.isEmpty() )
{
this.cellCountStack.removeLast();
- this.cellCountStack.addLast( new Integer( 0 ) );
+ this.cellCountStack.addLast( Integer.valueOf( 0 ) );
}
}
@@ -1475,7 +1475,7 @@ public class XhtmlBaseSink
&& !this.cellCountStack.isEmpty() )
{
int cellCount = Integer.parseInt( this.cellCountStack.removeLast().toString() );
- this.cellCountStack.addLast( new Integer( ++cellCount ) );
+ this.cellCountStack.addLast( Integer.valueOf( ++cellCount ) );
}
}
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java?rev=1438263&r1=1438262&r2=1438263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-fo/src/main/java/org/apache/maven/doxia/module/fo/FoSink.java Thu Jan 24 23:28:22 2013
@@ -972,7 +972,7 @@ public class FoSink
this.tableGridStack.addLast( Boolean.valueOf( grid ) );
this.cellJustifStack.addLast( justification );
this.isCellJustifStack.addLast( Boolean.valueOf( true ) );
- this.cellCountStack.addLast( new Integer( 0 ) );
+ this.cellCountStack.addLast( Integer.valueOf( 0 ) );
writeEOL();
writeStartTag( TABLE_BODY_TAG );
}
@@ -993,7 +993,7 @@ public class FoSink
// TODO spacer rows
writeStartTag( TABLE_ROW_TAG, "table.body.row" );
this.cellCountStack.removeLast();
- this.cellCountStack.addLast( new Integer( 0 ) );
+ this.cellCountStack.addLast( Integer.valueOf( 0 ) );
}
/** {@inheritDoc} */
@@ -1123,7 +1123,7 @@ public class FoSink
if ( this.isCellJustifStack.getLast().equals( Boolean.TRUE ) )
{
int cellCount = Integer.parseInt( this.cellCountStack.removeLast().toString() );
- this.cellCountStack.addLast( new Integer( ++cellCount ) );
+ this.cellCountStack.addLast( Integer.valueOf( ++cellCount ) );
}
}
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java?rev=1438263&r1=1438262&r2=1438263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-itext/src/main/java/org/apache/maven/doxia/module/itext/SinkActionContext.java Thu Jan 24 23:28:22 2013
@@ -154,6 +154,6 @@ public class SinkActionContext
{
//currentAction = action;
- stack.push( new Integer( action ) );
+ stack.push( Integer.valueOf( action ) );
}
}
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java?rev=1438263&r1=1438262&r2=1438263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-rtf/src/main/java/org/apache/maven/doxia/module/rtf/RtfSink.java Thu Jan 24 23:28:22 2013
@@ -697,7 +697,7 @@ public class RtfSink
/** {@inheritDoc} */
public void numberedList( int numbering )
{
- this.numbering.addElement( new Integer( numbering ) );
+ this.numbering.addElement( Integer.valueOf( numbering ) );
itemNumber.addElement( new Counter( 0 ) );
indentation.add( LIST_INDENT );
@@ -1848,7 +1848,7 @@ public class RtfSink
void set( int context )
{
- stack.addElement( new Integer( this.context ) );
+ stack.addElement( Integer.valueOf( this.context ) );
this.context = context;
}
@@ -1987,7 +1987,7 @@ public class RtfSink
void set( int space /*twips*/ )
{
- stack.addElement( new Integer( this.space ) );
+ stack.addElement( Integer.valueOf( this.space ) );
this.space = space;
next = space;
}
@@ -2048,7 +2048,7 @@ public class RtfSink
void set( int indent /*twips*/ )
{
- stack.addElement( new Integer( this.indent ) );
+ stack.addElement( Integer.valueOf( this.indent ) );
this.indent = indent;
}
Modified: maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java?rev=1438263&r1=1438262&r2=1438263&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java (original)
+++ maven/doxia/doxia/trunk/doxia-modules/doxia-module-xdoc/src/main/java/org/apache/maven/doxia/module/xdoc/XdocParser.java Thu Jan 24 23:28:22 2013
@@ -51,30 +51,44 @@ import org.codehaus.plexus.util.xml.pull
* @version $Id$
* @since 1.0
*/
-@Component( role = Parser.class, hint = "xdoc" )
+@Component(role = Parser.class, hint = "xdoc")
public class XdocParser
extends XhtmlBaseParser
implements XdocMarkup
{
- /** The source content of the input reader. Used to pass into macros. */
+ /**
+ * The source content of the input reader. Used to pass into macros.
+ */
private String sourceContent;
- /** Empty elements don't write a closing tag. */
+ /**
+ * Empty elements don't write a closing tag.
+ */
private boolean isEmptyElement;
- /** A macro name. */
+ /**
+ * A macro name.
+ */
private String macroName;
- /** The macro parameters. */
+ /**
+ * The macro parameters.
+ */
private Map<String, Object> macroParameters = new HashMap<String, Object>();
- /** Indicates that we're inside <properties> or <head>.*/
+ /**
+ * Indicates that we're inside <properties> or <head>.
+ */
private boolean inHead;
- /** Indicates that <title> was called from <properties> or <head>.*/
+ /**
+ * Indicates that <title> was called from <properties> or <head>.
+ */
private boolean hasTitle;
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
public void parse( Reader source, Sink sink )
throws ParseException
{
@@ -114,7 +128,9 @@ public class XdocParser
}
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
protected void handleStartTag( XmlPullParser parser, Sink sink )
throws XmlPullParserException, MacroExecutionException
{
@@ -229,8 +245,7 @@ public class XdocParser
if ( getLog().isDebugEnabled() )
{
- String position = "[" + parser.getLineNumber() + ":"
- + parser.getColumnNumber() + "]";
+ String position = "[" + parser.getLineNumber() + ":" + parser.getColumnNumber() + "]";
String tag = "<" + parser.getName() + ">";
getLog().debug( "Unrecognized xdoc tag: " + tag + " at " + position );
@@ -238,7 +253,9 @@ public class XdocParser
}
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
protected void handleEndTag( XmlPullParser parser, Sink sink )
throws XmlPullParserException, MacroExecutionException
{
@@ -315,7 +332,9 @@ public class XdocParser
isEmptyElement = false;
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
protected void consecutiveSections( int newLevel, Sink sink )
{
closeOpenSections( newLevel, sink );
@@ -324,7 +343,9 @@ public class XdocParser
setSectionLevel( newLevel );
}
- /** {@inheritDoc} */
+ /**
+ * {@inheritDoc}
+ */
protected void init()
{
super.init();
@@ -365,7 +386,7 @@ public class XdocParser
}
private void handleMacroEnd( Sink sink )
- throws MacroExecutionException
+ throws MacroExecutionException
{
if ( !isSecondParsing() )
{
@@ -382,7 +403,8 @@ public class XdocParser
try
{
executeMacro( macroName, request, sink );
- } catch ( MacroNotFoundException me )
+ }
+ catch ( MacroNotFoundException me )
{
throw new MacroExecutionException( "Macro not found: " + macroName, me );
}
@@ -395,7 +417,7 @@ public class XdocParser
}
private void handleMacroStart( XmlPullParser parser )
- throws MacroExecutionException
+ throws MacroExecutionException
{
if ( !isSecondParsing() )
{
@@ -408,8 +430,9 @@ public class XdocParser
if ( StringUtils.isEmpty( macroName ) )
{
- throw new MacroExecutionException( "The '" + Attribute.NAME.toString()
- + "' attribute for the '" + MACRO_TAG.toString() + "' tag is required." );
+ throw new MacroExecutionException(
+ "The '" + Attribute.NAME.toString() + "' attribute for the '" + MACRO_TAG.toString()
+ + "' tag is required." );
}
}
}
@@ -433,26 +456,26 @@ public class XdocParser
}
else
{
- sink.unknown( "meta", new Object[] {new Integer( TAG_TYPE_SIMPLE )}, attribs );
+ sink.unknown( "meta", new Object[]{ Integer.valueOf( TAG_TYPE_SIMPLE ) }, attribs );
}
}
private void handleParamStart( XmlPullParser parser, Sink sink )
- throws MacroExecutionException
+ throws MacroExecutionException
{
if ( !isSecondParsing() )
{
if ( StringUtils.isNotEmpty( macroName ) )
{
String paramName = parser.getAttributeValue( null, Attribute.NAME.toString() );
- String paramValue = parser.getAttributeValue( null,
- Attribute.VALUE.toString() );
+ String paramValue = parser.getAttributeValue( null, Attribute.VALUE.toString() );
if ( StringUtils.isEmpty( paramName ) || StringUtils.isEmpty( paramValue ) )
{
- throw new MacroExecutionException( "'" + Attribute.NAME.toString()
- + "' and '" + Attribute.VALUE.toString() + "' attributes for the '" + PARAM.toString()
- + "' tag are required inside the '" + MACRO_TAG.toString() + "' tag." );
+ throw new MacroExecutionException(
+ "'" + Attribute.NAME.toString() + "' and '" + Attribute.VALUE.toString()
+ + "' attributes for the '" + PARAM.toString() + "' tag are required inside the '"
+ + MACRO_TAG.toString() + "' tag." );
}
macroParameters.put( paramName, paramValue );