CloneSet316


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
61210.998class_body_declarations[4]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
16167
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.java
26158
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/SubstitutionTextReader.java
Clone Instance
1
Line Count
61
Source Line
67
Source File
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.java

        /**
         * Implement to compute the substitution for the given character and 
         * if necessary subsequent characters. Use <code>nextChar</code>
         * to read subsequent characters.
         */
        protected abstract String computeSubstitution(int c)
          throws                                                    IOException;

        /**
         * Returns the internal reader.
         */
        protected Reader getReader() {
                return fReader;
        }

        /**
         * Returns the next character.
         */
        protected int nextChar() throws IOException {
                fReadFromBuffer = (fBuffer.length() > 0);
                if (fReadFromBuffer) {
                        char ch = fBuffer.charAt(fIndex++);
                        if (fIndex >= fBuffer.length()) {
                                fBuffer.setLength(0);
                                fIndex = 0;
                        }
                        return ch;
                }
                else   {
                        int ch = fCharAfterWhiteSpace;
                        if (ch == -1) {
                                ch = fReader.read();
                        }
                        if (fSkipWhiteSpace && ScannerHelper.isWhitespace((char) ch)) {
                                do {
                                        ch = fReader.read();
                                }
                                while (  ScannerHelper.isWhitespace((char) ch));
                                if (ch != -1) {
                                        fCharAfterWhiteSpace = ch;
                                        return ' ';
                                }
                        }
                        else   {
                                fCharAfterWhiteSpace = -1;
                        }
                        return ch;
                }
        }

        /*
         * @see Reader#read()
         */
        public int read() throws IOException {
                int c;
                do {

                        c = nextChar();
                        while ( !fReadFromBuffer) {
                                String s = computeSubstitution(c);
                                if (s == null)
                                        break;
                                if (s.length() > 0)
                                        fBuffer.insert(0, s);
                                c = nextChar();
                        }
                }
                while (  fSkipWhiteSpace && fWasWhiteSpace && (c == ' '));
                fWasWhiteSpace = (c == ' ' || c == '\r' || c == '\n');
                return c;
        }


Clone Instance
2
Line Count
61
Source Line
58
Source File
plugins/org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/text/SubstitutionTextReader.java

        /**
         * Implement to compute the substitution for the given character and
         * if necessary subsequent characters. Use <code>nextChar</code>
         * to read subsequent characters.
         */
        protected abstract String computeSubstitution(int c)
          throws                                                    IOException;

        /**
         * Returns the internal reader.
         */
        protected Reader getReader() {
                return fReader;
        }

        /**
         * Returns the next character.
         */
        protected int nextChar() throws IOException {
                fReadFromBuffer = (fBuffer.length() > 0);
                if (fReadFromBuffer) {
                        char ch = fBuffer.charAt(fIndex++);
                        if (fIndex >= fBuffer.length()) {
                                fBuffer.setLength(0);
                                fIndex = 0;
                        }
                        return ch;
                }
                else   {
                        int ch = fCharAfterWhiteSpace;
                        if (ch == -1) {
                                ch = fReader.read();
                        }
                        if (fSkipWhiteSpace && Character.isWhitespace((char) ch)) {
                                do {
                                        ch = fReader.read();
                                }
                                while (  Character.isWhitespace((char) ch));
                                if (ch != -1) {
                                        fCharAfterWhiteSpace = ch;
                                        return ' ';
                                }
                        }
                        else   {
                                fCharAfterWhiteSpace = -1;
                        }
                        return ch;
                }
        }

        /**
         * @see Reader#read()
         */
        public int read() throws IOException {
                int c;
                do {

                        c = nextChar();
                        while ( !fReadFromBuffer) {
                                String s = computeSubstitution(c);
                                if (s == null)
                                        break;
                                if (s.length() > 0)
                                        fBuffer.insert(0, s);
                                c = nextChar();
                        }
                }
                while (  fSkipWhiteSpace && fWasWhiteSpace && (c == ' '));
                fWasWhiteSpace = (c == ' ' || c == '\r' || c == '\n');
                return c;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

/**
         * Implement to compute the substitution for the given character and 
         * if necessary subsequent characters. Use <code>nextChar</code>
         * to read subsequent characters.
         */
/**
         * Implement to compute the substitution for the given character and
         * if necessary subsequent characters. Use <code>nextChar</code>
         * to read subsequent characters.
         */
protected abstract String computeSubstitution(int c)
  throws IOException;

/**
         * Returns the internal reader.
         */
protected Reader getReader() {
  return fReader;
}

/**
         * Returns the next character.
         */
protected int nextChar() throws IOException {
  fReadFromBuffer = (fBuffer.length() > 0);
  if (fReadFromBuffer) {
    char ch = fBuffer.charAt(fIndex++);
    if (fIndex >= fBuffer.length()) {
      fBuffer.setLength(0);
      fIndex = 0;
    }
    return ch;
  }
  else {
    int ch = fCharAfterWhiteSpace;
    if (ch == -1) {
      ch = fReader.read();
    }
    if (fSkipWhiteSpace && [[#variableb9690cc0]].isWhitespace((char) ch)) {
      do {
        ch = fReader.read();
      }
      while ( [[#variableb9690cc0]].isWhitespace((char) ch));
      if (ch != -1) {
        fCharAfterWhiteSpace = ch;
        return ' ';
      }
    }
    else {
      fCharAfterWhiteSpace = -1;
    }
    return ch;
  }
}

/*
         * @see Reader#read()
         */
/**
         * @see Reader#read()
         */
public int read() throws IOException {
  int c;
  do {
    c = nextChar();
    while ( !fReadFromBuffer) {
      String s = computeSubstitution(c);
      if (s == null)
        break;
      if (s.length() > 0)
        fBuffer.insert(0, s);
      c = nextChar();
    }
  }
  while (fSkipWhiteSpace && fWasWhiteSpace && (c == ' '));
  fWasWhiteSpace = (c == ' ' || c == '\r' || c == '\n');
  return c;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b9690cc0]]
ScannerHelper 
12[[#b9690cc0]]
Character