CloneSet400


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
99201.000class_body_declarations[8]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
199109
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/TokenScanner.java
299157
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/TokenScanner.java
Clone Instance
1
Line Count
99
Source Line
109
Source File
plugins/org.eclipse.jdt.core/dom/org/eclipse/jdt/internal/core/dom/rewrite/TokenScanner.java

        /**
         * Reads the next token from the given offset.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread.
         * @return Returns the token id.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int readNext(int offset, boolean ignoreComments) throws CoreException {
                setOffset(offset);
                return readNext(ignoreComments);
        }

        /**
         * Reads the next token from the given offset and returns the start offset of the token.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread
         * @return Returns the start position of the next token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getNextStartOffset(int offset, boolean ignoreComments) throws CoreException {
                readNext(offset, ignoreComments);
                return getCurrentStartOffset();
        }

        /**
         * Reads the next token from the given offset and returns the offset after the token.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread
         * @return Returns the start position of the next token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getNextEndOffset(int offset, boolean ignoreComments) throws CoreException {
                readNext(offset, ignoreComments);
                return getCurrentEndOffset();
        }

        /**
         * Reads until a token is reached.
         * @param tok The token to read to.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public void readToToken(int tok) throws CoreException {
                int curr = 0;
                do {
                        curr = readNext(false);
                }
                while (  curr != tok);
        }

        /**
         * Reads until a token is reached, starting from the given offset.
         * @param tok The token to read to.
         * @param offset The offset to start reading from.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public void readToToken(int tok, int offset) throws CoreException {
                setOffset(offset);
                readToToken(tok);
        }

        /**
         * Reads from the given offset until a token is reached and returns the start offset of the token.
         * @param token The token to be found.
         * @param startOffset The offset to start reading from.
         * @return Returns the start position of the found token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getTokenStartOffset(int token, int startOffset) throws CoreException {
                readToToken(token, startOffset);
                return getCurrentStartOffset();
        }

        /**
         * Reads from the given offset until a token is reached and returns the offset after the token.
         * @param token The token to be found.
         * @param startOffset Offset to start reading from
         * @return Returns the end position of the found token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getTokenEndOffset(int token, int startOffset) throws CoreException {
                readToToken(token, startOffset);
                return getCurrentEndOffset();
        }

        /**
         * Reads from the given offset until a token is reached and returns the offset after the previous token.
         * @param token The token to be found.
         * @param startOffset The offset to start scanning from.
         * @return Returns the end offset of the token previous to the given token.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getPreviousTokenEndOffset(int token, int startOffset) throws CoreException {
                setOffset(startOffset);
                int res = startOffset;
                int curr = readNext(false);
                while (curr != token) {
                        res = getCurrentEndOffset();
                        curr = readNext(false);
                }
                return res;
        }


Clone Instance
2
Line Count
99
Source Line
157
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/dom/TokenScanner.java

        /**
         * Reads the next token from the given offset.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread.
         * @return Returns the token id.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int readNext(int offset, boolean ignoreComments) throws CoreException {
                setOffset(offset);
                return readNext(ignoreComments);
        }

        /**
         * Reads the next token from the given offset and returns the start offset of the token.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread
         * @return Returns the start position of the next token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getNextStartOffset(int offset, boolean ignoreComments) throws CoreException {
                readNext(offset, ignoreComments);
                return getCurrentStartOffset();
        }

        /**
         * Reads the next token from the given offset and returns the offset after the token.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread
         * @return Returns the start position of the next token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getNextEndOffset(int offset, boolean ignoreComments) throws CoreException {
                readNext(offset, ignoreComments);
                return getCurrentEndOffset();
        }

        /**
         * Reads until a token is reached.
         * @param tok The token to read to.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public void readToToken(int tok) throws CoreException {
                int curr = 0;
                do {
                        curr = readNext(false);
                }
                while (  curr != tok);
        }

        /**
         * Reads until a token is reached, starting from the given offset.
         * @param tok The token to read to.
         * @param offset The offset to start reading from.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public void readToToken(int tok, int offset) throws CoreException {
                setOffset(offset);
                readToToken(tok);
        }

        /**
         * Reads from the given offset until a token is reached and returns the start offset of the token.
         * @param token The token to be found.
         * @param startOffset The offset to start reading from.
         * @return Returns the start position of the found token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getTokenStartOffset(int token, int startOffset) throws CoreException {
                readToToken(token, startOffset);
                return getCurrentStartOffset();
        }

        /**
         * Reads from the given offset until a token is reached and returns the offset after the token.
         * @param token The token to be found.
         * @param startOffset Offset to start reading from
         * @return Returns the end position of the found token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getTokenEndOffset(int token, int startOffset) throws CoreException {
                readToToken(token, startOffset);
                return getCurrentEndOffset();
        }

        /**
         * Reads from the given offset until a token is reached and returns the offset after the previous token.
         * @param token The token to be found.
         * @param startOffset The offset to start scanning from.
         * @return Returns the end offset of the token previous to the given token.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
        public int getPreviousTokenEndOffset(int token, int startOffset) throws CoreException {
                setOffset(startOffset);
                int res = startOffset;
                int curr = readNext(false);
                while (curr != token) {
                        res = getCurrentEndOffset();
                        curr = readNext(false);
                }
                return res;
        }


Clone AbstractionParameter Count: 0Parameter Bindings

/**
         * Reads the next token from the given offset.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread.
         * @return Returns the token id.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
public int readNext(int offset, boolean ignoreComments) throws CoreException {
  setOffset(offset);
  return readNext(ignoreComments);
}

/**
         * Reads the next token from the given offset and returns the start offset of the token.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread
         * @return Returns the start position of the next token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
public int getNextStartOffset(int offset, boolean ignoreComments) throws CoreException {
  readNext(offset, ignoreComments);
  return getCurrentStartOffset();
}

/**
         * Reads the next token from the given offset and returns the offset after the token.
         * @param offset The offset to start reading from.
         * @param ignoreComments If set, comments will be overread
         * @return Returns the start position of the next token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
public int getNextEndOffset(int offset, boolean ignoreComments) throws CoreException {
  readNext(offset, ignoreComments);
  return getCurrentEndOffset();
}

/**
         * Reads until a token is reached.
         * @param tok The token to read to.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
public void readToToken(int tok) throws CoreException {
  int curr = 0;
  do {
    curr = readNext(false);
  }
  while (curr != tok);
}

/**
         * Reads until a token is reached, starting from the given offset.
         * @param tok The token to read to.
         * @param offset The offset to start reading from.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
public void readToToken(int tok, int offset) throws CoreException {
  setOffset(offset);
  readToToken(tok);
}

/**
         * Reads from the given offset until a token is reached and returns the start offset of the token.
         * @param token The token to be found.
         * @param startOffset The offset to start reading from.
         * @return Returns the start position of the found token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
public int getTokenStartOffset(int token, int startOffset) throws CoreException {
  readToToken(token, startOffset);
  return getCurrentStartOffset();
}

/**
         * Reads from the given offset until a token is reached and returns the offset after the token.
         * @param token The token to be found.
         * @param startOffset Offset to start reading from
         * @return Returns the end position of the found token. 
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
public int getTokenEndOffset(int token, int startOffset) throws CoreException {
  readToToken(token, startOffset);
  return getCurrentEndOffset();
}

/**
         * Reads from the given offset until a token is reached and returns the offset after the previous token.
         * @param token The token to be found.
         * @param startOffset The offset to start scanning from.
         * @return Returns the end offset of the token previous to the given token.
         * @exception CoreException Thrown when the end of the file has been reached (code END_OF_FILE)
         * or a lexical error was detected while scanning (code LEXICAL_ERROR)
         */
public int getPreviousTokenEndOffset(int token, int startOffset) throws CoreException {
  setOffset(startOffset);
  int res = startOffset;
  int curr = readNext(false);
  while (curr != token) {
    res = getCurrentEndOffset();
    curr = readNext(false);
  }
  return res;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None