@@ -15,7 +15,6 @@ private import semmle.code.java.security.QueryInjection
1515private import semmle.code.java.dataflow.internal.ModelExclusions as ModelExclusions
1616private import AutomodelJavaUtil as AutomodelJavaUtil
1717private import semmle.code.java.security.PathSanitizer as PathSanitizer
18- private import AutomodelSharedGetCallable as AutomodelSharedGetCallable
1918import AutomodelSharedCharacteristics as SharedCharacteristics
2019import AutomodelEndpointTypes as AutomodelEndpointTypes
2120
@@ -330,22 +329,6 @@ module ApplicationCandidatesImpl implements SharedCharacteristics::CandidateSig
330329 }
331330}
332331
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-
349332/**
350333 * Contains endpoints that are defined in QL code rather than as a MaD model. Ideally this predicate
351334 * should be empty.
@@ -459,8 +442,7 @@ private class ExceptionCharacteristic extends CharacteristicsImpl::NotASinkChara
459442 ExceptionCharacteristic ( ) { this = "exception" }
460443
461444 override predicate appliesToEndpoint ( Endpoint e ) {
462- ApplicationModeGetCallable:: getCallable ( e ) .getDeclaringType ( ) .getASupertype * ( ) instanceof
463- TypeThrowable
445+ e .( CallArgument ) .getCallable ( ) .getDeclaringType ( ) .getASupertype * ( ) instanceof TypeThrowable
464446 }
465447}
466448
@@ -493,18 +475,20 @@ private class LocalCall extends CharacteristicsImpl::UninterestingToModelCharact
493475 LocalCall ( ) { this = "local call" }
494476
495477 override predicate appliesToEndpoint ( Endpoint e ) {
496- ApplicationModeGetCallable:: getCallable ( e ) .fromSource ( )
478+ e .( CallArgument ) .getCallable ( ) .fromSource ( )
479+ or
480+ e .( MethodReturnValue ) .getCallable ( ) .fromSource ( )
497481 }
498482}
499483
500484/**
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.
502486 */
503487private class ExcludedFromModeling extends CharacteristicsImpl:: UninterestingToModelCharacteristic {
504488 ExcludedFromModeling ( ) { this = "excluded from modeling" }
505489
506490 override predicate appliesToEndpoint ( Endpoint e ) {
507- ModelExclusions:: isUninterestingForModels ( ApplicationModeGetCallable :: getCallable ( e ) )
491+ ModelExclusions:: isUninterestingForModels ( e . getCallable ( ) )
508492 }
509493}
510494
@@ -518,7 +502,7 @@ private class NonPublicMethodCharacteristic extends CharacteristicsImpl::Uninter
518502
519503 override predicate appliesToEndpoint ( Endpoint e ) {
520504 e .getExtensibleType ( ) = "sinkModel" and
521- not ApplicationModeGetCallable :: getCallable ( e ) .isPublic ( )
505+ not e . getCallable ( ) .isPublic ( )
522506 }
523507}
524508
0 commit comments