@@ -142,11 +142,8 @@ class MockitoMockedField extends MockitoAnnotatedField {
142142 exists ( MockitoInjectedField injectedField |
143143 injectedField .getDeclaringType ( ) = getDeclaringType ( )
144144 |
145- /*
146- * A `@Mock` is injected if it is used in one of the invoked callables (constructor or
147- * setter), or injected directly onto a field.
148- */
149-
145+ // A `@Mock` is injected if it is used in one of the invoked callables (constructor or
146+ // setter), or injected directly onto a field.
150147 getType ( ) .( RefType ) .getAnAncestor ( ) = injectedField .getAnInvokedCallable ( ) .getAParamType ( ) or
151148 getType ( ) .( RefType ) .getAnAncestor ( ) = injectedField .getASetField ( ) .getType ( )
152149 )
@@ -162,11 +159,8 @@ class MockitoInjectedField extends MockitoAnnotatedField {
162159 override predicate isValid ( ) {
163160 super .isValid ( ) and
164161 (
165- /*
166- * If we need to initialize the field, it is only valid if the type is a `Class` that is not
167- * local, is static if it is a nested class, and is not abstract.
168- */
169-
162+ // If we need to initialize the field, it is only valid if the type is a `Class` that is not
163+ // local, is static if it is a nested class, and is not abstract.
170164 exists ( getInitializer ( ) )
171165 or
172166 exists ( Class c | c = getType ( ) |
@@ -176,10 +170,7 @@ class MockitoInjectedField extends MockitoAnnotatedField {
176170 )
177171 ) and
178172 (
179- /*
180- * If neither of these is true, then mockito will fail to initialize this field.
181- */
182-
173+ // If neither of these is true, then mockito will fail to initialize this field.
183174 usingConstructorInjection ( ) or
184175 usingPropertyInjection ( )
185176 )
@@ -223,11 +214,8 @@ class MockitoInjectedField extends MockitoAnnotatedField {
223214 |
224215 if usingConstructorInjection ( )
225216 then
226- /*
227- * If there is no initializer for this field, and there is a most mockable constructor,
228- * then we are doing a parameterized injection of mocks into a most mockable constructor.
229- */
230-
217+ // If there is no initializer for this field, and there is a most mockable constructor,
218+ // then we are doing a parameterized injection of mocks into a most mockable constructor.
231219 result = mockInjectedClass .getAMostMockableConstructor ( )
232220 else
233221 if usingPropertyInjection ( )
@@ -239,21 +227,15 @@ class MockitoInjectedField extends MockitoAnnotatedField {
239227 )
240228 or
241229 (
242- /*
243- * Perform property injection into setter fields, but only where there exists a mock
244- * that can be injected into the method. Otherwise, the setter method is never called.
245- */
246-
230+ // Perform property injection into setter fields, but only where there exists a mock
231+ // that can be injected into the method. Otherwise, the setter method is never called.
247232 result = mockInjectedClass .getASetterMethod ( ) and
248233 exists ( MockitoMockedField mockedField |
249234 mockedField .getDeclaringType ( ) = this .getDeclaringType ( ) and
250235 mockedField .isValid ( )
251236 |
252- /*
253- * We make a simplifying assumption here - in theory, each mock can only be injected
254- * once, but we instead assume that there are sufficient mocks to go around.
255- */
256-
237+ // We make a simplifying assumption here - in theory, each mock can only be injected
238+ // once, but we instead assume that there are sufficient mocks to go around.
257239 mockedField .getType ( ) .( RefType ) .getAnAncestor ( ) = result .getParameterType ( 0 )
258240 )
259241 )
@@ -276,11 +258,8 @@ class MockitoInjectedField extends MockitoAnnotatedField {
276258 mockedField .getDeclaringType ( ) = this .getDeclaringType ( ) and
277259 mockedField .isValid ( )
278260 |
279- /*
280- * We make a simplifying assumption here - in theory, each mock can only be injected
281- * once, but we instead assume that there are sufficient mocks to go around.
282- */
283-
261+ // We make a simplifying assumption here - in theory, each mock can only be injected
262+ // once, but we instead assume that there are sufficient mocks to go around.
284263 mockedField .getType ( ) .( RefType ) .getAnAncestor ( ) = result .getType ( )
285264 )
286265 else none ( )
0 commit comments