Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 29b9231

Browse files
committed
Rename db types relating to local classes
These now all refer to types or classes-or-interfaces.
1 parent e8bdc8b commit 29b9231

6 files changed

Lines changed: 17 additions & 15 deletions

File tree

java/ql/lib/config/semmlecode.dbscheme

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,10 @@ isAnonymClass(
440440
int parent: @classinstancexpr ref
441441
);
442442

443-
#keyset[classid] #keyset[parent]
444-
isLocalClass(
445-
int classid: @classorinterface ref,
446-
int parent: @localclassdeclstmt ref
443+
#keyset[typeid] #keyset[parent]
444+
isLocalClassOrInterface(
445+
int typeid: @classorinterface ref,
446+
int parent: @localtypedeclstmt ref
447447
);
448448

449449
isDefConstr(
@@ -526,7 +526,7 @@ case @stmt.kind of
526526
| 15 = @labeledstmt
527527
| 16 = @assertstmt
528528
| 17 = @localvariabledeclstmt
529-
| 18 = @localclassdeclstmt
529+
| 18 = @localtypedeclstmt
530530
| 19 = @constructorinvocationstmt
531531
| 20 = @superconstructorinvocationstmt
532532
| 21 = @case

java/ql/lib/config/semmlecode.dbscheme.stats

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16910,7 +16910,7 @@
1691016910
</dependencies>
1691116911
</relation>
1691216912
<relation>
16913-
<name>isLocalClass</name>
16913+
<name>isLocalClassOrInterface</name>
1691416914
<cardinality>349</cardinality>
1691516915
<columnsizes>
1691616916
<e>

java/ql/lib/semmle/code/java/Statement.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -787,9 +787,9 @@ class LocalVariableDeclStmt extends Stmt, @localvariabledeclstmt {
787787
}
788788

789789
/** A statement that declares a local class or interface. */
790-
class LocalTypeDeclStmt extends Stmt, @localclassdeclstmt {
790+
class LocalTypeDeclStmt extends Stmt, @localtypedeclstmt {
791791
/** Gets the local type declared by this statement. */
792-
LocalClassOrInterface getLocalType() { isLocalClass(result, this) }
792+
LocalClassOrInterface getLocalType() { isLocalClassOrInterface(result, this) }
793793

794794
/**
795795
* DEPRECATED: Renamed `getLocalType` to reflect the fact that

java/ql/lib/semmle/code/java/Type.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ class LocalClassOrInterface extends NestedType, ClassOrInterface {
722722
LocalClassOrInterface() { this.isLocal() }
723723

724724
/** Gets the statement that declares this local class. */
725-
LocalTypeDeclStmt getLocalTypeDeclStmt() { isLocalClass(this, result) }
725+
LocalTypeDeclStmt getLocalTypeDeclStmt() { isLocalClassOrInterface(this, result) }
726726

727727
/**
728728
* DEPRECATED: renamed `getLocalTypeDeclStmt` to reflect the fact that
@@ -864,7 +864,7 @@ class Interface extends ClassOrInterface, @interface {
864864
/** A class or interface. */
865865
class ClassOrInterface extends RefType, @classorinterface {
866866
/** Holds if this class or interface is local. */
867-
predicate isLocal() { isLocalClass(this, _) }
867+
predicate isLocal() { isLocalClassOrInterface(this, _) }
868868

869869
/** Holds if this class or interface is package protected, that is, neither public nor private nor protected. */
870870
predicate isPackageProtected() {

java/upgrades/b4e689c90426b017ad550e30a439cab2763ff424/semmlecode.dbscheme

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -440,10 +440,10 @@ isAnonymClass(
440440
int parent: @classinstancexpr ref
441441
);
442442

443-
#keyset[classid] #keyset[parent]
444-
isLocalClass(
445-
int classid: @classorinterface ref,
446-
int parent: @localclassdeclstmt ref
443+
#keyset[typeid] #keyset[parent]
444+
isLocalClassOrInterface(
445+
int typeid: @classorinterface ref,
446+
int parent: @localtypedeclstmt ref
447447
);
448448

449449
isDefConstr(
@@ -526,7 +526,7 @@ case @stmt.kind of
526526
| 15 = @labeledstmt
527527
| 16 = @assertstmt
528528
| 17 = @localvariabledeclstmt
529-
| 18 = @localclassdeclstmt
529+
| 18 = @localtypedeclstmt
530530
| 19 = @constructorinvocationstmt
531531
| 20 = @superconstructorinvocationstmt
532532
| 21 = @case
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
description: Java 16: allow local interfaces
22
compatibility: backwards
3+
isLocalClassOrInterface.rel: reorder isLocalClass.rel(int id, int parent) id parent
4+
isLocalClass.rel: delete

0 commit comments

Comments
 (0)