id stringlengths 23 26 | content stringlengths 182 2.49k |
|---|---|
codereview_java_data_4836 | this.recordCount = 0;
PageWriteStore pageStore = pageStoreCtorParquet.newInstance(
- compressor, parquetSchema, props.getAllocator(), Integer.MAX_VALUE);
this.flushPageStoreToWriter = flushToWriter.bind(pageStore);
this.writeStore = props.newColumnWriteStore(parquetSchema, pageStore);
This will fail in case of `1.10` as it does not expect the last `int`, isn't it? Also, why not pass `ParquetProperties.DEFAULT_COLUMN_INDEX_TRUNCATE_LENGTH` instead of `Integer.MAX_VALUE`? It looks like `Integer.MAX_VALUE` is used in test cases only (for this particular value).
this.recordCount = 0;
PageWriteStore pageStore = pageStoreCtorParquet.newInstance(
+ compressor, parquetSchema, props.getAllocator(), this.columnIndexTruncateLength);
this.flushPageStoreToWriter = flushToWriter.bind(pageStore);
this.writeStore = props.newColumnWriteStore(parquetSchema, pageStore); |
codereview_java_data_4837 | * values of all remaining fields
*/
public Interval(IntervalQualifier qualifier, boolean negative, long leading, long remaining) {
- if (qualifier == null) {
- throw new NullPointerException();
- }
- if (leading == 0L && remaining == 0L) {
- negative = false;
- } else if (leading < 0L || remaining < 0L) {
- throw new RuntimeException();
- }
this.qualifier = qualifier;
- this.negative = negative;
this.leading = leading;
this.remaining = remaining;
}
what design drove the splitting of the negative flag separate from just letting leading be negative? Are we following some other model here?
* values of all remaining fields
*/
public Interval(IntervalQualifier qualifier, boolean negative, long leading, long remaining) {
this.qualifier = qualifier;
+ this.negative = DateTimeUtils.validateInterval(qualifier, negative, leading, remaining);
this.leading = leading;
this.remaining = remaining;
} |
codereview_java_data_4838 | }
private static void stopServer(final ClientContext context, final boolean tabletServersToo) throws AccumuloException, AccumuloSecurityException {
- MasterClient.executeVoidWithConnRetry(context,
client -> client.shutdown(Tracer.traceInfo(), context.rpcCreds(), tabletServersToo));
}
Is this the only place in the code that is timing out now? I am wondering this method should have a different name, like `executeVoidWithTimeout()`. If I am looking at this code, its not clear that this call will timeout.
}
private static void stopServer(final ClientContext context, final boolean tabletServersToo) throws AccumuloException, AccumuloSecurityException {
+ MasterClient.executeVoidAdmin(context,
client -> client.shutdown(Tracer.traceInfo(), context.rpcCreds(), tabletServersToo));
} |
codereview_java_data_4842 | for (Entry<Class<? extends RelNode>, Collection<RelNode>> e : result.asMap().entrySet()) {
resultCount.put(e.getKey(), e.getValue().size());
}
- assertEquals(expected, resultCount);
}
@Test public void testNodeTypeCountSample() {
We may suggest to use `assertThat` instead of `assertEquals`, which is more clear for parameters.
for (Entry<Class<? extends RelNode>, Collection<RelNode>> e : result.asMap().entrySet()) {
resultCount.put(e.getKey(), e.getValue().size());
}
+ assertThat(expected, equalTo(resultCount));
}
@Test public void testNodeTypeCountSample() { |
codereview_java_data_4863 | final Condition atLeastLighterForkBlockNumber = blockchain.blockNumberMustBeLatest(minerNode);
- cluster.close();
// Create the heavy fork
final PantheonNode minerNodeTwo = pantheon.createMinerNode("miner-node2");
Why `close` instead of `stop` here? I'd have expected `close` to only be called as part of tear down.
final Condition atLeastLighterForkBlockNumber = blockchain.blockNumberMustBeLatest(minerNode);
+ cluster.stop();
// Create the heavy fork
final PantheonNode minerNodeTwo = pantheon.createMinerNode("miner-node2"); |
codereview_java_data_4865 | checkBox.setOnCheckedChangeListener(null);
checkBox.setChecked(field.isSelected());
checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> field.setSelected(isChecked));
- parent.setOnClickListener(new android.view.View.OnClickListener() {
- @Override public void onClick(android.view.View v) {
- checkBox.toggle();
- }
- });
} else {
checkBox.setVisibility(View.GONE);
checkBox.setOnCheckedChangeListener(null);
You can use lambda syntax here instead of creating an anonymous object.
checkBox.setOnCheckedChangeListener(null);
checkBox.setChecked(field.isSelected());
checkBox.setOnCheckedChangeListener((buttonView, isChecked) -> field.setSelected(isChecked));
+ super.itemView.setOnClickListener(v -> checkBox.toggle());
} else {
checkBox.setVisibility(View.GONE);
checkBox.setOnCheckedChangeListener(null); |
codereview_java_data_4869 | import kotlin.Unit;
-public class SubsSection extends HomeSection<NavDrawerData.DrawerItem> {
public static final String TAG = "SubsSection";
Please don't use abbreviations in names. The few extra bytes don't hurt ;) ```suggestion public class SubscriptionsSection extends HomeSection<NavDrawerData.DrawerItem> { ```
import kotlin.Unit;
+public class SubscriptionsSection extends HomeSection<NavDrawerData.DrawerItem> {
public static final String TAG = "SubsSection"; |
codereview_java_data_4873 | */
public final class Compression {
- private static final Logger LOG = LoggerFactory.getLogger(Compression.class);
/**
* Prevent the instantiation of this class.
Keeping `log` as lower case would be consistent with other Accumulo code.
*/
public final class Compression {
+ private static final Logger log = LoggerFactory.getLogger(Compression.class);
/**
* Prevent the instantiation of this class. |
codereview_java_data_4881 | for (int i = splitOffset; i < splitCount + splitOffset; i++) {
byte[] splitBytes = ByteBufferUtil.toBytes(arguments.get(i));
String encodedSplit = Base64.getEncoder().encodeToString(splitBytes);
- stream.writeBytes(encodedSplit + '\n');
}
} catch (IOException e) {
log.error("Error in FateServiceHandler while writing splits to {}: {}", splitsPath,
Any idea why this temp file was created? Sounds like it was created to help with failover somewhere.
for (int i = splitOffset; i < splitCount + splitOffset; i++) {
byte[] splitBytes = ByteBufferUtil.toBytes(arguments.get(i));
String encodedSplit = Base64.getEncoder().encodeToString(splitBytes);
+ stream.write((encodedSplit + '\n').getBytes(UTF_8));
}
} catch (IOException e) {
log.error("Error in FateServiceHandler while writing splits to {}: {}", splitsPath, |
codereview_java_data_4884 | @Override
public void onFailure(Throwable t) {
- // downgrade to system.peers if we get an invalid query or server error as this
- // indicates the peers_v2 table does not exist.
- if (t instanceof InvalidQueryException || t instanceof ServerError) {
isPeersV2 = false;
MoreFutures.propagateFuture(peersFuture, selectPeersFuture(connection));
} else {
Didn't we decide to also match the error message in the case of `ServerError`?
@Override
public void onFailure(Throwable t) {
+ // downgrade to system.peers if we get an invalid query or server error with specific
+ // message as this indicates the peers_v2 table does not exist.
+ if (t instanceof InvalidQueryException
+ || (t instanceof ServerError
+ && t.getMessage().contains("Unknown keyspace/cf pair (system.peers_v2)"))) {
isPeersV2 = false;
MoreFutures.propagateFuture(peersFuture, selectPeersFuture(connection));
} else { |
codereview_java_data_4896 | R.string.remove_all_new_flags_confirmation_msg,
() -> DBWriter.removeFeedNewFlag(feed.getId()));
return true;
- } else if (itemId == R.id.mark_all_read_item) {
- displayConfirmationDialog(
R.string.mark_all_read_label,
R.string.mark_all_read_confirmation_msg,
() -> DBWriter.markFeedRead(feed.getId()));
Something went wrong while merging/rebasing here
R.string.remove_all_new_flags_confirmation_msg,
() -> DBWriter.removeFeedNewFlag(feed.getId()));
return true;
+ } else if (itemId == R.id.add_to_folder) {
+ TagSettingsDialog.newInstance(feed.getPreferences()).show(getChildFragmentManager(), TagSettingsDialog.TAG);
+ } else if (itemId == R.id.mark_all_read_item) { displayConfirmationDialog(
R.string.mark_all_read_label,
R.string.mark_all_read_confirmation_msg,
() -> DBWriter.markFeedRead(feed.getId())); |
codereview_java_data_4918 | if (messageExt.getMaxReConsumerTimes() >= 0) {
return messageExt.getMaxReConsumerTimes();
}
- if (this.defaultMQPushConsumer.getMaxReconsumeTimes() == -1) {
- return MixAll.DEFAULT_MAX_RECONSUME_TIMES;
- } else {
- return this.defaultMQPushConsumer.getMaxReconsumeTimes();
- }
}
private boolean checkReconsumeTimes(List<MessageExt> msgs) {
I think `private maxReconsumeTimes = -1` in DefaultMQPushConsumer is kind of unnecessary. Make it 16 just like DefaultMQPullConsumer would be simpler. So the const MixAll.DEFAULT_MAX_RECONSUME_TIMES is also unnecessary.
if (messageExt.getMaxReConsumerTimes() >= 0) {
return messageExt.getMaxReConsumerTimes();
}
+ return this.defaultMQPushConsumer.getMaxReconsumeTimes();
}
private boolean checkReconsumeTimes(List<MessageExt> msgs) { |
codereview_java_data_4919 | */
package tech.pegasys.pantheon.metrics;
-@FunctionalInterface
public interface Counter {
void inc();
}
Do we also want an inc(int) and maybe inc(long) options? If we gauge stuff like cumulative gas calcualated by the EVM or other such non-singleton measures a loop of inc will get tedious..
*/
package tech.pegasys.pantheon.metrics;
public interface Counter {
void inc();
} |
codereview_java_data_4922 | return this.jdbcTemplate.queryForList(sqlBuilder.toString(), Long.class,
new Object[] { officeId});
} catch (final EmptyResultDataAccessException e) {
- return null;
}
}
}
\ No newline at end of file
This strikes me as curious - is this done like this elsewhere in existing code?
return this.jdbcTemplate.queryForList(sqlBuilder.toString(), Long.class,
new Object[] { officeId});
} catch (final EmptyResultDataAccessException e) {
+ throw new OfficeNotFoundException(officeId);
}
}
}
\ No newline at end of file |
codereview_java_data_4927 | * @param <T> value type
* @return A new Stream
*/
- static <T> Stream<T> gen(T seed, Function1<T, T> supplier) {
Objects.requireNonNull(supplier, "supplier is null");
return new Stream.Cons<>(seed, () -> gen(supplier.apply(seed), supplier));
}
We should use `java.util.function.Function` instead of `javaslang.Function1` here. `Function1` is a `Function`, so we widen the type and increase the interoperability with Java a little bit.
* @param <T> value type
* @return A new Stream
*/
+ static <T> Stream<T> gen(T seed, Function<T, T> supplier) {
Objects.requireNonNull(supplier, "supplier is null");
return new Stream.Cons<>(seed, () -> gen(supplier.apply(seed), supplier));
} |
codereview_java_data_4928 | AvroFileAppender(Schema schema, OutputFile file,
Function<Schema, DatumWriter<?>> createWriterFunc,
- CodecFactory codec, Map<String, String> metadata) throws IOException {
- this.stream = file.createOrOverwrite();
this.writer = newAvroWriter(schema, stream, createWriterFunc, codec, metadata);
}
This will affect writes for all data and metadata files. Is it safe to do this everywhere?
AvroFileAppender(Schema schema, OutputFile file,
Function<Schema, DatumWriter<?>> createWriterFunc,
+ CodecFactory codec, Map<String, String> metadata,
+ boolean overwrite) throws IOException {
+ this.stream = overwrite ? file.createOrOverwrite() : file.create();
this.writer = newAvroWriter(schema, stream, createWriterFunc, codec, metadata);
} |
codereview_java_data_4930 | final int txWorkerCount,
final int computationWorkerCount,
final MetricsSystem metricsSystem) {
- this(
- syncWorkerCount,
- txWorkerCount,
- BoundedTimedQueue.Default.CAPACITY,
- computationWorkerCount,
- metricsSystem);
}
public EthScheduler(
I'd make the capacity explicitly transaction specific - we should be selecting a custom queue size that suits the use case every time we create a bounded queue, not just using a general default.
final int txWorkerCount,
final int computationWorkerCount,
final MetricsSystem metricsSystem) {
+ this(syncWorkerCount, txWorkerCount, txWorkerCapacity, computationWorkerCount, metricsSystem);
}
public EthScheduler( |
codereview_java_data_4934 | return firstEntry;
}
- String auditLogBooleanDefault(Boolean value, Boolean defaultValue) {
- if (defaultValue == Boolean.TRUE) {
return value == Boolean.TRUE ? "true" : "false";
} else {
return value == Boolean.FALSE ? "false" : "true";
I might be missing something but shouldn't this be reversed? if (defaultValue == Boolean.TRUE) { return value == Boolean.FALSE ? "false" : "true"; // in any other case that isn't false (null or true) - set to true } else { return value == Boolean.TRUE ? "true" : "false"; // in any other case that isn't true - set to false } In any case, it's best to a unit-test just to confirm it works properly
return firstEntry;
}
+ String auditLogBooleanDefault(Boolean value, Boolean checkValue) {
+ if (checkValue == Boolean.TRUE) {
return value == Boolean.TRUE ? "true" : "false";
} else {
return value == Boolean.FALSE ? "false" : "true"; |
codereview_java_data_4936 | setListShown(true);
String query = getArguments().getString(ARG_QUERY);
- setEmptyText(getString(R.string.no_results_for_query) + " \"" + query + "\"");
}
private final SearchlistAdapter.ItemAccess itemAccess = new SearchlistAdapter.ItemAccess() {
You need to keep in mind that the sentence construction in other languages could be different, so the query string doesn't always show at the end. You should use %1$s in your string on values/strings.xml and pass the query term as an extra argument to getString()
setListShown(true);
String query = getArguments().getString(ARG_QUERY);
+ setEmptyText(getString(R.string.no_results_for_query, query));
}
private final SearchlistAdapter.ItemAccess itemAccess = new SearchlistAdapter.ItemAccess() { |
codereview_java_data_4940 | vpUpload.setCurrentItem(index + 1, false);
fragments.get(index + 1).onBecameVisible();
} else {
- if(defaultKvStore.getInt(COUNTER_OF_NO_LOCATION, 0) == 10){
DialogUtil.showAlertDialog(this,
getString(R.string.turn_on_camera_location_title),
getString(R.string.turn_on_camera_location_message),
Would you mind changing `==10` to `>= 10`? It is a usual pattern, for safety.
vpUpload.setCurrentItem(index + 1, false);
fragments.get(index + 1).onBecameVisible();
} else {
+ if(defaultKvStore.getInt(COUNTER_OF_NO_LOCATION, 0) >= 10){
DialogUtil.showAlertDialog(this,
getString(R.string.turn_on_camera_location_title),
getString(R.string.turn_on_camera_location_message), |
codereview_java_data_4948 | return JSON_JR.beanFrom(type, jsonString);
}
- /**
- * Converts the contents of the specified {@code reader} to a object of
- * given type.
- */
- @Nonnull
- public static <T> T parse(@Nonnull Class<T> type, @Nonnull Reader reader) throws IOException {
- return JSON_JR.beanFrom(type, reader);
- }
-
/**
* Converts a JSON string to a {@link Map}.
*/
I'm not sure if we need to support `Reader` anymore, is it used anywhere?
return JSON_JR.beanFrom(type, jsonString);
}
/**
* Converts a JSON string to a {@link Map}.
*/ |
codereview_java_data_4952 | return new CachedBlockRead(_currBlock);
}
public synchronized void close() throws IOException {
if (closed)
return;
Again, class should be `Closeable` and `@Override` here.
return new CachedBlockRead(_currBlock);
}
+ @Override
public synchronized void close() throws IOException {
if (closed)
return; |
codereview_java_data_4957 | }
public void copy_to_ClipBoard(Context context,String address){
- com.fsck.k9.helper.ClipboardManager clipboardManager = com.fsck.k9.helper.ClipboardManager.getInstance(context);
clipboardManager.setText(address,address);
}
Import the class rather than fully-qualifying.
}
public void copy_to_ClipBoard(Context context,String address){
+ ClipboardManager clipboardManager = ClipboardManager.getInstance(context);
clipboardManager.setText(address,address);
} |
codereview_java_data_4961 | * The base package for all Minecraft classes. All Minecraft classes belong to this package
* in their intermediary names.
*
- * <p>Unmapped classes goes into this package by default. This package additionally contains
* {@link Bootstrap}, {@link SharedConstants}, and {@link MinecraftVersion} classes.
*
* <p>While it's known that some obfuscated Minecraft classes are under other packages like
```suggestion * <p>Unmapped classes go into this package by default. This package additionally contains ```
* The base package for all Minecraft classes. All Minecraft classes belong to this package
* in their intermediary names.
*
+ * <p>Unmapped classes go into this package by default. This package additionally contains
* {@link Bootstrap}, {@link SharedConstants}, and {@link MinecraftVersion} classes.
*
* <p>While it's known that some obfuscated Minecraft classes are under other packages like |
codereview_java_data_4962 | case R.id.audio_controls:
PlaybackControlsDialog dialog = PlaybackControlsDialog.newInstance();
dialog.setOnRepeatChanged(repeat -> {
if (repeat) {
imgvRepeat.setVisibility(View.VISIBLE);
} else {
This is not reliable when the PlaybackControlsDialog fragment is recreated by the Android system. Please listen to the preferences changes directly instead.
case R.id.audio_controls:
PlaybackControlsDialog dialog = PlaybackControlsDialog.newInstance();
dialog.setOnRepeatChanged(repeat -> {
+ repeat = UserPreferences.getShouldRepeatEpisode();
if (repeat) {
imgvRepeat.setVisibility(View.VISIBLE);
} else { |
codereview_java_data_4964 | package org.kie.kogito.tracing.event.model;
import org.kie.kogito.KogitoGAV;
import org.kie.kogito.event.ModelMetadata;
import org.kie.kogito.tracing.event.model.models.DecisionModelEvent;
-import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
Did you want `@type` here too?
package org.kie.kogito.tracing.event.model;
import org.kie.kogito.KogitoGAV;
+import org.kie.kogito.ModelDomain;
import org.kie.kogito.event.ModelMetadata;
import org.kie.kogito.tracing.event.model.models.DecisionModelEvent;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes; |
codereview_java_data_4965 | protected void setDesiredCapabilities(DesiredCapabilities desiredCapabilities)
{
desiredCapabilitiesConfigurers.ifPresent(
- configurers -> configurers.forEach(configurer -> configurer.addCapabilities(desiredCapabilities)));
desiredCapabilities.merge(webDriverManagerContext.getParameter(WebDriverManagerParameter.DESIRED_CAPABILITIES));
webDriverManagerContext.reset(WebDriverManagerParameter.DESIRED_CAPABILITIES);
RunningStory runningStory = bddRunContext.getRunningStory();
addCapabilities is a bit misleading from my pov :) maybe configureCapabilities?
protected void setDesiredCapabilities(DesiredCapabilities desiredCapabilities)
{
desiredCapabilitiesConfigurers.ifPresent(
+ configurers -> configurers.forEach(configurer -> configurer.configure(desiredCapabilities)));
desiredCapabilities.merge(webDriverManagerContext.getParameter(WebDriverManagerParameter.DESIRED_CAPABILITIES));
webDriverManagerContext.reset(WebDriverManagerParameter.DESIRED_CAPABILITIES);
RunningStory runningStory = bddRunContext.getRunningStory(); |
codereview_java_data_4968 | private final ExecutorService assignmentPool;
private final ExecutorService assignMetaDataPool;
private final ExecutorService summaryRetrievalPool;
- private final ExecutorService summaryParititionPool;
private final ExecutorService summaryRemotePool;
private final Map<String,ExecutorService> scanExecutors;
This should be summaryPartitionPool
private final ExecutorService assignmentPool;
private final ExecutorService assignMetaDataPool;
private final ExecutorService summaryRetrievalPool;
+ private final ExecutorService summaryPartitionPool;
private final ExecutorService summaryRemotePool;
private final Map<String,ExecutorService> scanExecutors; |
codereview_java_data_4970 | import static org.assertj.core.api.Assertions.assertThat;
import static tech.pegasys.pantheon.tests.acceptance.dsl.WaitUtils.waitFor;
-import static tech.pegasys.pantheon.tests.acceptance.dsl.transaction.clique.CliqueTransactions.LATEST;
import tech.pegasys.pantheon.ethereum.core.Address;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition;
we shouldn't be depending on this constant Clique even though it will work. This seems very generic LATEST could probably move somewhere more common.
import static org.assertj.core.api.Assertions.assertThat;
import static tech.pegasys.pantheon.tests.acceptance.dsl.WaitUtils.waitFor;
+import static tech.pegasys.pantheon.tests.acceptance.dsl.transaction.ibft.IbftTransactions.LATEST;
import tech.pegasys.pantheon.ethereum.core.Address;
import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition; |
codereview_java_data_4982 | // we're only interested in messages that need removing
if (!shouldBeNotifiedOf) {
- NotificationData data = getNotificationData(account, -1);
if (data != null) {
synchronized (data) {
MessageReference ref = localMessage.makeMessageReference();
Can you create a constant for the -1? I'm not sure what that represents here.
// we're only interested in messages that need removing
if (!shouldBeNotifiedOf) {
+ NotificationData data = getNotificationData(account, null);
if (data != null) {
synchronized (data) {
MessageReference ref = localMessage.makeMessageReference(); |
codereview_java_data_4996 | private static String getPlaintextExportDirectoryPath() {
File sdDirectory = Environment.getExternalStorageDirectory();
- return getOldPlaintextExportDirectoryPath() + FOLDERNAME + File.separator + "Backup" + File.separator;
}
private static String getOldPlaintextExportDirectoryPath() {
"Backup" --> `private static final String BACKUPFOLDERNAME`?
private static String getPlaintextExportDirectoryPath() {
File sdDirectory = Environment.getExternalStorageDirectory();
+ return getOldPlaintextExportDirectoryPath() + FOLDERNAME + File.separator + BACKUPFOLDERNAME + File.separator;
}
private static String getOldPlaintextExportDirectoryPath() { |
codereview_java_data_5001 | files.saveToKompiled("parsed.txt", parsedDef.toString());
checkDefinition(parsedDef, excludedModuleTags);
- sw.printIntermediate("Run definition checks");
-
sw.printIntermediate("Validate definition");
Definition kompiledDefinition = pipeline.apply(parsedDef);
This is redundant with 2 lines above (which I added in a previous PR) which says "Run definition checks.". So either remove this or just update the text of the one above.
files.saveToKompiled("parsed.txt", parsedDef.toString());
checkDefinition(parsedDef, excludedModuleTags);
sw.printIntermediate("Validate definition");
Definition kompiledDefinition = pipeline.apply(parsedDef); |
codereview_java_data_5007 | package org.apache.rocketmq.common.protocol.body;
import org.apache.rocketmq.common.message.MessageQueue;
-import org.apache.rocketmq.common.protocol.body.QueryCorrectionOffsetBody;
-import org.apache.rocketmq.common.protocol.body.ResetOffsetBody;
import org.apache.rocketmq.remoting.protocol.RemotingSerializable;
import org.junit.Test;
you'd better remove some unnecessary imports, use hot key 'Ctrl+Shift+o' for intelij idea import org.apache.rocketmq.common.protocol.body.QueryCorrectionOffsetBody; import org.apache.rocketmq.common.protocol.body.ResetOffsetBody; org.assertj.core.api.Assertions.offset;
package org.apache.rocketmq.common.protocol.body;
import org.apache.rocketmq.common.message.MessageQueue;
import org.apache.rocketmq.remoting.protocol.RemotingSerializable;
import org.junit.Test; |
codereview_java_data_5010 | when(this.userDetailsService.findByUsername(any())).thenReturn(Mono.just(expiredUser));
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
- this.user, this.user.getPassword());
this.manager.authenticate(token).block();
}
Can we use `expiredUser` to create the token instead of `this.user`? It will mimic a more realistic scenario. Similarly for `lockedUser` and `disabledUser` in the other tests.
when(this.userDetailsService.findByUsername(any())).thenReturn(Mono.just(expiredUser));
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
+ expiredUser, expiredUser.getPassword());
this.manager.authenticate(token).block();
} |
codereview_java_data_5013 | *
* The semantics of this kind depend on the language.
*/
int getKind();
}
I'd rather mark this as `@Experimental` for now. The reason is, that the different kinds are the constants e.g. from CppParserConstants. Whenever we change the grammar and add a new token, these "constants" might change, which will change the public API here. Maybe we need another abstraction here? Note: We have actually the same problem for AntlrToken as well....
*
* The semantics of this kind depend on the language.
*/
+ @Experimental
int getKind();
} |
codereview_java_data_5014 | /**
* Handles the incoming intent. If the activity was launched via a deep link,
* passes the uri to handleDeeplink().
- *
* Added an SDK version check since the minimum SDK supported by AntennaPod is 16
* and Object.equals(Obj1, Obj2) is only supported in API 19+.
*
* @param intent incoming intent
*/
private void handleIntent(Intent intent) {
- if (intent == null) return;
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return;
We already have a function named `handleNavIntent`. Could those functions be combined? They seem to do pretty similar things.
/**
* Handles the incoming intent. If the activity was launched via a deep link,
* passes the uri to handleDeeplink().
* Added an SDK version check since the minimum SDK supported by AntennaPod is 16
* and Object.equals(Obj1, Obj2) is only supported in API 19+.
*
* @param intent incoming intent
*/
private void handleIntent(Intent intent) {
+ if (intent == null) {
+ return;
+ }
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
return; |
codereview_java_data_5016 | if (configuration.getCredentialPrincipal().isPresent() && configuration.getCredentialSecret().isPresent()) {
Credential credential = Credential.newBuilder()
.setPrincipal(configuration.getCredentialPrincipal().get())
- .setSecret(ByteString.copyFrom(configuration.getCredentialSecret().get().getBytes("UTF-8")))
.build();
this.driver = new MesosSchedulerDriver(scheduler, frameworkInfo, configuration.getMaster(), credential);
} else {
nitpick: for Java 7+ `StandardCharsets.UTF_8` is preferred
if (configuration.getCredentialPrincipal().isPresent() && configuration.getCredentialSecret().isPresent()) {
Credential credential = Credential.newBuilder()
.setPrincipal(configuration.getCredentialPrincipal().get())
+ .setSecret(ByteString.copyFrom(configuration.getCredentialSecret().get().getBytes(StandardCharsets.UTF_8)))
.build();
this.driver = new MesosSchedulerDriver(scheduler, frameworkInfo, configuration.getMaster(), credential);
} else { |
codereview_java_data_5020 | }
// Add to the reply the multiple extended info (XDataForm) provided by the DiscoInfoProvider
Iterator<DataForm> dataForms = infoProvider.getExtendedInfos(name, node, packet.getFrom()).iterator();
- //Log.info("DATAFORM {}",dataForms.toString());
while (dataForms.hasNext()) {
final DataForm dataForm = dataForms.next();
queryElement.add(dataForm.getElement());
}
-
}
else {
// If the DiscoInfoProvider has no information for the requested name and node
I think you used this Log statement for debugging purposes. If we're not going to use it, let's remove it completely.
}
// Add to the reply the multiple extended info (XDataForm) provided by the DiscoInfoProvider
Iterator<DataForm> dataForms = infoProvider.getExtendedInfos(name, node, packet.getFrom()).iterator();
while (dataForms.hasNext()) {
final DataForm dataForm = dataForms.next();
queryElement.add(dataForm.getElement());
}
}
else {
// If the DiscoInfoProvider has no information for the requested name and node |
codereview_java_data_5021 | return diskInUseScore;
}
- long getTimestamp() {
- return timestamp;
- }
-
void addEstimatedCpuUsage(double estimatedAddedCpus) {
this.estimatedAddedCpusUsage += estimatedAddedCpus;
}
you should be able to just do getSlaveUsage().getTimestamp() instead of having to store it in two places
return diskInUseScore;
}
void addEstimatedCpuUsage(double estimatedAddedCpus) {
this.estimatedAddedCpusUsage += estimatedAddedCpus;
} |
codereview_java_data_5023 | }
}
- private FastSyncState storeState(final FastSyncState state) {
- fastSyncStateStorage.storeState(state);
if (state.getPivotBlockNumber().isPresent()) {
trailingPeerRequirements =
Optional.of(new TrailingPeerRequirements(state.getPivotBlockNumber().getAsLong(), 0));
This is a little unexpected in a "storeState" method
}
}
+ private FastSyncState updateMaxTrailingPeers(final FastSyncState state) {
if (state.getPivotBlockNumber().isPresent()) {
trailingPeerRequirements =
Optional.of(new TrailingPeerRequirements(state.getPivotBlockNumber().getAsLong(), 0)); |
codereview_java_data_5030 | return tag;
}
- @Override
- public String toString() {
- return getXPathNodeName();
- }
@Override
We don't need this method. We would inherit it from `AbstractNode` and still want to kill it eventually
return tag;
}
+
@Override |
codereview_java_data_5034 | //noinspection unchecked
NodeList<ImportDeclaration> modifiableList = new NodeList<>(n);
modifiableList.sort(
- comparingInt((ImportDeclaration left) -> left.isStatic() ? 0 : 1)
.thenComparing(NodeWithName::getNameAsString));
for (Object node : modifiableList) {
((Node) node).accept(this, arg);
shouldn't be called `left` anymore
//noinspection unchecked
NodeList<ImportDeclaration> modifiableList = new NodeList<>(n);
modifiableList.sort(
+ comparingInt((ImportDeclaration i) -> i.isStatic() ? 0 : 1)
.thenComparing(NodeWithName::getNameAsString));
for (Object node : modifiableList) {
((Node) node).accept(this, arg); |
codereview_java_data_5038 | private boolean watchingParent = false;
private String asyncLock;
- public ZooLock(ZooReaderWriter zoo, String path, RetryFactory retryFactory) {
this(new ZooCache(zoo), zoo, path);
}
- public ZooLock(String zookeepers, int timeInMillis, String secret, String path,
- RetryFactory retryFactory) {
- this(new ZooCacheFactory().getZooCache(zookeepers, timeInMillis),
- new ZooReaderWriter(zookeepers, timeInMillis, secret, retryFactory), path);
- }
-
protected ZooLock(ZooCache zc, ZooReaderWriter zrw, String path) {
getLockDataZooCache = zc;
this.path = path;
A new parameter is added, but not used.
private boolean watchingParent = false;
private String asyncLock;
+ public ZooLock(ZooReaderWriter zoo, String path) {
this(new ZooCache(zoo), zoo, path);
}
protected ZooLock(ZooCache zc, ZooReaderWriter zrw, String path) {
getLockDataZooCache = zc;
this.path = path; |
codereview_java_data_5044 | }
public void setMedia(final Slide slide, @Nullable MasterSecret masterSecret) {
- setMedia(slide, masterSecret, true);
- }
-
- public void setMedia(final Slide slide, @Nullable MasterSecret masterSecret, boolean updateThumbnail) {
slideDeck.clear();
slideDeck.addSlide(slide);
attachmentView.setVisibility(View.VISIBLE);
- if (updateThumbnail) thumbnail.setImageResource(slide, masterSecret);
attachmentListener.onAttachmentChanged();
}
For the caller to know whether the attachment manager should update its thumbnail or not feels pretty off.
}
public void setMedia(final Slide slide, @Nullable MasterSecret masterSecret) {
slideDeck.clear();
slideDeck.addSlide(slide);
attachmentView.setVisibility(View.VISIBLE);
+ thumbnail.setImageResource(slide, masterSecret);
attachmentListener.onAttachmentChanged();
} |
codereview_java_data_5064 | try {
double progress = entries.getValue().getBytesCopied() / walBlockSize;
// to be sure progress does not exceed 100%
- status.progress = Math.min(progress, 99.0);
} catch (IOException ex) {
log.warn("Error getting bytes read");
}
I suggest 99.9 instead of 99.0. It allows more room to see a changing number that's not "stuck" at 99.0%, but avoids the misleading behavior of being stuck at 100% for a long time if we just used 100.0 here.
try {
double progress = entries.getValue().getBytesCopied() / walBlockSize;
// to be sure progress does not exceed 100%
+ status.progress = Math.min(progress, 99.9);
} catch (IOException ex) {
log.warn("Error getting bytes read");
} |
codereview_java_data_5065 | @Override
protected void onAuthCookieAcquired(String authCookie) {
// Do a sync everytime we get here!
- ContentResolver.requestSync(application.getCurrentAccount(), ContributionsContentProvider.AUTHORITY, new Bundle());
Intent uploadServiceIntent = new Intent(this, UploadService.class);
uploadServiceIntent.setAction(UploadService.ACTION_START_SERVICE);
startService(uploadServiceIntent);
bindService(uploadServiceIntent, uploadServiceConnection, Context.BIND_AUTO_CREATE);
- allContributions = getContentResolver().query(ContributionsContentProvider.BASE_URI, Contribution.Table.ALL_FIELDS, CONTRIBUTION_SELECTION, null, CONTRIBUTION_SORT);
getSupportLoaderManager().initLoader(0, null, this);
}
Use a provider to get an instance of currentAccount
@Override
protected void onAuthCookieAcquired(String authCookie) {
// Do a sync everytime we get here!
+ requestSync(sessionManager.getCurrentAccount(), ContributionsContentProvider.AUTHORITY, new Bundle());
Intent uploadServiceIntent = new Intent(this, UploadService.class);
uploadServiceIntent.setAction(UploadService.ACTION_START_SERVICE);
startService(uploadServiceIntent);
bindService(uploadServiceIntent, uploadServiceConnection, Context.BIND_AUTO_CREATE);
+ allContributions = getContentResolver().query(BASE_URI, ALL_FIELDS,
+ CONTRIBUTION_SELECTION, null, CONTRIBUTION_SORT);
getSupportLoaderManager().initLoader(0, null, this);
} |
codereview_java_data_5069 | out.writeObject(lastSnapshotFailure);
out.writeObject(snapshotStats);
out.writeObject(exportedSnapshotMapName);
- out.writeUTF(suspensionCause);
out.writeBoolean(executed);
out.writeLong(timestamp.get());
}
`writeUTF` argument must be non-null, see 4 lines above.
out.writeObject(lastSnapshotFailure);
out.writeObject(snapshotStats);
out.writeObject(exportedSnapshotMapName);
+ out.writeObject(suspensionCause);
out.writeBoolean(executed);
out.writeLong(timestamp.get());
} |
codereview_java_data_5093 | assertThat(subProcess.getDataObjects())
.extracting(ValuedDataObject::getName, ValuedDataObject::getValue)
.containsExactly(tuple("SubTest", "Testing"));
- assertThat(subProcess.getDataObjects().get(0).getItemSubjectRef().getStructureRef())
- .isInstanceOfSatisfying(String.class, structRef -> {
- assertThat(structRef).isEqualTo("xsd:string");
- });
});
}
}
No need for `isInstanceOfSatisfying` you can directly do `isEqualTo("xsd:string")`. If it is not a string then it won't be equal to a string as well
assertThat(subProcess.getDataObjects())
.extracting(ValuedDataObject::getName, ValuedDataObject::getValue)
.containsExactly(tuple("SubTest", "Testing"));
+ assertThat(subProcess.getDataObjects().get(0).getItemSubjectRef().getStructureRef()).isEqualTo("xsd:string");
});
}
} |
codereview_java_data_5102 | }
} else if (classType.getName().equals("org.apache.logging.slf4j.Log4jLoggerFactory")) {
- Log4j2Helper.addClientLogger(clientLogRoot,clientLogLevel,clientLogMaxIndex,true);
}
} catch (Exception e) {
System.err.println(e);
Hi, please leave a space behind `,`: `Log4j2Helper.addClientLogger(clientLogRoot, clientLogLevel, clientLogMaxIndex, true);`
}
} else if (classType.getName().equals("org.apache.logging.slf4j.Log4jLoggerFactory")) {
+ Log4j2Helper.addClientLogger(clientLogRoot, clientLogLevel, clientLogMaxIndex, true);
}
} catch (Exception e) {
System.err.println(e); |
codereview_java_data_5103 | if (barcodeText.length() <= 2) {
displayToast(getResources().getString(R.string.txtBarcodeNotValid));
} else {
- if (ProductUtils.isBareCodeValid(barcodeText)) {
api.getProduct(mBarCodeText.getText().toString(), getActivity());
} else {
displayToast(getResources().getString(R.string.txtBarcodeNotValid));
What is a BareCode ? :-P
if (barcodeText.length() <= 2) {
displayToast(getResources().getString(R.string.txtBarcodeNotValid));
} else {
+ if (ProductUtils.isBarcodeValid(barcodeText)) {
api.getProduct(mBarCodeText.getText().toString(), getActivity());
} else {
displayToast(getResources().getString(R.string.txtBarcodeNotValid)); |
codereview_java_data_5110 | public Plan(TableFilter[] filters, int count, Expression condition) {
this.filters = new TableFilter[count];
System.arraycopy(filters, 0, this.filters, 0, count);
- final ArrayList<Expression> allCond = new ArrayList<>(count/2);
- final ArrayList<TableFilter> all = new ArrayList<>(count);
if (condition != null) {
allCond.add(condition);
}
These size assumptions are also incorrect. They are too small in about 43% of cases from the `TestAll`. It looks like plain `new ArrayList<>()` with its default initial capacity of 10 is the most reasonable choice here.
public Plan(TableFilter[] filters, int count, Expression condition) {
this.filters = new TableFilter[count];
System.arraycopy(filters, 0, this.filters, 0, count);
+ final ArrayList<Expression> allCond = new ArrayList<>();
+ final ArrayList<TableFilter> all = new ArrayList<>();
if (condition != null) {
allCond.add(condition);
} |
codereview_java_data_5111 | private String outerName;
- private Map<String, String> packages = new HashMap() {
- @Override
- public Object put(Object key, Object value) {
- return super.put(key, value);
- }
- };
private AnnotationVisitor annotationVisitor = new PMDAnnotationVisitor(this);
what's the point of this override?
private String outerName;
+ private Map<String, String> packages = new HashMap<>();
private AnnotationVisitor annotationVisitor = new PMDAnnotationVisitor(this); |
codereview_java_data_5117 | parseStringTerm(String input, Sort startSymbol, Scanner scanner, Source source, int startLine, int startColumn, boolean inferSortChecks, boolean isAnywhere) {
scanner = getGrammar(scanner);
- long start = System.currentTimeMillis(), endParse = 0, startTypeInf = 0, endTypeInf = 0;
try {
Grammar.NonTerminal startSymbolNT = grammar.get(startSymbol.toString());
I don't understand why this is being changed. Not only are we reducing the precision by a factor of 1000, you are now also calling the potentially somewhat expensive function even when its value doesn't matter.
parseStringTerm(String input, Sort startSymbol, Scanner scanner, Source source, int startLine, int startColumn, boolean inferSortChecks, boolean isAnywhere) {
scanner = getGrammar(scanner);
+ long start, endParse = 0, startTypeInf = 0, endTypeInf = 0;
+ start = profileRules ? System.currentTimeMillis() : 0;
try {
Grammar.NonTerminal startSymbolNT = grammar.get(startSymbol.toString()); |
codereview_java_data_5156 | }
@Test
- public void whenControllersAreNotPresentMethodShouldDoNothingAndReturnSuccess() {
method = new PermReloadPermissionsFromFile(Optional.empty(), Optional.empty());
JsonRpcResponse response = method.response(reloadRequest());
- assertThat(response).isEqualToComparingFieldByField(successResponse());
}
@Test
Not sure about this one. If both controllers aren't present, that should mean that permissioning hasn't been enabled and this method isn't available.
}
@Test
+ public void whenBothControllersAreNotPresentMethodShouldReturnPermissioningDisabled() {
+ JsonRpcResponse expectedErrorResponse =
+ new JsonRpcErrorResponse(null, JsonRpcError.PERMISSIONING_NOT_ENABLED);
+
method = new PermReloadPermissionsFromFile(Optional.empty(), Optional.empty());
JsonRpcResponse response = method.response(reloadRequest());
+ assertThat(response).isEqualToComparingFieldByField(expectedErrorResponse);
}
@Test |
codereview_java_data_5157 | assertThat(cmd.getCode()).isEqualTo(code);
assertThat(cmd.getVersion()).isEqualTo(2333);
assertThat(cmd.getRemark()).isEqualTo(remark);
- assertThat(cmd.getFlag() & 0x01).isEqualTo(1); //flag bit 0: 1 presents request
}
@Test
We don't need to catch the exception here. The unit test can be failed when the exception is thrown.
assertThat(cmd.getCode()).isEqualTo(code);
assertThat(cmd.getVersion()).isEqualTo(2333);
assertThat(cmd.getRemark()).isEqualTo(remark);
+ assertThat(cmd.getFlag() & 0x01).isEqualTo(1); //flag bit 0: 1 presents response
}
@Test |
codereview_java_data_5171 | * <p>Nested transactions such as creating a new table may fail. Those failures alone do
* not necessarily result in a failure of the catalog-level transaction.
*
*/
public interface TransactionalCatalog extends Catalog, AutoCloseable {
I'm not sure this is a good idea because there are times when `rollback` should be called instead. For example: ```java try (TransactionCatalog txnCat = ...) { data = readData(txnCat, srcTable); writeData(txnCat, destTable, data); deleteData(txnCat, srcTable, data); } ``` If `writeData` succeeds, then `deleteData` fails (maybe it's interrupted) before it creates the delete operation, then closing would complete the write without knowing that the delete didn't finish and should be rolled back. I think the fix is to accept a flag, although I'm not sure we'd want to do this: ```java TransactionCatalog txnCat = ... boolean rollback = true; try { data = readData(txnCat, srcTable); writeData(txnCat, destTable, data); deleteData(txnCat, srcTable, data); rollback = false; } finally { txnCat.close(rollback); } ``` Passing a flag means you can no longer use try-with-resources, so I don't see much point to a `close(boolean)` method.
* <p>Nested transactions such as creating a new table may fail. Those failures alone do
* not necessarily result in a failure of the catalog-level transaction.
*
+ * <p>Implementations of {@code TransactionalCatalog} are responsible for monitoring all
+ * table level operations that are spawned from this catalog and ensure that all nested
+ * transactions that are completed successfully are either exposed atomically or not.
+ *
*/
public interface TransactionalCatalog extends Catalog, AutoCloseable { |
codereview_java_data_5173 | @Override
public Description matchVariable(VariableTree tree, VisitorState state) {
- if (matcher.matches(tree, state)) {
- if (!tree.getName().contentEquals("log")) {
- return buildDescription(tree)
- .addFix(SuggestedFixes.renameVariable(tree, "log", state))
- .build();
- }
}
return Description.NO_MATCH;
}
pedantic nit: might as well combine conditions to reduce indent depth `if (matcher.matches(tree, state) && !tree.getName().contentEquals("log")) {` I'll give this PR a try internally
@Override
public Description matchVariable(VariableTree tree, VisitorState state) {
+ if (matcher.matches(tree, state) && !tree.getName().contentEquals("log")) {
+ return buildDescription(tree)
+ .addFix(SuggestedFixes.renameVariable(tree, "log", state))
+ .build();
}
return Description.NO_MATCH;
} |
codereview_java_data_5178 | NacosException exception = new NacosException();
if (StringUtils.isNotBlank(nacosDomain)) {
- for (int i = 0; i < UtilAndComs.REQUEST_DOMAIN_RETRY_COUNT; i++) {
try {
return callServer(api, params, body, nacosDomain, method);
} catch (NacosException e) {
Where is the place `maxRetry ` used? The count limit should be `maxRetry`
NacosException exception = new NacosException();
if (StringUtils.isNotBlank(nacosDomain)) {
+ for (int i = 0; i < maxRetry; i++) {
try {
return callServer(api, params, body, nacosDomain, method);
} catch (NacosException e) { |
codereview_java_data_5180 | final CompletableFuture<T> result = new CompletableFuture<>();
future.whenComplete(
(value, error) -> {
- final CompletionStage<T> nextStep =
- error != null ? errorHandler.apply(error) : completedFuture(value);
- propagateResult(nextStep, result);
});
return result;
}
Should we add a try / catch around the `errorHandler` execution in case that function throws?
final CompletableFuture<T> result = new CompletableFuture<>();
future.whenComplete(
(value, error) -> {
+ try {
+ final CompletionStage<T> nextStep =
+ error != null ? errorHandler.apply(error) : completedFuture(value);
+ propagateResult(nextStep, result);
+ } catch (final Throwable t) {
+ result.completeExceptionally(t);
+ }
});
return result;
} |
codereview_java_data_5189 | }
@Override
- public void setPlugins(final List<String> plugins) {
- this.plugins.clear();
- this.plugins.addAll(plugins);
}
@Override
this looks like dead code
}
@Override
+ public List<String> getExtraCLIOptions() {
+ return extraCLIOptions;
}
@Override |
codereview_java_data_5191 | input.requestFocus();
alert.setPositiveButton(R.string.ok, (dialog1, whichButton) -> {
String reason = input.getText().toString();
-
- deleteHelper.makeDeletion(getContext(), media, reason);
- enableDeleteButton(false);
});
alert.setNegativeButton(R.string.cancel, (dialog12, whichButton) -> {
});
It seems that you have reformatted the code? That makes it difficult to see what has actually changed. Better send a first pull request with only the real changes, and then optionally later a second pull request with only the reformatting. Thanks! :-)
input.requestFocus();
alert.setPositiveButton(R.string.ok, (dialog1, whichButton) -> {
String reason = input.getText().toString();
+ onDeleteClickedOthers(reason);
});
alert.setNegativeButton(R.string.cancel, (dialog12, whichButton) -> {
}); |
codereview_java_data_5192 | * exception occurs calling {@code supplier.get()}.
*/
static <T> Try<T> ofSupplier(Supplier<? extends T> supplier) {
return of(supplier::get);
}
We need the ```java Objects.requireNonNull(supplier, "supplier is null"); ``` everywhere because of the `::get` call. Otherwise it will throw a NPE before we enter `of(CheckedSupplier)`...
* exception occurs calling {@code supplier.get()}.
*/
static <T> Try<T> ofSupplier(Supplier<? extends T> supplier) {
+ Objects.requireNonNull(supplier, "supplier is null");
return of(supplier::get);
} |
codereview_java_data_5193 | });
Selection selection = selector.select(new CompactionSelector.SelectionParameters() {
-
- private final ServiceEnvironment senv = new ServiceEnvironmentImpl(tablet.getContext());
-
@Override
public PluginEnvironment getEnvironment() {
return senv;
This is duplicated in the `selectFiles` method for InitParamaters and for SelectionParameters. It could be created once in the selectFiles method as a final local variable.
});
Selection selection = selector.select(new CompactionSelector.SelectionParameters() {
@Override
public PluginEnvironment getEnvironment() {
return senv; |
codereview_java_data_5196 | * Displays the 'download statistics' screen
*/
public class DownloadStatisticsFragment extends Fragment {
- public static final String TAG = DownloadStatisticsFragment.class.getSimpleName();
private Disposable disposable;
private RecyclerView downloadStatisticsList;
Is this change still needed? I think I can see no usages of it here.
* Displays the 'download statistics' screen
*/
public class DownloadStatisticsFragment extends Fragment {
+ private static final String TAG = DownloadStatisticsFragment.class.getSimpleName();
private Disposable disposable;
private RecyclerView downloadStatisticsList; |
codereview_java_data_5201 | protected abstract ProtocolSchedule<C> createProtocolSchedule();
- protected boolean validateContext(final ProtocolContext<C> context) {
- return true;
- }
protected abstract C createConsensusContext(
Blockchain blockchain, WorldStateArchive worldStateArchive);
Remove the return value - nothing appears to use it.
protected abstract ProtocolSchedule<C> createProtocolSchedule();
+ protected void validateContext(final ProtocolContext<C> context) { }
protected abstract C createConsensusContext(
Blockchain blockchain, WorldStateArchive worldStateArchive); |
codereview_java_data_5202 | final Optional<BlockHeader> optionalParentHeader =
protocolContext.getBlockchain().getBlockHeader(sealableBlockHeader.getParentHash());
- final BlockHeader parentHeader =
- optionalParentHeader.orElseThrow(
- () -> new IllegalStateException("Block being created does not have a parent."));
final CliqueContext cliqueContext = protocolContext.getConsensusState();
final VoteTally voteTally = cliqueContext.getVoteTallyCache().getVoteTallyAtBlock(parentHeader);
why not make the parentHeader in the parent class protected, and you can use it here without looking it up? Can ditch the throw and everything.
final Optional<BlockHeader> optionalParentHeader =
protocolContext.getBlockchain().getBlockHeader(sealableBlockHeader.getParentHash());
final CliqueContext cliqueContext = protocolContext.getConsensusState();
final VoteTally voteTally = cliqueContext.getVoteTallyCache().getVoteTallyAtBlock(parentHeader); |
codereview_java_data_5209 | */
public void startTransactionRunners(AccumuloConfiguration conf) {
final ThreadPoolExecutor pool = (ThreadPoolExecutor) ThreadPools.createExecutorService(conf,
- Property.MANAGER_FATE_THREADPOOL_SIZE, false);
fatePoolWatcher = ThreadPools.createGeneralScheduledExecutorService(conf);
fatePoolWatcher.schedule(() -> {
// resize the pool if the property changed
May be ok to set this one to true. This method may only be called once by the manager.
*/
public void startTransactionRunners(AccumuloConfiguration conf) {
final ThreadPoolExecutor pool = (ThreadPoolExecutor) ThreadPools.createExecutorService(conf,
+ Property.MANAGER_FATE_THREADPOOL_SIZE, true);
fatePoolWatcher = ThreadPools.createGeneralScheduledExecutorService(conf);
fatePoolWatcher.schedule(() -> {
// resize the pool if the property changed |
codereview_java_data_5211 | return mProperties.getString(name);
}
- private String getString(String name, String defaultValue) {
- checkProperty(name);
- return mProperties.getString(name, defaultValue);
- }
-
private int getInt(String name) {
checkProperty(name);
return mProperties.getInt(name);
checkProperty makes sure the the property exists so specifying a default value does not make sense. Lets keep the current convention assuming that all params should be provided.
return mProperties.getString(name);
}
private int getInt(String name) {
checkProperty(name);
return mProperties.getInt(name); |
codereview_java_data_5215 | private Expression filter;
private long targetSizeInBytes;
private int splitLookback;
- private int itemsPerBin;
private long splitOpenFileCost;
protected BaseRewriteDataFilesAction(Table table) {
Looks like this is only modifying the old rewrite path and not the new path. We should probably fix it in both places
private Expression filter;
private long targetSizeInBytes;
private int splitLookback;
+ private int binItemsSize;
private long splitOpenFileCost;
protected BaseRewriteDataFilesAction(Table table) { |
codereview_java_data_5216 | private static String ACTION_UPDATE_MESSAGE_LIST = "UPDATE_MESSAGE_LIST";
- public static void updateMailViewList(Context context) {
Context appContext = context.getApplicationContext();
AppWidgetManager widgetManager = AppWidgetManager.getInstance(appContext);
ComponentName widget = new ComponentName(appContext, MessageListWidgetProvider.class);
This name doesn't indicate that the method doesn't actually update anything itself, but just sends a broadcast intent
private static String ACTION_UPDATE_MESSAGE_LIST = "UPDATE_MESSAGE_LIST";
+ public static void triggerMessageListWidgetUpdate(Context context) {
Context appContext = context.getApplicationContext();
AppWidgetManager widgetManager = AppWidgetManager.getInstance(appContext);
ComponentName widget = new ComponentName(appContext, MessageListWidgetProvider.class); |
codereview_java_data_5221 | throw new UserNotFoundException("user cannot be null");
}
return getUser(user.getNode());
}
Thanks for your contribution! I don't think that there's a reason why we should not have an overloaded method like this. However, there is one improvement that should be made: the code should check if the domain of the provided JID matches the domain of the server.
throw new UserNotFoundException("user cannot be null");
}
+ if (!xmppServer.isLocal(user)) {
+ throw new UserNotFoundException("Cannot get remote user");
+ }
+
return getUser(user.getNode());
} |
codereview_java_data_5226 | }
} else {
if (node instanceof ASTField) {
try {
final Field f = node.getNode().getClass().getDeclaredField("fieldInfo");
f.setAccessible(true);
can't you simply do `node.getNode().getFieldInfo().getType().getApexName().equalsIgnoreCase("String")`? I don't see the reason to use reflection here, nor cast to `StandardFieldInfo` where the interface `FieldInfo` suffices
}
} else {
if (node instanceof ASTField) {
+ /* sergey.gorbaty:
+ * Apex Jorje parser is returning a null from Field.getFieldInfo(), but the info is available from an inner field.
+ * DO NOT attempt to optimize this block without checking that Jorje parser actually fixed its bug.
+ *
+ */
try {
final Field f = node.getNode().getClass().getDeclaredField("fieldInfo");
f.setAccessible(true); |
codereview_java_data_5250 | if (closed)
throw new IllegalStateException("Closed");
- Span span = TraceUtil.getTracer().spanBuilder("TabletServerBatchWriter::flush").startSpan();
try (Scope scope = span.makeCurrent()) {
checkForFailures();
Some of these SpanBuilder options could be set in future to indicate that the span is client side or server side of an RPC call, using `setSpanKind()`. This could be very useful. Other useful things might be to set the parent or to set that it has no parent.
if (closed)
throw new IllegalStateException("Closed");
+ Span span = TraceUtil.createSpan(this.getClass(), "flush", SpanKind.CLIENT);
try (Scope scope = span.makeCurrent()) {
checkForFailures(); |
codereview_java_data_5251 | import org.apache.iceberg.dell.ObjectKey;
/**
- * use ECS append api to write data
*/
public class EcsAppendOutputStream extends OutputStream {
private final AmazonS3 s3;
-
private final ObjectKey key;
/**
Why doesn't this implement `PositionOutputStream`?
import org.apache.iceberg.dell.ObjectKey;
/**
+ * An {@link OutputStream} implementation of ECS append API.
*/
public class EcsAppendOutputStream extends OutputStream {
private final AmazonS3 s3;
private final ObjectKey key;
/** |
codereview_java_data_5255 | boolean zapTservers = false;
@Parameter(names = "-tracers", description = "remove tracer locks")
boolean zapTracers = false;
- @Parameter(names = "-coordinators", description = "remove compaction coordinator locks")
- boolean zapCoordinator = false;
@Parameter(names = "-compactors", description = "remove compactor locks")
boolean zapCompactors = false;
@Parameter(names = "-verbose", description = "print out messages about progress")
I wish `compaction-coordinators` wasn't so lengthy. `-coordinators` is just so generic, when we're referring to a specific coordinator.
boolean zapTservers = false;
@Parameter(names = "-tracers", description = "remove tracer locks")
boolean zapTracers = false;
+ @Parameter(names = "-compaction-coordinators",
+ description = "remove compaction coordinator locks")
+ boolean zapCoordinators = false;
@Parameter(names = "-compactors", description = "remove compactor locks")
boolean zapCompactors = false;
@Parameter(names = "-verbose", description = "print out messages about progress") |
codereview_java_data_5258 | try {
auditConnector.tableOperations().offline(OLD_TEST_TABLE_NAME);
} catch (AccumuloSecurityException ex) {}
- try {
- Scanner scanner = auditConnector.createScanner(OLD_TEST_TABLE_NAME, auths);
scanner.iterator().next().getKey();
- scanner.close();
} catch (RuntimeException ex) {}
try {
auditConnector.tableOperations().deleteRows(OLD_TEST_TABLE_NAME, new Text("myRow"), new Text("myRow~"));
I think that in many cases like this, the following try-with-resources syntax is preferred: ```java try (Scanner scanner = auditConnector.createScanner(OLD_TEST_TABLE_NAME, auths)) { scanner.iterator().next().getKey(); } ``` This is a simpler syntax that doesn't require an explicit call to the AutoCloseable's close method.
try {
auditConnector.tableOperations().offline(OLD_TEST_TABLE_NAME);
} catch (AccumuloSecurityException ex) {}
+ try (Scanner scanner = auditConnector.createScanner(OLD_TEST_TABLE_NAME, auths)) {
scanner.iterator().next().getKey();
} catch (RuntimeException ex) {}
try {
auditConnector.tableOperations().deleteRows(OLD_TEST_TABLE_NAME, new Text("myRow"), new Text("myRow~")); |
codereview_java_data_5267 | checkConflict(requestWithState.getState() != RequestState.PAUSED, "Request %s is paused. Unable to run now (it must be manually unpaused first)", requestWithState.getRequest().getId());
// Check these to avoid unnecessary calls to taskManager
- Integer activeTasks = null;
- Integer pendingTasks = null;
boolean isOneoffWithInstances = requestWithState.getRequest().isOneOff() && requestWithState.getRequest().getInstances().isPresent();
if (requestWithState.getRequest().isScheduled() || isOneoffWithInstances) {
I think we want to default these to `0` instead of `null` to avoid NPE's in `checkRunNowRequest()`.
checkConflict(requestWithState.getState() != RequestState.PAUSED, "Request %s is paused. Unable to run now (it must be manually unpaused first)", requestWithState.getRequest().getId());
// Check these to avoid unnecessary calls to taskManager
+ int activeTasks = 0;
+ int pendingTasks = 0;
boolean isOneoffWithInstances = requestWithState.getRequest().isOneOff() && requestWithState.getRequest().getInstances().isPresent();
if (requestWithState.getRequest().isScheduled() || isOneoffWithInstances) { |
codereview_java_data_5271 | * attached internally. When using the flags with external servers,..
* one should use the realName() method.
*/
-public class Flag {
/*
* IMPORTANT WARNING!!
I guess this class should be final to avoid equals/hashcode problems
* attached internally. When using the flags with external servers,..
* one should use the realName() method.
*/
+public final class Flag {
/*
* IMPORTANT WARNING!! |
codereview_java_data_5283 | // create a new cache at most every 5 seconds
// so that out of memory exceptions are not delayed
long time = System.nanoTime();
- if (softCacheCreated != 0 && time - softCacheCreated < TimeUnit.SECONDS.toNanos(5)) {
return null;
}
try {
rename softCacheCreated to softCacheCreatedNs
// create a new cache at most every 5 seconds
// so that out of memory exceptions are not delayed
long time = System.nanoTime();
+ if (softCacheCreatedNs != 0 && time - softCacheCreatedNs < TimeUnit.SECONDS.toNanos(5)) {
return null;
}
try { |
codereview_java_data_5287 | import openfoodfacts.github.scrachx.openfood.utils.FileUtils;
import openfoodfacts.github.scrachx.openfood.utils.ProductUtils;
import openfoodfacts.github.scrachx.openfood.utils.QuantityParserUtil;
-import openfoodfacts.github.scrachx.openfood.utils.StringComparator;
import openfoodfacts.github.scrachx.openfood.utils.UnitUtils;
import openfoodfacts.github.scrachx.openfood.utils.Utils;
import openfoodfacts.github.scrachx.openfood.utils.ValueState;
StringComparator imported but never used?
import openfoodfacts.github.scrachx.openfood.utils.FileUtils;
import openfoodfacts.github.scrachx.openfood.utils.ProductUtils;
import openfoodfacts.github.scrachx.openfood.utils.QuantityParserUtil;
+import openfoodfacts.github.scrachx.openfood.utils.Stringi18nUtils;
import openfoodfacts.github.scrachx.openfood.utils.UnitUtils;
import openfoodfacts.github.scrachx.openfood.utils.Utils;
import openfoodfacts.github.scrachx.openfood.utils.ValueState; |
codereview_java_data_5288 | String[] ct = getServerConfig(dataId, group, tenant, 3000L);
cacheData.setContent(ct[0]);
}
lastCacheData = cacheData;
}
taskId ``` java int taskId = cacheMap.size() / (int) ParamUtil.getPerTaskConfigSize(); ```
String[] ct = getServerConfig(dataId, group, tenant, 3000L);
cacheData.setContent(ct[0]);
}
+ int taskId = cacheMap.size() / (int) ParamUtil.getPerTaskConfigSize();
+ cacheData.setTaskId(taskId);
lastCacheData = cacheData;
} |
codereview_java_data_5294 | }
/**
- * Use in lieu of {@link CordovaInterfaceImpl#onRequestPermissionResult(int, String[], int[])} to return
- * a boolean if Cordova is handling the permission request with a registered code.
*
* @param requestCode
* @param permissions
Is `CordovaInterfaceImpl#onRequestPermissionResult()` still used? Pretty sure we can remove it.
}
/**
+ * Checks Cordova permission callbacks to handle permissions defined by a Cordova plugin.
+ * Returns true if Cordova is handling the permission request with a registered code.
*
* @param requestCode
* @param permissions |
codereview_java_data_5295 | }
public boolean isAlreadyConnected(final BytesValue nodeId) {
- return getConnectionForPeer(nodeId).isPresent();
}
public Optional<PeerConnection> getConnectionForPeer(final BytesValue nodeID) {
why did this need to change?
}
public boolean isAlreadyConnected(final BytesValue nodeId) {
+ return connections.containsKey(nodeId);
}
public Optional<PeerConnection> getConnectionForPeer(final BytesValue nodeID) { |
codereview_java_data_5306 | @Override
public void onLocationChangedSlightly(fr.free.nrw.commons.location.LatLng latLng) {
- Timber.d("Location significantly changed");
if (isMapBoxReady && latLng != null &&!isUserBrowsing()) {//If the map has never ever shown the current location, lets do it know
handleLocationUpdate(latLng,LOCATION_SLIGHTLY_CHANGED);
}
this log is not in keeping with the name of this method, which one is happening here? Slightly or significantly?
@Override
public void onLocationChangedSlightly(fr.free.nrw.commons.location.LatLng latLng) {
+ Timber.d("Location slightly changed");
if (isMapBoxReady && latLng != null &&!isUserBrowsing()) {//If the map has never ever shown the current location, lets do it know
handleLocationUpdate(latLng,LOCATION_SLIGHTLY_CHANGED);
} |
codereview_java_data_5307 | repositoryService.addCandidateStarterUser(latestProcessDef.getId(), "user1");
links = repositoryService.getIdentityLinksForProcessDefinition(latestProcessDef.getId());
- assertThat(links).hasSize(2);
- assertThat(containsUserOrGroup(null, "group1", links)).isTrue();
- assertThat(containsUserOrGroup("user1", null, links)).isTrue();
repositoryService.deleteCandidateStarterGroup(latestProcessDef.getId(), "nonexisting");
links = repositoryService.getIdentityLinksForProcessDefinition(latestProcessDef.getId());
```suggestion assertThat(links) .extracting(IdentityLink::getUserId, IdentityLink::getGroupId) .containsExactlyInAnyOrder( tuple("user1", null), tuple(null, "group1") ); ```
repositoryService.addCandidateStarterUser(latestProcessDef.getId(), "user1");
links = repositoryService.getIdentityLinksForProcessDefinition(latestProcessDef.getId());
+ assertThat(links)
+ .extracting(IdentityLink::getUserId, IdentityLink::getGroupId)
+ .containsExactlyInAnyOrder(
+ tuple("user1", null),
+ tuple(null, "group1")
+ );
repositoryService.deleteCandidateStarterGroup(latestProcessDef.getId(), "nonexisting");
links = repositoryService.getIdentityLinksForProcessDefinition(latestProcessDef.getId()); |
codereview_java_data_5309 | */
public enum AuditOperationType {
- STREAM_DEFINITIONS(100L, "Stream Definitions"),
- TASK_DEFINITIONS( 200L, "Task Definitions"),
- APP_REGISTRATIONS( 300L, "App Registrations"),
- SCHEDULES( 400L, "Schedules");
private Long id;
private String name;
`STREAM`, `TASK`, `APP_REGISTRATION` (or maybe just `REGISTRATION`), and `SCHEDULE` would be more descriptive/appropriate - reads better
*/
public enum AuditOperationType {
+ STREAM ( 100L, "Streams"),
+ TASK ( 200L, "Task"),
+ APP ( 300L, "App"),
+ SCHEDULE ( 400L, "Schedule");
private Long id;
private String name; |
codereview_java_data_5311 | @Override
public String toString() {
- return ":" + getDestinationName();
}
String getDestinationName() {
Do we really want to use `:` prefix for the destination name? Given, the `toString()` is expected to *only* return the actual destination name, we may not want to use the `:` prefix here as this could introduce some regression.
@Override
public String toString() {
+ return getDestinationName();
}
String getDestinationName() { |
codereview_java_data_5319 | int pos = 0;
if (buff.hasArray()) {
comp = buff.array();
- pos = buff.position();
} else {
comp = Utils.newBytes(compLen);
buff.get(comp);
I didn't check it, but I guess it should be `pos = buff.arrayOffset() + buff.position()`. Maybe offset is always 0 with our current code, but who knows how it can be changed in the future.
int pos = 0;
if (buff.hasArray()) {
comp = buff.array();
+ pos = buff.arrayOffset() + buff.position();
} else {
comp = Utils.newBytes(compLen);
buff.get(comp); |
codereview_java_data_5320 | final View layouttoast;
LayoutInflater inflater = getLayoutInflater();
layouttoast = inflater.inflate(R.layout.toast_custom, (ViewGroup) findViewById(R.id.toastcustom));
- ((TextView) layouttoast.findViewById(R.id.texttoast)).setText("Press back again to exit");
Toast mytoast = new Toast(getBaseContext());
mytoast.setView(layouttoast);
Please use the string resource
final View layouttoast;
LayoutInflater inflater = getLayoutInflater();
layouttoast = inflater.inflate(R.layout.toast_custom, (ViewGroup) findViewById(R.id.toastcustom));
+ ((TextView) layouttoast.findViewById(R.id.texttoast)).setText(R.string.back_to_exit);
Toast mytoast = new Toast(getBaseContext());
mytoast.setView(layouttoast); |
codereview_java_data_5321 | private final Optional<Boolean> skipHealthchecks;
private final Optional<Resources> resources;
private final Map<String, String> envOverrides;
private final Optional<Long> runAt;
public SingularityRunNowRequest(
Quick note here, we don't want to modify existing constructor signatures for classes in a `Base` module of a project (or more generally, for any classes that are intended for use outside the project itself), because it'd break other projects. Adding "proxy" constructors is one way around this.
private final Optional<Boolean> skipHealthchecks;
private final Optional<Resources> resources;
private final Map<String, String> envOverrides;
+ private final List<SingularityMesosArtifact> extraArtifacts;
private final Optional<Long> runAt;
public SingularityRunNowRequest( |
codereview_java_data_5347 | * @return the number of elements actually drained
*/
@SuppressWarnings("unchecked")
- default <E> int drainTo(Collection<E> target) {
for (Object o : this) {
target.add((E) o);
}
What was the motivation to introduce this iterator? It seems it added more code and complexity than it helped to reduce.
* @return the number of elements actually drained
*/
@SuppressWarnings("unchecked")
+ default <E> int drainTo(@Nonnull Collection<E> target) {
for (Object o : this) {
target.add((E) o);
} |
codereview_java_data_5353 | Log.debug( "Unable to get user: no auth token on session." );
return null;
}
- if (authToken instanceof OneTimeAuthToken) {
- return new User(authToken.getUsername(), "one time user", null, new Date(), new Date());
}
final String username = authToken.getUsername();
if (username == null || username.isEmpty())
Instead of 'one time user', I'd use "Recovery via One Time Auth Token"
Log.debug( "Unable to get user: no auth token on session." );
return null;
}
+ if (authToken instanceof AuthToken.OneTimeAuthToken) {
+ return new User(authToken.getUsername(), "Recovery via One Time Auth Token", null, new Date(), new Date());
}
final String username = authToken.getUsername();
if (username == null || username.isEmpty()) |
codereview_java_data_5369 | try {
log.debug("Basal profile " + profile + ": " + String.format("%02d", index) + "h: " + pump.pumpProfiles[profile][index]);
} catch (Exception e){
-
}
}
}
do not use empty try - catch we'll never know about a bug do `log.error("Unhandled exception" , e);`
try {
log.debug("Basal profile " + profile + ": " + String.format("%02d", index) + "h: " + pump.pumpProfiles[profile][index]);
} catch (Exception e){
+ log.error("Unhandled exception" , e);
}
}
} |
codereview_java_data_5370 | clusterObj.setHealthChecker(new AbstractHealthChecker.None());
serviceManager.createServiceIfAbsent(Constants.DEFAULT_NAMESPACE_ID, serviceName, false, clusterObj);
String[] ipArray = addressServerManager.splitIps(ips);
- String checkResult = IpUtil.checkIps(ipArray);
- if (IpUtil.CHECK_OK.equals(checkResult)) {
List<Instance> instanceList = addressServerGeneratorManager
.generateInstancesByIps(serviceName, rawProductName, clusterName, ipArray);
for (Instance instance : instanceList) {
IpUtil.checkOK(str) I think is better
clusterObj.setHealthChecker(new AbstractHealthChecker.None());
serviceManager.createServiceIfAbsent(Constants.DEFAULT_NAMESPACE_ID, serviceName, false, clusterObj);
String[] ipArray = addressServerManager.splitIps(ips);
+ String checkResult = IPUtil.checkIPs(ipArray);
+ if (IPUtil.checkOK(checkResult)) {
List<Instance> instanceList = addressServerGeneratorManager
.generateInstancesByIps(serviceName, rawProductName, clusterName, ipArray);
for (Instance instance : instanceList) { |
codereview_java_data_5376 | /**
* Unzips the ZIP archive and processes JAR files
*/
- private void loadZip(Map<String, byte[]> map, URL url) throws IOException {
try (ZipInputStream zis = new ZipInputStream(new BufferedInputStream(url.openStream()))) {
ZipEntry zipEntry;
while ((zipEntry = zis.getNextEntry()) != null) {
Method should be `loadJarsInZip`
/**
* Unzips the ZIP archive and processes JAR files
*/
+ private void loadJarsInZip(Map<String, byte[]> map, URL url) throws IOException {
try (ZipInputStream zis = new ZipInputStream(new BufferedInputStream(url.openStream()))) {
ZipEntry zipEntry;
while ((zipEntry = zis.getNextEntry()) != null) { |
codereview_java_data_5379 | Operation operation() throws ParsingException;
/**
- * Describes how the database record or document looked like BEFORE
- * applying the change event. Not provided for MongoDB updates.
*
* @throws ParsingException if this {@code ChangeEventValue} doesn't
* have a 'before' sub-element
Do we really want to make this MongoDb specific concern first class citizen of the API ? Also given the fact that we are not including it in this round.
Operation operation() throws ParsingException;
/**
+ * Describes how the database record looked like BEFORE applying the
+ * change event.
*
* @throws ParsingException if this {@code ChangeEventValue} doesn't
* have a 'before' sub-element |
codereview_java_data_5382 | @Override
protected void validate(TableMetadata base) {
- // update startingSnapshotId.
- if (!base.snapshots().isEmpty()) {
- Map<Long, Snapshot> snapshotById = base.snapshots().stream()
- .collect(Collectors.toMap(Snapshot::snapshotId, snapshot -> snapshot));
- Snapshot snapshot = base.snapshots().get(0);
- while (snapshot != null && snapshot.parentId() != null) {
- startingSnapshotId = snapshot.parentId();
- snapshot = snapshotById.get(snapshot.parentId());
- }
- }
-
if (base.currentSnapshot() != null) {
if (!referencedDataFiles.isEmpty()) {
validateDataFilesExist(
Changing the starting snapshot ID breaks the correctness of certain operations, so I don't think that's what you want to do. What are you trying to do here?
@Override
protected void validate(TableMetadata base) {
if (base.currentSnapshot() != null) {
if (!referencedDataFiles.isEmpty()) {
validateDataFilesExist( |
codereview_java_data_5398 | conf.setStrings(enumToConfKey(implementingClass, ScanOpts.RANGES),
rangeStrings.toArray(new String[0]));
} catch (IOException ex) {
- throw new UncheckedIOException("Unable to encode ranges to Base64", ex);
}
}
This one actually is an illegal argument. This is user-facing API, and the IOException is just incidental to the implementation. The user-facing exception should be IAE.
conf.setStrings(enumToConfKey(implementingClass, ScanOpts.RANGES),
rangeStrings.toArray(new String[0]));
} catch (IOException ex) {
+ throw new IllegalArgumentException("Unable to encode ranges to Base64", ex);
}
} |
codereview_java_data_5401 | @Override
protected boolean shouldEmit(Map map) {
- return map != null && !map.isEmpty();
}
};
nit: should we just use CollectionUtils.isNullOrEmpty?
@Override
protected boolean shouldEmit(Map map) {
+ return !isNullOrEmpty(map);
}
}; |
codereview_java_data_5406 | }
InputFile getInputFile(String location) {
- // normalize the path before looking it up in the map
- Path path = new Path(location);
- return inputFiles.get(path.toString());
}
@Override
I don't think using the Hadoop API directly is a good way to solve the problem. It sounds like we need to fix the keys in the map to match the original location from the input split instead.
}
InputFile getInputFile(String location) {
+ return inputFiles.get(location);
}
@Override |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.