Index: src/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrector.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrector.java	(revision 17010)
+++ src/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrector.java	(date 1599307459066)
@@ -52,12 +52,19 @@
      */
     public static TagCollection getDirectionalTags(Tagged way) {
         final TagCollection collection = new TagCollection();
+
+        // TODO: uncomment the next line if needed
+        //final Tag cityWall = new Tag("barrier", "city_wall");
+
         for (Map.Entry<String, String> entry : way.getKeys().entrySet()) {
             final Tag tag = new Tag(entry.getKey(), entry.getValue());
             final boolean isDirectional = DIRECTIONAL_TAGS.contains(tag) || tag.isDirectionKey();
             if (isDirectional) {
                 final boolean cannotBeCorrected = ReverseWayTagCorrector.getTagCorrections(tag).isEmpty();
-                if (cannotBeCorrected) {
+
+                // TODO: delete the inline comment if you want to restrict two_sided for city_wall only
+                if (cannotBeCorrected && !(/*tag.equals(cityWall) && */way.isKeyTrue("two_sided"))) {
+                    // two_sided=yes is a special (documented) barrier=city_wall attribute, see #197140
                     collection.add(tag);
                 }
             }
Index: test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrectorTest.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrectorTest.java	(revision 17010)
+++ test/unit/org/openstreetmap/josm/actions/corrector/ReverseWayNoTagCorrectorTest.java	(date 1599302736903)
@@ -6,6 +6,8 @@
 import org.junit.Rule;
 import org.junit.Test;
 import org.openstreetmap.josm.data.osm.Tag;
+import org.openstreetmap.josm.data.osm.Tagged;
+import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -33,5 +35,12 @@
         assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("aerialway", "station")).size());
         assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("incline", "up")).size());
         assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("oneway", "yes")).size());
+        assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("barrier", "kerb")).size());
+        assertEquals(1, ReverseWayNoTagCorrector.getDirectionalTags(new Tag("barrier", "city_wall")).size());
+
+        final Tagged twoSidedCityWall = new Way();
+        twoSidedCityWall.put("barrier", "city_wall");
+        twoSidedCityWall.put("two_sided", "yes");
+        assertEquals(0, ReverseWayNoTagCorrector.getDirectionalTags(twoSidedCityWall).size());
     }
 }
