You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2016/05/14 09:22:10 UTC

svn commit: r1743801 - in /webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer: ExtendedLexicalHandler.java SerializerBase.java ToStream.java ToXMLStream.java

Author: veithen
Date: Sat May 14 09:22:10 2016
New Revision: 1743801

URL: http://svn.apache.org/viewvc?rev=1743801&view=rev
Log:
Remove unused code.

Modified:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ExtendedLexicalHandler.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/SerializerBase.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToStream.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToXMLStream.java

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ExtendedLexicalHandler.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ExtendedLexicalHandler.java?rev=1743801&r1=1743800&r2=1743801&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ExtendedLexicalHandler.java (original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ExtendedLexicalHandler.java Sat May 14 09:22:10 2016
@@ -38,6 +38,4 @@ public interface ExtendedLexicalHandler
     public void comment(String comment) throws StreamException;
 
     public void comment(char ch[], int start, int length) throws StreamException;
-
-    public void startEntity(String name) throws StreamException;
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/SerializerBase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/SerializerBase.java?rev=1743801&r1=1743800&r2=1743801&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/SerializerBase.java (original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/SerializerBase.java Sat May 14 09:22:10 2016
@@ -84,14 +84,6 @@ public abstract class SerializerBase
     protected boolean m_cdataTagOpen = false;
 
     /**
-     * Tells if we're in an EntityRef event.
-     */
-    protected boolean m_inEntityRef = false;
-
-    /** This flag is set while receiving events from the external DTD */
-    protected boolean m_inExternalDTD = false;
-
-    /**
      * The System ID for the doc type.
      */
     protected String m_doctypeSystem;
@@ -230,20 +222,6 @@ public abstract class SerializerBase
     }
 
     /**
-     * Report the end of an entity.
-     *
-     * @param name The name of the entity that is ending.
-     * @throws StreamException The application may raise an exception.
-     * @see #startEntity
-     */
-    public void endEntity(String name) throws StreamException
-    {
-        if (name.equals("[dtd]"))
-            m_inExternalDTD = false;
-        m_inEntityRef = false;
-    }
-
-    /**
      * Flush and close the underlying java.io.Writer. This method applies to
      * ToStream serializers, not ToSAXHandler serializers.
      * @see ToStream
@@ -482,22 +460,6 @@ public abstract class SerializerBase
     }
 
     /**
-     * Entity reference event.
-     *
-     * @param name Name of entity
-     *
-     * @throws StreamException
-     */
-    public void entityReference(String name) throws StreamException
-    {
-
-        flushPending();
-
-        startEntity(name);
-        endEntity(name);
-    }
-
-    /**
      * This method gets the nodes value as a String and uses that String as if
      * it were an input character notification.
      * @param node the Node to serialize
@@ -606,8 +568,6 @@ public abstract class SerializerBase
     	this.m_doctypePublic = null;
     	this.m_doctypeSystem = null;
         this.m_elemContext = new ElemContext();
-    	this.m_inEntityRef = false;
-    	this.m_inExternalDTD = false;
     	this.m_mediatype = null;
     	this.m_needToOutputDocTypeDecl = false;
         if (m_OutputProps != null)

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToStream.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToStream.java?rev=1743801&r1=1743800&r2=1743801&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToStream.java (original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToStream.java Sat May 14 09:22:10 2016
@@ -125,13 +125,6 @@ abstract public class ToStream extends S
      * remembers if we are in between the startCDATA() and endCDATA() callbacks
      */
     protected boolean m_cdataStartCalled = false;
-    
-    /**
-     * If this flag is true DTD entity references are not left as-is,
-     * which is exiting older behavior.
-     */
-    private boolean m_expandDTDEntities = true;
-  
 
     /**
      * Default constructor
@@ -188,9 +181,6 @@ abstract public class ToStream extends S
      */
     public void elementDecl(String name, String model) throws StreamException
     {
-        // Do not inline external DTD
-        if (m_inExternalDTD)
-            return;
         try
         {
             final XmlWriter writer = m_writer;
@@ -226,9 +216,6 @@ abstract public class ToStream extends S
     public void internalEntityDecl(String name, String value)
         throws StreamException
     {
-        // Do not inline external DTD
-        if (m_inExternalDTD)
-            return;
         try
         {
             DTDprolog();
@@ -615,9 +602,6 @@ abstract public class ToStream extends S
         String value)
         throws StreamException
     {
-        // Do not inline external DTD
-        if (m_inExternalDTD)
-            return;
         try
         {
             final XmlWriter writer = m_writer;
@@ -1085,9 +1069,6 @@ abstract public class ToStream extends S
     protected void charactersRaw(char ch[], int start, int length)
         throws StreamException
     {
-
-        if (m_inEntityRef)
-            return;
         try
         {
             m_writer.write(ch, start, length);
@@ -1133,7 +1114,7 @@ abstract public class ToStream extends S
         // characters to read from array is 0.
         // Section 7.6.1 of XSLT 1.0 (http://www.w3.org/TR/xslt#value-of) suggest no text node
         // is created if string is empty.	
-        if (length == 0 || (m_inEntityRef && !m_expandDTDEntities))
+        if (length == 0)
             return;
             
         m_docIsEmpty = false;
@@ -1443,8 +1424,6 @@ abstract public class ToStream extends S
      */
     public void characters(String s) throws StreamException
     {
-        if (m_inEntityRef && !m_expandDTDEntities)
-            return;
         final int length = s.length();
         if (length > m_charsBuff.length)
         {
@@ -1581,9 +1560,6 @@ abstract public class ToStream extends S
         String name)
         throws StreamException
     {
-        if (m_inEntityRef)
-            return;
-
         if (m_cdataTagOpen)
             closeCDATA();
         try
@@ -1798,9 +1774,6 @@ abstract public class ToStream extends S
     public void endElement(String namespaceURI, String localName, String name)
         throws StreamException
     {
-        if (m_inEntityRef)
-            return;
-
         try
         {
             final XmlWriter writer = m_writer;
@@ -1860,8 +1833,6 @@ abstract public class ToStream extends S
     {
 
         int start_old = start;
-        if (m_inEntityRef)
-            return;
 
         try
         {
@@ -2004,39 +1975,6 @@ abstract public class ToStream extends S
     }
 
     /**
-     * Report the beginning of an entity.
-     * 
-     * The start and end of the document entity are not reported.
-     * The start and end of the external DTD subset are reported
-     * using the pseudo-name "[dtd]".  All other events must be
-     * properly nested within start/end entity events.
-     * 
-     * @param name The name of the entity.  If it is a parameter
-     *        entity, the name will begin with '%'.
-     * @throws StreamException The application may raise an exception.
-     * @see #endEntity
-     * @see org.xml.sax.ext.DeclHandler#internalEntityDecl
-     * @see org.xml.sax.ext.DeclHandler#externalEntityDecl
-     */
-    public void startEntity(String name) throws StreamException
-    {
-        if (name.equals("[dtd]"))
-            m_inExternalDTD = true;
-
-        if (!m_expandDTDEntities && !m_inExternalDTD) {
-            /* Only leave the entity as-is if
-             * we've been told not to expand them
-             * and this is not the magic [dtd] name.
-             */
-            startNonEscaping();
-            characters("&" + name + ';');
-            endNonEscaping();
-        }
-
-        m_inEntityRef = true;
-    }
-
-    /**
      * For the enclosing elements starting tag write out
      * out any attributes followed by ">"
      *
@@ -2155,7 +2093,6 @@ abstract public class ToStream extends S
          
          // Leave m_format alone for now - Brian M.
          // this.m_format = null;
-         this.m_expandDTDEntities = true; 
          this.m_inDoctype = false;
          this.m_isUTF8 = false; //  ?? used anywhere ??
          this.m_lineSep = s_systemLineSep;
@@ -2439,14 +2376,6 @@ abstract public class ToStream extends S
     }
     
     /**
-     * If set to false the serializer does not expand DTD entities,
-     * but leaves them as is, the default value is true;
-     */
-    public void setDTDEntityExpansion(boolean expand) { 
-        m_expandDTDEntities = expand;     
-    }
-        
-    /**
      * Sets the end of line characters to be used during serialization
      * @param eolChars A character array corresponding to the characters to be used.
      */    

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToXMLStream.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToXMLStream.java?rev=1743801&r1=1743800&r2=1743801&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToXMLStream.java (original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/stream/serializer/ToXMLStream.java Sat May 14 09:22:10 2016
@@ -98,9 +98,6 @@ public class ToXMLStream extends ToStrea
     {
         super.startDocumentInternal();
 
-        if (m_inEntityRef)
-            return;
-
         m_needToOutputDocTypeDecl = true;
         m_startNewLine = false;
         /* The call to getXMLVersion() might emit an error message
@@ -174,9 +171,6 @@ public class ToXMLStream extends ToStrea
     public void processingInstruction(String target, String data)
         throws StreamException
     {
-        if (m_inEntityRef)
-            return;
-        
         flushPending();   
 
         if (target.equals(Result.PI_DISABLE_OUTPUT_ESCAPING))