Skip to content

Commit a9ad870

Browse files
scheglovCommit Queue
authored andcommitted
Fine. Rename @trackedXyz annotations.
trackedIncludedIntoId -> trackedIncludedInId trackedDirectlyDisable -> trackedDirectlyOpaque To better align names with requirement methods. Change-Id: Id4ede2c54017610c0530109bc2fb5379b3e90823 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/444980 Reviewed-by: Paul Berry <[email protected]> Commit-Queue: Konstantin Shcheglov <[email protected]> Reviewed-by: Johnni Winther <[email protected]>
1 parent 0b2d73b commit a9ad870

File tree

2 files changed

+48
-48
lines changed

2 files changed

+48
-48
lines changed

pkg/analyzer/lib/src/dart/element/element.dart

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ class BindPatternVariableFragmentImpl extends PatternVariableFragmentImpl
132132
@elementClass
133133
class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
134134
@override
135-
@trackedIncludedIntoId
135+
@trackedIncludedInId
136136
final Reference reference;
137137

138138
final ClassFragmentImpl _firstFragment;
@@ -204,14 +204,14 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
204204
}
205205

206206
@override
207-
@trackedDirectlyDisable
207+
@trackedDirectlyOpaque
208208
ClassFragmentImpl get firstFragment {
209209
globalResultRequirements?.recordOpaqueApiUse(this, 'firstFragment');
210210
return _firstFragment;
211211
}
212212

213213
@override
214-
@trackedDirectlyDisable
214+
@trackedDirectlyOpaque
215215
List<ClassFragmentImpl> get fragments {
216216
globalResultRequirements?.recordOpaqueApiUse(this, 'fragments');
217217
return [
@@ -266,7 +266,7 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
266266
}
267267

268268
@override
269-
@trackedIncludedIntoId
269+
@trackedIncludedInId
270270
bool get isAbstract {
271271
return hasModifier(Modifier.ABSTRACT);
272272
}
@@ -276,7 +276,7 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
276276
}
277277

278278
@override
279-
@trackedIncludedIntoId
279+
@trackedIncludedInId
280280
bool get isBase {
281281
return hasModifier(Modifier.BASE);
282282
}
@@ -286,11 +286,11 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
286286
}
287287

288288
@override
289-
@trackedIncludedIntoId
289+
@trackedIncludedInId
290290
bool get isConstructable => firstFragment.isConstructable;
291291

292292
@override
293-
@trackedIncludedIntoId
293+
@trackedIncludedInId
294294
bool get isDartCoreEnum {
295295
return name == 'Enum' && library.isDartCore;
296296
}
@@ -302,12 +302,12 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
302302
}
303303

304304
@override
305-
@trackedIncludedIntoId
305+
@trackedIncludedInId
306306
bool get isDartCoreObject {
307307
return name == 'Object' && library.isDartCore;
308308
}
309309

310-
@trackedIncludedIntoId
310+
@trackedIncludedInId
311311
bool get isDartCoreRecord {
312312
return name == 'Record' && library.isDartCore;
313313
}
@@ -350,14 +350,14 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
350350
}
351351

352352
@override
353-
@trackedIncludedIntoId
353+
@trackedIncludedInId
354354
bool get isExhaustive => firstFragment.isExhaustive;
355355

356356
@override
357357
bool get isExtendableOutside => !isInterface && !isFinal && !isSealed;
358358

359359
@override
360-
@trackedIncludedIntoId
360+
@trackedIncludedInId
361361
bool get isFinal {
362362
return hasModifier(Modifier.FINAL);
363363
}
@@ -370,7 +370,7 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
370370
bool get isImplementableOutside => !isBase && !isFinal && !isSealed;
371371

372372
@override
373-
@trackedIncludedIntoId
373+
@trackedIncludedInId
374374
bool get isInterface {
375375
return hasModifier(Modifier.INTERFACE);
376376
}
@@ -388,15 +388,15 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
388388
}
389389

390390
@override
391-
@trackedIncludedIntoId
391+
@trackedIncludedInId
392392
bool get isMixinApplication {
393393
return globalResultRequirements.includedInId(() {
394394
return firstFragment.isMixinApplication;
395395
});
396396
}
397397

398398
@override
399-
@trackedIncludedIntoId
399+
@trackedIncludedInId
400400
bool get isMixinClass {
401401
return hasModifier(Modifier.MIXIN_CLASS);
402402
}
@@ -406,7 +406,7 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
406406
}
407407

408408
@override
409-
@trackedIncludedIntoId
409+
@trackedIncludedInId
410410
bool get isSealed {
411411
return hasModifier(Modifier.SEALED);
412412
}
@@ -416,22 +416,22 @@ class ClassElementImpl extends InterfaceElementImpl implements ClassElement {
416416
}
417417

418418
@override
419-
@trackedIncludedIntoId
419+
@trackedIncludedInId
420420
bool get isValidMixin => firstFragment.isValidMixin;
421421

422422
@override
423423
ElementKind get kind => ElementKind.CLASS;
424424

425425
@override
426-
@trackedDirectlyDisable
426+
@trackedDirectlyOpaque
427427
T? accept<T>(ElementVisitor2<T> visitor) {
428428
globalResultRequirements?.recordOpaqueApiUse(this, 'accept2');
429429
return visitor.visitClassElement(this);
430430
}
431431

432432
@Deprecated('Use accept instead')
433433
@override
434-
@trackedDirectlyDisable
434+
@trackedDirectlyOpaque
435435
T? accept2<T>(ElementVisitor2<T> visitor) {
436436
return accept(visitor);
437437
}
@@ -1790,7 +1790,7 @@ abstract class ElementImpl implements Element {
17901790
bool get isPublic => !isPrivate;
17911791

17921792
@override
1793-
@trackedIncludedIntoId
1793+
@trackedIncludedInId
17941794
LibraryElementImpl? get library {
17951795
return globalResultRequirements.includedInId(() {
17961796
return firstFragment.libraryFragment?.element as LibraryElementImpl?;
@@ -4033,7 +4033,7 @@ abstract class InstanceElementImpl extends ElementImpl
40334033
}
40344034

40354035
@override
4036-
@trackedIncludedIntoId
4036+
@trackedIncludedInId
40374037
String get displayName {
40384038
return globalResultRequirements.includedInId(() {
40394039
return firstFragment.displayName;
@@ -4090,15 +4090,15 @@ abstract class InstanceElementImpl extends ElementImpl
40904090
bool get isPublic => firstFragment.isPublic;
40914091

40924092
@override
4093-
@trackedIncludedIntoId
4093+
@trackedIncludedInId
40944094
bool get isSimplyBounded {
40954095
return globalResultRequirements.includedInId(() {
40964096
return firstFragment.isSimplyBounded;
40974097
});
40984098
}
40994099

41004100
@override
4101-
@trackedIncludedIntoId
4101+
@trackedIncludedInId
41024102
bool get isSynthetic {
41034103
return globalResultRequirements.includedInId(() {
41044104
return firstFragment.isSynthetic;
@@ -4113,7 +4113,7 @@ abstract class InstanceElementImpl extends ElementImpl
41134113
LibraryElementImpl get library2 => library;
41144114

41154115
@override
4116-
@trackedIncludedIntoId
4116+
@trackedIncludedInId
41174117
MetadataImpl get metadata {
41184118
return globalResultRequirements.includedInId(() {
41194119
return firstFragment.metadata;
@@ -4141,7 +4141,7 @@ abstract class InstanceElementImpl extends ElementImpl
41414141
List<MethodElementImpl> get methods2 => methods;
41424142

41434143
@override
4144-
@trackedIncludedIntoId
4144+
@trackedIncludedInId
41454145
String? get name {
41464146
return globalResultRequirements.includedInId(() {
41474147
return firstFragment.name;
@@ -4174,7 +4174,7 @@ abstract class InstanceElementImpl extends ElementImpl
41744174
List<SetterElementImpl> get setters2 => setters;
41754175

41764176
@override
4177-
@trackedIncludedIntoId
4177+
@trackedIncludedInId
41784178
List<TypeParameterElementImpl> get typeParameters {
41794179
return globalResultRequirements.includedInId(() {
41804180
return firstFragment.typeParameters
@@ -4723,7 +4723,7 @@ abstract class InterfaceElementImpl extends InstanceElementImpl
47234723
.map;
47244724

47254725
@override
4726-
@trackedIncludedIntoId
4726+
@trackedIncludedInId
47274727
List<InterfaceTypeImpl> get interfaces {
47284728
return globalResultRequirements.includedInId(() {
47294729
return firstFragment.interfaces;
@@ -4743,15 +4743,15 @@ abstract class InterfaceElementImpl extends InstanceElementImpl
47434743
}
47444744

47454745
@override
4746-
@trackedIncludedIntoId
4746+
@trackedIncludedInId
47474747
List<InterfaceTypeImpl> get mixins {
47484748
return globalResultRequirements.includedInId(() {
47494749
return firstFragment.mixins;
47504750
});
47514751
}
47524752

47534753
@override
4754-
@trackedIncludedIntoId
4754+
@trackedIncludedInId
47554755
InterfaceTypeImpl? get supertype {
47564756
return globalResultRequirements.includedInId(() {
47574757
return firstFragment.supertype;

pkg/analyzer/lib/src/fine/annotations.dart

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/// annotated, as follows:
99
///
1010
/// Public getters and fields must be annotated with one of:
11-
/// [trackedIncludedIntoId]
11+
/// [trackedIncludedInId]
1212
/// [trackedDirectly]
1313
/// [trackedIndirectly]
1414
///
@@ -19,24 +19,13 @@ const elementClass = _ElementClass();
1919

2020
/// Annotation for methods that must record the fact of the invocation.
2121
///
22-
/// In contrast to [trackedIncludedIntoId], the result of the method is not
22+
/// In contrast to [trackedIncludedInId], the result of the method is not
2323
/// reflected in the ID of the target class, so we need to record this
2424
/// requirement separately.
2525
///
2626
/// Examples: `getMethod(name)`, `getNamedConstructor(name)`.
2727
const trackedDirectly = _TrackedDirectly();
2828

29-
/// Annotation for methods that are too invasive, and if invoked for anything
30-
/// other than the current library, disable fine-grained dependencies
31-
/// optimizations. So, the result will be re-computed if just anything in
32-
/// its transitive closure of imported libraries changed.
33-
///
34-
/// Examples: `fragments`, `visitChildren()`.
35-
///
36-
/// We must make sure that the analyzer itself does not use such APIs.
37-
/// We should try to fix any popular lint rules that use such APIs.
38-
const trackedDirectlyDisable = _TrackedDirectlyDisable();
39-
4029
/// As [trackedDirectly], but for methods that are expensive.
4130
///
4231
/// For example, `get methods` adds dependency on all declared methods, but
@@ -49,14 +38,25 @@ const trackedDirectlyDisable = _TrackedDirectlyDisable();
4938
/// We should try to fix any popular lint rules that use such APIs.
5039
const trackedDirectlyExpensive = _TrackedDirectlyExpensive();
5140

41+
/// Annotation for methods that are too invasive, and if invoked for anything
42+
/// other than the current library, disable fine-grained dependencies
43+
/// optimizations. So, the result will be re-computed if just anything in
44+
/// its transitive closure of imported libraries changed.
45+
///
46+
/// Examples: `fragments`, `visitChildren()`.
47+
///
48+
/// We must make sure that the analyzer itself does not use such APIs.
49+
/// We should try to fix any popular lint rules that use such APIs.
50+
const trackedDirectlyOpaque = _TrackedDirectlyOpaque();
51+
5252
/// Annotation for getters that don't require recording.
5353
///
5454
/// The library manifest builder must compare the value of the getter with
5555
/// the previous value in the manifest, and give the element a new ID if the
5656
/// value is different.
5757
///
5858
/// Examples: `isAbstract`, `interfaces`, `returnType`.
59-
const trackedIncludedIntoId = _TrackedIncludedIntoId();
59+
const trackedIncludedInId = _TrackedIncludedInId();
6060

6161
/// Annotation for methods that don't require recording.
6262
///
@@ -73,16 +73,16 @@ final class _TrackedDirectly extends _TrackedKind {
7373
const _TrackedDirectly();
7474
}
7575

76-
final class _TrackedDirectlyDisable extends _TrackedDirectly {
77-
const _TrackedDirectlyDisable();
78-
}
79-
8076
final class _TrackedDirectlyExpensive extends _TrackedDirectly {
8177
const _TrackedDirectlyExpensive();
8278
}
8379

84-
final class _TrackedIncludedIntoId extends _TrackedKind {
85-
const _TrackedIncludedIntoId();
80+
final class _TrackedDirectlyOpaque extends _TrackedDirectly {
81+
const _TrackedDirectlyOpaque();
82+
}
83+
84+
final class _TrackedIncludedInId extends _TrackedKind {
85+
const _TrackedIncludedInId();
8686
}
8787

8888
final class _TrackedIndirectly extends _TrackedKind {

0 commit comments

Comments
 (0)