Skip to content

Commit b90e4cd

Browse files
authored
Merge pull request #141 from dfa1/master
Minor javadoc fixes
2 parents e5e449e + 01b5102 commit b90e4cd

32 files changed

+85
-90
lines changed

src/main/java/org/dataloader/BatchLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
* The back-end service returned results in a different order than we requested, likely because it was more efficient for it to
5555
* do so. Also, it omitted a result for key 6, which we may interpret as no value existing for that key.
5656
* <p>
57-
* To uphold the constraints of the batch function, it must return an List of values the same length as
57+
* To uphold the constraints of the batch function, it must return a List of values the same length as
5858
* the List of keys, and re-order them to ensure each index aligns with the original keys [ 2, 9, 6, 1 ]:
5959
*
6060
* <pre>

src/main/java/org/dataloader/BatchLoaderEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public Map<Object, Object> getKeyContexts() {
5454
* {@link org.dataloader.DataLoader#loadMany(java.util.List, java.util.List)} can be given
5555
* a context object when it is invoked. A list of them is present by this method.
5656
*
57-
* @return a list of key context objects in the order they where encountered
57+
* @return a list of key context objects in the order they were encountered
5858
*/
5959
public List<Object> getKeyContextsList() {
6060
return keyContextsList;

src/main/java/org/dataloader/CacheMap.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static <K, V> CacheMap<K, V> simpleMap() {
6565
/**
6666
* Gets the specified key from the cache map.
6767
* <p>
68-
* May throw an exception if the key does not exists, depending on the cache map implementation that is used,
68+
* May throw an exception if the key does not exist, depending on the cache map implementation that is used,
6969
* so be sure to check {@link CacheMap#containsKey(Object)} first.
7070
*
7171
* @param key the key to retrieve

src/main/java/org/dataloader/DataLoader.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadF
108108
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
109109
* {@link org.dataloader.Try} objects.
110110
* <p>
111-
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
111+
* If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then
112112
* you can use this form to create the data loader.
113113
* <p>
114114
* Using Try objects allows you to capture a value returned or an exception that might
@@ -186,7 +186,7 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoaderWithContext<K, V>
186186
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
187187
* {@link org.dataloader.Try} objects.
188188
* <p>
189-
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
189+
* If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then
190190
* you can use this form to create the data loader.
191191
* <p>
192192
* Using Try objects allows you to capture a value returned or an exception that might
@@ -264,7 +264,7 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoader<K, V
264264
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
265265
* {@link org.dataloader.Try} objects.
266266
* <p>
267-
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
267+
* If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then
268268
* you can use this form to create the data loader.
269269
* <p>
270270
* Using Try objects allows you to capture a value returned or an exception that might
@@ -343,7 +343,7 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoaderWithC
343343
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
344344
* {@link org.dataloader.Try} objects.
345345
* <p>
346-
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
346+
* If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then
347347
* you can use this form to create the data loader.
348348
* <p>
349349
* Using Try objects allows you to capture a value returned or an exception that might
@@ -471,11 +471,11 @@ public CompletableFuture<V> load(K key) {
471471
* This will return an optional promise to a value previously loaded via a {@link #load(Object)} call or empty if not call has been made for that key.
472472
* <p>
473473
* If you do get a present CompletableFuture it does not mean it has been dispatched and completed yet. It just means
474-
* its at least pending and in cache.
474+
* it's at least pending and in cache.
475475
* <p>
476476
* If caching is disabled there will never be a present Optional returned.
477477
* <p>
478-
* NOTE : This will NOT cause a data load to happen. You must called {@link #load(Object)} for that to happen.
478+
* NOTE : This will NOT cause a data load to happen. You must call {@link #load(Object)} for that to happen.
479479
*
480480
* @param key the key to check
481481
*
@@ -494,7 +494,7 @@ public Optional<CompletableFuture<V>> getIfPresent(K key) {
494494
* <p>
495495
* If caching is disabled there will never be a present Optional returned.
496496
* <p>
497-
* NOTE : This will NOT cause a data load to happen. You must called {@link #load(Object)} for that to happen.
497+
* NOTE : This will NOT cause a data load to happen. You must call {@link #load(Object)} for that to happen.
498498
*
499499
* @param key the key to check
500500
*

src/main/java/org/dataloader/DataLoaderFactory.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoader<K, V> batchLoadF
4242
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
4343
* {@link org.dataloader.Try} objects.
4444
* <p>
45-
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
45+
* If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then
4646
* you can use this form to create the data loader.
4747
* <p>
4848
* Using Try objects allows you to capture a value returned or an exception that might
@@ -109,7 +109,7 @@ public static <K, V> DataLoader<K, V> newDataLoader(BatchLoaderWithContext<K, V>
109109
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
110110
* {@link org.dataloader.Try} objects.
111111
* <p>
112-
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
112+
* If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then
113113
* you can use this form to create the data loader.
114114
* <p>
115115
* Using Try objects allows you to capture a value returned or an exception that might
@@ -176,7 +176,7 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoader<K, V
176176
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
177177
* {@link org.dataloader.Try} objects.
178178
* <p>
179-
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
179+
* If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then
180180
* you can use this form to create the data loader.
181181
* <p>
182182
* Using Try objects allows you to capture a value returned or an exception that might
@@ -244,7 +244,7 @@ public static <K, V> DataLoader<K, V> newMappedDataLoader(MappedBatchLoaderWithC
244244
* (batching, caching and unlimited batch size) where the batch loader function returns a list of
245245
* {@link org.dataloader.Try} objects.
246246
* <p>
247-
* If its important you to know the exact status of each item in a batch call and whether it threw exceptions then
247+
* If it's important you to know the exact status of each item in a batch call and whether it threw exceptions then
248248
* you can use this form to create the data loader.
249249
* <p>
250250
* Using Try objects allows you to capture a value returned or an exception that might

src/main/java/org/dataloader/DataLoaderHelper.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@
3434
import static org.dataloader.impl.Assertions.nonNull;
3535

3636
/**
37-
* This helps break up the large DataLoader class functionality and it contains the logic to dispatch the
38-
* promises on behalf of its peer dataloader
37+
* This helps break up the large DataLoader class functionality, and it contains the logic to dispatch the
38+
* promises on behalf of its peer dataloader.
3939
*
4040
* @param <K> the type of keys
4141
* @param <V> the type of values
@@ -148,13 +148,11 @@ CompletableFuture<V> load(K key, Object loadContext) {
148148
}
149149
}
150150

151-
@SuppressWarnings("unchecked")
152151
Object getCacheKey(K key) {
153152
return loaderOptions.cacheKeyFunction().isPresent() ?
154153
loaderOptions.cacheKeyFunction().get().getKey(key) : key;
155154
}
156155

157-
@SuppressWarnings("unchecked")
158156
Object getCacheKeyWithContext(K key, Object context) {
159157
return loaderOptions.cacheKeyFunction().isPresent() ?
160158
loaderOptions.cacheKeyFunction().get().getKeyWithContext(key, context) : key;
@@ -296,9 +294,9 @@ private void possiblyClearCacheEntriesOnExceptions(List<K> keys) {
296294
if (keys.isEmpty()) {
297295
return;
298296
}
299-
// by default we don't clear the cached view of this entry to avoid
300-
// frequently loading the same error. This works for short lived request caches
301-
// but might work against long lived caches. Hence we have an option that allows
297+
// by default, we don't clear the cached view of this entry to avoid
298+
// frequently loading the same error. This works for short-lived request caches
299+
// but might work against long-lived caches. Hence, we have an option that allows
302300
// it to be cleared
303301
if (!loaderOptions.cachingExceptionsEnabled()) {
304302
keys.forEach(dataLoader::clear);
@@ -384,7 +382,7 @@ CompletableFuture<List<V>> invokeLoader(List<K> keys, List<Object> keyContexts,
384382
return completedFuture(assembledValues);
385383
} else {
386384
//
387-
// we missed some of the keys from cache, so send them to the batch loader
385+
// we missed some keys from cache, so send them to the batch loader
388386
// and then fill in their values
389387
//
390388
CompletableFuture<List<V>> batchLoad = invokeLoader(missedKeys, missedKeyContexts);

src/main/java/org/dataloader/DataLoaderOptions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ public DataLoaderOptions setCachingEnabled(boolean cachingEnabled) {
135135
/**
136136
* Option that determines whether to cache exceptional values (the default), or not.
137137
*
138-
* For short lived caches (that is request caches) it makes sense to cache exceptions since
139-
* its likely the key is still poisoned. However if you have long lived caches, then it may make
138+
* For short-lived caches (that is request caches) it makes sense to cache exceptions since
139+
* it's likely the key is still poisoned. However, if you have long-lived caches, then it may make
140140
* sense to set this to false since the downstream system may have recovered from its failure
141141
* mode.
142142
*
@@ -147,7 +147,7 @@ public boolean cachingExceptionsEnabled() {
147147
}
148148

149149
/**
150-
* Sets the option that determines whether exceptional values are cachedis enabled.
150+
* Sets the option that determines whether exceptional values are cache enabled.
151151
*
152152
* @param cachingExceptionsEnabled {@code true} to enable caching exceptional values, {@code false} otherwise
153153
*
@@ -236,7 +236,7 @@ public StatisticsCollector getStatisticsCollector() {
236236

237237
/**
238238
* Sets the statistics collector supplier that will be used with these data loader options. Since it uses
239-
* the supplier pattern, you can create a new statistics collector on each call or you can reuse
239+
* the supplier pattern, you can create a new statistics collector on each call, or you can reuse
240240
* a common value
241241
*
242242
* @param statisticsCollector the statistics collector to use

src/main/java/org/dataloader/DataLoaderRegistry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ public Set<String> getKeys() {
127127
}
128128

129129
/**
130-
* This will called {@link org.dataloader.DataLoader#dispatch()} on each of the registered
130+
* This will be called {@link org.dataloader.DataLoader#dispatch()} on each of the registered
131131
* {@link org.dataloader.DataLoader}s
132132
*/
133133
public void dispatchAll() {
@@ -197,7 +197,7 @@ public Builder register(String key, DataLoader<?, ?> dataLoader) {
197197
}
198198

199199
/**
200-
* This will combine together the data loaders in this builder with the ones
200+
* This will combine the data loaders in this builder with the ones
201201
* from a previous {@link DataLoaderRegistry}
202202
*
203203
* @param otherRegistry the previous {@link DataLoaderRegistry}

src/main/java/org/dataloader/MappedBatchLoader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616

1717
package org.dataloader;
1818

19-
import java.util.List;
2019
import java.util.Map;
2120
import java.util.Set;
2221
import java.util.concurrent.CompletionStage;
2322

2423
/**
25-
* A function that is invoked for batch loading a map of of data values indicated by the provided set of keys. The
24+
* A function that is invoked for batch loading a map of data values indicated by the provided set of keys. The
2625
* function returns a promise of a map of results of individual load requests.
2726
* <p>
2827
* There are a few constraints that must be upheld:

src/main/java/org/dataloader/MappedBatchLoaderWithContext.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
package org.dataloader;
1818

19-
import java.util.List;
2019
import java.util.Map;
2120
import java.util.Set;
2221
import java.util.concurrent.CompletionStage;

0 commit comments

Comments
 (0)