Index: trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java	(revision 11367)
+++ trunk/src/org/openstreetmap/josm/data/osm/AbstractPrimitive.java	(revision 11368)
@@ -57,5 +57,5 @@
      * and on upload the object will be send to the server.
      */
-    protected static final short FLAG_MODIFIED = 1 << 0;
+    protected static final short FLAG_MODIFIED = 0x0001;
 
     /**
@@ -63,5 +63,5 @@
      * as deleted on the server.
      */
-    protected static final short FLAG_VISIBLE = 1 << 1;
+    protected static final short FLAG_VISIBLE = 0x0010;
 
     /**
@@ -72,5 +72,5 @@
      * objects still referring to it.
      */
-    protected static final short FLAG_DELETED = 1 << 2;
+    protected static final short FLAG_DELETED = 0x0100;
 
     /**
@@ -79,5 +79,5 @@
      * fetched from the server.
      */
-    protected static final short FLAG_INCOMPLETE = 1 << 3;
+    protected static final short FLAG_INCOMPLETE = 0x1000;
 
     /**
Index: trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 11367)
+++ trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java	(revision 11368)
@@ -248,5 +248,5 @@
      *--------*/
     public StyleCache mappaintStyle;
-    public int mappaintCacheIdx;
+    private short mappaintCacheIdx;
 
     /* This should not be called from outside. Fixing the UI to add relevant
@@ -256,4 +256,21 @@
         mappaintStyle = null;
     }
+
+    /**
+     * Returns mappaint cache index.
+     * @return mappaint cache index
+     */
+    public final short getMappaintCacheIdx() {
+        return mappaintCacheIdx;
+    }
+
+    /**
+     * Sets the mappaint cache index.
+     * @param mappaintCacheIdx mappaint cache index
+     */
+    public final void setMappaintCacheIdx(short mappaintCacheIdx) {
+        this.mappaintCacheIdx = mappaintCacheIdx;
+    }
+
     /* end of mappaint data */
 
Index: trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 11367)
+++ trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java	(revision 11368)
@@ -52,6 +52,5 @@
  * The results are cached with respect to the current scale.
  *
- * Use {@link #setStyleSources(Collection)} to select the StyleSources that are
- * applied.
+ * Use {@link #setStyleSources(Collection)} to select the StyleSources that are applied.
  */
 public class ElemStyles implements PreferenceChangedListener {
@@ -59,8 +58,11 @@
     private boolean drawMultipolygon;
 
-    private int cacheIdx = 1;
-
-    private boolean defaultNodes, defaultLines;
-    private int defaultNodesIdx, defaultLinesIdx;
+    private short cacheIdx = 1;
+
+    private boolean defaultNodes;
+    private boolean defaultLines;
+
+    private short defaultNodesIdx;
+    private short defaultLinesIdx;
 
     private final Map<String, String> preferenceCache = new HashMap<>();
@@ -112,5 +114,5 @@
      */
     public Pair<StyleElementList, Range> getStyleCacheWithRange(OsmPrimitive osm, double scale, NavigatableComponent nc) {
-        if (osm.mappaintStyle == null || osm.mappaintCacheIdx != cacheIdx || scale <= 0) {
+        if (osm.mappaintStyle == null || osm.getMappaintCacheIdx() != cacheIdx || scale <= 0) {
             osm.mappaintStyle = StyleCache.EMPTY_STYLECACHE;
         } else {
@@ -170,5 +172,5 @@
                     + ", scale: " + scale + ", new stylelist: " + p.a + ", new range: " + p.b + ')', e);
         }
-        osm.mappaintCacheIdx = cacheIdx;
+        osm.setMappaintCacheIdx(cacheIdx);
         return p;
     }
