From b7a8660375ccb246d9de751b9878ecf02fdd1de7 Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Tue, 23 May 2023 16:26:43 +0200 Subject: [PATCH] Java: Re-factor getComponent. --- .../code/java/dataflow/internal/FlowSummaryImpl.qll | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll index 034c6101de3..ce63ac5ef90 100644 --- a/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll +++ b/java/ql/lib/semmle/code/java/dataflow/internal/FlowSummaryImpl.qll @@ -166,15 +166,10 @@ module Public { SummaryComponentStack return(ReturnKind rk) { result = singleton(SummaryComponent::return(rk)) } } - private predicate noComponentSpecific(SummaryComponent sc) { - not exists(getComponentSpecific(sc)) - } - /** Gets a textual representation of this component used for flow summaries. */ private string getComponent(SummaryComponent sc) { result = getComponentSpecific(sc) or - noComponentSpecific(sc) and ( exists(ArgumentPosition pos | sc = TParameterSummaryComponent(pos) and @@ -185,9 +180,9 @@ module Public { sc = TArgumentSummaryComponent(pos) and result = "Argument[" + getParameterPosition(pos) + "]" ) - or - sc = TReturnSummaryComponent(getReturnValueKind()) and result = "ReturnValue" ) + or + sc = TReturnSummaryComponent(getReturnValueKind()) and result = "ReturnValue" } /** Gets a textual representation of this stack used for flow summaries. */