@@ -153,11 +153,12 @@ module SourceSinkInterpretationInput implements
153
153
// Methods having multiple qualified names, a given Method is liable to have
154
154
// more than one SourceOrSinkElement, one for each of the names it claims.
155
155
private newtype TSourceOrSinkElement =
156
- TMethodEntityElement ( Method m , string pkg , string type , boolean subtypes ) {
157
- m .hasQualifiedName ( pkg , type , _) and subtypes = [ true , false ]
158
- } or
159
- TFieldEntityElement ( Field f , string pkg , string type , boolean subtypes ) {
160
- f .hasQualifiedName ( pkg , type , _) and subtypes = [ true , false ]
156
+ TMethodOrFieldEntityElement ( Entity e , string pkg , string type , boolean subtypes ) {
157
+ (
158
+ e .( Method ) .hasQualifiedName ( pkg , type , _) or
159
+ e .( Field ) .hasQualifiedName ( pkg , type , _)
160
+ ) and
161
+ subtypes = [ true , false ]
161
162
} or
162
163
TOtherEntityElement ( Entity e ) {
163
164
not e instanceof Method and
@@ -169,8 +170,7 @@ module SourceSinkInterpretationInput implements
169
170
class SourceOrSinkElement extends TSourceOrSinkElement {
170
171
/** Gets this source or sink element as an entity, if it is one. */
171
172
Entity asEntity ( ) {
172
- this = TMethodEntityElement ( result , _, _, _) or
173
- this = TFieldEntityElement ( result , _, _, _) or
173
+ this = TMethodOrFieldEntityElement ( result , _, _, _) or
174
174
this = TOtherEntityElement ( result )
175
175
}
176
176
@@ -182,8 +182,7 @@ module SourceSinkInterpretationInput implements
182
182
* with the given values for `pkg`, `type` and `subtypes`.
183
183
*/
184
184
predicate hasTypeInfo ( string pkg , string type , boolean subtypes ) {
185
- this = TMethodEntityElement ( _, pkg , type , subtypes ) or
186
- this = TFieldEntityElement ( _, pkg , type , subtypes )
185
+ this = TMethodOrFieldEntityElement ( _, pkg , type , subtypes )
187
186
}
188
187
189
188
/** Gets a textual representation of this source or sink element. */
0 commit comments