maven-doxia-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r599188 - in /maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink: AbstractXmlSink.java XhtmlBaseSink.java
Date Wed, 28 Nov 2007 23:09:32 GMT
Author: hboutemy
Date: Wed Nov 28 15:09:31 2007
New Revision: 599188

URL: http://svn.apache.org/viewvc?rev=599188&view=rev
Log:
simplified code

Modified:
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java
    maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/XhtmlBaseSink.java

Modified: maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java
URL: http://svn.apache.org/viewvc/maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java?rev=599188&r1=599187&r2=599188&view=diff
==============================================================================
--- maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java
(original)
+++ maven/doxia/doxia/trunk/doxia-core/src/main/java/org/apache/maven/doxia/sink/AbstractXmlSink.java
Wed Nov 28 15:09:31 2007
@@ -83,8 +83,8 @@
                 // AttributeSets are ignored
                 if ( !(value instanceof AttributeSet) )
                 {
-                    sb.append( String.valueOf( SPACE ) ).append( key.toString() ).append(
String.valueOf( EQUAL ) )
-                        .append( String.valueOf( QUOTE ) ).append( value.toString() ).append(
String.valueOf( QUOTE ) );
+                    sb.append( SPACE ).append( key.toString() ).append( EQUAL )
+                        .append( QUOTE ).append( value.toString() ).append( QUOTE );
                 }
             }
         }
@@ -139,11 +139,11 @@
         }
 
         StringBuffer sb = new StringBuffer();
-        sb.append( String.valueOf( LESS_THAN ) );
+        sb.append( LESS_THAN );
 
         if ( nameSpace != null )
         {
-            sb.append( nameSpace ).append( ":" );
+            sb.append( nameSpace ).append( ':' );
         }
 
         sb.append( t.toString() );
@@ -152,10 +152,10 @@
 
         if ( isSimpleTag )
         {
-            sb.append( String.valueOf( SPACE ) ).append( String.valueOf( SLASH ) );
+            sb.append( SPACE ).append( SLASH );
         }
 
-        sb.append( String.valueOf( GREATER_THAN ) );
+        sb.append( GREATER_THAN );
 
         if ( isSimpleTag )
         {
@@ -174,21 +174,8 @@
      */
     protected void writeEndTag( Tag t )
     {
-        StringBuffer sb = new StringBuffer();
-        sb.append( String.valueOf( LESS_THAN ) );
-        sb.append( String.valueOf( SLASH ) );
-
-        if ( nameSpace != null )
-        {
-            sb.append( nameSpace ).append( ":" );
-        }
-
-        sb.append( t.toString() );
-        sb.append( String.valueOf( GREATER_THAN ) );
-
-        sb.append( EOL );
-
-        write( sb.toString() );
+        writeEndTagWithoutEOL( t );
+        write( EOL );
     }
 
     /**
@@ -200,16 +187,16 @@
     protected void writeEndTagWithoutEOL( Tag t )
     {
         StringBuffer sb = new StringBuffer();
-        sb.append( String.valueOf( LESS_THAN ) );
-        sb.append( String.valueOf( SLASH ) );
+        sb.append( LESS_THAN );
+        sb.append( SLASH );
 
         if ( nameSpace != null )
         {
-            sb.append( nameSpace ).append( ":" );
+            sb.append( nameSpace ).append( ':' );
         }
 
         sb.append( t.toString() );
-        sb.append( String.valueOf( GREATER_THAN ) );
+        sb.append( GREATER_THAN );
 
         write( sb.toString() );
     }

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=599188&r1=599187&r2=599188&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
Wed Nov 28 15:09:31 2007
@@ -586,20 +586,19 @@
     /** {@inheritDoc} */
     public void figure_()
     {
-        write( String.valueOf( SPACE ) + String.valueOf( SLASH ) + String.valueOf( GREATER_THAN
) );
+        write( String.valueOf( SPACE ) + SLASH + GREATER_THAN );
     }
 
     /** {@inheritDoc} */
     public void figureGraphics( String name )
     {
-        write( String.valueOf( SPACE ) + Attribute.SRC + String.valueOf( EQUAL ) + String.valueOf(
QUOTE ) + name
-            + String.valueOf( QUOTE ) );
+        write( String.valueOf( SPACE ) + Attribute.SRC + EQUAL + QUOTE + name + QUOTE );
     }
 
     /** {@inheritDoc} */
     public void figureCaption()
     {
-        write( String.valueOf( SPACE ) + Attribute.ALT + String.valueOf( EQUAL ) + String.valueOf(
QUOTE ) );
+        write( String.valueOf( SPACE ) + Attribute.ALT + EQUAL + QUOTE );
     }
 
     /** {@inheritDoc} */
@@ -1129,11 +1128,11 @@
     {
         StringBuffer buf = new StringBuffer( comment.length() + 9 );
 
-        buf.append( LESS_THAN ).append( BANG ).append( MINUS ).append( MINUS ).append( SPACE
);
+        buf.append( "" + LESS_THAN + BANG + MINUS + MINUS + SPACE );
 
         buf.append( comment );
 
-        buf.append( SPACE ).append( MINUS ).append( MINUS ).append( GREATER_THAN );
+        buf.append( "" + SPACE + MINUS + MINUS + GREATER_THAN );
 
         rawText( buf.toString() );
     }



Mime
View raw message