From b8ff336fc5eaaa203b31b6a094aeb038e7778506 Mon Sep 17 00:00:00 2001 From: Bohdan Artiukhov <69891500+bohdanprog@users.noreply.github.com> Date: Thu, 18 Jul 2024 10:52:02 +0200 Subject: [PATCH] fix: remove using pattern matching in FilterView (#2354) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Summary Closes #2347 Fixed a problem with building an Android app, pattern matching threw an error when we tried to build an Android app. [Repository](https://github.com/bohdanprog/react-native-svg-error-pattern-matching) to reproduce that error. ## Test Plan We can easily check that build the app. ### What are the steps to reproduce (after prerequisites)? build the app without that fix. ## Compatibility | OS | Implemented | | ------- | :---------: | | Android | ✅ | --- android/src/main/java/com/horcrux/svg/FilterView.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/android/src/main/java/com/horcrux/svg/FilterView.java b/android/src/main/java/com/horcrux/svg/FilterView.java index a3d90293..528f4d1b 100644 --- a/android/src/main/java/com/horcrux/svg/FilterView.java +++ b/android/src/main/java/com/horcrux/svg/FilterView.java @@ -80,7 +80,8 @@ class FilterView extends DefinitionView { for (int i = 0; i < getChildCount(); i++) { View node = getChildAt(i); - if (node instanceof FilterPrimitiveView currentFilter) { + if (node instanceof FilterPrimitiveView) { + FilterPrimitiveView currentFilter = (FilterPrimitiveView) node; res = currentFilter.applyFilter(mResultsMap, res); String resultName = currentFilter.getResult(); if (resultName != null) {