@@ -821,15 +821,15 @@ abstract class InstructionFilter(
821
821
/* *
822
822
* If this filter matches the method instruction.
823
823
*
824
- * @param method The enclosing method of [instruction].
824
+ * @param enclosingMethod The method of that contains [instruction].
825
825
* @param instruction The instruction to check for a match.
826
- * @param methodIndex The index of [instruction] in the enclosing [method ].
826
+ * @param methodIndex The index of [instruction] in the enclosing [enclosingMethod ].
827
827
* The index can be ignored unless a filter has an unusual reason,
828
828
* such as matching only the last index of a method.
829
829
*/
830
830
abstract fun matches (
831
831
context : BytecodePatchContext ,
832
- method : Method ,
832
+ enclosingMethod : Method ,
833
833
instruction : Instruction ,
834
834
methodIndex : Int
835
835
): Boolean
@@ -852,12 +852,12 @@ class AnyInstruction internal constructor(
852
852
853
853
override fun matches (
854
854
context : BytecodePatchContext ,
855
- method : Method ,
855
+ enclosingMethod : Method ,
856
856
instruction : Instruction ,
857
857
methodIndex : Int
858
858
) : Boolean {
859
859
return filters.any { filter ->
860
- filter.matches(context, method , instruction, methodIndex)
860
+ filter.matches(context, enclosingMethod , instruction, methodIndex)
861
861
}
862
862
}
863
863
}
@@ -879,7 +879,7 @@ open class OpcodeFilter(
879
879
880
880
override fun matches (
881
881
context : BytecodePatchContext ,
882
- method : Method ,
882
+ enclosingMethod : Method ,
883
883
instruction : Instruction ,
884
884
methodIndex : Int
885
885
): Boolean {
@@ -914,7 +914,7 @@ open class OpcodesFilter private constructor(
914
914
915
915
override fun matches (
916
916
context : BytecodePatchContext ,
917
- method : Method ,
917
+ enclosingMethod : Method ,
918
918
instruction : Instruction ,
919
919
methodIndex : Int
920
920
): Boolean {
@@ -963,11 +963,11 @@ class LiteralFilter internal constructor(
963
963
964
964
override fun matches (
965
965
context : BytecodePatchContext ,
966
- method : Method ,
966
+ enclosingMethod : Method ,
967
967
instruction : Instruction ,
968
968
methodIndex : Int
969
969
): Boolean {
970
- if (! super .matches(context, method , instruction, methodIndex)) {
970
+ if (! super .matches(context, enclosingMethod , instruction, methodIndex)) {
971
971
return false
972
972
}
973
973
@@ -1030,11 +1030,11 @@ class StringFilter internal constructor(
1030
1030
1031
1031
override fun matches (
1032
1032
context : BytecodePatchContext ,
1033
- method : Method ,
1033
+ enclosingMethod : Method ,
1034
1034
instruction : Instruction ,
1035
1035
methodIndex : Int
1036
1036
): Boolean {
1037
- if (! super .matches(context, method , instruction, methodIndex)) {
1037
+ if (! super .matches(context, enclosingMethod , instruction, methodIndex)) {
1038
1038
return false
1039
1039
}
1040
1040
@@ -1088,11 +1088,11 @@ class MethodCallFilter internal constructor(
1088
1088
1089
1089
override fun matches (
1090
1090
context : BytecodePatchContext ,
1091
- method : Method ,
1091
+ enclosingMethod : Method ,
1092
1092
instruction : Instruction ,
1093
1093
methodIndex : Int
1094
1094
): Boolean {
1095
- if (! super .matches(context, method , instruction, methodIndex)) {
1095
+ if (! super .matches(context, enclosingMethod , instruction, methodIndex)) {
1096
1096
return false
1097
1097
}
1098
1098
@@ -1108,7 +1108,7 @@ class MethodCallFilter internal constructor(
1108
1108
// Would be nice if this also checked all super classes,
1109
1109
// but doing so requires iteratively checking all superclasses
1110
1110
// up to the root Object class since class defs are mere Strings.
1111
- if (! (definingClass == " this" && referenceClass == method .definingClass)) {
1111
+ if (! (definingClass == " this" && referenceClass == enclosingMethod .definingClass)) {
1112
1112
return false
1113
1113
} // else, the method call is for 'this' class.
1114
1114
}
@@ -1376,11 +1376,11 @@ class FieldAccessFilter internal constructor(
1376
1376
1377
1377
override fun matches (
1378
1378
context : BytecodePatchContext ,
1379
- method : Method ,
1379
+ enclosingMethod : Method ,
1380
1380
instruction : Instruction ,
1381
1381
methodIndex : Int
1382
1382
): Boolean {
1383
- if (! super .matches(context, method , instruction, methodIndex)) {
1383
+ if (! super .matches(context, enclosingMethod , instruction, methodIndex)) {
1384
1384
return false
1385
1385
}
1386
1386
@@ -1392,7 +1392,7 @@ class FieldAccessFilter internal constructor(
1392
1392
val definingClass = definingClass(context)
1393
1393
1394
1394
if (! referenceClass.endsWith(definingClass)) {
1395
- if (! (definingClass == " this" && referenceClass == method .definingClass)) {
1395
+ if (! (definingClass == " this" && referenceClass == enclosingMethod .definingClass)) {
1396
1396
return false
1397
1397
} // else, the method call is for 'this' class.
1398
1398
}
@@ -1562,11 +1562,11 @@ class NewInstanceFilter internal constructor (
1562
1562
1563
1563
override fun matches (
1564
1564
context : BytecodePatchContext ,
1565
- method : Method ,
1565
+ enclosingMethod : Method ,
1566
1566
instruction : Instruction ,
1567
1567
methodIndex : Int
1568
1568
): Boolean {
1569
- if (! super .matches(context, method , instruction, methodIndex)) {
1569
+ if (! super .matches(context, enclosingMethod , instruction, methodIndex)) {
1570
1570
return false
1571
1571
}
1572
1572
@@ -1607,11 +1607,11 @@ class CheckCastFilter internal constructor (
1607
1607
1608
1608
override fun matches (
1609
1609
context : BytecodePatchContext ,
1610
- method : Method ,
1610
+ enclosingMethod : Method ,
1611
1611
instruction : Instruction ,
1612
1612
methodIndex : Int
1613
1613
): Boolean {
1614
- if (! super .matches(context, method , instruction, methodIndex)) {
1614
+ if (! super .matches(context, enclosingMethod , instruction, methodIndex)) {
1615
1615
return false
1616
1616
}
1617
1617
@@ -1652,12 +1652,12 @@ class LastInstructionFilter internal constructor(
1652
1652
1653
1653
override fun matches (
1654
1654
context : BytecodePatchContext ,
1655
- method : Method ,
1655
+ enclosingMethod : Method ,
1656
1656
instruction : Instruction ,
1657
1657
methodIndex : Int
1658
1658
): Boolean {
1659
- return methodIndex == method .instructions.count() - 1 && filter.matches(
1660
- context, method , instruction, methodIndex
1659
+ return methodIndex == enclosingMethod .instructions.count() - 1 && filter.matches(
1660
+ context, enclosingMethod , instruction, methodIndex
1661
1661
)
1662
1662
}
1663
1663
}
0 commit comments