String substitute(Object input,String replace) { return substitute(input,replace,0,0); } /** * Substitutes the replacement text for the first match found in the input * beginning at the specified index position. Specifying an index * effectively causes the regular expression engine to throw away the * specified number of characters. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @param index The offset index at which the search should be begin. * @return A String containing the substring of the input, starting * at the index position, and interpolating the substituted text. * @see REMatch#substituteInto */ public String substitute(Object input,String replace,int index) { return substitute(input,replace,index,0); } /** * Substitutes the replacement text for the first match found in the input * string, beginning at the specified index position and using the * specified execution flags. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. * @return A String containing the substring of the input, starting * at the index position, and interpolating the substituted text. * @see REMatch#substituteInto */ public String substitute(Object input,String replace,int index,int eflags) { return substituteImpl(makeCharIndexed(input,index),replace,index,eflags); }
String substituteAll(Object input,String replace) { return substituteAll(input,replace,0,0); } /** * Substitutes the replacement text for each non-overlapping match found * in the input text, starting at the specified index. * * If the regular expression allows the empty string to match, it will * substitute matches at all positions except the end of the input. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @param index The offset index at which the search should be begin. * @return A String containing the substring of the input, starting * at the index position, and interpolating the substituted text. * @see REMatch#substituteInto */ public String substituteAll(Object input,String replace,int index) { return substituteAll(input,replace,index,0); } /** * Substitutes the replacement text for each non-overlapping match found * in the input text, starting at the specified index and using the * specified execution flags. * * @param input The input text. * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto). * @param index The offset index at which the search should be begin. * @param eflags The logical OR of any execution flags above. * @return A String containing the substring of the input, starting * at the index position, and interpolating the substituted text. * @see REMatch#substituteInto */ public String substituteAll(Object input,String replace,int index,int eflags) { return substituteAllImpl(makeCharIndexed(input,index),replace,index,eflags); }
Clone fragments detected by clone detection tool
File path: /jEdit-4.2/src/gnu/regexp/RE.java File path: /jEdit-4.2/src/gnu/regexp/RE.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
String substitute(Object input,String replace) {
1
String substituteAll(Object input,String replace) {
2
    return substitute(input,replace,0,0);
2
    return substituteAll(input,replace,0,0);
3
  }
3
  }
4
  /**
4
  /**
5
   * Substitutes the replacement text for the first match found 
5
   * Substitutes the replacement text for each non-overlapping match found 
6
in the input
6
   * in the input
7
   * beginning at the specified index position.  Specifying an index
7
 text, starting at the specified index
8
   * effectively causes
8
.
9
   *
9
 the regular expression engine to throw away the
10
   * If the regular expression allows the empty string to 
10
   * specified number of characters. 
11
match, it will
12
   * substitute matches at all positions except the end of the input.
11
   *
13
   *
12
   * @param input The input text.
14
   * @param input The input text.
13
   * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
15
   * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
14
   * @param index The offset index at which the search should be begin.
16
   * @param index The offset index at which the search should be begin.
15
   * @return A String containing the substring of the input, starting
17
   * @return A String containing the substring of the input, starting
16
   *   at the index position, and interpolating the substituted text.
18
   *   at the index position, and interpolating the substituted text.
17
   * @see REMatch#substituteInto
19
   * @see REMatch#substituteInto
18
   */
20
   */
19
  public String substitute(Object input,String replace,int index) {
21
  public String substituteAll(Object input,String replace,int index) {
20
    return substitute(input,replace,index,0);
22
    return substituteAll(input,replace,index,0);
21
  }
23
  }
24
 
22
  /**
25
  /**
23
   * Substitutes the replacement text for the first match found 
26
   * Substitutes the replacement text for each non-overlapping match found 
24
in the input
27
   * in the input
25
   * string, beginning at the specified index position and using the
28
 text, starting at the specified index and using the
26
   * specified execution flags.
29
   * specified execution flags.
27
   *
30
   *
28
   * @param input The input text.
31
   * @param input The input text.
29
   * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
32
   * @param replace The replacement text, which may contain $x metacharacters (see REMatch.substituteInto).
30
   * @param index The offset index at which the search should be begin.
33
   * @param index The offset index at which the search should be begin.
31
   * @param eflags The logical OR of any execution flags above.
34
   * @param eflags The logical OR of any execution flags above.
32
   * @return A String containing the substring of the input, starting
35
   * @return A String containing the substring of the input, starting
33
   *   at the index position, and interpolating the substituted text.
36
   *   at the index position, and interpolating the substituted text.
34
   * @see REMatch#substituteInto
37
   * @see REMatch#substituteInto
35
   */
38
   */
36
  public String substitute(Object input,String replace,int index,int eflags) {
39
  public String substituteAll(Object input,String replace,int index,int eflags) {
37
    return substituteImpl(makeCharIndexed(input,index),replace,index,eflags);
40
    return substituteAllImpl(makeCharIndexed(input,index),replace,index,eflags);
38
  }
41
  }
Summary
Number of common nesting structure subtrees0
Number of refactorable cases0
Number of non-refactorable cases0
Time elapsed for finding largest common nesting structure subtrees (ms)0.0
Clones location
Number of node comparisons0