[ONOS-7724] Incorrect priority check in PiFlowRuleTranslator

Change-Id: Ib927bd52959b3d128060960c5e048ea5afc7a52a
diff --git a/core/net/src/main/java/org/onosproject/net/pi/impl/PiFlowRuleTranslatorImpl.java b/core/net/src/main/java/org/onosproject/net/pi/impl/PiFlowRuleTranslatorImpl.java
index 40a150f..5741e65 100644
--- a/core/net/src/main/java/org/onosproject/net/pi/impl/PiFlowRuleTranslatorImpl.java
+++ b/core/net/src/main/java/org/onosproject/net/pi/impl/PiFlowRuleTranslatorImpl.java
@@ -111,9 +111,9 @@
                     .build();
             // FIXME: P4Runtime limit
             // Need to ignore priority if no TCAM lookup match field
-            needPriority = fieldMatches.stream()
-                    .anyMatch(match -> match.type() == PiMatchType.TERNARY ||
-                            match.type() == PiMatchType.RANGE);
+            needPriority = tableModel.matchFields().stream()
+                    .anyMatch(match -> match.matchType() == PiMatchType.TERNARY ||
+                            match.matchType() == PiMatchType.RANGE);
         }
         // Translate treatment.
         final PiTableAction piTableAction = translateTreatment(rule.treatment(), interpreter, piTableId, pipelineModel);