@Override protected synchronized void initDo() { if (!this.closed) { synchronized (this.recordStore.getApiSync()) { if (this.boundingBox == null) { if (this.sql.startsWith("SELECT")) { this.rows = this.recordStore.query(this.sql, true); } else { this.rows = this.recordStore.search(this.catalogPath, this.table, this.fields, this.sql, true); } } else { BoundingBox boundingBox = this.boundingBox; if (boundingBox.getWidth() == 0) { boundingBox = boundingBox.expand(1, 0); } if (boundingBox.getHeight() == 0) { boundingBox = boundingBox.expand(0, 1); } final com.revolsys.gis.esri.gdb.file.capi.swig.Envelope envelope = GeometryConverter.toEsri(boundingBox); String sql = this.sql; if ("1 = 1".equals(sql)) { sql = ""; } this.rows = this.recordStore.search( this.catalogPath, this.table, this.fields, sql, envelope, true); } if (this.rows == null) { close(); } } } }