CloneSet551


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
33201.000class_body_declarations[2]
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
133173
plugins/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/EnvUtil.java
233385
plugins/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/util/Visitors.java
Clone Instance
1
Line Count
33
Source Line
173
Source File
plugins/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/env/EnvUtil.java

        public void preVisit(ASTNode node)
        {
                final int startingOffset = node.getStartPosition();
                final int endingOffset = startingOffset + node.getLength();
                // starting offset is inclusive
                int startIndex = Arrays.binarySearch(_sortedStartingOffset, startingOffset);
                // ending offset is exclusive
                int endIndex = Arrays.binarySearch(_sortedStartingOffset, endingOffset);
                if (startIndex < 0)
                        startIndex = - startIndex - 1;
                if (endIndex < 0)
                        endIndex = - endIndex - 1;
                else
                        // endIndex needs to be exclusive and we want to 
                        // include the 'endIndex'th entry in our computation.
                        endIndex++;
                if (startIndex >= _sortedStartingOffset.length)
                        return;

                for (int i = startIndex; i < endIndex; i++) {
                        if (_endingOffsets[i] == 0)
                                _endingOffsets[i] = endingOffset;
                        else if (endingOffset < _endingOffsets[i])
                                _endingOffsets[i] = endingOffset;
                }
        }


        public int getEndingOffset( final int startingOffset)
        {
                int index = Arrays.binarySearch(_sortedStartingOffset, startingOffset);
                if (index == -1)  return 0;
                return _endingOffsets[index];
        }


Clone Instance
2
Line Count
33
Source Line
385
Source File
plugins/org.eclipse.jdt.apt.core/src/org/eclipse/jdt/apt/core/internal/util/Visitors.java

        public void preVisit(ASTNode node)
        {
                final int startingOffset = node.getStartPosition();
                final int endingOffset = startingOffset + node.getLength();
                // starting offset is inclusive
                int startIndex = Arrays.binarySearch(_sortedStartingOffset, startingOffset);
                // ending offset is exclusive
                int endIndex = Arrays.binarySearch(_sortedStartingOffset, endingOffset);
                if (startIndex < 0)
                        startIndex = - startIndex - 1;
                if (endIndex < 0)
                        endIndex = - endIndex - 1;
                else
                        // endIndex needs to be exclusive and we want to 
                        // include the 'endIndex'th entry in our computation.
                        endIndex++;
                if (startIndex >= _sortedStartingOffset.length)
                        return;

                for (int i = startIndex; i < endIndex; i++) {
                        if (_endingOffsets[i] == 0)
                                _endingOffsets[i] = endingOffset;
                        else if (endingOffset < _endingOffsets[i])
                                _endingOffsets[i] = endingOffset;
                }
        }


        public int getEndingOffset( final int startingOffset)
        {
                int index = Arrays.binarySearch(_sortedStartingOffset, startingOffset);
                if (index == -1)  return 0;
                return _endingOffsets[index];
        }


Clone AbstractionParameter Count: 0Parameter Bindings

public void preVisit(ASTNode node) {
  final int startingOffset = node.getStartPosition();
  final int endingOffset = startingOffset + node.getLength();
  // starting offset is inclusive
  int startIndex = Arrays.binarySearch(_sortedStartingOffset, startingOffset);
  // ending offset is exclusive
  int endIndex = Arrays.binarySearch(_sortedStartingOffset, endingOffset);
  if (startIndex < 0)
    startIndex = -startIndex - 1;
  if (endIndex < 0)
    endIndex = -endIndex - 1;
  else
    // endIndex needs to be exclusive and we want to 
    // include the 'endIndex'th entry in our computation.
    endIndex++;
  if (startIndex >= _sortedStartingOffset.length)
    return;
  for (int i = startIndex; i < endIndex; i++) {
    if (_endingOffsets[i] == 0)
      _endingOffsets[i] = endingOffset;
    else
      if (endingOffset < _endingOffsets[i])
        _endingOffsets[i] = endingOffset;
  }
}

public int getEndingOffset( final int startingOffset) {
  int index = Arrays.binarySearch(_sortedStartingOffset, startingOffset);
  if (index == -1)
    return 0;
  return _endingOffsets[index];
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
None