From 4b73fed267532b06d8cd5f5196c37becfea12970 Mon Sep 17 00:00:00 2001 From: Ian Lynagh Date: Thu, 10 Oct 2024 17:45:29 +0100 Subject: [PATCH] KE2: Add more dbscheme comments --- java/ql/lib/config/semmlecode.dbscheme | 29 ++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/java/ql/lib/config/semmlecode.dbscheme b/java/ql/lib/config/semmlecode.dbscheme index 186df68ece58..9c0233019869 100644 --- a/java/ql/lib/config/semmlecode.dbscheme +++ b/java/ql/lib/config/semmlecode.dbscheme @@ -831,6 +831,16 @@ isLocalClassOrInterface( int parent: @localtypedeclstmt ref ); +/** + * Holds if `constructorid` is a compiler-generated constructor, + * i.e. where it is not explicitly defined in the source code. + * For example, the constructor for + * ``` + * class SomeClass {} + * ``` + * Only holds for constructors of classes for which we see the + * source code, not classes from external libraries. + */ isDefConstr( int constructorid: @constructor ref ); @@ -841,6 +851,25 @@ lambdaKind( int bodyKind: int ref ); +/** + * Holds if `constructorid` is the canonical constructor of a Java + * record, e.g. the first constructor in + * ``` + * record Rectangle(double length, double width) { + * public Rectangle(double length, double width) { + * if (length <= 0 || width <= 0) { + * throw new java.lang.IllegalArgumentException("Bad size"); + * } + * this.length = length; + * this.width = width; + * } + * + * public Rectangle(double size) { + * this(size, size); + * } + * } + * ``` + */ isCanonicalConstr( int constructorid: @constructor ref );