@@ -57,30 +57,24 @@ class DeclarationWithGetSetAccessors extends DeclarationWithAccessors, TopLevelE
5757 /** Gets the `set` accessor of this declaration, if any. */
5858 Setter getSetter ( ) { result = this .getAnAccessor ( ) }
5959
60- /** Gets the target `get` accessor of this declaration, if any. */
61- private Getter getFirstGetter ( ) {
62- if exists ( this .getGetter ( ) )
63- then result = this .getGetter ( )
64- else result = this .getOverridee ( ) .getFirstGetter ( )
65- }
66-
6760 /** Gets the target accessor of this declaration when used in a read context, if any. */
68- Accessor getReadTarget ( ) { result = this .getFirstGetter ( ) }
69-
70- /** Gets the target `set` accessor of this declaration, if any. */
71- private Setter getFirstSetter ( ) {
72- if exists ( this .getSetter ( ) )
73- then result = this .getSetter ( )
74- else result = this .getOverridee ( ) .getFirstSetter ( )
61+ Accessor getReadTarget ( ) {
62+ result = this .getGetter ( )
63+ or
64+ not exists ( this .getGetter ( ) ) and
65+ result = this .getOverridee ( ) .getReadTarget ( )
7566 }
7667
7768 /** Gets the target accessor of this declaration when used in a write context, if any. */
7869 Accessor getWriteTarget ( ) {
79- result = this .getFirstSetter ( )
70+ result = this .getSetter ( )
71+ or
72+ not exists ( this .getSetter ( ) ) and
73+ result = this .getOverridee ( ) .getWriteTarget ( )
8074 or
8175 result =
8276 any ( Getter g |
83- g = this .getFirstGetter ( ) and
77+ g = this .getReadTarget ( ) and
8478 g .getAnnotatedReturnType ( ) .isRef ( )
8579 )
8680 }
0 commit comments