| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
| 6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
| 7 | 7 |
| 8 library engine; | 8 library engine; |
| 9 | 9 |
| 10 import 'java_core.dart'; | 10 import 'java_core.dart'; |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 * | 287 * |
| 288 * @param source the source whose line information is to be returned | 288 * @param source the source whose line information is to be returned |
| 289 * @return the line information for the given source | 289 * @return the line information for the given source |
| 290 * @throws AnalysisException if the line information could not be determined b
ecause the analysis | 290 * @throws AnalysisException if the line information could not be determined b
ecause the analysis |
| 291 * could not be performed | 291 * could not be performed |
| 292 * @see #getLineInfo(Source) | 292 * @see #getLineInfo(Source) |
| 293 */ | 293 */ |
| 294 LineInfo computeLineInfo(Source source); | 294 LineInfo computeLineInfo(Source source); |
| 295 | 295 |
| 296 /** | 296 /** |
| 297 * Notifies the context that the client is going to stop using this context. |
| 298 */ |
| 299 void dispose(); |
| 300 |
| 301 /** |
| 297 * Return `true` if the given source exists. | 302 * Return `true` if the given source exists. |
| 298 * | 303 * |
| 299 * This method should be used rather than the method [Source#exists] because c
ontexts can | 304 * This method should be used rather than the method [Source#exists] because c
ontexts can |
| 300 * have local overrides of the content of a source that the source is not awar
e of and a source | 305 * have local overrides of the content of a source that the source is not awar
e of and a source |
| 301 * with local content is considered to exist even if there is no file on disk. | 306 * with local content is considered to exist even if there is no file on disk. |
| 302 * | 307 * |
| 303 * @param source the source whose modification stamp is to be returned | 308 * @param source the source whose modification stamp is to be returned |
| 304 * @return `true` if the source exists | 309 * @return `true` if the source exists |
| 305 */ | 310 */ |
| 306 bool exists(Source source); | 311 bool exists(Source source); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 * This method should be used rather than the method [Source#getContents] beca
use contexts | 347 * This method should be used rather than the method [Source#getContents] beca
use contexts |
| 343 * can have local overrides of the content of a source that the source is not
aware of. | 348 * can have local overrides of the content of a source that the source is not
aware of. |
| 344 * | 349 * |
| 345 * @param source the source whose content is to be returned | 350 * @param source the source whose content is to be returned |
| 346 * @return the contents and timestamp of the source | 351 * @return the contents and timestamp of the source |
| 347 * @throws Exception if the contents of the source could not be accessed | 352 * @throws Exception if the contents of the source could not be accessed |
| 348 */ | 353 */ |
| 349 TimestampedData<String> getContents(Source source); | 354 TimestampedData<String> getContents(Source source); |
| 350 | 355 |
| 351 /** | 356 /** |
| 352 * Get the contents of the given source and pass it to the given content recei
ver. | |
| 353 * | |
| 354 * This method should be used rather than the method | |
| 355 * [Source#getContentsToReceiver] because contexts can have local overrides | |
| 356 * of the content of a source that the source is not aware of. | |
| 357 * | |
| 358 * @param source the source whose content is to be returned | |
| 359 * @param receiver the content receiver to which the content of the source wil
l be passed | |
| 360 * @throws Exception if the contents of the source could not be accessed | |
| 361 */ | |
| 362 void getContentsToReceiver(Source source, Source_ContentReceiver receiver); | |
| 363 | |
| 364 /** | |
| 365 * Return the element referenced by the given location, or `null` if the eleme
nt is not | 357 * Return the element referenced by the given location, or `null` if the eleme
nt is not |
| 366 * immediately available or if there is no element with the given location. Th
e latter condition | 358 * immediately available or if there is no element with the given location. Th
e latter condition |
| 367 * can occur, for example, if the location describes an element from a differe
nt context or if the | 359 * can occur, for example, if the location describes an element from a differe
nt context or if the |
| 368 * element has been removed from this context as a result of some change since
it was originally | 360 * element has been removed from this context as a result of some change since
it was originally |
| 369 * obtained. | 361 * obtained. |
| 370 * | 362 * |
| 371 * @param location the reference describing the element to be returned | 363 * @param location the reference describing the element to be returned |
| 372 * @return the element referenced by the given location | 364 * @return the element referenced by the given location |
| 373 */ | 365 */ |
| 374 Element getElement(ElementLocation location); | 366 Element getElement(ElementLocation location); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 * <b>Note:</b> In addition to the expected case of returning `false` if the s
ource is known | 562 * <b>Note:</b> In addition to the expected case of returning `false` if the s
ource is known |
| 571 * to be a library that cannot be run on a client, this method will also retur
n `false` if | 563 * to be a library that cannot be run on a client, this method will also retur
n `false` if |
| 572 * the source is not known to be a library or if we do not know whether it can
be run on a client. | 564 * the source is not known to be a library or if we do not know whether it can
be run on a client. |
| 573 * | 565 * |
| 574 * @param librarySource the source being tested | 566 * @param librarySource the source being tested |
| 575 * @return `true` if the given source is known to be a library that can be run
on a client | 567 * @return `true` if the given source is known to be a library that can be run
on a client |
| 576 */ | 568 */ |
| 577 bool isClientLibrary(Source librarySource); | 569 bool isClientLibrary(Source librarySource); |
| 578 | 570 |
| 579 /** | 571 /** |
| 572 * Returns `true` if this context was disposed using [dispose]. |
| 573 * |
| 574 * @return `true` if this context was disposed |
| 575 */ |
| 576 bool get isDisposed; |
| 577 |
| 578 /** |
| 580 * Return `true` if the given source is known to be the defining compilation u
nit of a | 579 * Return `true` if the given source is known to be the defining compilation u
nit of a |
| 581 * library that can be run on the server (does not reference 'dart:html', eith
er directly or | 580 * library that can be run on the server (does not reference 'dart:html', eith
er directly or |
| 582 * indirectly). | 581 * indirectly). |
| 583 * | 582 * |
| 584 * <b>Note:</b> In addition to the expected case of returning `false` if the s
ource is known | 583 * <b>Note:</b> In addition to the expected case of returning `false` if the s
ource is known |
| 585 * to be a library that cannot be run on the server, this method will also ret
urn `false` if | 584 * to be a library that cannot be run on the server, this method will also ret
urn `false` if |
| 586 * the source is not known to be a library or if we do not know whether it can
be run on the | 585 * the source is not known to be a library or if we do not know whether it can
be run on the |
| 587 * server. | 586 * server. |
| 588 * | 587 * |
| 589 * @param librarySource the source being tested | 588 * @param librarySource the source being tested |
| (...skipping 3045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3635 * priority source's AST structure to be flushed. | 3634 * priority source's AST structure to be flushed. |
| 3636 */ | 3635 */ |
| 3637 static int _PRIORITY_ORDER_SIZE_DELTA = 4; | 3636 static int _PRIORITY_ORDER_SIZE_DELTA = 4; |
| 3638 | 3637 |
| 3639 /** | 3638 /** |
| 3640 * The set of analysis options controlling the behavior of this context. | 3639 * The set of analysis options controlling the behavior of this context. |
| 3641 */ | 3640 */ |
| 3642 AnalysisOptionsImpl _options = new AnalysisOptionsImpl(); | 3641 AnalysisOptionsImpl _options = new AnalysisOptionsImpl(); |
| 3643 | 3642 |
| 3644 /** | 3643 /** |
| 3644 * A flag indicating whether this context is disposed. |
| 3645 */ |
| 3646 bool _disposed = false; |
| 3647 |
| 3648 /** |
| 3645 * A cache of content used to override the default content of a source. | 3649 * A cache of content used to override the default content of a source. |
| 3646 */ | 3650 */ |
| 3647 ContentCache _contentCache = new ContentCache(); | 3651 ContentCache _contentCache = new ContentCache(); |
| 3648 | 3652 |
| 3649 /** | 3653 /** |
| 3650 * The source factory used to create the sources that can be analyzed in this
context. | 3654 * The source factory used to create the sources that can be analyzed in this
context. |
| 3651 */ | 3655 */ |
| 3652 SourceFactory _sourceFactory; | 3656 SourceFactory _sourceFactory; |
| 3653 | 3657 |
| 3654 /** | 3658 /** |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3901 dartEntry = _cacheDartParseData(source, dartEntry, DartEntry.PARSED_UNIT); | 3905 dartEntry = _cacheDartParseData(source, dartEntry, DartEntry.PARSED_UNIT); |
| 3902 DartEntryImpl dartCopy = dartEntry.writableCopy; | 3906 DartEntryImpl dartCopy = dartEntry.writableCopy; |
| 3903 CompilationUnit unit = dartCopy.resolvableCompilationUnit; | 3907 CompilationUnit unit = dartCopy.resolvableCompilationUnit; |
| 3904 if (unit == null) { | 3908 if (unit == null) { |
| 3905 throw new AnalysisException.con2("Internal error: computeResolvableCompila
tionUnit could not parse ${source.fullName}", dartEntry.exception); | 3909 throw new AnalysisException.con2("Internal error: computeResolvableCompila
tionUnit could not parse ${source.fullName}", dartEntry.exception); |
| 3906 } | 3910 } |
| 3907 _cache.put(source, dartCopy); | 3911 _cache.put(source, dartCopy); |
| 3908 return new ResolvableCompilationUnit(dartCopy.modificationTime, unit); | 3912 return new ResolvableCompilationUnit(dartCopy.modificationTime, unit); |
| 3909 } | 3913 } |
| 3910 | 3914 |
| 3915 void dispose() { |
| 3916 _disposed = true; |
| 3917 } |
| 3918 |
| 3911 bool exists(Source source) { | 3919 bool exists(Source source) { |
| 3912 if (source == null) { | 3920 if (source == null) { |
| 3913 return false; | 3921 return false; |
| 3914 } | 3922 } |
| 3915 if (_contentCache.getContents(source) != null) { | 3923 if (_contentCache.getContents(source) != null) { |
| 3916 return true; | 3924 return true; |
| 3917 } | 3925 } |
| 3918 return source.exists(); | 3926 return source.exists(); |
| 3919 } | 3927 } |
| 3920 | 3928 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3954 } | 3962 } |
| 3955 | 3963 |
| 3956 TimestampedData<String> getContents(Source source) { | 3964 TimestampedData<String> getContents(Source source) { |
| 3957 String contents = _contentCache.getContents(source); | 3965 String contents = _contentCache.getContents(source); |
| 3958 if (contents != null) { | 3966 if (contents != null) { |
| 3959 return new TimestampedData<String>(_contentCache.getModificationStamp(sour
ce), contents); | 3967 return new TimestampedData<String>(_contentCache.getModificationStamp(sour
ce), contents); |
| 3960 } | 3968 } |
| 3961 return source.contents; | 3969 return source.contents; |
| 3962 } | 3970 } |
| 3963 | 3971 |
| 3964 void getContentsToReceiver(Source source, Source_ContentReceiver receiver) { | |
| 3965 String contents = _contentCache.getContents(source); | |
| 3966 if (contents != null) { | |
| 3967 receiver.accept(contents, _contentCache.getModificationStamp(source)); | |
| 3968 return; | |
| 3969 } | |
| 3970 source.getContentsToReceiver(receiver); | |
| 3971 } | |
| 3972 | |
| 3973 Element getElement(ElementLocation location) { | 3972 Element getElement(ElementLocation location) { |
| 3974 // TODO(brianwilkerson) This should not be a "get" method. | 3973 // TODO(brianwilkerson) This should not be a "get" method. |
| 3975 try { | 3974 try { |
| 3976 List<String> components = (location as ElementLocationImpl).components; | 3975 List<String> components = (location as ElementLocationImpl).components; |
| 3977 Source librarySource = _computeSourceFromEncoding(components[0]); | 3976 Source librarySource = _computeSourceFromEncoding(components[0]); |
| 3978 ElementImpl element = computeLibraryElement(librarySource) as ElementImpl; | 3977 ElementImpl element = computeLibraryElement(librarySource) as ElementImpl; |
| 3979 for (int i = 1; i < components.length; i++) { | 3978 for (int i = 1; i < components.length; i++) { |
| 3980 if (element == null) { | 3979 if (element == null) { |
| 3981 return null; | 3980 return null; |
| 3982 } | 3981 } |
| 3983 element = element.getChild(components[i]); | 3982 element = element.getChild(components[i]); |
| 3984 } | 3983 } |
| 3985 return element; | 3984 return element; |
| 3986 } on AnalysisException catch (exception) { | 3985 } on AnalysisException catch (exception) { |
| 3987 return null; | 3986 return null; |
| 3988 } | 3987 } |
| 3989 } | 3988 } |
| 3990 | 3989 |
| 3991 AnalysisErrorInfo getErrors(Source source) { | 3990 AnalysisErrorInfo getErrors(Source source) { |
| 3992 SourceEntry sourceEntry = _getReadableSourceEntry(source); | 3991 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source); |
| 3993 if (sourceEntry is DartEntry) { | 3992 if (sourceEntry is DartEntry) { |
| 3994 DartEntry dartEntry = sourceEntry; | 3993 DartEntry dartEntry = sourceEntry; |
| 3995 return new AnalysisErrorInfoImpl(dartEntry.allErrors, dartEntry.getValue(S
ourceEntry.LINE_INFO)); | 3994 return new AnalysisErrorInfoImpl(dartEntry.allErrors, dartEntry.getValue(S
ourceEntry.LINE_INFO)); |
| 3996 } else if (sourceEntry is HtmlEntry) { | 3995 } else if (sourceEntry is HtmlEntry) { |
| 3997 HtmlEntry htmlEntry = sourceEntry; | 3996 HtmlEntry htmlEntry = sourceEntry; |
| 3998 return new AnalysisErrorInfoImpl(htmlEntry.allErrors, htmlEntry.getValue(S
ourceEntry.LINE_INFO)); | 3997 return new AnalysisErrorInfoImpl(htmlEntry.allErrors, htmlEntry.getValue(S
ourceEntry.LINE_INFO)); |
| 3999 } | 3998 } |
| 4000 return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, null); | 3999 return new AnalysisErrorInfoImpl(AnalysisError.NO_ERRORS, null); |
| 4001 } | 4000 } |
| 4002 | 4001 |
| 4003 HtmlElement getHtmlElement(Source source) { | 4002 HtmlElement getHtmlElement(Source source) { |
| 4004 SourceEntry sourceEntry = _getReadableSourceEntry(source); | 4003 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source); |
| 4005 if (sourceEntry is HtmlEntry) { | 4004 if (sourceEntry is HtmlEntry) { |
| 4006 return sourceEntry.getValue(HtmlEntry.ELEMENT); | 4005 return sourceEntry.getValue(HtmlEntry.ELEMENT); |
| 4007 } | 4006 } |
| 4008 return null; | 4007 return null; |
| 4009 } | 4008 } |
| 4010 | 4009 |
| 4011 List<Source> getHtmlFilesReferencing(Source source) { | 4010 List<Source> getHtmlFilesReferencing(Source source) { |
| 4012 SourceKind sourceKind = getKindOf(source); | 4011 SourceKind sourceKind = getKindOf(source); |
| 4013 if (sourceKind == null) { | 4012 if (sourceKind == null) { |
| 4014 return Source.EMPTY_ARRAY; | 4013 return Source.EMPTY_ARRAY; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 4032 } | 4031 } |
| 4033 if (htmlSources.isEmpty) { | 4032 if (htmlSources.isEmpty) { |
| 4034 return Source.EMPTY_ARRAY; | 4033 return Source.EMPTY_ARRAY; |
| 4035 } | 4034 } |
| 4036 return new List.from(htmlSources); | 4035 return new List.from(htmlSources); |
| 4037 } | 4036 } |
| 4038 | 4037 |
| 4039 List<Source> get htmlSources => _getSources(SourceKind.HTML); | 4038 List<Source> get htmlSources => _getSources(SourceKind.HTML); |
| 4040 | 4039 |
| 4041 SourceKind getKindOf(Source source) { | 4040 SourceKind getKindOf(Source source) { |
| 4042 SourceEntry sourceEntry = _getReadableSourceEntry(source); | 4041 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source); |
| 4043 if (sourceEntry == null) { | 4042 if (sourceEntry == null) { |
| 4044 return SourceKind.UNKNOWN; | 4043 return SourceKind.UNKNOWN; |
| 4045 } | 4044 } |
| 4046 return sourceEntry.kind; | 4045 return sourceEntry.kind; |
| 4047 } | 4046 } |
| 4048 | 4047 |
| 4049 List<Source> get launchableClientLibrarySources { | 4048 List<Source> get launchableClientLibrarySources { |
| 4050 // TODO(brianwilkerson) This needs to filter out libraries that do not refer
ence dart:html, | 4049 // TODO(brianwilkerson) This needs to filter out libraries that do not refer
ence dart:html, |
| 4051 // either directly or indirectly. | 4050 // either directly or indirectly. |
| 4052 List<Source> sources = new List<Source>(); | 4051 List<Source> sources = new List<Source>(); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 4072 if (identical(sourceEntry.kind, SourceKind.LIBRARY) && !source.isInSystemL
ibrary) { | 4071 if (identical(sourceEntry.kind, SourceKind.LIBRARY) && !source.isInSystemL
ibrary) { |
| 4073 // DartEntry dartEntry = (DartEntry) sourceEntry; | 4072 // DartEntry dartEntry = (DartEntry) sourceEntry; |
| 4074 // if (dartEntry.getValue(DartEntry.IS_LAUNCHABLE) && !dartEntr
y.getValue(DartEntry.IS_CLIENT)) { | 4073 // if (dartEntry.getValue(DartEntry.IS_LAUNCHABLE) && !dartEntr
y.getValue(DartEntry.IS_CLIENT)) { |
| 4075 sources.add(source); | 4074 sources.add(source); |
| 4076 } | 4075 } |
| 4077 } | 4076 } |
| 4078 return new List.from(sources); | 4077 return new List.from(sources); |
| 4079 } | 4078 } |
| 4080 | 4079 |
| 4081 List<Source> getLibrariesContaining(Source source) { | 4080 List<Source> getLibrariesContaining(Source source) { |
| 4082 DartEntry dartEntry = _getReadableDartEntry(source); | 4081 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source); |
| 4083 if (dartEntry == null) { | 4082 if (sourceEntry is DartEntry) { |
| 4084 return Source.EMPTY_ARRAY; | 4083 return sourceEntry.getValue(DartEntry.CONTAINING_LIBRARIES); |
| 4085 } | 4084 } |
| 4086 return dartEntry.getValue(DartEntry.CONTAINING_LIBRARIES); | 4085 return Source.EMPTY_ARRAY; |
| 4087 } | 4086 } |
| 4088 | 4087 |
| 4089 List<Source> getLibrariesDependingOn(Source librarySource) { | 4088 List<Source> getLibrariesDependingOn(Source librarySource) { |
| 4090 List<Source> dependentLibraries = new List<Source>(); | 4089 List<Source> dependentLibraries = new List<Source>(); |
| 4091 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { | 4090 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { |
| 4092 SourceEntry sourceEntry = entry.getValue(); | 4091 SourceEntry sourceEntry = entry.getValue(); |
| 4093 if (identical(sourceEntry.kind, SourceKind.LIBRARY)) { | 4092 if (identical(sourceEntry.kind, SourceKind.LIBRARY)) { |
| 4094 if (_contains((sourceEntry as DartEntry).getValue(DartEntry.EXPORTED_LIB
RARIES), librarySource)) { | 4093 if (_contains((sourceEntry as DartEntry).getValue(DartEntry.EXPORTED_LIB
RARIES), librarySource)) { |
| 4095 dependentLibraries.add(entry.getKey()); | 4094 dependentLibraries.add(entry.getKey()); |
| 4096 } | 4095 } |
| 4097 if (_contains((sourceEntry as DartEntry).getValue(DartEntry.IMPORTED_LIB
RARIES), librarySource)) { | 4096 if (_contains((sourceEntry as DartEntry).getValue(DartEntry.IMPORTED_LIB
RARIES), librarySource)) { |
| 4098 dependentLibraries.add(entry.getKey()); | 4097 dependentLibraries.add(entry.getKey()); |
| 4099 } | 4098 } |
| 4100 } | 4099 } |
| 4101 } | 4100 } |
| 4102 if (dependentLibraries.isEmpty) { | 4101 if (dependentLibraries.isEmpty) { |
| 4103 return Source.EMPTY_ARRAY; | 4102 return Source.EMPTY_ARRAY; |
| 4104 } | 4103 } |
| 4105 return new List.from(dependentLibraries); | 4104 return new List.from(dependentLibraries); |
| 4106 } | 4105 } |
| 4107 | 4106 |
| 4108 LibraryElement getLibraryElement(Source source) { | 4107 LibraryElement getLibraryElement(Source source) { |
| 4109 SourceEntry sourceEntry = _getReadableSourceEntry(source); | 4108 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source); |
| 4110 if (sourceEntry is DartEntry) { | 4109 if (sourceEntry is DartEntry) { |
| 4111 return sourceEntry.getValue(DartEntry.ELEMENT); | 4110 return sourceEntry.getValue(DartEntry.ELEMENT); |
| 4112 } | 4111 } |
| 4113 return null; | 4112 return null; |
| 4114 } | 4113 } |
| 4115 | 4114 |
| 4116 List<Source> get librarySources => _getSources(SourceKind.LIBRARY); | 4115 List<Source> get librarySources => _getSources(SourceKind.LIBRARY); |
| 4117 | 4116 |
| 4118 LineInfo getLineInfo(Source source) { | 4117 LineInfo getLineInfo(Source source) { |
| 4119 SourceEntry sourceEntry = _getReadableSourceEntry(source); | 4118 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(source); |
| 4120 if (sourceEntry != null) { | 4119 if (sourceEntry != null) { |
| 4121 return sourceEntry.getValue(SourceEntry.LINE_INFO); | 4120 return sourceEntry.getValue(SourceEntry.LINE_INFO); |
| 4122 } | 4121 } |
| 4123 return null; | 4122 return null; |
| 4124 } | 4123 } |
| 4125 | 4124 |
| 4126 int getModificationStamp(Source source) { | 4125 int getModificationStamp(Source source) { |
| 4127 int stamp = _contentCache.getModificationStamp(source); | 4126 int stamp = _contentCache.getModificationStamp(source); |
| 4128 if (stamp != null) { | 4127 if (stamp != null) { |
| 4129 return stamp; | 4128 return stamp; |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4202 } | 4201 } |
| 4203 | 4202 |
| 4204 CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement l
ibrary) { | 4203 CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement l
ibrary) { |
| 4205 if (library == null) { | 4204 if (library == null) { |
| 4206 return null; | 4205 return null; |
| 4207 } | 4206 } |
| 4208 return getResolvedCompilationUnit2(unitSource, library.source); | 4207 return getResolvedCompilationUnit2(unitSource, library.source); |
| 4209 } | 4208 } |
| 4210 | 4209 |
| 4211 CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source libraryS
ource) { | 4210 CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source libraryS
ource) { |
| 4212 SourceEntry sourceEntry = _getReadableSourceEntry(unitSource); | 4211 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(unitSource); |
| 4213 if (sourceEntry is DartEntry) { | 4212 if (sourceEntry is DartEntry) { |
| 4214 return sourceEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySourc
e); | 4213 return sourceEntry.getValueInLibrary(DartEntry.RESOLVED_UNIT, librarySourc
e); |
| 4215 } | 4214 } |
| 4216 return null; | 4215 return null; |
| 4217 } | 4216 } |
| 4218 | 4217 |
| 4219 ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) { | 4218 ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) { |
| 4220 SourceEntry sourceEntry = _getReadableSourceEntry(htmlSource); | 4219 SourceEntry sourceEntry = _getReadableSourceEntryOrNull(htmlSource); |
| 4221 if (sourceEntry is HtmlEntry) { | 4220 if (sourceEntry is HtmlEntry) { |
| 4222 HtmlEntry htmlEntry = sourceEntry; | 4221 HtmlEntry htmlEntry = sourceEntry; |
| 4223 return htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT); | 4222 return htmlEntry.getValue(HtmlEntry.RESOLVED_UNIT); |
| 4224 } | 4223 } |
| 4225 return null; | 4224 return null; |
| 4226 } | 4225 } |
| 4227 | 4226 |
| 4228 SourceFactory get sourceFactory => _sourceFactory; | 4227 SourceFactory get sourceFactory => _sourceFactory; |
| 4229 | 4228 |
| 4230 /** | 4229 /** |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4311 | 4310 |
| 4312 bool isClientLibrary(Source librarySource) { | 4311 bool isClientLibrary(Source librarySource) { |
| 4313 SourceEntry sourceEntry = _getReadableSourceEntry(librarySource); | 4312 SourceEntry sourceEntry = _getReadableSourceEntry(librarySource); |
| 4314 if (sourceEntry is DartEntry) { | 4313 if (sourceEntry is DartEntry) { |
| 4315 DartEntry dartEntry = sourceEntry; | 4314 DartEntry dartEntry = sourceEntry; |
| 4316 return dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(DartE
ntry.IS_LAUNCHABLE); | 4315 return dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(DartE
ntry.IS_LAUNCHABLE); |
| 4317 } | 4316 } |
| 4318 return false; | 4317 return false; |
| 4319 } | 4318 } |
| 4320 | 4319 |
| 4320 bool get isDisposed => _disposed; |
| 4321 |
| 4321 bool isServerLibrary(Source librarySource) { | 4322 bool isServerLibrary(Source librarySource) { |
| 4322 SourceEntry sourceEntry = _getReadableSourceEntry(librarySource); | 4323 SourceEntry sourceEntry = _getReadableSourceEntry(librarySource); |
| 4323 if (sourceEntry is DartEntry) { | 4324 if (sourceEntry is DartEntry) { |
| 4324 DartEntry dartEntry = sourceEntry; | 4325 DartEntry dartEntry = sourceEntry; |
| 4325 return !dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(Dart
Entry.IS_LAUNCHABLE); | 4326 return !dartEntry.getValue(DartEntry.IS_CLIENT) && dartEntry.getValue(Dart
Entry.IS_LAUNCHABLE); |
| 4326 } | 4327 } |
| 4327 return false; | 4328 return false; |
| 4328 } | 4329 } |
| 4329 | 4330 |
| 4330 void mergeContext(AnalysisContext context) { | 4331 void mergeContext(AnalysisContext context) { |
| (...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5755 if (sourceEntry == null) { | 5756 if (sourceEntry == null) { |
| 5756 sourceEntry = _createSourceEntry(source); | 5757 sourceEntry = _createSourceEntry(source); |
| 5757 } | 5758 } |
| 5758 if (sourceEntry is HtmlEntry) { | 5759 if (sourceEntry is HtmlEntry) { |
| 5759 return sourceEntry as HtmlEntry; | 5760 return sourceEntry as HtmlEntry; |
| 5760 } | 5761 } |
| 5761 return null; | 5762 return null; |
| 5762 } | 5763 } |
| 5763 | 5764 |
| 5764 /** | 5765 /** |
| 5765 * Return the cache entry associated with the given source, or `null` if there
is no entry | 5766 * Return the cache entry associated with the given source, creating it if nec
essary. |
| 5766 * associated with the source. | |
| 5767 * | 5767 * |
| 5768 * @param source the source for which a cache entry is being sought | 5768 * @param source the source for which a cache entry is being sought |
| 5769 * @return the source cache entry associated with the given source | 5769 * @return the source cache entry associated with the given source |
| 5770 */ | 5770 */ |
| 5771 SourceEntry _getReadableSourceEntry(Source source) { | 5771 SourceEntry _getReadableSourceEntry(Source source) { |
| 5772 SourceEntry sourceEntry = _cache.get(source); | 5772 SourceEntry sourceEntry = _cache.get(source); |
| 5773 if (sourceEntry == null) { | 5773 if (sourceEntry == null) { |
| 5774 sourceEntry = _createSourceEntry(source); | 5774 sourceEntry = _createSourceEntry(source); |
| 5775 } | 5775 } |
| 5776 return sourceEntry; | 5776 return sourceEntry; |
| 5777 } | 5777 } |
| 5778 | 5778 |
| 5779 /** | 5779 /** |
| 5780 * Return the cache entry associated with the given source, or `null` if there
is no entry |
| 5781 * associated with the source. |
| 5782 * |
| 5783 * @param source the source for which a cache entry is being sought |
| 5784 * @return the source cache entry associated with the given source |
| 5785 */ |
| 5786 SourceEntry _getReadableSourceEntryOrNull(Source source) => _cache.get(source)
; |
| 5787 |
| 5788 /** |
| 5780 * Return an array containing all of the sources known to this context that ha
ve the given kind. | 5789 * Return an array containing all of the sources known to this context that ha
ve the given kind. |
| 5781 * | 5790 * |
| 5782 * @param kind the kind of sources to be returned | 5791 * @param kind the kind of sources to be returned |
| 5783 * @return all of the sources known to this context that have the given kind | 5792 * @return all of the sources known to this context that have the given kind |
| 5784 */ | 5793 */ |
| 5785 List<Source> _getSources(SourceKind kind) { | 5794 List<Source> _getSources(SourceKind kind) { |
| 5786 List<Source> sources = new List<Source>(); | 5795 List<Source> sources = new List<Source>(); |
| 5787 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { | 5796 for (MapEntry<Source, SourceEntry> entry in _cache.entrySet()) { |
| 5788 if (identical(entry.getValue().kind, kind)) { | 5797 if (identical(entry.getValue().kind, kind)) { |
| 5789 sources.add(entry.getKey()); | 5798 sources.add(entry.getKey()); |
| (...skipping 2230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8020 bool get hasWork => _oldLength > 0 || _newLength > 0; | 8029 bool get hasWork => _oldLength > 0 || _newLength > 0; |
| 8021 } | 8030 } |
| 8022 | 8031 |
| 8023 /** | 8032 /** |
| 8024 * Instances of the class `InstrumentedAnalysisContextImpl` implement an | 8033 * Instances of the class `InstrumentedAnalysisContextImpl` implement an |
| 8025 * [AnalysisContext] by recording instrumentation data and delegating to | 8034 * [AnalysisContext] by recording instrumentation data and delegating to |
| 8026 * another analysis context to do the non-instrumentation work. | 8035 * another analysis context to do the non-instrumentation work. |
| 8027 */ | 8036 */ |
| 8028 class InstrumentedAnalysisContextImpl implements InternalAnalysisContext { | 8037 class InstrumentedAnalysisContextImpl implements InternalAnalysisContext { |
| 8029 /** | 8038 /** |
| 8039 * If the current thread is the UI thread, then note this in the specified ins
trumentation and |
| 8040 * append this information to the log. |
| 8041 * |
| 8042 * @param instrumentation the instrumentation, not `null` |
| 8043 */ |
| 8044 static void _checkThread(InstrumentationBuilder instrumentation) { |
| 8045 } |
| 8046 |
| 8047 /** |
| 8030 * Record an exception that was thrown during analysis. | 8048 * Record an exception that was thrown during analysis. |
| 8031 * | 8049 * |
| 8032 * @param instrumentation the instrumentation builder being used to record the
exception | 8050 * @param instrumentation the instrumentation builder being used to record the
exception |
| 8033 * @param exception the exception being reported | 8051 * @param exception the exception being reported |
| 8034 */ | 8052 */ |
| 8035 static void _recordAnalysisException(InstrumentationBuilder instrumentation, A
nalysisException exception) { | 8053 static void _recordAnalysisException(InstrumentationBuilder instrumentation, A
nalysisException exception) { |
| 8036 instrumentation.record(exception); | 8054 instrumentation.record(exception); |
| 8037 } | 8055 } |
| 8038 | 8056 |
| 8039 /** | 8057 /** |
| (...skipping 21 matching lines...) Expand all Loading... |
| 8061 InstrumentedAnalysisContextImpl.con1(InternalAnalysisContext context) { | 8079 InstrumentedAnalysisContextImpl.con1(InternalAnalysisContext context) { |
| 8062 _basis = context; | 8080 _basis = context; |
| 8063 } | 8081 } |
| 8064 | 8082 |
| 8065 void addSourceInfo(Source source, SourceEntry info) { | 8083 void addSourceInfo(Source source, SourceEntry info) { |
| 8066 _basis.addSourceInfo(source, info); | 8084 _basis.addSourceInfo(source, info); |
| 8067 } | 8085 } |
| 8068 | 8086 |
| 8069 void applyChanges(ChangeSet changeSet) { | 8087 void applyChanges(ChangeSet changeSet) { |
| 8070 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
applyChanges"); | 8088 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
applyChanges"); |
| 8089 _checkThread(instrumentation); |
| 8071 try { | 8090 try { |
| 8072 instrumentation.metric3("contextId", _contextId); | 8091 instrumentation.metric3("contextId", _contextId); |
| 8073 _basis.applyChanges(changeSet); | 8092 _basis.applyChanges(changeSet); |
| 8074 } finally { | 8093 } finally { |
| 8075 instrumentation.log(); | 8094 instrumentation.log(); |
| 8076 } | 8095 } |
| 8077 } | 8096 } |
| 8078 | 8097 |
| 8079 String computeDocumentationComment(Element element) { | 8098 String computeDocumentationComment(Element element) { |
| 8080 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeDocumentationComment"); | 8099 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeDocumentationComment"); |
| 8100 _checkThread(instrumentation); |
| 8081 try { | 8101 try { |
| 8082 instrumentation.metric3("contextId", _contextId); | 8102 instrumentation.metric3("contextId", _contextId); |
| 8083 return _basis.computeDocumentationComment(element); | 8103 return _basis.computeDocumentationComment(element); |
| 8084 } finally { | 8104 } finally { |
| 8085 instrumentation.log(); | 8105 instrumentation.log(); |
| 8086 } | 8106 } |
| 8087 } | 8107 } |
| 8088 | 8108 |
| 8089 List<AnalysisError> computeErrors(Source source) { | 8109 List<AnalysisError> computeErrors(Source source) { |
| 8090 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeErrors"); | 8110 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeErrors"); |
| 8111 _checkThread(instrumentation); |
| 8091 try { | 8112 try { |
| 8092 instrumentation.metric3("contextId", _contextId); | 8113 instrumentation.metric3("contextId", _contextId); |
| 8093 List<AnalysisError> errors = _basis.computeErrors(source); | 8114 List<AnalysisError> errors = _basis.computeErrors(source); |
| 8094 instrumentation.metric2("Errors-count", errors.length); | 8115 instrumentation.metric2("Errors-count", errors.length); |
| 8095 return errors; | 8116 return errors; |
| 8096 } finally { | 8117 } finally { |
| 8097 instrumentation.log(); | 8118 instrumentation.log(); |
| 8098 } | 8119 } |
| 8099 } | 8120 } |
| 8100 | 8121 |
| 8101 List<Source> computeExportedLibraries(Source source) => _basis.computeExported
Libraries(source); | 8122 List<Source> computeExportedLibraries(Source source) => _basis.computeExported
Libraries(source); |
| 8102 | 8123 |
| 8103 HtmlElement computeHtmlElement(Source source) { | 8124 HtmlElement computeHtmlElement(Source source) { |
| 8104 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeHtmlElement"); | 8125 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeHtmlElement"); |
| 8126 _checkThread(instrumentation); |
| 8105 try { | 8127 try { |
| 8106 instrumentation.metric3("contextId", _contextId); | 8128 instrumentation.metric3("contextId", _contextId); |
| 8107 return _basis.computeHtmlElement(source); | 8129 return _basis.computeHtmlElement(source); |
| 8108 } on AnalysisException catch (e) { | 8130 } on AnalysisException catch (e) { |
| 8109 _recordAnalysisException(instrumentation, e); | 8131 _recordAnalysisException(instrumentation, e); |
| 8110 throw e; | 8132 throw e; |
| 8111 } finally { | 8133 } finally { |
| 8112 instrumentation.log(); | 8134 instrumentation.log(); |
| 8113 } | 8135 } |
| 8114 } | 8136 } |
| 8115 | 8137 |
| 8116 List<Source> computeImportedLibraries(Source source) => _basis.computeImported
Libraries(source); | 8138 List<Source> computeImportedLibraries(Source source) => _basis.computeImported
Libraries(source); |
| 8117 | 8139 |
| 8118 SourceKind computeKindOf(Source source) { | 8140 SourceKind computeKindOf(Source source) { |
| 8119 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeKindOf"); | 8141 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeKindOf"); |
| 8142 _checkThread(instrumentation); |
| 8120 try { | 8143 try { |
| 8121 instrumentation.metric3("contextId", _contextId); | 8144 instrumentation.metric3("contextId", _contextId); |
| 8122 return _basis.computeKindOf(source); | 8145 return _basis.computeKindOf(source); |
| 8123 } finally { | 8146 } finally { |
| 8124 instrumentation.log(); | 8147 instrumentation.log(); |
| 8125 } | 8148 } |
| 8126 } | 8149 } |
| 8127 | 8150 |
| 8128 LibraryElement computeLibraryElement(Source source) { | 8151 LibraryElement computeLibraryElement(Source source) { |
| 8129 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeLibraryElement"); | 8152 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeLibraryElement"); |
| 8153 _checkThread(instrumentation); |
| 8130 try { | 8154 try { |
| 8131 instrumentation.metric3("contextId", _contextId); | 8155 instrumentation.metric3("contextId", _contextId); |
| 8132 return _basis.computeLibraryElement(source); | 8156 return _basis.computeLibraryElement(source); |
| 8133 } on AnalysisException catch (e) { | 8157 } on AnalysisException catch (e) { |
| 8134 _recordAnalysisException(instrumentation, e); | 8158 _recordAnalysisException(instrumentation, e); |
| 8135 throw e; | 8159 throw e; |
| 8136 } finally { | 8160 } finally { |
| 8137 instrumentation.log(); | 8161 instrumentation.log(); |
| 8138 } | 8162 } |
| 8139 } | 8163 } |
| 8140 | 8164 |
| 8141 LineInfo computeLineInfo(Source source) { | 8165 LineInfo computeLineInfo(Source source) { |
| 8142 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeLineInfo"); | 8166 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
computeLineInfo"); |
| 8167 _checkThread(instrumentation); |
| 8143 try { | 8168 try { |
| 8144 instrumentation.metric3("contextId", _contextId); | 8169 instrumentation.metric3("contextId", _contextId); |
| 8145 return _basis.computeLineInfo(source); | 8170 return _basis.computeLineInfo(source); |
| 8146 } on AnalysisException catch (e) { | 8171 } on AnalysisException catch (e) { |
| 8147 _recordAnalysisException(instrumentation, e); | 8172 _recordAnalysisException(instrumentation, e); |
| 8148 throw e; | 8173 throw e; |
| 8149 } finally { | 8174 } finally { |
| 8150 instrumentation.log(); | 8175 instrumentation.log(); |
| 8151 } | 8176 } |
| 8152 } | 8177 } |
| 8153 | 8178 |
| 8154 ResolvableCompilationUnit computeResolvableCompilationUnit(Source source) => _
basis.computeResolvableCompilationUnit(source); | 8179 ResolvableCompilationUnit computeResolvableCompilationUnit(Source source) => _
basis.computeResolvableCompilationUnit(source); |
| 8155 | 8180 |
| 8181 void dispose() { |
| 8182 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
dispose"); |
| 8183 _checkThread(instrumentation); |
| 8184 try { |
| 8185 instrumentation.metric3("contextId", _contextId); |
| 8186 _basis.dispose(); |
| 8187 } finally { |
| 8188 instrumentation.log(); |
| 8189 } |
| 8190 } |
| 8191 |
| 8156 bool exists(Source source) { | 8192 bool exists(Source source) { |
| 8157 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
exists"); | 8193 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
exists"); |
| 8194 _checkThread(instrumentation); |
| 8158 try { | 8195 try { |
| 8159 instrumentation.metric3("contextId", _contextId); | 8196 instrumentation.metric3("contextId", _contextId); |
| 8160 return _basis.exists(source); | 8197 return _basis.exists(source); |
| 8161 } finally { | 8198 } finally { |
| 8162 instrumentation.log(); | 8199 instrumentation.log(); |
| 8163 } | 8200 } |
| 8164 } | 8201 } |
| 8165 | 8202 |
| 8166 AnalysisContext extractContext(SourceContainer container) { | 8203 AnalysisContext extractContext(SourceContainer container) { |
| 8167 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
extractContext"); | 8204 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
extractContext"); |
| 8205 _checkThread(instrumentation); |
| 8168 try { | 8206 try { |
| 8169 instrumentation.metric3("contextId", _contextId); | 8207 instrumentation.metric3("contextId", _contextId); |
| 8170 InstrumentedAnalysisContextImpl newContext = new InstrumentedAnalysisConte
xtImpl(); | 8208 InstrumentedAnalysisContextImpl newContext = new InstrumentedAnalysisConte
xtImpl(); |
| 8171 _basis.extractContextInto(container, newContext._basis); | 8209 _basis.extractContextInto(container, newContext._basis); |
| 8172 return newContext; | 8210 return newContext; |
| 8173 } finally { | 8211 } finally { |
| 8174 instrumentation.log(); | 8212 instrumentation.log(); |
| 8175 } | 8213 } |
| 8176 } | 8214 } |
| 8177 | 8215 |
| 8178 InternalAnalysisContext extractContextInto(SourceContainer container, Internal
AnalysisContext newContext) => _basis.extractContextInto(container, newContext); | 8216 InternalAnalysisContext extractContextInto(SourceContainer container, Internal
AnalysisContext newContext) => _basis.extractContextInto(container, newContext); |
| 8179 | 8217 |
| 8180 AnalysisOptions get analysisOptions { | 8218 AnalysisOptions get analysisOptions { |
| 8181 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getAnalysisOptions"); | 8219 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getAnalysisOptions"); |
| 8220 _checkThread(instrumentation); |
| 8182 try { | 8221 try { |
| 8183 instrumentation.metric3("contextId", _contextId); | 8222 instrumentation.metric3("contextId", _contextId); |
| 8184 return _basis.analysisOptions; | 8223 return _basis.analysisOptions; |
| 8185 } finally { | 8224 } finally { |
| 8186 instrumentation.log(); | 8225 instrumentation.log(); |
| 8187 } | 8226 } |
| 8188 } | 8227 } |
| 8189 | 8228 |
| 8190 /** | 8229 /** |
| 8191 * @return the underlying [AnalysisContext]. | 8230 * @return the underlying [AnalysisContext]. |
| 8192 */ | 8231 */ |
| 8193 AnalysisContext get basis => _basis; | 8232 AnalysisContext get basis => _basis; |
| 8194 | 8233 |
| 8195 CompilationUnitElement getCompilationUnitElement(Source unitSource, Source lib
rarySource) { | 8234 CompilationUnitElement getCompilationUnitElement(Source unitSource, Source lib
rarySource) { |
| 8196 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getCompilationUnitElement"); | 8235 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getCompilationUnitElement"); |
| 8236 _checkThread(instrumentation); |
| 8197 try { | 8237 try { |
| 8198 instrumentation.metric3("contextId", _contextId); | 8238 instrumentation.metric3("contextId", _contextId); |
| 8199 return _basis.getCompilationUnitElement(unitSource, librarySource); | 8239 return _basis.getCompilationUnitElement(unitSource, librarySource); |
| 8200 } finally { | 8240 } finally { |
| 8201 instrumentation.log(); | 8241 instrumentation.log(); |
| 8202 } | 8242 } |
| 8203 } | 8243 } |
| 8204 | 8244 |
| 8205 TimestampedData<String> getContents(Source source) => _basis.getContents(sourc
e); | 8245 TimestampedData<String> getContents(Source source) => _basis.getContents(sourc
e); |
| 8206 | 8246 |
| 8207 void getContentsToReceiver(Source source, Source_ContentReceiver receiver) { | |
| 8208 _basis.getContentsToReceiver(source, receiver); | |
| 8209 } | |
| 8210 | |
| 8211 Element getElement(ElementLocation location) { | 8247 Element getElement(ElementLocation location) { |
| 8212 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getElement"); | 8248 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getElement"); |
| 8249 _checkThread(instrumentation); |
| 8213 try { | 8250 try { |
| 8214 instrumentation.metric3("contextId", _contextId); | 8251 instrumentation.metric3("contextId", _contextId); |
| 8215 return _basis.getElement(location); | 8252 return _basis.getElement(location); |
| 8216 } finally { | 8253 } finally { |
| 8217 instrumentation.log(); | 8254 instrumentation.log(); |
| 8218 } | 8255 } |
| 8219 } | 8256 } |
| 8220 | 8257 |
| 8221 AnalysisErrorInfo getErrors(Source source) { | 8258 AnalysisErrorInfo getErrors(Source source) { |
| 8222 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getErrors"); | 8259 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getErrors"); |
| 8260 _checkThread(instrumentation); |
| 8223 try { | 8261 try { |
| 8224 instrumentation.metric3("contextId", _contextId); | 8262 instrumentation.metric3("contextId", _contextId); |
| 8225 AnalysisErrorInfo ret = _basis.getErrors(source); | 8263 AnalysisErrorInfo ret = _basis.getErrors(source); |
| 8226 if (ret != null) { | 8264 if (ret != null) { |
| 8227 instrumentation.metric2("Errors-count", ret.errors.length); | 8265 instrumentation.metric2("Errors-count", ret.errors.length); |
| 8228 } | 8266 } |
| 8229 return ret; | 8267 return ret; |
| 8230 } finally { | 8268 } finally { |
| 8231 instrumentation.log(); | 8269 instrumentation.log(); |
| 8232 } | 8270 } |
| 8233 } | 8271 } |
| 8234 | 8272 |
| 8235 HtmlElement getHtmlElement(Source source) { | 8273 HtmlElement getHtmlElement(Source source) { |
| 8236 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getHtmlElement"); | 8274 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getHtmlElement"); |
| 8275 _checkThread(instrumentation); |
| 8237 try { | 8276 try { |
| 8238 instrumentation.metric3("contextId", _contextId); | 8277 instrumentation.metric3("contextId", _contextId); |
| 8239 return _basis.getHtmlElement(source); | 8278 return _basis.getHtmlElement(source); |
| 8240 } finally { | 8279 } finally { |
| 8241 instrumentation.log(); | 8280 instrumentation.log(); |
| 8242 } | 8281 } |
| 8243 } | 8282 } |
| 8244 | 8283 |
| 8245 List<Source> getHtmlFilesReferencing(Source source) { | 8284 List<Source> getHtmlFilesReferencing(Source source) { |
| 8246 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getHtmlFilesReferencing"); | 8285 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getHtmlFilesReferencing"); |
| 8286 _checkThread(instrumentation); |
| 8247 try { | 8287 try { |
| 8248 instrumentation.metric3("contextId", _contextId); | 8288 instrumentation.metric3("contextId", _contextId); |
| 8249 List<Source> ret = _basis.getHtmlFilesReferencing(source); | 8289 List<Source> ret = _basis.getHtmlFilesReferencing(source); |
| 8250 if (ret != null) { | 8290 if (ret != null) { |
| 8251 instrumentation.metric2("Source-count", ret.length); | 8291 instrumentation.metric2("Source-count", ret.length); |
| 8252 } | 8292 } |
| 8253 return ret; | 8293 return ret; |
| 8254 } finally { | 8294 } finally { |
| 8255 instrumentation.log(); | 8295 instrumentation.log(); |
| 8256 } | 8296 } |
| 8257 } | 8297 } |
| 8258 | 8298 |
| 8259 List<Source> get htmlSources { | 8299 List<Source> get htmlSources { |
| 8260 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getHtmlSources"); | 8300 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getHtmlSources"); |
| 8301 _checkThread(instrumentation); |
| 8261 try { | 8302 try { |
| 8262 instrumentation.metric3("contextId", _contextId); | 8303 instrumentation.metric3("contextId", _contextId); |
| 8263 List<Source> ret = _basis.htmlSources; | 8304 List<Source> ret = _basis.htmlSources; |
| 8264 if (ret != null) { | 8305 if (ret != null) { |
| 8265 instrumentation.metric2("Source-count", ret.length); | 8306 instrumentation.metric2("Source-count", ret.length); |
| 8266 } | 8307 } |
| 8267 return ret; | 8308 return ret; |
| 8268 } finally { | 8309 } finally { |
| 8269 instrumentation.log(); | 8310 instrumentation.log(); |
| 8270 } | 8311 } |
| 8271 } | 8312 } |
| 8272 | 8313 |
| 8273 SourceKind getKindOf(Source source) { | 8314 SourceKind getKindOf(Source source) { |
| 8274 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getKindOf"); | 8315 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getKindOf"); |
| 8316 _checkThread(instrumentation); |
| 8275 try { | 8317 try { |
| 8276 instrumentation.metric3("contextId", _contextId); | 8318 instrumentation.metric3("contextId", _contextId); |
| 8277 return _basis.getKindOf(source); | 8319 return _basis.getKindOf(source); |
| 8278 } finally { | 8320 } finally { |
| 8279 instrumentation.log(); | 8321 instrumentation.log(); |
| 8280 } | 8322 } |
| 8281 } | 8323 } |
| 8282 | 8324 |
| 8283 List<Source> get launchableClientLibrarySources { | 8325 List<Source> get launchableClientLibrarySources { |
| 8284 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLaunchableClientLibrarySources"); | 8326 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLaunchableClientLibrarySources"); |
| 8327 _checkThread(instrumentation); |
| 8285 try { | 8328 try { |
| 8286 instrumentation.metric3("contextId", _contextId); | 8329 instrumentation.metric3("contextId", _contextId); |
| 8287 List<Source> ret = _basis.launchableClientLibrarySources; | 8330 List<Source> ret = _basis.launchableClientLibrarySources; |
| 8288 if (ret != null) { | 8331 if (ret != null) { |
| 8289 instrumentation.metric2("Source-count", ret.length); | 8332 instrumentation.metric2("Source-count", ret.length); |
| 8290 } | 8333 } |
| 8291 return ret; | 8334 return ret; |
| 8292 } finally { | 8335 } finally { |
| 8293 instrumentation.log(); | 8336 instrumentation.log(); |
| 8294 } | 8337 } |
| 8295 } | 8338 } |
| 8296 | 8339 |
| 8297 List<Source> get launchableServerLibrarySources { | 8340 List<Source> get launchableServerLibrarySources { |
| 8298 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLaunchableServerLibrarySources"); | 8341 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLaunchableServerLibrarySources"); |
| 8342 _checkThread(instrumentation); |
| 8299 try { | 8343 try { |
| 8300 instrumentation.metric3("contextId", _contextId); | 8344 instrumentation.metric3("contextId", _contextId); |
| 8301 List<Source> ret = _basis.launchableServerLibrarySources; | 8345 List<Source> ret = _basis.launchableServerLibrarySources; |
| 8302 if (ret != null) { | 8346 if (ret != null) { |
| 8303 instrumentation.metric2("Source-count", ret.length); | 8347 instrumentation.metric2("Source-count", ret.length); |
| 8304 } | 8348 } |
| 8305 return ret; | 8349 return ret; |
| 8306 } finally { | 8350 } finally { |
| 8307 instrumentation.log(); | 8351 instrumentation.log(); |
| 8308 } | 8352 } |
| 8309 } | 8353 } |
| 8310 | 8354 |
| 8311 List<Source> getLibrariesContaining(Source source) { | 8355 List<Source> getLibrariesContaining(Source source) { |
| 8312 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLibrariesContaining"); | 8356 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLibrariesContaining"); |
| 8357 _checkThread(instrumentation); |
| 8313 try { | 8358 try { |
| 8314 instrumentation.metric3("contextId", _contextId); | 8359 instrumentation.metric3("contextId", _contextId); |
| 8315 List<Source> ret = _basis.getLibrariesContaining(source); | 8360 List<Source> ret = _basis.getLibrariesContaining(source); |
| 8316 if (ret != null) { | 8361 if (ret != null) { |
| 8317 instrumentation.metric2("Source-count", ret.length); | 8362 instrumentation.metric2("Source-count", ret.length); |
| 8318 } | 8363 } |
| 8319 return ret; | 8364 return ret; |
| 8320 } finally { | 8365 } finally { |
| 8321 instrumentation.log2(2); | 8366 instrumentation.log2(2); |
| 8322 } | 8367 } |
| 8323 } | 8368 } |
| 8324 | 8369 |
| 8325 List<Source> getLibrariesDependingOn(Source librarySource) { | 8370 List<Source> getLibrariesDependingOn(Source librarySource) { |
| 8326 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLibrariesDependingOn"); | 8371 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLibrariesDependingOn"); |
| 8372 _checkThread(instrumentation); |
| 8327 try { | 8373 try { |
| 8328 instrumentation.metric3("contextId", _contextId); | 8374 instrumentation.metric3("contextId", _contextId); |
| 8329 List<Source> ret = _basis.getLibrariesDependingOn(librarySource); | 8375 List<Source> ret = _basis.getLibrariesDependingOn(librarySource); |
| 8330 if (ret != null) { | 8376 if (ret != null) { |
| 8331 instrumentation.metric2("Source-count", ret.length); | 8377 instrumentation.metric2("Source-count", ret.length); |
| 8332 } | 8378 } |
| 8333 return ret; | 8379 return ret; |
| 8334 } finally { | 8380 } finally { |
| 8335 instrumentation.log(); | 8381 instrumentation.log(); |
| 8336 } | 8382 } |
| 8337 } | 8383 } |
| 8338 | 8384 |
| 8339 LibraryElement getLibraryElement(Source source) { | 8385 LibraryElement getLibraryElement(Source source) { |
| 8340 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLibraryElement"); | 8386 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLibraryElement"); |
| 8387 _checkThread(instrumentation); |
| 8341 try { | 8388 try { |
| 8342 instrumentation.metric3("contextId", _contextId); | 8389 instrumentation.metric3("contextId", _contextId); |
| 8343 return _basis.getLibraryElement(source); | 8390 return _basis.getLibraryElement(source); |
| 8344 } finally { | 8391 } finally { |
| 8345 instrumentation.log(); | 8392 instrumentation.log(); |
| 8346 } | 8393 } |
| 8347 } | 8394 } |
| 8348 | 8395 |
| 8349 List<Source> get librarySources { | 8396 List<Source> get librarySources { |
| 8350 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLibrarySources"); | 8397 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLibrarySources"); |
| 8398 _checkThread(instrumentation); |
| 8351 try { | 8399 try { |
| 8352 instrumentation.metric3("contextId", _contextId); | 8400 instrumentation.metric3("contextId", _contextId); |
| 8353 List<Source> ret = _basis.librarySources; | 8401 List<Source> ret = _basis.librarySources; |
| 8354 if (ret != null) { | 8402 if (ret != null) { |
| 8355 instrumentation.metric2("Source-count", ret.length); | 8403 instrumentation.metric2("Source-count", ret.length); |
| 8356 } | 8404 } |
| 8357 return ret; | 8405 return ret; |
| 8358 } finally { | 8406 } finally { |
| 8359 instrumentation.log(); | 8407 instrumentation.log(); |
| 8360 } | 8408 } |
| 8361 } | 8409 } |
| 8362 | 8410 |
| 8363 LineInfo getLineInfo(Source source) { | 8411 LineInfo getLineInfo(Source source) { |
| 8364 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLineInfo"); | 8412 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getLineInfo"); |
| 8413 _checkThread(instrumentation); |
| 8365 try { | 8414 try { |
| 8366 instrumentation.metric3("contextId", _contextId); | 8415 instrumentation.metric3("contextId", _contextId); |
| 8367 return _basis.getLineInfo(source); | 8416 return _basis.getLineInfo(source); |
| 8368 } finally { | 8417 } finally { |
| 8369 instrumentation.log(); | 8418 instrumentation.log(); |
| 8370 } | 8419 } |
| 8371 } | 8420 } |
| 8372 | 8421 |
| 8373 int getModificationStamp(Source source) { | 8422 int getModificationStamp(Source source) { |
| 8374 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getModificationStamp"); | 8423 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getModificationStamp"); |
| 8424 _checkThread(instrumentation); |
| 8375 try { | 8425 try { |
| 8376 instrumentation.metric3("contextId", _contextId); | 8426 instrumentation.metric3("contextId", _contextId); |
| 8377 return _basis.getModificationStamp(source); | 8427 return _basis.getModificationStamp(source); |
| 8378 } finally { | 8428 } finally { |
| 8379 instrumentation.log(); | 8429 instrumentation.log(); |
| 8380 } | 8430 } |
| 8381 } | 8431 } |
| 8382 | 8432 |
| 8383 Namespace getPublicNamespace(LibraryElement library) => _basis.getPublicNamesp
ace(library); | 8433 Namespace getPublicNamespace(LibraryElement library) => _basis.getPublicNamesp
ace(library); |
| 8384 | 8434 |
| 8385 Namespace getPublicNamespace2(Source source) => _basis.getPublicNamespace2(sou
rce); | 8435 Namespace getPublicNamespace2(Source source) => _basis.getPublicNamespace2(sou
rce); |
| 8386 | 8436 |
| 8387 List<Source> get refactoringUnsafeSources { | 8437 List<Source> get refactoringUnsafeSources { |
| 8388 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getRefactoringUnsafeSources"); | 8438 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getRefactoringUnsafeSources"); |
| 8439 _checkThread(instrumentation); |
| 8389 try { | 8440 try { |
| 8390 instrumentation.metric3("contextId", _contextId); | 8441 instrumentation.metric3("contextId", _contextId); |
| 8391 return _basis.refactoringUnsafeSources; | 8442 return _basis.refactoringUnsafeSources; |
| 8392 } finally { | 8443 } finally { |
| 8393 instrumentation.log(); | 8444 instrumentation.log(); |
| 8394 } | 8445 } |
| 8395 } | 8446 } |
| 8396 | 8447 |
| 8397 CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement l
ibrary) { | 8448 CompilationUnit getResolvedCompilationUnit(Source unitSource, LibraryElement l
ibrary) { |
| 8398 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getResolvedCompilationUnit"); | 8449 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getResolvedCompilationUnit"); |
| 8450 _checkThread(instrumentation); |
| 8399 try { | 8451 try { |
| 8400 instrumentation.metric3("contextId", _contextId); | 8452 instrumentation.metric3("contextId", _contextId); |
| 8401 return _basis.getResolvedCompilationUnit(unitSource, library); | 8453 return _basis.getResolvedCompilationUnit(unitSource, library); |
| 8402 } finally { | 8454 } finally { |
| 8403 instrumentation.log(); | 8455 instrumentation.log(); |
| 8404 } | 8456 } |
| 8405 } | 8457 } |
| 8406 | 8458 |
| 8407 CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source libraryS
ource) { | 8459 CompilationUnit getResolvedCompilationUnit2(Source unitSource, Source libraryS
ource) { |
| 8408 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getResolvedCompilationUnit"); | 8460 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getResolvedCompilationUnit"); |
| 8461 _checkThread(instrumentation); |
| 8409 try { | 8462 try { |
| 8410 instrumentation.metric3("contextId", _contextId); | 8463 instrumentation.metric3("contextId", _contextId); |
| 8411 return _basis.getResolvedCompilationUnit2(unitSource, librarySource); | 8464 return _basis.getResolvedCompilationUnit2(unitSource, librarySource); |
| 8412 } finally { | 8465 } finally { |
| 8413 instrumentation.log2(2); | 8466 instrumentation.log2(2); |
| 8414 } | 8467 } |
| 8415 } | 8468 } |
| 8416 | 8469 |
| 8417 ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) { | 8470 ht.HtmlUnit getResolvedHtmlUnit(Source htmlSource) { |
| 8418 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getResolvedHtmlUnit"); | 8471 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getResolvedHtmlUnit"); |
| 8472 _checkThread(instrumentation); |
| 8419 try { | 8473 try { |
| 8420 instrumentation.metric3("contextId", _contextId); | 8474 instrumentation.metric3("contextId", _contextId); |
| 8421 return _basis.getResolvedHtmlUnit(htmlSource); | 8475 return _basis.getResolvedHtmlUnit(htmlSource); |
| 8422 } finally { | 8476 } finally { |
| 8423 instrumentation.log2(2); | 8477 instrumentation.log2(2); |
| 8424 } | 8478 } |
| 8425 } | 8479 } |
| 8426 | 8480 |
| 8427 SourceFactory get sourceFactory { | 8481 SourceFactory get sourceFactory { |
| 8428 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getSourceFactory"); | 8482 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
getSourceFactory"); |
| 8483 _checkThread(instrumentation); |
| 8429 try { | 8484 try { |
| 8430 instrumentation.metric3("contextId", _contextId); | 8485 instrumentation.metric3("contextId", _contextId); |
| 8431 return _basis.sourceFactory; | 8486 return _basis.sourceFactory; |
| 8432 } finally { | 8487 } finally { |
| 8433 instrumentation.log2(2); | 8488 instrumentation.log2(2); |
| 8434 } | 8489 } |
| 8435 } | 8490 } |
| 8436 | 8491 |
| 8437 AnalysisContentStatistics get statistics => _basis.statistics; | 8492 AnalysisContentStatistics get statistics => _basis.statistics; |
| 8438 | 8493 |
| 8439 TypeProvider get typeProvider => _basis.typeProvider; | 8494 TypeProvider get typeProvider => _basis.typeProvider; |
| 8440 | 8495 |
| 8441 TimestampedData<CompilationUnit> internalResolveCompilationUnit(Source unitSou
rce, LibraryElement libraryElement) => _basis.internalResolveCompilationUnit(uni
tSource, libraryElement); | 8496 TimestampedData<CompilationUnit> internalResolveCompilationUnit(Source unitSou
rce, LibraryElement libraryElement) => _basis.internalResolveCompilationUnit(uni
tSource, libraryElement); |
| 8442 | 8497 |
| 8443 bool isClientLibrary(Source librarySource) { | 8498 bool isClientLibrary(Source librarySource) { |
| 8444 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
isClientLibrary"); | 8499 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
isClientLibrary"); |
| 8500 _checkThread(instrumentation); |
| 8445 try { | 8501 try { |
| 8446 instrumentation.metric3("contextId", _contextId); | 8502 instrumentation.metric3("contextId", _contextId); |
| 8447 return _basis.isClientLibrary(librarySource); | 8503 return _basis.isClientLibrary(librarySource); |
| 8448 } finally { | 8504 } finally { |
| 8449 instrumentation.log(); | 8505 instrumentation.log(); |
| 8450 } | 8506 } |
| 8451 } | 8507 } |
| 8452 | 8508 |
| 8509 bool get isDisposed { |
| 8510 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
isDisposed"); |
| 8511 _checkThread(instrumentation); |
| 8512 try { |
| 8513 instrumentation.metric3("contextId", _contextId); |
| 8514 return _basis.isDisposed; |
| 8515 } finally { |
| 8516 instrumentation.log(); |
| 8517 } |
| 8518 } |
| 8519 |
| 8453 bool isServerLibrary(Source librarySource) { | 8520 bool isServerLibrary(Source librarySource) { |
| 8454 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
isServerLibrary"); | 8521 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
isServerLibrary"); |
| 8522 _checkThread(instrumentation); |
| 8455 try { | 8523 try { |
| 8456 instrumentation.metric3("contextId", _contextId); | 8524 instrumentation.metric3("contextId", _contextId); |
| 8457 return _basis.isServerLibrary(librarySource); | 8525 return _basis.isServerLibrary(librarySource); |
| 8458 } finally { | 8526 } finally { |
| 8459 instrumentation.log(); | 8527 instrumentation.log(); |
| 8460 } | 8528 } |
| 8461 } | 8529 } |
| 8462 | 8530 |
| 8463 void mergeContext(AnalysisContext context) { | 8531 void mergeContext(AnalysisContext context) { |
| 8464 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
mergeContext"); | 8532 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
mergeContext"); |
| 8533 _checkThread(instrumentation); |
| 8465 try { | 8534 try { |
| 8466 instrumentation.metric3("contextId", _contextId); | 8535 instrumentation.metric3("contextId", _contextId); |
| 8467 if (context is InstrumentedAnalysisContextImpl) { | 8536 if (context is InstrumentedAnalysisContextImpl) { |
| 8468 context = (context as InstrumentedAnalysisContextImpl)._basis; | 8537 context = (context as InstrumentedAnalysisContextImpl)._basis; |
| 8469 } | 8538 } |
| 8470 _basis.mergeContext(context); | 8539 _basis.mergeContext(context); |
| 8471 } finally { | 8540 } finally { |
| 8472 instrumentation.log(); | 8541 instrumentation.log(); |
| 8473 } | 8542 } |
| 8474 } | 8543 } |
| 8475 | 8544 |
| 8476 CompilationUnit parseCompilationUnit(Source source) { | 8545 CompilationUnit parseCompilationUnit(Source source) { |
| 8477 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
parseCompilationUnit"); | 8546 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
parseCompilationUnit"); |
| 8547 _checkThread(instrumentation); |
| 8478 try { | 8548 try { |
| 8479 instrumentation.metric3("contextId", _contextId); | 8549 instrumentation.metric3("contextId", _contextId); |
| 8480 return _basis.parseCompilationUnit(source); | 8550 return _basis.parseCompilationUnit(source); |
| 8481 } on AnalysisException catch (e) { | 8551 } on AnalysisException catch (e) { |
| 8482 _recordAnalysisException(instrumentation, e); | 8552 _recordAnalysisException(instrumentation, e); |
| 8483 throw e; | 8553 throw e; |
| 8484 } finally { | 8554 } finally { |
| 8485 instrumentation.log(); | 8555 instrumentation.log(); |
| 8486 } | 8556 } |
| 8487 } | 8557 } |
| 8488 | 8558 |
| 8489 ht.HtmlUnit parseHtmlUnit(Source source) { | 8559 ht.HtmlUnit parseHtmlUnit(Source source) { |
| 8490 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
parseHtmlUnit"); | 8560 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
parseHtmlUnit"); |
| 8561 _checkThread(instrumentation); |
| 8491 try { | 8562 try { |
| 8492 instrumentation.metric3("contextId", _contextId); | 8563 instrumentation.metric3("contextId", _contextId); |
| 8493 return _basis.parseHtmlUnit(source); | 8564 return _basis.parseHtmlUnit(source); |
| 8494 } on AnalysisException catch (e) { | 8565 } on AnalysisException catch (e) { |
| 8495 _recordAnalysisException(instrumentation, e); | 8566 _recordAnalysisException(instrumentation, e); |
| 8496 throw e; | 8567 throw e; |
| 8497 } finally { | 8568 } finally { |
| 8498 instrumentation.log(); | 8569 instrumentation.log(); |
| 8499 } | 8570 } |
| 8500 } | 8571 } |
| 8501 | 8572 |
| 8502 AnalysisResult performAnalysisTask() { | 8573 AnalysisResult performAnalysisTask() { |
| 8503 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
performAnalysisTask"); | 8574 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
performAnalysisTask"); |
| 8575 _checkThread(instrumentation); |
| 8504 try { | 8576 try { |
| 8505 instrumentation.metric3("contextId", _contextId); | 8577 instrumentation.metric3("contextId", _contextId); |
| 8506 AnalysisResult result = _basis.performAnalysisTask(); | 8578 AnalysisResult result = _basis.performAnalysisTask(); |
| 8507 if (result.changeNotices != null) { | 8579 if (result.changeNotices != null) { |
| 8508 instrumentation.metric2("ChangeNotice-count", result.changeNotices.lengt
h); | 8580 instrumentation.metric2("ChangeNotice-count", result.changeNotices.lengt
h); |
| 8509 } | 8581 } |
| 8510 return result; | 8582 return result; |
| 8511 } finally { | 8583 } finally { |
| 8512 instrumentation.log2(2); | 8584 instrumentation.log2(2); |
| 8513 } | 8585 } |
| 8514 } | 8586 } |
| 8515 | 8587 |
| 8516 void recordLibraryElements(Map<Source, LibraryElement> elementMap) { | 8588 void recordLibraryElements(Map<Source, LibraryElement> elementMap) { |
| 8517 _basis.recordLibraryElements(elementMap); | 8589 _basis.recordLibraryElements(elementMap); |
| 8518 } | 8590 } |
| 8519 | 8591 |
| 8520 CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement libra
ry) { | 8592 CompilationUnit resolveCompilationUnit(Source unitSource, LibraryElement libra
ry) { |
| 8521 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
resolveCompilationUnit"); | 8593 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
resolveCompilationUnit"); |
| 8594 _checkThread(instrumentation); |
| 8522 try { | 8595 try { |
| 8523 instrumentation.metric3("contextId", _contextId); | 8596 instrumentation.metric3("contextId", _contextId); |
| 8524 return _basis.resolveCompilationUnit(unitSource, library); | 8597 return _basis.resolveCompilationUnit(unitSource, library); |
| 8525 } on AnalysisException catch (e) { | 8598 } on AnalysisException catch (e) { |
| 8526 _recordAnalysisException(instrumentation, e); | 8599 _recordAnalysisException(instrumentation, e); |
| 8527 throw e; | 8600 throw e; |
| 8528 } finally { | 8601 } finally { |
| 8529 instrumentation.log(); | 8602 instrumentation.log(); |
| 8530 } | 8603 } |
| 8531 } | 8604 } |
| 8532 | 8605 |
| 8533 CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySourc
e) { | 8606 CompilationUnit resolveCompilationUnit2(Source unitSource, Source librarySourc
e) { |
| 8534 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
resolveCompilationUnit"); | 8607 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
resolveCompilationUnit"); |
| 8608 _checkThread(instrumentation); |
| 8535 try { | 8609 try { |
| 8536 instrumentation.metric3("contextId", _contextId); | 8610 instrumentation.metric3("contextId", _contextId); |
| 8537 return _basis.resolveCompilationUnit2(unitSource, librarySource); | 8611 return _basis.resolveCompilationUnit2(unitSource, librarySource); |
| 8538 } on AnalysisException catch (e) { | 8612 } on AnalysisException catch (e) { |
| 8539 _recordAnalysisException(instrumentation, e); | 8613 _recordAnalysisException(instrumentation, e); |
| 8540 throw e; | 8614 throw e; |
| 8541 } finally { | 8615 } finally { |
| 8542 instrumentation.log(); | 8616 instrumentation.log(); |
| 8543 } | 8617 } |
| 8544 } | 8618 } |
| 8545 | 8619 |
| 8546 ht.HtmlUnit resolveHtmlUnit(Source htmlSource) { | 8620 ht.HtmlUnit resolveHtmlUnit(Source htmlSource) { |
| 8547 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
resolveHtmlUnit"); | 8621 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
resolveHtmlUnit"); |
| 8622 _checkThread(instrumentation); |
| 8548 try { | 8623 try { |
| 8549 instrumentation.metric3("contextId", _contextId); | 8624 instrumentation.metric3("contextId", _contextId); |
| 8550 return _basis.resolveHtmlUnit(htmlSource); | 8625 return _basis.resolveHtmlUnit(htmlSource); |
| 8551 } on AnalysisException catch (e) { | 8626 } on AnalysisException catch (e) { |
| 8552 _recordAnalysisException(instrumentation, e); | 8627 _recordAnalysisException(instrumentation, e); |
| 8553 throw e; | 8628 throw e; |
| 8554 } finally { | 8629 } finally { |
| 8555 instrumentation.log(); | 8630 instrumentation.log(); |
| 8556 } | 8631 } |
| 8557 } | 8632 } |
| 8558 | 8633 |
| 8559 void set analysisOptions(AnalysisOptions options) { | 8634 void set analysisOptions(AnalysisOptions options) { |
| 8560 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setAnalysisOptions"); | 8635 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setAnalysisOptions"); |
| 8636 _checkThread(instrumentation); |
| 8561 try { | 8637 try { |
| 8562 instrumentation.metric3("contextId", _contextId); | 8638 instrumentation.metric3("contextId", _contextId); |
| 8563 _basis.analysisOptions = options; | 8639 _basis.analysisOptions = options; |
| 8564 } finally { | 8640 } finally { |
| 8565 instrumentation.log(); | 8641 instrumentation.log(); |
| 8566 } | 8642 } |
| 8567 } | 8643 } |
| 8568 | 8644 |
| 8569 void set analysisPriorityOrder(List<Source> sources) { | 8645 void set analysisPriorityOrder(List<Source> sources) { |
| 8570 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setAnalysisPriorityOrder"); | 8646 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setAnalysisPriorityOrder"); |
| 8647 _checkThread(instrumentation); |
| 8571 try { | 8648 try { |
| 8572 instrumentation.metric3("contextId", _contextId); | 8649 instrumentation.metric3("contextId", _contextId); |
| 8573 _basis.analysisPriorityOrder = sources; | 8650 _basis.analysisPriorityOrder = sources; |
| 8574 } finally { | 8651 } finally { |
| 8575 instrumentation.log(); | 8652 instrumentation.log(); |
| 8576 } | 8653 } |
| 8577 } | 8654 } |
| 8578 | 8655 |
| 8579 void setChangedContents(Source source, String contents, int offset, int oldLen
gth, int newLength) { | 8656 void setChangedContents(Source source, String contents, int offset, int oldLen
gth, int newLength) { |
| 8580 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setChangedContents"); | 8657 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setChangedContents"); |
| 8658 _checkThread(instrumentation); |
| 8581 try { | 8659 try { |
| 8582 instrumentation.metric3("contextId", _contextId); | 8660 instrumentation.metric3("contextId", _contextId); |
| 8583 _basis.setChangedContents(source, contents, offset, oldLength, newLength); | 8661 _basis.setChangedContents(source, contents, offset, oldLength, newLength); |
| 8584 } finally { | 8662 } finally { |
| 8585 instrumentation.log(); | 8663 instrumentation.log(); |
| 8586 } | 8664 } |
| 8587 } | 8665 } |
| 8588 | 8666 |
| 8589 void setContents(Source source, String contents) { | 8667 void setContents(Source source, String contents) { |
| 8590 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setContents"); | 8668 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setContents"); |
| 8669 _checkThread(instrumentation); |
| 8591 try { | 8670 try { |
| 8592 instrumentation.metric3("contextId", _contextId); | 8671 instrumentation.metric3("contextId", _contextId); |
| 8593 _basis.setContents(source, contents); | 8672 _basis.setContents(source, contents); |
| 8594 } finally { | 8673 } finally { |
| 8595 instrumentation.log(); | 8674 instrumentation.log(); |
| 8596 } | 8675 } |
| 8597 } | 8676 } |
| 8598 | 8677 |
| 8599 void set sourceFactory(SourceFactory factory) { | 8678 void set sourceFactory(SourceFactory factory) { |
| 8600 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setSourceFactory"); | 8679 InstrumentationBuilder instrumentation = Instrumentation.builder2("Analysis-
setSourceFactory"); |
| 8680 _checkThread(instrumentation); |
| 8601 try { | 8681 try { |
| 8602 instrumentation.metric3("contextId", _contextId); | 8682 instrumentation.metric3("contextId", _contextId); |
| 8603 _basis.sourceFactory = factory; | 8683 _basis.sourceFactory = factory; |
| 8604 } finally { | 8684 } finally { |
| 8605 instrumentation.log(); | 8685 instrumentation.log(); |
| 8606 } | 8686 } |
| 8607 } | 8687 } |
| 8608 } | 8688 } |
| 8609 | 8689 |
| 8610 /** | 8690 /** |
| (...skipping 3339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11950 | 12030 |
| 11951 void logError2(String message, Exception exception) { | 12031 void logError2(String message, Exception exception) { |
| 11952 } | 12032 } |
| 11953 | 12033 |
| 11954 void logInformation(String message) { | 12034 void logInformation(String message) { |
| 11955 } | 12035 } |
| 11956 | 12036 |
| 11957 void logInformation2(String message, Exception exception) { | 12037 void logInformation2(String message, Exception exception) { |
| 11958 } | 12038 } |
| 11959 } | 12039 } |
| OLD | NEW |