@@ -15,7 +15,6 @@ private import semmle.code.java.security.QueryInjection
15
15
private import semmle.code.java.dataflow.internal.ModelExclusions as ModelExclusions
16
16
private import AutomodelJavaUtil as AutomodelJavaUtil
17
17
private import semmle.code.java.security.PathSanitizer as PathSanitizer
18
- private import AutomodelSharedGetCallable as AutomodelSharedGetCallable
19
18
import AutomodelSharedCharacteristics as SharedCharacteristics
20
19
import AutomodelEndpointTypes as AutomodelEndpointTypes
21
20
@@ -330,22 +329,6 @@ module ApplicationCandidatesImpl implements SharedCharacteristics::CandidateSig
330
329
}
331
330
}
332
331
333
- private class JavaCallable = Callable ;
334
-
335
- private module ApplicationModeGetCallable implements AutomodelSharedGetCallable:: GetCallableSig {
336
- class Callable = JavaCallable ;
337
-
338
- class Endpoint = ApplicationCandidatesImpl:: Endpoint ;
339
-
340
- /**
341
- * Returns the API callable being modeled.
342
- *
343
- * We usually want to use `.getSourceDeclaration()` instead of just 'the' callable,
344
- * because the source declaration callable has erased generic type parameters.
345
- */
346
- Callable getCallable ( Endpoint e ) { result = e .getCall ( ) .getCallee ( ) }
347
- }
348
-
349
332
/**
350
333
* Contains endpoints that are defined in QL code rather than as a MaD model. Ideally this predicate
351
334
* should be empty.
@@ -459,8 +442,7 @@ private class ExceptionCharacteristic extends CharacteristicsImpl::NotASinkChara
459
442
ExceptionCharacteristic ( ) { this = "exception" }
460
443
461
444
override predicate appliesToEndpoint ( Endpoint e ) {
462
- ApplicationModeGetCallable:: getCallable ( e ) .getDeclaringType ( ) .getASupertype * ( ) instanceof
463
- TypeThrowable
445
+ e .( CallArgument ) .getCallable ( ) .getDeclaringType ( ) .getASupertype * ( ) instanceof TypeThrowable
464
446
}
465
447
}
466
448
@@ -493,18 +475,20 @@ private class LocalCall extends CharacteristicsImpl::UninterestingToModelCharact
493
475
LocalCall ( ) { this = "local call" }
494
476
495
477
override predicate appliesToEndpoint ( Endpoint e ) {
496
- ApplicationModeGetCallable:: getCallable ( e ) .fromSource ( )
478
+ e .( CallArgument ) .getCallable ( ) .fromSource ( )
479
+ or
480
+ e .( MethodReturnValue ) .getCallable ( ) .fromSource ( )
497
481
}
498
482
}
499
483
500
484
/**
501
- * A Characteristic that marks endpoints as uninteresting to model, according to the Java ModelExclusions module.
485
+ * A characteristic that marks endpoints as uninteresting to model, according to the Java ModelExclusions module.
502
486
*/
503
487
private class ExcludedFromModeling extends CharacteristicsImpl:: UninterestingToModelCharacteristic {
504
488
ExcludedFromModeling ( ) { this = "excluded from modeling" }
505
489
506
490
override predicate appliesToEndpoint ( Endpoint e ) {
507
- ModelExclusions:: isUninterestingForModels ( ApplicationModeGetCallable :: getCallable ( e ) )
491
+ ModelExclusions:: isUninterestingForModels ( e . getCallable ( ) )
508
492
}
509
493
}
510
494
@@ -518,7 +502,7 @@ private class NonPublicMethodCharacteristic extends CharacteristicsImpl::Uninter
518
502
519
503
override predicate appliesToEndpoint ( Endpoint e ) {
520
504
e .getExtensibleType ( ) = "sinkModel" and
521
- not ApplicationModeGetCallable :: getCallable ( e ) .isPublic ( )
505
+ not e . getCallable ( ) .isPublic ( )
522
506
}
523
507
}
524
508
0 commit comments