diff --git a/base/src/main/java/proguard/evaluation/ExecutingInvocationUnit.java b/base/src/main/java/proguard/evaluation/ExecutingInvocationUnit.java index 827942e29..3d89a1ca4 100644 --- a/base/src/main/java/proguard/evaluation/ExecutingInvocationUnit.java +++ b/base/src/main/java/proguard/evaluation/ExecutingInvocationUnit.java @@ -419,7 +419,7 @@ private MethodResult createFallbackResult(MethodExecutionInfo methodInfo) { Object instanceId = null; if (instanceValue != null && instanceValue.isSpecific()) { - instanceId = ((IdentifiedReferenceValue) instanceValue).id; + instanceId = PartialEvaluatorUtils.getIdFromSpecificReferenceValue(instanceValue); } boolean returnsSameTypeAsInstance = methodInfo.returnsSameTypeAsInstance(); diff --git a/base/src/main/java/proguard/evaluation/executor/ReflectionExecutor.java b/base/src/main/java/proguard/evaluation/executor/ReflectionExecutor.java index 9930ffacb..0cd893516 100644 --- a/base/src/main/java/proguard/evaluation/executor/ReflectionExecutor.java +++ b/base/src/main/java/proguard/evaluation/executor/ReflectionExecutor.java @@ -93,12 +93,10 @@ private Optional createFallbackResultIfInvalidParameters( return Optional.of(createFallbackResultMethod(methodExecutionInfo, valueCalculator)); } - int paramOffset = methodExecutionInfo.isStatic() ? 0 : 1; if ((methodExecutionInfo.isInstanceMethod() && (!instance.isParticular() // NOSONAR instance can't be null for instance methods || isNonPreciseParticularValue(instance))) || methodExecutionInfo.getParameters().stream() - .skip(paramOffset) .anyMatch(value -> !value.isParticular() || isNonPreciseParticularValue(value))) { // All parameters must be particular and real objects to use reflection. Detailed arrays can // be converted to a real object if they are particular.