Fixed Bug P3 Add Hotlist Status UpdateNo update yet.Descriptionme...@thomaskeller.biz created issue #1Feb 11, 2021 02:37PMThere is an endless loop error in the Android Lint plugin (tested with AGP 4.0.1 and AGP 4.1.2) that prevents Lint from parsing the following databinding expression e.g. for the UnusedResources rule: @{SomeEnum.NOMER.isEditable(viewmodel.fieldIsEditable)} The culprit is that in the NOMER. part the Lint plugin recognizes an R. expression at first and figures that it's not actually a valid one: https://cs.android.com/android-studio/platform/tools/base/+/mirror-goog-studio-master-dev:sdk-common/src/main/java/com/android/ide/common/resources/usage/ResourceUsageModel.java;l=827;bpv=0 The while returns again in value.indexOf("R.", resourceStartIndex), but resourceStartIndex isn't incremented, so it finds the same instance again. A proper fix could be to increment that index here: if (Character.isJavaIdentifierPart( value.charAt(resourceStartIndex - 1))) { resourceStartIndex += 2; continue; } Issue summaryCommentsAll comments Oldest first tn...@google.com <tn...@google.com> #2Feb 11, 2021 06:04PMFix pending in ag/13553912. Thanks for the clear bug report! vi...@google.com <vi...@google.com> Feb 15, 2021 08:48AMAssigned to an...@google.com.sa...@google.com <sa...@google.com> Feb 24, 2021 02:01AMReassigned to tn...@google.com.tn...@google.com <tn...@google.com> Feb 24, 2021 03:36AMMarked as fixed.Add comment Comment
Description
There is an endless loop error in the Android Lint plugin (tested with AGP 4.0.1 and AGP 4.1.2) that prevents Lint from parsing the following databinding expression e.g. for the
UnusedResources
rule:The culprit is that in the
NOMER.
part the Lint plugin recognizes anR.
expression at first and figures that it's not actually a valid one:The while returns again in
value.indexOf("R.", resourceStartIndex)
, butresourceStartIndex
isn't incremented, so it finds the same instance again.A proper fix could be to increment that index here: