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... |
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) {
- negativ... |
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 t... |
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`, w... |
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... |
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 onCli... |
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> { ... |
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 ... |
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.... |
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) {
... |
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,
... |
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.getM... |
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 tec... |
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... |
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.f... |
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, createWriter... |
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 ... |
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 som... |
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 se... |
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_ti... |
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... |
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() throw... |
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.
}
pub... |
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... |
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 ... |
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 co... |
codereview_java_data_4965 | protected void setDesiredCapabilities(DesiredCapabilities desiredCapabilities)
{
desiredCapabilitiesConfigurers.ifPresent(
- configurers -> configurers.forEach(configurer -> configurer.addCapabilities(desiredCapabilities)));
desiredCapabilities.merge(webDriverManagerContext.getPar... |
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> scanExecut... |
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.panthe... |
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) {
... |
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" --> `... |
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 redunda... |
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;
i... |
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 inst... |
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,... |
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+.
*
* @... |
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().... |
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());
... |
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
... |
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 lit... |
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));
... |
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) {
- ... |
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.s... |
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 in... |
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.clas... |
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... |
codereview_java_data_5093 | assertThat(subProcess.getDataObjects())
.extracting(ValuedDataObject::getName, ValuedDataObject::getValue)
.containsExactly(tuple("SubTest", "Testing"));
- assertThat(subProcess.getDataObjects().get(0).getItemSubjectRef().... |
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.prin... |
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());
... |
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<>(c... |
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 th... |
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;
t... |
codereview_java_data_5156 | }
@Test
- public void whenControllersAreNotPresentMethodShouldDoNothingAndReturnSuccess() {
method = new PermReloadPermissionsFromFile(Optional.empty(), Optional.empty());
JsonRpcResponse response = method.response(reloadRequest());
- assertThat(response).isEqualToComparingFieldByField(successRespon... |
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 un... |
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` s... |
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", s... |
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 (N... |
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);
});
ret... |
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);
});
... |
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... |
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 `sel... |
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 thi... |
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 appea... |
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.... |
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);
fateP... |
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... |
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 ... |
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 = ... |
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... |
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().equal... |
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 spa... |
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;
/**... |
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", descriptio... |
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 ... |
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;
... |
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,..
*... |
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 softCache... |
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.uti... |
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 = getSer... |
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#onRequestPermissio... |
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) {
+ retu... |
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
handleLocat... |
codereview_java_data_5307 | repositoryService.addCandidateStarterUser(latestProcessDef.getId(), "user1");
links = repositoryService.getIdentityLinksForProcessDefinition(latestProcessDef.getId());
- assertThat(links).hasSize(2);
- assertThat(containsUserOrGroup(null, "group1", links)).isTrue();
- ... |
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 jus... |
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 int... |
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() + buf... |
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.texttoas... |
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 `B... |
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 compl... |
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());
}
fina... |
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 tr... |
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);
-... |
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 = zi... |
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
* ha... |
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.... |
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 t... |
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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.