diff --git a/java/ql/src/Telemetry/AutomodelApplicationModeCharacteristics.qll b/java/ql/src/Telemetry/AutomodelApplicationModeCharacteristics.qll index 4e753a4479d..882c957f3a5 100644 --- a/java/ql/src/Telemetry/AutomodelApplicationModeCharacteristics.qll +++ b/java/ql/src/Telemetry/AutomodelApplicationModeCharacteristics.qll @@ -171,7 +171,7 @@ class ApplicationModeMetadataExtractor extends string { } predicate hasMetadata( - Endpoint e, string package, string type, boolean subtypes, string name, string signature, + Endpoint e, string package, string type, string subtypes, string name, string signature, string input ) { exists(Call call, Callable callable, int argIdx | @@ -184,7 +184,7 @@ class ApplicationModeMetadataExtractor extends string { input = AutomodelSharedUtil::getArgumentForIndex(argIdx) and package = callable.getDeclaringType().getPackage().getName() and type = callable.getDeclaringType().getErasure().(RefType).nestedName() and - subtypes = this.considerSubtypes(callable) and + subtypes = this.considerSubtypes(callable).toString() and name = callable.getName() and signature = ExternalFlow::paramsString(callable) ) diff --git a/java/ql/src/Telemetry/AutomodelApplicationModeExtractCandidates.ql b/java/ql/src/Telemetry/AutomodelApplicationModeExtractCandidates.ql index 40e0e307300..589a10ae663 100644 --- a/java/ql/src/Telemetry/AutomodelApplicationModeExtractCandidates.ql +++ b/java/ql/src/Telemetry/AutomodelApplicationModeExtractCandidates.ql @@ -16,8 +16,9 @@ private import AutomodelApplicationModeCharacteristics private import AutomodelSharedUtil from - Endpoint endpoint, string message, ApplicationModeMetadataExtractor meta, string package, - string type, boolean subtypes, string name, string signature, string input + Endpoint endpoint, string message, ApplicationModeMetadataExtractor meta, DollarAtString package, + DollarAtString type, DollarAtString subtypes, DollarAtString name, DollarAtString signature, + DollarAtString input where not exists(CharacteristicsImpl::UninterestingToModelCharacteristic u | u.appliesToEndpoint(endpoint) @@ -40,9 +41,9 @@ where ) select endpoint, message + "\nrelated locations: $@." + "\nmetadata: $@, $@, $@, $@, $@, $@.", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, CallContext()), "CallContext", // - package.(DollarAtString), "package", // - type.(DollarAtString), "type", // - subtypes.toString().(DollarAtString), "subtypes", // - name.(DollarAtString), "name", // method name - signature.(DollarAtString), "signature", // - input.(DollarAtString), "input" // + package, "package", // + type, "type", // + subtypes, "subtypes", // + name, "name", // method name + signature, "signature", // + input, "input" // diff --git a/java/ql/src/Telemetry/AutomodelApplicationModeExtractNegativeExamples.ql b/java/ql/src/Telemetry/AutomodelApplicationModeExtractNegativeExamples.ql index d817d3a244a..7407be0be57 100644 --- a/java/ql/src/Telemetry/AutomodelApplicationModeExtractNegativeExamples.ql +++ b/java/ql/src/Telemetry/AutomodelApplicationModeExtractNegativeExamples.ql @@ -35,8 +35,8 @@ Endpoint getSampleForCharacteristic(EndpointCharacteristic c, int limit) { from Endpoint endpoint, EndpointCharacteristic characteristic, float confidence, string message, - ApplicationModeMetadataExtractor meta, string package, string type, boolean subtypes, string name, - string signature, string input + ApplicationModeMetadataExtractor meta, DollarAtString package, DollarAtString type, + DollarAtString subtypes, DollarAtString name, DollarAtString signature, DollarAtString input where endpoint = getSampleForCharacteristic(characteristic, 100) and confidence >= SharedCharacteristics::highConfidence() and @@ -58,9 +58,9 @@ where message = characteristic select endpoint, message + "\nrelated locations: $@." + "\nmetadata: $@, $@, $@, $@, $@, $@.", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, CallContext()), "CallContext", // - package.(DollarAtString), "package", // - type.(DollarAtString), "type", // - subtypes.toString().(DollarAtString), "subtypes", // - name.(DollarAtString), "name", // - signature.(DollarAtString), "signature", // - input.(DollarAtString), "input" // + package, "package", // + type, "type", // + subtypes, "subtypes", // + name, "name", // + signature, "signature", // + input, "input" // diff --git a/java/ql/src/Telemetry/AutomodelApplicationModeExtractPositiveExamples.ql b/java/ql/src/Telemetry/AutomodelApplicationModeExtractPositiveExamples.ql index 0a70b376c82..49be5c1d45f 100644 --- a/java/ql/src/Telemetry/AutomodelApplicationModeExtractPositiveExamples.ql +++ b/java/ql/src/Telemetry/AutomodelApplicationModeExtractPositiveExamples.ql @@ -13,8 +13,9 @@ private import AutomodelEndpointTypes private import AutomodelSharedUtil from - Endpoint endpoint, SinkType sinkType, ApplicationModeMetadataExtractor meta, string package, - string type, boolean subtypes, string name, string signature, string input + Endpoint endpoint, SinkType sinkType, ApplicationModeMetadataExtractor meta, + DollarAtString package, DollarAtString type, DollarAtString subtypes, DollarAtString name, + DollarAtString signature, DollarAtString input where // Exclude endpoints that have contradictory endpoint characteristics, because we only want examples we're highly // certain about in the prompt. @@ -24,9 +25,9 @@ where CharacteristicsImpl::isKnownSink(endpoint, sinkType) select endpoint, sinkType + "\nrelated locations: $@." + "\nmetadata: $@, $@, $@, $@, $@, $@.", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, CallContext()), "CallContext", // - package.(DollarAtString), "package", // - type.(DollarAtString), "type", // - subtypes.toString().(DollarAtString), "subtypes", // - name.(DollarAtString), "name", // - signature.(DollarAtString), "signature", // - input.(DollarAtString), "input" // + package, "package", // + type, "type", // + subtypes, "subtypes", // + name, "name", // + signature, "signature", // + input, "input" // diff --git a/java/ql/src/Telemetry/AutomodelFrameworkModeCharacteristics.qll b/java/ql/src/Telemetry/AutomodelFrameworkModeCharacteristics.qll index 85e28436df3..1a94d1a6338 100644 --- a/java/ql/src/Telemetry/AutomodelFrameworkModeCharacteristics.qll +++ b/java/ql/src/Telemetry/AutomodelFrameworkModeCharacteristics.qll @@ -129,7 +129,7 @@ class FrameworkModeMetadataExtractor extends string { } predicate hasMetadata( - Endpoint e, string package, string type, boolean subtypes, string name, string signature, + Endpoint e, string package, string type, string subtypes, string name, string signature, string input, string parameterName ) { exists(Callable callable, int paramIdx | @@ -137,7 +137,7 @@ class FrameworkModeMetadataExtractor extends string { input = AutomodelSharedUtil::getArgumentForIndex(paramIdx) and package = callable.getDeclaringType().getPackage().getName() and type = callable.getDeclaringType().getErasure().(RefType).nestedName() and - subtypes = this.considerSubtypes(callable) and + subtypes = this.considerSubtypes(callable).toString() and name = callable.getName() and parameterName = e.asParameter().getName() and signature = ExternalFlow::paramsString(callable) diff --git a/java/ql/src/Telemetry/AutomodelFrameworkModeExtractCandidates.ql b/java/ql/src/Telemetry/AutomodelFrameworkModeExtractCandidates.ql index 7f7f050fac4..391105b9d56 100644 --- a/java/ql/src/Telemetry/AutomodelFrameworkModeExtractCandidates.ql +++ b/java/ql/src/Telemetry/AutomodelFrameworkModeExtractCandidates.ql @@ -16,8 +16,9 @@ private import AutomodelFrameworkModeCharacteristics private import AutomodelSharedUtil from - Endpoint endpoint, string message, FrameworkModeMetadataExtractor meta, string package, - string type, boolean subtypes, string name, string signature, string input, string parameterName + Endpoint endpoint, string message, FrameworkModeMetadataExtractor meta, DollarAtString package, + DollarAtString type, DollarAtString subtypes, DollarAtString name, DollarAtString signature, + DollarAtString input, DollarAtString parameterName where not exists(CharacteristicsImpl::UninterestingToModelCharacteristic u | u.appliesToEndpoint(endpoint) @@ -42,10 +43,10 @@ select endpoint, message + "\nrelated locations: $@, $@." + "\nmetadata: $@, $@, $@, $@, $@, $@, $@.", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, MethodDoc()), "MethodDoc", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, ClassDoc()), "ClassDoc", // - package.(DollarAtString), "package", // - type.(DollarAtString), "type", // - subtypes.toString().(DollarAtString), "subtypes", // - name.(DollarAtString), "name", // - signature.(DollarAtString), "signature", // - input.(DollarAtString), "input", // - parameterName.(DollarAtString), "parameterName" // + package, "package", // + type, "type", // + subtypes, "subtypes", // + name, "name", // + signature, "signature", // + input, "input", // + parameterName, "parameterName" // diff --git a/java/ql/src/Telemetry/AutomodelFrameworkModeExtractNegativeExamples.ql b/java/ql/src/Telemetry/AutomodelFrameworkModeExtractNegativeExamples.ql index 9036d638c2b..fb4bbc0e675 100644 --- a/java/ql/src/Telemetry/AutomodelFrameworkModeExtractNegativeExamples.ql +++ b/java/ql/src/Telemetry/AutomodelFrameworkModeExtractNegativeExamples.ql @@ -13,9 +13,10 @@ private import AutomodelEndpointTypes private import AutomodelSharedUtil from - Endpoint endpoint, EndpointCharacteristic characteristic, float confidence, string message, - FrameworkModeMetadataExtractor meta, string package, string type, boolean subtypes, string name, - string signature, string input, string parameterName + Endpoint endpoint, EndpointCharacteristic characteristic, float confidence, + DollarAtString message, FrameworkModeMetadataExtractor meta, DollarAtString package, + DollarAtString type, DollarAtString subtypes, DollarAtString name, DollarAtString signature, + DollarAtString input, DollarAtString parameterName where characteristic.appliesToEndpoint(endpoint) and confidence >= SharedCharacteristics::highConfidence() and @@ -39,10 +40,10 @@ select endpoint, message + "\nrelated locations: $@, $@." + "\nmetadata: $@, $@, $@, $@, $@, $@, $@.", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, MethodDoc()), "MethodDoc", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, ClassDoc()), "ClassDoc", // - package.(DollarAtString), "package", // - type.(DollarAtString), "type", // - subtypes.toString().(DollarAtString), "subtypes", // - name.(DollarAtString), "name", // - signature.(DollarAtString), "signature", // - input.(DollarAtString), "input", // - parameterName.(DollarAtString), "parameterName" // + package, "package", // + type, "type", // + subtypes, "subtypes", // + name, "name", // + signature, "signature", // + input, "input", // + parameterName, "parameterName" // diff --git a/java/ql/src/Telemetry/AutomodelFrameworkModeExtractPositiveExamples.ql b/java/ql/src/Telemetry/AutomodelFrameworkModeExtractPositiveExamples.ql index eeaf7037a15..41cca592380 100644 --- a/java/ql/src/Telemetry/AutomodelFrameworkModeExtractPositiveExamples.ql +++ b/java/ql/src/Telemetry/AutomodelFrameworkModeExtractPositiveExamples.ql @@ -13,8 +13,9 @@ private import AutomodelEndpointTypes private import AutomodelSharedUtil from - Endpoint endpoint, SinkType sinkType, FrameworkModeMetadataExtractor meta, string package, - string type, boolean subtypes, string name, string signature, string input, string parameterName + Endpoint endpoint, SinkType sinkType, FrameworkModeMetadataExtractor meta, DollarAtString package, + DollarAtString type, DollarAtString subtypes, DollarAtString name, DollarAtString signature, + DollarAtString input, DollarAtString parameterName where // Exclude endpoints that have contradictory endpoint characteristics, because we only want examples we're highly // certain about in the prompt. @@ -26,10 +27,10 @@ select endpoint, sinkType + "\nrelated locations: $@, $@." + "\nmetadata: $@, $@, $@, $@, $@, $@, $@.", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, MethodDoc()), "MethodDoc", // CharacteristicsImpl::getRelatedLocationOrCandidate(endpoint, ClassDoc()), "ClassDoc", // - package.(DollarAtString), "package", // - type.(DollarAtString), "type", // - subtypes.toString().(DollarAtString), "subtypes", // - name.(DollarAtString), "name", // - signature.(DollarAtString), "signature", // - input.(DollarAtString), "input", // - parameterName.(DollarAtString), "parameterName" // + package, "package", // + type, "type", // + subtypes, "subtypes", // + name, "name", // + signature, "signature", // + input, "input", // + parameterName, "parameterName" //