MCPcopy Create free account
hub / github.com/apache/tomcat / addLineData

Method addLineData

java/org/apache/jasper/compiler/SmapStratum.java:244–274  ·  view source on GitHub ↗

Adds complete information about a simple line mapping. Specify all the fields in this method; the back-end machinery takes care of printing only those that are necessary in the final SMAP. (My view is that fields are optional primarily for spatial efficiency, not for programmer convenience. Could al

(int inputStartLine, String inputFileName, int inputLineCount, int outputStartLine,
            int outputLineIncrement)

Source from the content-addressed store, hash-verified

242 * <code>OutputLineExcrement</code>.</i>
243 */
244 public void addLineData(int inputStartLine, String inputFileName, int inputLineCount, int outputStartLine,
245 int outputLineIncrement) {
246 // check the input - what are you doing here??
247 int fileIndex = filePathList.indexOf(inputFileName);
248 if (fileIndex == -1) {
249 throw new IllegalArgumentException("inputFileName: " + inputFileName);
250 }
251
252 /*
253 * Jasper incorrectly SMAPs certain Nodes, giving them an outputStartLine of 0. This can cause a fatal error in
254 * optimizeLineSection, making it impossible for Jasper to compile the JSP. Until we can fix the underlying
255 * SMAPping problem, we simply ignore the flawed SMAP entries.
256 */
257 if (outputStartLine == 0) {
258 return;
259 }
260
261 // build the LineInfo
262 LineInfo li = new LineInfo();
263 li.setInputStartLine(inputStartLine);
264 li.setInputLineCount(inputLineCount);
265 li.setOutputStartLine(outputStartLine);
266 li.setOutputLineIncrement(outputLineIncrement);
267 if (fileIndex != lastFileID) {
268 li.setLineFileID(fileIndex);
269 }
270 lastFileID = fileIndex;
271
272 // save it
273 lineData.add(li);
274 }
275
276
277 /**

Callers 3

test01Method · 0.95
visitMethod · 0.80
doSmapMethod · 0.80

Calls 7

setInputStartLineMethod · 0.95
setInputLineCountMethod · 0.95
setOutputStartLineMethod · 0.95
setLineFileIDMethod · 0.95
addMethod · 0.65
indexOfMethod · 0.45

Tested by 1

test01Method · 0.76