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

Skip to content

Commit 0ba2daf

Browse files
tamasvajkigfoo
authored andcommitted
Adjust extraction to reuse KtProperty* relations
1 parent 78b4c94 commit 0ba2daf

2 files changed

Lines changed: 9 additions & 26 deletions

File tree

java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -897,21 +897,21 @@ open class KotlinFileExtractor(
897897
tw.writeHasLocation(blockId, locId)
898898
extractVariable(s.delegate, callable, blockId, 0)
899899

900-
val propType = useType(s.type)
901-
val propId = tw.getFreshIdLabel<DbKt_local_delegated_property>()
902-
tw.writeKtLocalDelegatedProperties(propId, useVariable(s.delegate), propType.javaResult.id, s.name.asString())
903-
tw.writeKtLocalDelegatedPropertiesKotlinType(propId, propType.kotlinResult.id)
900+
val propId = tw.getFreshIdLabel<DbKt_property>()
901+
tw.writeKtProperties(propId, s.name.asString())
902+
tw.writeHasLocation(propId, locId)
903+
tw.writeKtPropertyDelegates(propId, useVariable(s.delegate))
904904

905905
// Getter:
906906
extractStatement(s.getter, callable, blockId, 1)
907907
val l = getLocallyVisibleFunctionLabels(s.getter).function
908-
tw.writeKtLocalDelegatedPropertyGetters(propId, l)
908+
tw.writeKtPropertyGetters(propId, l)
909909

910910
val setter = s.setter
911911
if (setter != null) {
912912
extractStatement(setter, callable, blockId, 2)
913913
val l = getLocallyVisibleFunctionLabels(setter).function
914-
tw.writeKtLocalDelegatedPropertySetters(propId, l)
914+
tw.writeKtPropertySetters(propId, l)
915915
}
916916
}
917917
else -> {

java/ql/lib/config/semmlecode.dbscheme

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1218,24 +1218,7 @@ ktInitializerAssignment(
12181218
unique int id: @assignexpr ref
12191219
)
12201220

1221-
ktLocalDelegatedProperties(
1222-
unique int id: @kt_local_delegated_property,
1223-
unique int variableId: @variable ref,
1224-
int typeId: @type ref,
1225-
string name: string ref
1226-
)
1227-
1228-
ktLocalDelegatedPropertiesKotlinType(
1229-
unique int id: @kt_local_delegated_property ref,
1230-
int kttypeid: @kt_type ref
1231-
);
1232-
1233-
ktLocalDelegatedPropertyGetters(
1234-
unique int id: @kt_local_delegated_property ref,
1235-
int getter: @method ref
1236-
)
1237-
1238-
ktLocalDelegatedPropertySetters(
1239-
unique int id: @kt_local_delegated_property ref,
1240-
int setter: @method ref
1221+
ktPropertyDelegates(
1222+
unique int id: @kt_property ref,
1223+
unique int variableId: @variable ref
12411224
)

0 commit comments

Comments
 (0)