Bug 559187 - Reduce memory consumption and improve performance

Switch column first with row first approach on rendering to gain
performance on accessing list items with Java 11

Change-Id: If593f8eb679fcf905a345993fa196c08315bd7a1
Signed-off-by: Dirk Fauth <dirk.fauth@googlemail.com>
diff --git a/org.eclipse.nebula.widgets.nattable.core/META-INF/MANIFEST.MF b/org.eclipse.nebula.widgets.nattable.core/META-INF/MANIFEST.MF
index bb3dff7..d8109be 100644
--- a/org.eclipse.nebula.widgets.nattable.core/META-INF/MANIFEST.MF
+++ b/org.eclipse.nebula.widgets.nattable.core/META-INF/MANIFEST.MF
@@ -193,6 +193,7 @@
  org.eclipse.collections.api.factory.list.primitive;version="10.1.0",
  org.eclipse.collections.api.factory.map;version="10.1.0",
  org.eclipse.collections.api.factory.map.primitive;version="10.1.0",
+ org.eclipse.collections.api.factory.set;version="10.4.0",
  org.eclipse.collections.api.factory.set.primitive;version="10.1.0",
  org.eclipse.collections.api.iterator;version="10.1.0",
  org.eclipse.collections.api.list;version="10.1.0",
diff --git a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/painter/layer/CellLayerPainter.java b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/painter/layer/CellLayerPainter.java
index 2c24fa8..1ea2a28 100644
--- a/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/painter/layer/CellLayerPainter.java
+++ b/org.eclipse.nebula.widgets.nattable.core/src/org/eclipse/nebula/widgets/nattable/painter/layer/CellLayerPainter.java
@@ -14,9 +14,9 @@
 
 import java.util.Collection;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Map;
 
+import org.eclipse.collections.api.factory.Sets;
 import org.eclipse.nebula.widgets.nattable.config.IConfigRegistry;
 import org.eclipse.nebula.widgets.nattable.layer.ILayer;
 import org.eclipse.nebula.widgets.nattable.layer.cell.ILayerCell;
@@ -71,12 +71,12 @@
 
         calculateDimensionInfo(positionRectangle);
 
-        Collection<ILayerCell> spannedCells = new HashSet<>();
+        Collection<ILayerCell> spannedCells = Sets.mutable.empty();
 
-        for (int columnPosition = positionRectangle.x; columnPosition < positionRectangle.x
-                + positionRectangle.width; columnPosition++) {
-            for (int rowPosition = positionRectangle.y; rowPosition < positionRectangle.y
-                    + positionRectangle.height; rowPosition++) {
+        for (int rowPosition = positionRectangle.y; rowPosition < positionRectangle.y
+                + positionRectangle.height; rowPosition++) {
+            for (int columnPosition = positionRectangle.x; columnPosition < positionRectangle.x
+                    + positionRectangle.width; columnPosition++) {
                 if (columnPosition == -1 || rowPosition == -1) {
                     continue;
                 }