Clover coverage report - PMD - 3.7 Coverage timestamp: Wed May 31 2006 09:25:59 EDT FRAMES NO FRAMES |
file stats: | LOC: | 43 |  | Methods: | 4
| NCLOC: | 35 |  | Classes: | 1
Source file | Conditionals | Statements | Methods | TOTAL
ExcludeLines.java | 50% | 100% | 100% | 90.5% |

1 |  | package net.sourceforge.pmd;
2 |  |
3 |  | import java.io.BufferedReader;
4 |  | import java.io.IOException;
5 |  | import java.io.Reader;
6 |  | import java.io.StringReader;
7 |  | import java.util.HashSet;
8 |  | import java.util.Set;
9 |  |
10 |  | public class ExcludeLines {
11 |  |
12 |  | public static final String EXCLUDE_MARKER = "NOPMD";
13 |  |
14 |  | private Set lines = new HashSet();
15 |  | private String copy;
16 |  |
17 | 1059 | public ExcludeLines(Reader r, String marker) throws IOException {
18 | 1059 | BufferedReader br = new BufferedReader(r);
19 | 1059 | StringBuffer copyBuffer = new StringBuffer();
20 | 1059 | String tmp;
21 | 1059 | int counter = 1;
22 | ? | while ((tmp = br.readLine()) != null) {
23 | 6161 | copyBuffer.append(tmp + PMD.EOL);
24 | 6161 | if (tmp.indexOf(marker) != -1) {
25 | 8 | lines.add(new Integer(counter));
26 |  | }
27 | 6161 | counter++;
28 |  | }
29 | 1059 | copy = copyBuffer.toString();
30 |  | }
31 |  |
32 | 3 | public ExcludeLines(Reader r) throws IOException {
33 | 3 | this(r, EXCLUDE_MARKER);
34 |  | }
35 |  |
36 | 1056 | public Reader getCopyReader() {
37 | 1056 | return new StringReader(copy);
38 |  | }
39 |  |
40 | 1062 | public Set getLinesToExclude() {
41 | 1062 | return lines;
42 |  | }
43 |  | }