public void setLines(final long lines) { this.lines = lines; } /** * Returns the number of lines to be returned in the filtered stream. * * @return the number of lines to be returned in the filtered stream */ private long getLines() { return lines; } /** * Sets the number of lines to be skipped in the filtered stream. * * @param skip the number of lines to be skipped in the filtered stream */ public void setSkip(final long skip) { this.skip = skip; } /** * Returns the number of lines to be skipped in the filtered stream. * * @return the number of lines to be skipped in the filtered stream */ private long getSkip() { return skip; } /** * Creates a new HeadFilter using the passed in * Reader for instantiation. * * @param rdr A Reader object providing the underlying stream. * Must not be <code>null</code>. * * @return a new filter based on this configuration, but filtering * the specified reader */ public Reader chain(final Reader rdr) { HeadFilter newFilter = new HeadFilter(rdr); newFilter.setLines(getLines()); newFilter.setSkip(getSkip()); newFilter.setInitialized(true); return newFilter
public void setLines(final long lines) { this.lines = lines; } /** * Returns the number of lines to be returned in the filtered stream. * * @return the number of lines to be returned in the filtered stream */ private long getLines() { return lines; } /** * Sets the number of lines to be skipped in the filtered stream. * * @param skip the number of lines to be skipped in the filtered stream */ public void setSkip(final long skip) { this.skip = skip; } /** * Returns the number of lines to be skipped in the filtered stream. * * @return the number of lines to be skipped in the filtered stream */ private long getSkip() { return skip; } /** * Creates a new TailFilter using the passed in * Reader for instantiation. * * @param rdr A Reader object providing the underlying stream. * Must not be <code>null</code>. * * @return a new filter based on this configuration, but filtering * the specified reader */ public Reader chain(final Reader rdr) { TailFilter newFilter = new TailFilter(rdr); newFilter.setLines(getLines()); newFilter.setSkip(getSkip()); newFilter.setInitialized(true); return newFilter
Clone fragments detected by clone detection tool
File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/HeadFilter.java File path: /apache-ant-1.7.0/src/org/apache/tools/ant/filters/TailFilter.java
Method name: Method name:
Number of AST nodes: 0 Number of AST nodes: 0
1
public void setLines(final long lines) {
1
public void setLines(final long lines) {
2
        this.lines = lines;
2
        this.lines = lines;
3
    }
3
    }
4
    /**
4
    /**
5
     * Returns the number of lines to be returned in the filtered stream.
5
     * Returns the number of lines to be returned in the filtered stream.
6
     *
6
     *
7
     * @return the number of lines to be returned in the filtered stream
7
     * @return the number of lines to be returned in the filtered stream
8
     */
8
     */
9
    private long getLines() {
9
    private long getLines() {
10
        return lines;
10
        return lines;
11
    }
11
    }
12
    /**
12
    /**
13
     * Sets the number of lines to be skipped in the filtered stream.
13
     * Sets the number of lines to be skipped in the filtered stream.
14
     *
14
     *
15
     * @param skip the number of lines to be skipped in the filtered stream
15
     * @param skip the number of lines to be skipped in the filtered stream
16
     */
16
     */
17
    public void setSkip(final long skip) {
17
    public void setSkip(final long skip) {
18
        this.skip = skip;
18
        this.skip = skip;
19
    }
19
    }
20
    /**
20
    /**
21
     * Returns the number of lines to be skipped in the filtered stream.
21
     * Returns the number of lines to be skipped in the filtered stream.
22
     *
22
     *
23
     * @return the number of lines to be skipped in the filtered stream
23
     * @return the number of lines to be skipped in the filtered stream
24
     */
24
     */
25
    private long getSkip() {
25
    private long getSkip() {
26
        return skip;
26
        return skip;
27
    }
27
    }
28
    /**
28
    /**
29
     * Creates a new HeadFilter using the passed in
29
     * Creates a new TailFilter using the passed in
30
     * Reader for instantiation.
30
     * Reader for instantiation.
31
     *
31
     *
32
     * @param rdr A Reader object providing the underlying stream.
32
     * @param rdr A Reader object providing the underlying stream.
33
     *            Must not be <code>null</code>.
33
     *            Must not be <code>null</code>.
34
     *
34
     *
35
     * @return a new filter based on this configuration, but filtering
35
     * @return a new filter based on this configuration, but filtering
36
     *         the specified reader
36
     *         the specified reader
37
     */
37
     */
38
    public Reader chain(final Reader rdr) {
38
    public Reader chain(final Reader rdr) {
39
        HeadFilter newFilter = new HeadFilter(rdr);
39
        TailFilter newFilter = new TailFilter(rdr);
40
        newFilter.setLines(getLines());
40
        newFilter.setLines(getLines());
41
        newFilter.setSkip(getSkip());
41
        newFilter.setSkip(getSkip());
42
        newFilter.setInitialized(true);
42
        newFilter.setInitialized(true);
43
        return newFilter
43
        return newFilter
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