CloneSet541


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
36201.000class_body_declarations[6]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
13621
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.java
23623
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/XMLWriter.java
Clone Instance
1
Line Count
36
Source Line
21
Source File
plugins/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/util/GenericXMLWriter.java

        /* constants */
        private static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$

        private static void appendEscapedChar(StringBuffer buffer, char c) {
                String replacement = getReplacement(c);
                if (replacement != null) {
                        buffer.append('&');
                        buffer.append(replacement);
                        buffer.append(';');
                }
                else   {
                        buffer.append(c);
                }
        }

        private static String getEscaped(String s) {
                StringBuffer result = new StringBuffer(s.length() + 10);
                for (int i = 0; i < s.length(); ++i)
                        appendEscapedChar(result, s.charAt(i));
                return result.toString();
        }

        private static String getReplacement(char c) {
                // Encode special XML characters into the equivalent character references.
                // These five are defined by default for all XML documents.
                switch (c) {
                        case '<':
                                return "lt"; //$NON-NLS-1$
                        case '>':
                                return "gt"; //$NON-NLS-1$
                        case '\"':
                                return "quot"; //$NON-NLS-1$
                        case '\'':
                                return "apos"; //$NON-NLS-1$
                        case '&':
                                return "amp"; //$NON-NLS-1$
                      }
                return null;
        }

        private int tab;

        private String lineSeparator;


Clone Instance
2
Line Count
36
Source Line
23
Source File
plugins/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/XMLWriter.java

        /* constants */
        private static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$

        private static void appendEscapedChar(StringBuffer buffer, char c) {
                String replacement = getReplacement(c);
                if (replacement != null) {
                        buffer.append('&');
                        buffer.append(replacement);
                        buffer.append(';');
                }
                else   {
                        buffer.append(c);
                }
        }

        private static String getEscaped(String s) {
                StringBuffer result = new StringBuffer(s.length() + 10);
                for (int i = 0; i < s.length(); ++i)
                        appendEscapedChar(result, s.charAt(i));
                return result.toString();
        }

        private static String getReplacement(char c) {
                // Encode special XML characters into the equivalent character references.
                // These five are defined by default for all XML documents.
                switch (c) {
                        case '<':
                                return "lt"; //$NON-NLS-1$
                        case '>':
                                return "gt"; //$NON-NLS-1$
                        case '\"':
                                return "quot"; //$NON-NLS-1$
                        case '\'':
                                return "apos"; //$NON-NLS-1$
                        case '&':
                                return "amp"; //$NON-NLS-1$
                      }
                return null;
        }

        private int tab;

        private String lineSeparator;


Clone AbstractionParameter Count: 0Parameter Bindings

/* constants */
private static final String XML_VERSION = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; //$NON-NLS-1$

private static void appendEscapedChar(StringBuffer buffer, char c) {
  String replacement = getReplacement(c);
  if (replacement != null) {
    buffer.append('&');
    buffer.append(replacement);
    buffer.append(';');
  }
  else {
    buffer.append(c);
  }
}

private static String getEscaped(String s) {
  StringBuffer result = new StringBuffer(s.length() + 10);
  for (int i = 0; i < s.length(); ++i)
    appendEscapedChar(result, s.charAt(i));
  return result.toString();
}

private static String getReplacement(char c) {
  // Encode special XML characters into the equivalent character references.
  // These five are defined by default for all XML documents.
  switch (c) {
    case '<':
      return "lt"; //$NON-NLS-1$
    case '>':
      return "gt"; //$NON-NLS-1$
    case '\"':
      return "quot"; //$NON-NLS-1$
    case '\'':
      return "apos"; //$NON-NLS-1$
    case '&':
      return "amp"; //$NON-NLS-1$
  }
  return null;
}

private int tab;

private String lineSeparator;
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None