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)
| 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 | /** |