MCPcopy Index your code
hub / github.com/apache/tomcat / indexOf

Method indexOf

java/org/apache/jasper/compiler/JspReader.java:179–208  ·  view source on GitHub ↗

Search the given character, If it was found, then mark the current cursor and the cursor point to next character.

(char c, Mark mark)

Source from the content-addressed store, hash-verified

177 * Search the given character, If it was found, then mark the current cursor and the cursor point to next character.
178 */
179 private Boolean indexOf(char c, Mark mark) {
180 if (!hasMoreInput()) {
181 return null;
182 }
183
184 int end = current.stream.length;
185 int ch;
186 int line = current.line;
187 int col = current.col;
188 int i = current.cursor;
189 for (; i < end; i++) {
190 ch = current.stream[i];
191
192 if (ch == c) {
193 mark.update(i, line, col);
194 }
195 if (ch == '\n') {
196 line++;
197 col = 0;
198 } else {
199 col++;
200 }
201 if (ch == c) {
202 current.update(i + 1, line, col);
203 return Boolean.TRUE;
204 }
205 }
206 current.update(i, line, col);
207 return Boolean.FALSE;
208 }
209
210 /**
211 * Back up the current cursor by one char, assumes current.cursor > 0, and that the char to be pushed back is not

Callers 15

skipUntilMethod · 0.95
isAbsoluteUrlMethod · 0.45
stripSessionMethod · 0.45
printMultiLnMethod · 0.45
processWebDotXmlMethod · 0.45
parseJavacMessageMethod · 0.45
generateSmapMethod · 0.45
doSmapTextMethod · 0.45
isOutDatedMethod · 0.45

Calls 2

hasMoreInputMethod · 0.95
updateMethod · 0.65

Tested by

no test coverage detected