Index: trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java	(revision 6578)
+++ trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java	(revision 6579)
@@ -603,4 +603,20 @@
     }
 
+    /**
+     * Returns true if the {@code key} corresponds to an OSM true value.
+     * @see {@link OsmUtils#isTrue(String) }
+     */
+    public final boolean isKeyTrue(String key) {
+        return OsmUtils.isTrue(get(key));
+    }
+
+    /**
+     * Returns true if the {@code key} corresponds to an OSM false value.
+     * @see {@link OsmUtils#isFalse(String) }
+     */
+    public final boolean isKeyFalse(String key) {
+        return OsmUtils.isFalse(get(key));
+    }
+
     public final String getIgnoreCase(String key) {
         String[] keys = this.keys;
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 6578)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java	(revision 6579)
@@ -15,4 +15,5 @@
 
 import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.data.osm.WaySegment;
@@ -61,4 +62,21 @@
         errorSegments = null;
         seenWays = null;
+    }
+
+    private String getLayer(OsmPrimitive w) {
+        String layer1 = w.get("layer");
+        if ("0".equals(layer1)) {
+            layer1 = null; // 0 is default value for layer.
+        } else if (layer1 == null && w.isKeyTrue("bridge")) {
+            /* see #4280.
+               In order to avoid a test error for simple settings (such as one way is a bridge, the other one isn't),
+               set layer to a marker value <bridge>. Then, two crossing bridges w/o a layer set are still detected.
+            */
+            layer1 = "<bridge>";
+        } else if (layer1 == null && w.isKeyTrue("tunnel")) {
+            /* likewise for tunnels */
+            layer1 = "<tunnel>";
+        }
+        return layer1;
     }
 
@@ -84,8 +102,5 @@
 
         String level1 = w.get("level");
-        String layer1 = w.get("layer");
-        if ("0".equals(layer1)) {
-            layer1 = null; // 0 is default value for layer. Don't assume the same for levels
-        }
+        String layer1 = getLayer(w);
 
         int nodesSize = w.getNodesCount();
Index: trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 6578)
+++ trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java	(revision 6579)
@@ -130,5 +130,5 @@
                             || en.hasTag("amenity", "parking_entrance")
                             || en.hasTag("railway", "buffer_stop")
-                            || OsmUtils.isTrue(en.get("noexit"))
+                            || en.isKeyTrue("noexit")
                             || en.hasKey("entrance")
                             || en.hasKey("barrier")) {
@@ -235,5 +235,5 @@
             String railway = w.get("railway");
             String highway = w.get("highway");
-            this.isAbandoned = "abandoned".equals(railway) || OsmUtils.isTrue(w.get("disused"));
+            this.isAbandoned = "abandoned".equals(railway) || w.isKeyTrue("disused");
             this.highway = (highway != null || railway != null) && !isAbandoned;
             this.isBoundary = !this.highway && "administrative".equals(w.get("boundary"));
@@ -252,5 +252,5 @@
             if (w.containsNode(n))
                 return false;
-            if (OsmUtils.isTrue(n.get("noexit")))
+            if (n.isKeyTrue("noexit"))
                 return false;
             EastNorth coord = n.getEastNorth();
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java	(revision 6578)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java	(revision 6579)
@@ -255,7 +255,7 @@
             case PRIMITIVE:
                 if (KeyMatchType.TRUE.equals(matchType))
-                    return OsmUtils.isTrue(e.osm.get(label)) ^ negateResult;
+                    return e.osm.isKeyTrue(label) ^ negateResult;
                 else if (KeyMatchType.FALSE.equals(matchType))
-                    return OsmUtils.isFalse(e.osm.get(label)) ^ negateResult;
+                    return e.osm.isKeyFalse(label) ^ negateResult;
                 else if (KeyMatchType.REGEX.equals(matchType))
                     return Utils.exists(e.osm.keySet(), Predicates.stringContainsPattern(Pattern.compile(label))) ^ negateResult;
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 6578)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java	(revision 6579)
@@ -177,5 +177,5 @@
         String lineIdx = null;
         HashMap<String, LinemodPrototype> overlayMap = new HashMap<String, LinemodPrototype>();
-        boolean isNotArea = OsmUtils.isFalse(primitive.get("area"));
+        boolean isNotArea = primitive.isKeyFalse("area");
         for (String key : primitive.keySet()) {
             String val = primitive.get(key);
