CloneSet1260


Previous CloneSetNext CloneSetBack to Main Report
Clone
Mass
Clones in
CloneSet
Parameter
Count
Clone
Similarity
Syntax Category
[Sequence Length]
15210.952class_body_declaration
Clone AbstractionParameter Bindings
Clone Instance
(Click to see clone)
Line CountSource Line
Source File
11541
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.java
215203
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/CodeFormatterUtil.java
Clone Instance
1
Line Count
15
Source Line
41
Source File
plugins/org.eclipse.jdt.core/formatter/org/eclipse/jdt/internal/formatter/comment/CommentFormatterUtil.java

        /**
         * Evaluates the edit on the given string.
         * 
         * @throws IllegalArgumentException if the positions are not inside the
         *                 string
         */
        public static String evaluateFormatterEdit(String string, TextEdit edit, Position[] positions) {
                try {
                        Document doc = createDocument(string, positions);
                        edit.apply(doc, 0);
                        if (positions != null) {
                                for (int i = 0; i < positions.length; i++) {
                                        Assert.isTrue( !positions[i].isDeleted, "Position got deleted"); //$NON-NLS-1$
                                }
                        }
                        return doc.get();
                } catch (BadLocationException e) {
                        log(e); // bug in the formatter
                        Assert.isTrue(false, "Formatter created edits with wrong positions: " + e.getMessage()); //$NON-NLS-1$
                  }
                return null;
        }


Clone Instance
2
Line Count
15
Source Line
203
Source File
plugins/org.eclipse.jdt.ui/core extension/org/eclipse/jdt/internal/corext/util/CodeFormatterUtil.java

        /**
         * Evaluates the edit on the given string.
         * @throws IllegalArgumentException If the positions are not inside the string, a
         *  IllegalArgumentException is thrown.
         */
        public static String evaluateFormatterEdit(String string, TextEdit edit, Position[] positions) {
                try {
                        Document doc = createDocument(string, positions);
                        edit.apply(doc, 0);
                        if (positions != null) {
                                for (int i = 0; i < positions.length; i++) {
                                        Assert.isTrue( !positions[i].isDeleted, "Position got deleted"); //$NON-NLS-1$
                                }
                        }
                        return doc.get();
                } catch (BadLocationException e) {
                        JavaPlugin.log(e); // bug in the formatter
                        Assert.isTrue(false, "Formatter created edits with wrong positions: " + e.getMessage()); //$NON-NLS-1$
                  }
                return null;
        }


Clone AbstractionParameter Count: 1Parameter Bindings

/**
         * Evaluates the edit on the given string.
         * @throws IllegalArgumentException If the positions are not inside the string, a
         *  IllegalArgumentException is thrown.
         */
/**
         * Evaluates the edit on the given string.
         * 
         * @throws IllegalArgumentException if the positions are not inside the
         *                 string
         */
public static String evaluateFormatterEdit(String string, TextEdit edit, Position[] positions) {
  try {
    Document doc = createDocument(string, positions);
    edit.apply(doc, 0);
    if (positions != null) {
      for (int i = 0; i < positions.length; i++) {
        Assert.isTrue( !positions[i].isDeleted, "Position got deleted"); //$NON-NLS-1$
      }
    }
    return doc.get();
  }
  catch (BadLocationException e) {
     [[#variableb4411fc0]]; // bug in the formatter
    Assert.isTrue(false, "Formatter created edits with wrong positions: " + e.getMessage()); //$NON-NLS-1$
  }
  return null;
}
 

CloneAbstraction
Parameter Bindings
Parameter
Index
Clone
Instance
Parameter
Name
Value
11[[#b4411fc0]]
JavaPlugin.log(e) 
12[[#b4411fc0]]
log(e)