Author: mir
Date: Thu Mar 18 09:47:54 2010
New Revision: 924676

URL: http://svn.apache.org/viewvc?rev=924676&view=rev
Log:
CLEREZZA-163: applied review comments

Modified:
    
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java
    
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java

Modified: 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java?rev=924676&r1=924675&r2=924676&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java
 (original)
+++ 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/main/java/org/apache/clerezza/platform/xhtml2html/DocTypeFilteringByteChannel.java
 Thu Mar 18 09:47:54 2010
@@ -34,10 +34,10 @@ class DocTypeFilteringByteChannel implem
        private final static byte[] DOCTYPE_TAG_BYTES = "<!DOCTYPE".getBytes();
        private final static byte[] HTML_TAG_BYTES = "<html".getBytes();
        private final static byte[]     XML_DECLARATION_BYTES = 
"<?xml".getBytes();
-       private final static byte GREATER_THAN = ">".getBytes()[0];
-       private final static byte SPACE = " ".getBytes()[0];
-       private final static byte NEXTLINE = "\n".getBytes()[0];
-       private final static byte CARRIAGE_RETURN = "\r".getBytes()[0];
+       private final static byte GREATER_THAN = '>';
+       private final static byte SPACE = ' ';
+       private final static byte NEXTLINE = '\n';
+       private final static byte CARRIAGE_RETURN = '\r';
        private WritableByteChannel wrappedByteChannel;
        private boolean doctypeWritten = false;
        private int arrayPosition = 0;
@@ -67,7 +67,7 @@ class DocTypeFilteringByteChannel implem
                                }
                                if (arrayPosition == (DOCTYPE_TAG_BYTES.length 
- 1) &&
                                                
DOCTYPE_TAG_BYTES[arrayPosition] == b) {
-                                       
WriteEverthingAndSetDoctypeWrittenToTrue(byteBuffer);
+                                       
writeEverythingAndSetDoctypeWrittenToTrue(byteBuffer);
                                        break;
                                }
                                if (arrayPosition < XML_DECLARATION_BYTES.length
@@ -98,10 +98,10 @@ class DocTypeFilteringByteChannel implem
                                        isNotADoctypeDef = true;
                                        if (!isXmlDeclaration && hasHtmlTag) {
                                                
writeToWrappedChannel(DOCTYPE_DEF_BYTES);                                       
        
-                                               
WriteEverthingAndSetDoctypeWrittenToTrue(byteBuffer);
+                                               
writeEverythingAndSetDoctypeWrittenToTrue(byteBuffer);
                                                break;
                                        } else if (!isXmlDeclaration && 
!hasHtmlTag && !lookingForHtmlTag){
-                                               
WriteEverthingAndSetDoctypeWrittenToTrue(byteBuffer);
+                                               
writeEverythingAndSetDoctypeWrittenToTrue(byteBuffer);
                                                break;
                                        }
                                }
@@ -113,7 +113,7 @@ class DocTypeFilteringByteChannel implem
                }
        }
 
-       private void WriteEverthingAndSetDoctypeWrittenToTrue(ByteBuffer 
byteBuffer) throws IOException {
+       private void writeEverythingAndSetDoctypeWrittenToTrue(ByteBuffer 
byteBuffer) throws IOException {
                writeToWrappedChannel(cachedBytes.toByteArray());
                wrappedByteChannel.write(byteBuffer);
                doctypeWritten = true;

Modified: 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java
URL: 
http://svn.apache.org/viewvc/incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java?rev=924676&r1=924675&r2=924676&view=diff
==============================================================================
--- 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java
 (original)
+++ 
incubator/clerezza/trunk/org.apache.clerezza.parent/org.apache.clerezza.platform.xhtml2html/src/test/java/org/apache/clerezza/platform/xhtml2html/DocTypeSettingByteChannelTest.java
 Thu Mar 18 09:47:54 2010
@@ -144,7 +144,7 @@ public class DocTypeSettingByteChannelTe
        }
 
        @Test
-       public void RemoveXmlDeclarationAndDotnotAddDoctypeIfHtmlNotComplete() 
throws Exception {
+       public void removeXmlDeclarationAndDotnotAddDoctypeIfHtmlNotComplete() 
throws Exception {
                final String someHtmlSnippet =  "<?xml version=\"1.0\" 
encoding=\"UTF-8\" ?>\n\n\n\n\n<body>\n" +
                                "hello" +
                                "</body>\n";


Reply via email to