OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library input.transformer.instrumentation; | 5 library input.transformer.instrumentation; |
6 | 6 |
7 import 'dart:convert'; | 7 import 'dart:convert'; |
8 | 8 |
9 import 'package:analyzer/src/generated/java_engine.dart'; | 9 import 'package:analyzer/src/generated/java_engine.dart'; |
10 import 'package:analyzer/instrumentation/instrumentation.dart'; | 10 import 'package:analyzer/instrumentation/instrumentation.dart'; |
(...skipping 11 matching lines...) Expand all Loading... |
22 class InstrumentationInputConverter extends CommonInputConverter { | 22 class InstrumentationInputConverter extends CommonInputConverter { |
23 final Set<String> codesSeen = new Set<String>(); | 23 final Set<String> codesSeen = new Set<String>(); |
24 | 24 |
25 /** | 25 /** |
26 * [readBuffer] holds the contents of the file being read from disk | 26 * [readBuffer] holds the contents of the file being read from disk |
27 * as recorded in the instrumentation log | 27 * as recorded in the instrumentation log |
28 * or `null` if not converting a "Read" entry. | 28 * or `null` if not converting a "Read" entry. |
29 */ | 29 */ |
30 StringBuffer readBuffer = null; | 30 StringBuffer readBuffer = null; |
31 | 31 |
32 InstrumentationInputConverter( | 32 InstrumentationInputConverter(String tmpSrcDirPath, PathMap srcPathMap) |
33 String tmpSrcDirPath, PathMap srcPathMap) | |
34 : super(tmpSrcDirPath, srcPathMap); | 33 : super(tmpSrcDirPath, srcPathMap); |
35 | 34 |
36 @override | 35 @override |
37 Operation convert(String line) { | 36 Operation convert(String line) { |
38 List<String> fields; | 37 List<String> fields; |
39 try { | 38 try { |
40 fields = _parseFields(line); | 39 fields = _parseFields(line); |
41 if (fields.length < 2) { | 40 if (fields.length < 2) { |
42 if (readBuffer != null) { | 41 if (readBuffer != null) { |
43 readBuffer.writeln(fields.length == 1 ? fields[0] : ''); | 42 readBuffer.writeln(fields.length == 1 ? fields[0] : ''); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 sb.writeCharCode(code); | 139 sb.writeCharCode(code); |
141 } | 140 } |
142 ++index; | 141 ++index; |
143 } | 142 } |
144 if (sb.isNotEmpty) { | 143 if (sb.isNotEmpty) { |
145 fields.add(sb.toString()); | 144 fields.add(sb.toString()); |
146 } | 145 } |
147 return fields; | 146 return fields; |
148 } | 147 } |
149 } | 148 } |
OLD | NEW |