|
18 | 18 | */
|
19 | 19 |
|
20 | 20 | /*
|
21 |
| - * Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved. |
| 21 | + * Copyright (c) 2007, 2022, Oracle and/or its affiliates. All rights reserved. |
22 | 22 | */
|
23 | 23 | package org.opengrok.indexer.history;
|
24 | 24 |
|
|
38 | 38 | * Wrote it since invoking 'sccs prs' for each file was
|
39 | 39 | * taking a lot of time. Time to index history has reduced 4 to 1!
|
40 | 40 | */
|
41 |
| -class SCCSHistoryParser { |
| 41 | +final class SCCSHistoryParser { |
42 | 42 |
|
43 | 43 | boolean pass;
|
44 | 44 | boolean passRecord;
|
45 | 45 | boolean active;
|
46 | 46 | int field;
|
47 | 47 | boolean sep;
|
48 |
| - StringBuilder record = new StringBuilder(128); |
| 48 | + StringBuilder sccsRecord = new StringBuilder(128); |
49 | 49 | Reader in;
|
50 | 50 |
|
51 | 51 | // Record fields
|
@@ -102,31 +102,31 @@ private History parseFile(File file) throws IOException, ParseException {
|
102 | 102 | }
|
103 | 103 |
|
104 | 104 | /**
|
105 |
| - * Read a single line of delta record into the 'record' member. |
| 105 | + * Read a single line of delta record into the {@link #sccsRecord} member. |
106 | 106 | *
|
107 |
| - * @throws java.io.IOException |
| 107 | + * @throws java.io.IOException on I/O error |
108 | 108 | * @return boolean indicating whether there is another record.
|
109 | 109 | */
|
110 | 110 | private boolean next() throws java.io.IOException {
|
111 | 111 | sep = true;
|
112 |
| - record.setLength(0); |
| 112 | + sccsRecord.setLength(0); |
113 | 113 | int c;
|
114 | 114 | while ((c = read()) > 1) {
|
115 |
| - record.append((char) c); |
| 115 | + sccsRecord.append((char) c); |
116 | 116 | }
|
117 | 117 | // to flag that revision needs to be re populated if you really need it
|
118 | 118 | revision = null;
|
119 |
| - return (record.length() > 2); |
| 119 | + return (sccsRecord.length() > 2); |
120 | 120 | }
|
121 | 121 |
|
122 | 122 | /**
|
123 | 123 | * Split record into fields.
|
124 | 124 | *
|
125 |
| - * @throws java.io.IOException |
| 125 | + * @throws ParseException if the date in the record cannot be parsed |
126 | 126 | */
|
127 | 127 | private void initFields() throws ParseException {
|
128 | 128 | if (revision == null) {
|
129 |
| - String[] f = record.toString().split(" ", 6); |
| 129 | + String[] f = sccsRecord.toString().split(" ", 6); |
130 | 130 | if (f.length > 5) {
|
131 | 131 | revision = f[1];
|
132 | 132 | try {
|
|
0 commit comments