Skip to content

Commit 3a50cbb

Browse files
committed
Reformatting the codebase with Palantir
1 parent feb31fa commit 3a50cbb

File tree

547 files changed

+12994
-19587
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

547 files changed

+12994
-19587
lines changed

geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCache.java

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
/**
2-
* This program is free software: you can redistribute it and/or modify it under the terms of the
3-
* GNU Lesser General Public License as published by the Free Software Foundation, either version 3
4-
* of the License, or (at your option) any later version.
2+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
3+
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
4+
* later version.
55
*
6-
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8-
* GNU General Public License for more details.
6+
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
7+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
98
*
10-
* <p>You should have received a copy of the GNU Lesser General Public License along with this
11-
* program. If not, see <http://www.gnu.org/licenses/>.
9+
* <p>You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
10+
* <http://www.gnu.org/licenses/>.
1211
*
1312
* <p>Copyright 2019
1413
*/
@@ -56,8 +55,8 @@ public abstract class ArcGISCompactCache {
5655
* @param zoom Zoom levl
5756
* @param row Row
5857
* @param col Column
59-
* @return String containing complete path without file extension in the form of
60-
* .../Lzz/RrrrrCcccc with the number of c and r at least 4.
58+
* @return String containing complete path without file extension in the form of .../Lzz/RrrrrCcccc with the number
59+
* of c and r at least 4.
6160
*/
6261
protected String buildBundleFilePath(int zoom, int row, int col) {
6362
StringBuilder bundlePath = new StringBuilder(pathToCacheRoot);
@@ -96,9 +95,8 @@ protected String buildBundleFilePath(int zoom, int row, int col) {
9695
* @param filePath Path to file
9796
* @param offset Read at offset
9897
* @param length Read length bytes
99-
* @return ByteBuffer that contains read bytes and has byte order set to little endian. The
100-
* length of the byte buffer is multiple of 4, so getInt() and getLong() can be used even
101-
* when fewer bytes are read.
98+
* @return ByteBuffer that contains read bytes and has byte order set to little endian. The length of the byte
99+
* buffer is multiple of 4, so getInt() and getLong() can be used even when fewer bytes are read.
102100
*/
103101
protected ByteBuffer readFromLittleEndianFile(String filePath, long offset, int length) {
104102
ByteBuffer result = null;

geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV1.java

Lines changed: 19 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
/**
2-
* This program is free software: you can redistribute it and/or modify it under the terms of the
3-
* GNU Lesser General Public License as published by the Free Software Foundation, either version 3
4-
* of the License, or (at your option) any later version.
2+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
3+
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
4+
* later version.
55
*
6-
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8-
* GNU General Public License for more details.
6+
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
7+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
98
*
10-
* <p>You should have received a copy of the GNU Lesser General Public License along with this
11-
* program. If not, see <http://www.gnu.org/licenses/>.
9+
* <p>You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
10+
* <http://www.gnu.org/licenses/>.
1211
*
1312
* <p>Copyright 2019
1413
*/
@@ -21,13 +20,12 @@
2120
/**
2221
* Implementation of ArcGIS compact caches for ArcGIS 10.0 - 10.2
2322
*
24-
* <p>The compact cache consists of bundle index files (*.bundlx) and bundle files (*.bundle), that
25-
* contain the actual image data. Every .bundlx file contains a 16 byte header and 16 byte footer.
26-
* Between header and footer is 128x128 matrix (16384 tiles) of 5 byte offsets. Every offset points
27-
* to a 4 byte word in the corresponding .bundle file which contains the size of the tile image
28-
* data. The actual image data starts at offset+4. If the size is zero there is no image data
29-
* available and the index entry is not used. If the map cache has more than 128 rows or columns it
30-
* is divided into several .bundlx and .bundle files.
23+
* <p>The compact cache consists of bundle index files (*.bundlx) and bundle files (*.bundle), that contain the actual
24+
* image data. Every .bundlx file contains a 16 byte header and 16 byte footer. Between header and footer is 128x128
25+
* matrix (16384 tiles) of 5 byte offsets. Every offset points to a 4 byte word in the corresponding .bundle file which
26+
* contains the size of the tile image data. The actual image data starts at offset+4. If the size is zero there is no
27+
* image data available and the index entry is not used. If the map cache has more than 128 rows or columns it is
28+
* divided into several .bundlx and .bundle files.
3129
*
3230
* @author Bjoern Saxe
3331
*/
@@ -39,12 +37,11 @@ public class ArcGISCompactCacheV1 extends ArcGISCompactCache {
3937
/**
4038
* Constructs new ArcGIS 10.0-10.2 compact cache.
4139
*
42-
* @param pathToCacheRoot Path to compact cache directory (usually ".../_alllayers/"). Path must
43-
* contain directories for zoom levels (named "Lxx").
40+
* @param pathToCacheRoot Path to compact cache directory (usually ".../_alllayers/"). Path must contain directories
41+
* for zoom levels (named "Lxx").
4442
*/
4543
public ArcGISCompactCacheV1(String pathToCacheRoot) {
46-
if (pathToCacheRoot.endsWith("" + File.separatorChar))
47-
this.pathToCacheRoot = pathToCacheRoot;
44+
if (pathToCacheRoot.endsWith("" + File.separatorChar)) this.pathToCacheRoot = pathToCacheRoot;
4845
else this.pathToCacheRoot = pathToCacheRoot + File.separatorChar;
4946

5047
indexCache = new BundlxCache(10000);
@@ -60,16 +57,14 @@ public Resource getBundleFileResource(int zoom, int row, int col) {
6057
Resource res = null;
6158

6259
if ((entry = indexCache.get(key)) != null) {
63-
if (entry.size > 0)
64-
res = new BundleFileResource(entry.pathToBundleFile, entry.offset, entry.size);
60+
if (entry.size > 0) res = new BundleFileResource(entry.pathToBundleFile, entry.offset, entry.size);
6561
} else {
6662

6763
String basePath = buildBundleFilePath(zoom, row, col);
6864
String pathToBundlxFile = basePath + BUNDLX_EXT;
6965
String pathToBundleFile = basePath + BUNDLE_EXT;
7066

71-
if (!(new File(pathToBundleFile)).exists() || !(new File(pathToBundlxFile)).exists())
72-
return null;
67+
if (!(new File(pathToBundleFile)).exists() || !(new File(pathToBundlxFile)).exists()) return null;
7368

7469
long tileOffset = readTileStartOffset(pathToBundlxFile, row, col);
7570
int tileSize = readTileSize(pathToBundleFile, tileOffset);
@@ -89,8 +84,7 @@ public Resource getBundleFileResource(int zoom, int row, int col) {
8984
private long readTileStartOffset(String bundlxFile, int row, int col) {
9085
int index = BUNDLX_MAXIDX * (col % BUNDLX_MAXIDX) + (row % BUNDLX_MAXIDX);
9186

92-
ByteBuffer idxBytes =
93-
readFromLittleEndianFile(bundlxFile, (index * 5) + COMPACT_CACHE_HEADER_LENGTH, 5);
87+
ByteBuffer idxBytes = readFromLittleEndianFile(bundlxFile, (index * 5) + COMPACT_CACHE_HEADER_LENGTH, 5);
9488

9589
return idxBytes.getLong();
9690
}

geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/ArcGISCompactCacheV2.java

Lines changed: 21 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
/**
2-
* This program is free software: you can redistribute it and/or modify it under the terms of the
3-
* GNU Lesser General Public License as published by the Free Software Foundation, either version 3
4-
* of the License, or (at your option) any later version.
2+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
3+
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
4+
* later version.
55
*
6-
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8-
* GNU General Public License for more details.
6+
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
7+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
98
*
10-
* <p>You should have received a copy of the GNU Lesser General Public License along with this
11-
* program. If not, see <http://www.gnu.org/licenses/>.
9+
* <p>You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
10+
* <http://www.gnu.org/licenses/>.
1211
*
1312
* <p>Copyright 2019
1413
*/
@@ -22,14 +21,12 @@
2221
/**
2322
* Implementation of ArcGIS compact caches for ArcGIS 10.3
2423
*
25-
* <p>The compact cache consists of bundle files (*.bundle), that contain an index and the actual
26-
* image data. Every .bundle file starts with a 64 byte header. After the header 128x128 matrix
27-
* (16384 tiles) of 8 byte words. The first 5 bytes of every word is the offset that points to the
28-
* tile image data inside the same .bundle file. The next 3 bytes is the size of the image data. The
29-
* size of the image data is repeated at offset-4 in 4 byte word. Unused index entries use
30-
* 04|00|00|00|00|00|00|00. If the size is zero than there is no image data available and the index
31-
* entry is. If the map cache has more than 128 rows or columns it is divided into several .bundle
32-
* files.
24+
* <p>The compact cache consists of bundle files (*.bundle), that contain an index and the actual image data. Every
25+
* .bundle file starts with a 64 byte header. After the header 128x128 matrix (16384 tiles) of 8 byte words. The first 5
26+
* bytes of every word is the offset that points to the tile image data inside the same .bundle file. The next 3 bytes
27+
* is the size of the image data. The size of the image data is repeated at offset-4 in 4 byte word. Unused index
28+
* entries use 04|00|00|00|00|00|00|00. If the size is zero than there is no image data available and the index entry
29+
* is. If the map cache has more than 128 rows or columns it is divided into several .bundle files.
3330
*
3431
* @author Bjoern Saxe
3532
*/
@@ -41,12 +38,11 @@ public class ArcGISCompactCacheV2 extends ArcGISCompactCache {
4138
/**
4239
* Constructs new ArcGIS 10.3 compact cache.
4340
*
44-
* @param pathToCacheRoot Path to compact cache directory (usually ".../_alllayers/"). Path must
45-
* contain directories for zoom levels (named "Lxx").
41+
* @param pathToCacheRoot Path to compact cache directory (usually ".../_alllayers/"). Path must contain directories
42+
* for zoom levels (named "Lxx").
4643
*/
4744
public ArcGISCompactCacheV2(String pathToCacheRoot) {
48-
if (pathToCacheRoot.endsWith("" + File.separatorChar))
49-
this.pathToCacheRoot = pathToCacheRoot;
45+
if (pathToCacheRoot.endsWith("" + File.separatorChar)) this.pathToCacheRoot = pathToCacheRoot;
5046
else this.pathToCacheRoot = pathToCacheRoot + File.separatorChar;
5147

5248
indexCache = new BundlxCache(10000);
@@ -62,8 +58,7 @@ public Resource getBundleFileResource(int zoom, int row, int col) {
6258
Resource res = null;
6359

6460
if ((entry = indexCache.get(key)) != null) {
65-
if (entry.size > 0)
66-
res = new BundleFileResource(entry.pathToBundleFile, entry.offset, entry.size);
61+
if (entry.size > 0) res = new BundleFileResource(entry.pathToBundleFile, entry.offset, entry.size);
6762
} else {
6863

6964
String basePath = buildBundleFilePath(zoom, row, col);
@@ -73,8 +68,7 @@ public Resource getBundleFileResource(int zoom, int row, int col) {
7368

7469
entry = createCacheEntry(pathToBundleFile, row, col);
7570

76-
if (entry.size > 0)
77-
res = new BundleFileResource(pathToBundleFile, entry.offset, entry.size);
71+
if (entry.size > 0) res = new BundleFileResource(pathToBundleFile, entry.offset, entry.size);
7872

7973
indexCache.put(key, entry);
8074
}
@@ -87,16 +81,16 @@ private BundlxCache.CacheEntry createCacheEntry(String bundleFile, int row, int
8781
int index = BUNDLX_MAXIDX * (row % BUNDLX_MAXIDX) + (col % BUNDLX_MAXIDX);
8882

8983
// to save one addtional read, we read all 8 bytes in one read
90-
ByteBuffer offsetAndSize =
91-
readFromLittleEndianFile(bundleFile, (index * 8) + COMPACT_CACHE_HEADER_LENGTH, 8);
84+
ByteBuffer offsetAndSize = readFromLittleEndianFile(bundleFile, (index * 8) + COMPACT_CACHE_HEADER_LENGTH, 8);
9285

9386
byte[] offsetBytes = new byte[8];
9487
byte[] sizeBytes = new byte[4];
9588

9689
offsetAndSize.get(offsetBytes, 0, 5);
9790
offsetAndSize.get(sizeBytes, 0, 3);
9891

99-
long tileOffset = ByteBuffer.wrap(offsetBytes).order(ByteOrder.LITTLE_ENDIAN).getLong();
92+
long tileOffset =
93+
ByteBuffer.wrap(offsetBytes).order(ByteOrder.LITTLE_ENDIAN).getLong();
10094
int tileSize = ByteBuffer.wrap(sizeBytes).order(ByteOrder.LITTLE_ENDIAN).getInt();
10195

10296
return new BundlxCache.CacheEntry(bundleFile, tileOffset, tileSize);

geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundleFileResource.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
/**
2-
* This program is free software: you can redistribute it and/or modify it under the terms of the
3-
* GNU Lesser General Public License as published by the Free Software Foundation, either version 3
4-
* of the License, or (at your option) any later version.
2+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
3+
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
4+
* later version.
55
*
6-
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8-
* GNU General Public License for more details.
6+
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
7+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
98
*
10-
* <p>You should have received a copy of the GNU Lesser General Public License along with this
11-
* program. If not, see <http://www.gnu.org/licenses/>.
9+
* <p>You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
10+
* <http://www.gnu.org/licenses/>.
1211
*
1312
* <p>Copyright 2019
1413
*/
@@ -57,7 +56,8 @@ public long transferTo(WritableByteChannel target) throws IOException {
5756
FileChannel in = fin.getChannel()) {
5857
final long size = tileSize;
5958
long written = 0;
60-
while ((written += in.transferTo(tileOffset + written, size, target)) < size) ;
59+
while ((written += in.transferTo(tileOffset + written, size, target)) < size)
60+
;
6161
return size;
6262
}
6363
}

geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/compact/BundlxCache.java

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
/**
2-
* This program is free software: you can redistribute it and/or modify it under the terms of the
3-
* GNU Lesser General Public License as published by the Free Software Foundation, either version 3
4-
* of the License, or (at your option) any later version.
2+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
3+
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
4+
* later version.
55
*
6-
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8-
* GNU General Public License for more details.
6+
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
7+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
98
*
10-
* <p>You should have received a copy of the GNU Lesser General Public License along with this
11-
* program. If not, see <http://www.gnu.org/licenses/>.
9+
* <p>You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
10+
* <http://www.gnu.org/licenses/>.
1211
*
1312
* <p>Copyright 2019
1413
*/
@@ -20,8 +19,8 @@
2019
/**
2120
* Cache that stores data from .bundlx files.
2221
*
23-
* <p>Zoom, row, and column of the tile are used as key. Entries contain the path to the .bundle
24-
* file, the size of the tile and the offset of the image data inside the .bundle file.
22+
* <p>Zoom, row, and column of the tile are used as key. Entries contain the path to the .bundle file, the size of the
23+
* tile and the offset of the image data inside the .bundle file.
2524
*
2625
* @author Bjoern Saxe
2726
*/
@@ -79,8 +78,8 @@ public CacheEntry(String pathToBundleFile, long offset, int size) {
7978
/**
8079
* Cache that stores the path ot the .
8180
*
82-
* @param maxSize Maximum size of cache. If the size of the cache equals maxSize, adding a new
83-
* entry will remove the least recently used entry from the cache.
81+
* @param maxSize Maximum size of cache. If the size of the cache equals maxSize, adding a new entry will remove the
82+
* least recently used entry from the cache.
8483
*/
8584
public BundlxCache(int maxSize) {
8685
indexCache = CacheBuilder.newBuilder().maximumSize(maxSize).build();
@@ -90,8 +89,7 @@ public BundlxCache(int maxSize) {
9089
* Get the entry for a key from the cache.
9190
*
9291
* @param key Key.
93-
* @return Returns the entry. Returns null if the key has a null value or if the key has no
94-
* entry.
92+
* @return Returns the entry. Returns null if the key has a null value or if the key has no entry.
9593
*/
9694
public synchronized CacheEntry get(CacheKey key) {
9795
return indexCache.getIfPresent(key);

geowebcache/arcgiscache/src/main/java/org/geowebcache/arcgis/config/CacheInfo.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
/**
2-
* This program is free software: you can redistribute it and/or modify it under the terms of the
3-
* GNU Lesser General Public License as published by the Free Software Foundation, either version 3
4-
* of the License, or (at your option) any later version.
2+
* This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General
3+
* Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any
4+
* later version.
55
*
6-
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
7-
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
8-
* GNU General Public License for more details.
6+
* <p>This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
7+
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
98
*
10-
* <p>You should have received a copy of the GNU Lesser General Public License along with this
11-
* program. If not, see <http://www.gnu.org/licenses/>.
9+
* <p>You should have received a copy of the GNU Lesser General Public License along with this program. If not, see
10+
* <http://www.gnu.org/licenses/>.
1211
*
1312
* <p>Copyright 2019
1413
*/

0 commit comments

Comments
 (0)