| Previous CloneSet | Next CloneSet | Back to Main Report |
| Clone Mass | Clones in CloneSet | Parameter Count | Clone Similarity | Syntax Category [Sequence Length] |
|---|---|---|---|---|
| 61 | 2 | 1 | 0.998 | class_body_declarations[4] |
| Clone Abstraction | Parameter Bindings |
| Clone Instance (Click to see clone) | Line Count | Source Line | Source File |
|---|---|---|---|
| 1 | 61 | 67 | plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/SubstitutionTextReader.java |
| 2 | 61 | 58 | 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 && 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;
}
|
| ||||
/**
* 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;
}
|
| |||
/**
* 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 Index | Clone Instance | Parameter Name | Value |
|---|---|---|---|
| 1 | 1 | [[#b9690cc0]] | ScannerHelper |
| 1 | 2 | [[#b9690cc0]] | Character |