@@ -98,43 +98,41 @@ class TargetApiSpecific extends Callable {
98
98
Callable lift ( ) { result = lift }
99
99
}
100
100
101
- private string isExtensible ( J:: RefType ref ) {
102
- if ref .isFinal ( ) then result = "false" else result = "true"
103
- }
104
-
105
- private string typeAsModel ( J:: RefType type ) {
106
- result =
107
- type .getCompilationUnit ( ) .getPackage ( ) .getName ( ) + ";" +
108
- type .getErasure ( ) .( J:: RefType ) .nestedName ( )
109
- }
110
-
111
- private J:: RefType bestTypeForModel ( TargetApiSpecific api ) {
112
- result = api .lift ( ) .getDeclaringType ( )
101
+ private string isExtensible ( Callable c ) {
102
+ if c .getDeclaringType ( ) .isFinal ( ) then result = "false" else result = "true"
113
103
}
114
104
115
105
/**
116
- * Returns the appropriate type name for the model. Either the type
117
- * declaring the method or the supertype introducing the method.
106
+ * Returns the appropriate type name for the model.
118
107
*/
119
- private string typeAsSummaryModel ( TargetApiSpecific api ) {
120
- result = typeAsModel ( bestTypeForModel ( api ) )
108
+ private string typeAsModel ( Callable c ) {
109
+ exists ( RefType type | type = c .getDeclaringType ( ) |
110
+ result =
111
+ type .getCompilationUnit ( ) .getPackage ( ) .getName ( ) + ";" +
112
+ type .getErasure ( ) .( J:: RefType ) .nestedName ( )
113
+ )
121
114
}
122
115
123
- private predicate partialModel ( TargetApiSpecific api , string type , string name , string parameters ) {
124
- type = typeAsSummaryModel ( api ) and
125
- name = api .getName ( ) and
126
- parameters = ExternalFlow:: paramsString ( api )
116
+ private predicate partialLiftedModel (
117
+ TargetApiSpecific api , string type , string extensible , string name , string parameters
118
+ ) {
119
+ exists ( Callable c | c = api .lift ( ) |
120
+ type = typeAsModel ( c ) and
121
+ extensible = isExtensible ( c ) and
122
+ name = c .getName ( ) and
123
+ parameters = ExternalFlow:: paramsString ( c )
124
+ )
127
125
}
128
126
129
127
/**
130
128
* Computes the first 6 columns for MaD rows.
131
129
*/
132
130
string asPartialModel ( TargetApiSpecific api ) {
133
- exists ( string type , string name , string parameters |
134
- partialModel ( api , type , name , parameters ) and
131
+ exists ( string type , string extensible , string name , string parameters |
132
+ partialLiftedModel ( api , type , extensible , name , parameters ) and
135
133
result =
136
134
type + ";" //
137
- + isExtensible ( bestTypeForModel ( api ) ) + ";" //
135
+ + extensible + ";" //
138
136
+ name + ";" //
139
137
+ parameters + ";" //
140
138
+ /* ext + */ ";" //
@@ -146,7 +144,7 @@ string asPartialModel(TargetApiSpecific api) {
146
144
*/
147
145
string asPartialNeutralModel ( TargetApiSpecific api ) {
148
146
exists ( string type , string name , string parameters |
149
- partialModel ( api , type , name , parameters ) and
147
+ partialLiftedModel ( api , type , _ , name , parameters ) and
150
148
result =
151
149
type + ";" //
152
150
+ name + ";" //
0 commit comments