id stringlengths 23 26 | content stringlengths 182 2.49k |
|---|---|
codereview_java_data_12446 | }
}
- @Override
- public int getCount() {
- return knownSessions.size();
- }
-
@Override
public void remove(SessionId id) {
Require.nonNull("Session ID", id);
This method isn't needed (see above)
}
}
@Override
public void remove(SessionId id) {
Require.nonNull("Session ID",... |
codereview_java_data_12448 | private final int pc;
private final String[] stack;
private final Object storage;
- private final BytesValue reason;
public StructLog(final TraceFrame traceFrame) {
depth = traceFrame.getDepth() + 1;
I think this should be a String here, but calculated from the `BytesValue` with `BytesValue.toUnprefi... |
codereview_java_data_12453 | try (Writer w = Util.printWriter(logFile)) {
write(doc, w, indent);
}
- System.out.println("write; modCount=" + modCount);
} catch (IOException e) {
throw Util.throwAsRuntime("error while writing test reference log '"
+ logFile + "'", e);
Please remove system.out befo... |
codereview_java_data_12459 | * Key: opId, value: [ mapId, key, oldValue ].
*/
@SuppressWarnings("unchecked")
- final MVMap<Long,Record<?,?>>[] undoLogs = (MVMap<Long,Record<?,?>>[])new MVMap[MAX_OPEN_TRANSACTIONS];
private final MVMap.Builder<Long, Record<?,?>> undoLogBuilder;
private final DataType<?> dataType;
Cast... |
codereview_java_data_12462 | if (!this.runningFlags.isWriteable()) {
long value = this.printTimes.getAndIncrement();
if ((value % 50000) == 0) {
- log.warn("message store could not write (may be disk full) so putMessage is forbidden");
}
return PutMessageStatus.SERVICE_NOT... |
codereview_java_data_12464 | TreeSet<KeyExtent> tablets = tables.get(tableId);
if (tablets == null) {
- for (Entry<TableId,TreeSet<KeyExtent>> e : tables.entrySet()) {
- TableId key = e.getKey();
- TreeSet<KeyExtent> value = e.getValue();
- String tableName = Tables.getTableName(opts.getS... |
codereview_java_data_12465 | }
count++;
- if (hash.equals(Hash.EMPTY)) {
- // No need to go to the archive for an empty value
- nodeData.add(BytesValue.EMPTY);
- } else {
- worldStateArchive.getNodeData(hash).ifPresent(nodeData::add);
- }
}
return NodeDataMessage.create(nodeData);
}
T... |
codereview_java_data_12470 | assertNoProblems(result);
}
@Test
void noModifiersInForEachBesideFinal() {
ParseResult<Statement> result = javaParser.parse(STATEMENT, provider("for(static transient int i : nums){}"));
Hmmm, three messages are a little overkill?
assertNoProblems(result);
}
+ @Test
+ ... |
codereview_java_data_12474 | for (int i=0;i<itemcount;i++){
h.clearAlbumExclude(excludedFolders.remove(0).getAbsolutePath());
}
- Toast.makeText(ExcludedAlbumsActivity.this,"All folders are restored!",Toast.LENGTH_SHORT).show();
- finish();
}
}
Replace this toast with ... |
codereview_java_data_12478 | ImmutableSet.of("bucketing_version", StatsSetupConst.ROW_COUNT,
StatsSetupConst.RAW_DATA_SIZE, StatsSetupConst.TOTAL_SIZE, StatsSetupConst.NUM_FILES);
- private static final int METASTORE_POOL_SIZE = 15;
-
- // before variables
- protected static TestHiveMetastore metastore;
private static TestH... |
codereview_java_data_12479 | }
} finally {
synchronized (this) {
writesInProgress--;
if (writesInProgress == 0)
this.notifyAll();
I think these checks should be left as-is. It may not be possible to for the current code result in this condition, but changes in the code could cause the assumptions to... |
codereview_java_data_12483 | if (privacy.isDisplayMessage()) {
setTicker(getStyledMessage(recipient, message));
} else if (privacy.isDisplayContact()) {
- setTicker(getStyledMessage(recipient, context.getString(R.string.SingleRecipientNotificationBuilder_signal)));
} else {
- setTicker(context.getString(R.string.Sin... |
codereview_java_data_12484 | this.running = true;
} catch (LDAPException ex) {
throw new RuntimeException("Server startup failed", ex);
}
}
With these changes, there is still no exception thrown when the file does not exist. We need to check if the LDIF exists and throw an exception if it does not. We can add the check for `isFile... |
codereview_java_data_12485 | return rootReference;
}
- private Page replacePage(CursorPos path, Page replacement, IntValueHolder unsavedMemoryHolder) {
int unsavedMemory = replacement.getMemory();
while (path != null) {
Page child = replacement;
This method can be static.
return rootRefere... |
codereview_java_data_12489 | calculateIncomeAndExpenseBooking = new CalculateIncomeAndExpenseBookingImpl(null, null, null, null, incomeAndExpenseReadPlatformService,officeReadPlatformService);
}
- @After
- public void tearDown() {
-
- }
/*
Case 1: All running balances has to be calculated before booking off i... |
codereview_java_data_12491 | finish();
}
- if (threadId > -1) {
- getSupportLoaderManager().initLoader(0,null,MediaPreviewActivity.this);
- } else {
- initializeViewPagerAdapter();
- }
}
private void initializeViewPager() {
this does io on the ui thread
finish();
}
+ getSupportLoaderManager().i... |
codereview_java_data_12495 | */
package org.h2.value;
import org.h2.engine.Constants;
import org.h2.util.MathUtils;
/**
- * Base class for collection values.
*/
abstract class ValueCollectionBase extends Value {
Base class for ROW and ARRAY values
*/
package org.h2.value;
+import org.h2.api.ErrorCode;
import org.h2.engine.Constants;... |
codereview_java_data_12501 | package software.amazon.awssdk.util;
import static java.time.ZoneOffset.UTC;
-import static java.time.format.DateTimeFormatter.ISO_DATE_TIME;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static software.amazon.awssdk.uti... |
codereview_java_data_12503 | }
logger.info(jobs.size() + " jobs are running, adding a member");
createJetMember(config);
for (Job job : jobs) {
assertJobStatusEventually(job, RUNNING, 30);
}
If I understand the test correctly it has set delay for 1 second. It means that removing this `slee... |
codereview_java_data_12505 | doEnqueue(awaitableCallback);
if (!await(awaitableCallback.countDown)) throw new InterruptedIOException();
- Throwable t = awaitableCallback.throwable.get();
if (t != null) {
if (t instanceof Error) throw (Error) t;
if (t instanceof IOException) throw (IOException) t;
It took me a while... |
codereview_java_data_12510 | }
/**
- * Returns true if user is logged
*
- * @return true if user is logged; false otherwise
*/
public boolean isLogged() {
return authentication.getCurrentUser() != null;
Should this be "logged in"?
}
/**
+ * Returns true if user is logged in
*
+ ... |
codereview_java_data_12518 | payload.get(payloadBytes);
}
Long timestamp = null;
- timestamp = messageAndOffset.message().timestamp();
-
return new Message(topicPartition.getTopic(), topicPartition.getPartition(),
messageAndOffset.offset(), keyBytes, payloadBytes, timestamp);
}
... |
codereview_java_data_12539 | JavaTypeDefinition previousType;
if (node.getType() != null) { // static field or method
previousType = JavaTypeDefinition.forClass(node.getType());
} else { // non-static field or method
if (dotSplitImage.length == 1 && astArguments != null) { // method
I'm lost he... |
codereview_java_data_12545 | Map<String,String> overrides =
CompactableUtils.getOverrides(job.getKind(), tablet, cInfo.localHelper, job.getFiles());
- String tmpFileName =
- tablet.getNextMapFilename(!cInfo.propagateDeletes ? "A" : "C").getMetaInsert() + "_tmp";
- TabletFile compactTmpName = new TabletFile(new ... |
codereview_java_data_12557 | import java.util.Collection;
import java.util.List;
import java.util.Optional;
-import org.junit.AssumptionViolatedException;
import org.junit.jupiter.api.extension.AfterAllCallback;
import org.junit.jupiter.api.extension.BeforeAllCallback;
import org.junit.jupiter.api.extension.ExtensionContext;
import org.slf4... |
codereview_java_data_12558 | this.brokerController.getConfiguration().update(properties);
if (properties.containsKey("brokerPermission")) {
this.brokerController.getTopicConfigManager().getDataVersion().nextVersion();
- this.brokerController.registerBrokerAll... |
codereview_java_data_12562 | private static final String TAG = "PodDBAdapter";
public static final String DATABASE_NAME = "Antennapod.db";
- public static final int VERSION = 1091000;
/**
* Maximum number of arguments for IN-operator.
Please only increment by 1.
private static final String TAG = "PodDBAdapter";
... |
codereview_java_data_12578 | @Override
public Options forTablets(Collection<KeyExtent> extents) {
- if (!extents.stream().map(e -> DataLevel.of(e.tableId()))
- .allMatch(dl -> dl == DataLevel.USER)) {
throw new IllegalArgumentException(
"readTablets only supported for user tablets at this time.");
... |
codereview_java_data_12592 | return false;
}
MessageReference other = (MessageReference) o;
- return equals(other.accountUuid, other.folderName, other.uid, other.flag);
}
- @SuppressWarnings("UnusedParameters") // consistency with constructor
- public boolean equals(String accountUuid, String folder... |
codereview_java_data_12598 | long minLogicOffset = logicQueue.getMinLogicOffset();
SelectMappedBufferResult result = logicQueue.getIndexBuffer(minLogicOffset / ConsumeQueue.CQ_STORE_UNIT_SIZE);
- Long storeTime = getStoreTime(result);
- return storeTime;
}
return -1;
`return getSto... |
codereview_java_data_12608 | outputStream = fs.create(new Path(file), false, bufferSize, (short) rep, block);
}
- BCFile.Writer _cbw = new BCFile.Writer(
- new RateLimitedOutputStream(outputStream, options.getRateLimiter()), compression, conf,
- false, acuconf);
return new RFile.Writer(_cbw, (int) blockSize, (int)... |
codereview_java_data_12611 | return R.string.location_inside;
case OUTSIDE:
return R.string.location_outside;
default:
return R.string.unknown;
}
only 2 are implemented now?
return R.string.location_inside;
... |
codereview_java_data_12620 | private final ActionButtonCallback actionButtonCallback;
private final ActionButtonUtils actionButtonUtils;
private final boolean showOnlyNewEpisodes;
- private final MainActivity mainActivity;
public AllEpisodesRecycleAdapter(Context context,
MainActivity ma... |
codereview_java_data_12621 | .filter(l -> {
boolean pass = l % 2 == 0;
if (!pass) {
- UserMetrics.getCounter("dropped").inc();
}
- UserMetrics.getCounter("total").inc();
return pass;
})
.drainTo(sink);
this won't work because of lazyS... |
codereview_java_data_12628 | import com.palantir.baseline.tasks.CheckExactDependenciesTask;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginConvention;
import org.gradle.api.tasks.SourceSet;
does this need to be configurable?
import com.palantir... |
codereview_java_data_12650 | return rules
.stream()
.filter(filter)
- .allMatch(
- rule -> {
- final boolean result = rule.validate(header, parent, protocolContext);
- return result;
- });
}
private Optional<BlockHeader> getParent(
The `result` variable appears to... |
codereview_java_data_12655 | final WebSocketConfiguration webSocketConfiguration,
final MetricsConfiguration metricsConfiguration,
final Optional<PermissioningConfiguration> permissioningConfiguration,
- final Collection<EnodeURL> staticNodes)
- throws IOException {
checkNotNull(runnerBuilder);
I can't immediat... |
codereview_java_data_12656 | job.suspend();
assertJobStatusEventually(job, SUSPENDED);
assertThat(job.getSuspensionCause()).matches(JobSuspensionCause::requestedByUser);
-
assertThatThrownBy(job.getSuspensionCause()::errorCause)
- .isInstanceOf(UnsupportedOperationException.class)
... |
codereview_java_data_12676 | if (header.getNumber() == BlockHeader.GENESIS_BLOCK_NUMBER) {
continue;
}
- if (header.getNumber() % 1 == 0) {
LOG.info("Import at block {}", header.getNumber());
}
if (blockchain.contains(header.getHash())) {
nit: why not just get rid of the if statemen... |
codereview_java_data_12682 | assertThat(Base64Utils.decode(null)).isNull();
assertThat(Base64Utils.encode(null)).isNull();
assertThat(Base64Utils.decode(Base64Utils.encode("foo"))).isEqualTo("foo");
assertThat(Base64Utils.decode("juststring")).isEqualTo("juststring");
}
}
Could also test for `foo.*`.
assertThat(Base64Utils.deco... |
codereview_java_data_12693 | }
// Adding current time to snooze if we got staleData
log.debug("Notification text is: "+notification.text);
- if(notification.text == MainApp.sResources.getString(R.string.nsalarm_staledata)){
... |
codereview_java_data_12696 | configureJetService(config);
HazelcastInstanceImpl hazelcastInstance = ((HazelcastInstanceProxy)
Hazelcast.newHazelcastInstance(config.getHazelcastConfig())).getOriginal();
- Runtime.getRuntime().addShutdownHook(shutdownHookThread(hazelcastInstance));
- return new JetIns... |
codereview_java_data_12720 | /**
* Ignores empty bulk import source directory, rather than throwing an IllegalArgumentException.
*/
ImportMappingOptions ignoreEmptyDir(boolean ignore);
Should include `@since 2.1.0` java doc tag since this will be new.
/**
* Ignores empty bulk import source directory, rather than ... |
codereview_java_data_12729 | }
}
sb.append(" axiom{R");
- StringBuilder oldSB = sb;
- sb = new StringBuilder();
- extraSortParams.clear();
if (owise) {
sb.append("\\implies{R} (\n \\and{R} (\n \\not{R} (\n ");
... |
codereview_java_data_12735 | *
* @param <T> type of the function input, called <em>domain</em> of the function
* @param <R> type of the function output, called <em>codomain</em> of the function
*/
public interface PartialFunction<T, R> {
`@author` and `@since` tags missed
*
* @param <T> type of the function input, called <em>domain<... |
codereview_java_data_12744 | }
@Override
- public void setUDFContextSignature(String setSignature) {
- this.signature = setSignature;
}
private void storeInUDFContext(String key, Serializable value) throws IOException {
nit: instead of set or init, we've used new in other modules
}
@Override
+ public void setUDFContextSign... |
codereview_java_data_12762 | @Override
public Rewriter apply(Module module) {
if (!module.equals(def.executionModule())) {
- throw KEMException.criticalError("Invalid module specified for rewriting. Ocaml backend only supports rewriting over" +
" the definition's main module.");
}
... |
codereview_java_data_12764 | package com.pinterest.secor.reader;
import com.pinterest.secor.common.SecorConfig;
import com.pinterest.secor.common.ZookeeperConnector;
import com.pinterest.secor.message.Message;
Is this a kafka bug? I would imagine the kafka consumer will reset to the correct offset after partition reassignment. And also do we ... |
codereview_java_data_12765 | requestState = oldRequestWithState.get().getState();
}
- if (oldRequest.isPresent() && oldRequest.get().getInstancesSafe() < request.getInstancesSafe()) {
// Trigger cleanups for scale down
int newInstances = request.getInstancesSafe();
taskManager.getActiveTaskIdsForRequest(request.... |
codereview_java_data_12767 | List<String> mod = generatedRuleMappers.stream().map(gen -> "new " + gen + "()").collect(Collectors.toList());
expected = "Arrays.asList(" + String.join(", ", mod) + ");";
assertTrue(retrieved.contains(expected));
- System.out.println(retrieved);
}
-}
\ No newline at end of file
... |
codereview_java_data_12770 | import de.danoeh.antennapod.activity.MainActivity;
import de.danoeh.antennapod.adapter.NavListAdapter;
import de.danoeh.antennapod.adapter.SubscriptionsAdapter;
import de.danoeh.antennapod.core.feed.Feed;
import de.danoeh.antennapod.core.storage.DBReader;
import de.greenrobot.event.EventBus;
You should register ... |
codereview_java_data_12776 | .insertOrUpdateCapacity(group, tenant, quota, maxSize, maxAggrCount, maxAggrSize);
if (insertOrUpdateResult) {
setSuccessResult(response, restResult);
- restResult.setMessage(String.format("Successfully updated %s for capacity information configuration f... |
codereview_java_data_12781 | if (msgId == null) {
msgId = msgExt.getProperty(MessageConst.PROPERTY_ORIGIN_MESSAGE_ID);
}
- dlqLogger.info("[DLQ] topic:" + retryTopic + " consumerGroup:" + requestHeader.getGroup() + " msgId:" + msgId);
} else {
if (0 == delayLevel) {
... |
codereview_java_data_12784 | import com.google.errorprone.matchers.Matchers;
import com.google.errorprone.matchers.method.MethodMatchers;
import com.sun.source.tree.VariableTree;
@AutoService(BugChecker.class)
@BugPattern(
I think we can avoid adding a new utility: ```suggestion Matchers.hasModifier(Modifier.FINAL), ``` That will match `inte... |
codereview_java_data_12787 | originalDf.select("id", "data").write()
.format("iceberg")
.mode("append")
- .option("extra-metadata.extra-key", "someValue")
- .option("extra-metadata.another-key", "anotherValue")
.save(tableLocation);
Table table = tables.load(tableLocation);
pl... |
codereview_java_data_12795 | // See SEC-2002
@Test
public void onSessionChangePublishesMigrationEventIfMigrateAttributesIsTrue() throws Exception {
- SessionFixationProtectionStrategy strategy = new SessionFixationProtectionStrategy();
HttpServletRequest request = new MockHttpServletRequest();
HttpSession se... |
codereview_java_data_12801 | public void startLdapServer() throws Exception {
UnboundIdContainer server = new UnboundIdContainer(
validRootDn, validLdifClassPath);
- server.setApplicationContext(new GenericApplicationContext());
- List<Integer> ports = getDefaultPorts(1);
- server.setPort(ports.get(0));
-
- try {
- server.afterProp... |
codereview_java_data_12805 | FormInfo formInfo = repositoryService.getFormModelByKey("form1");
SimpleFormModel formModel = (SimpleFormModel) formInfo.getFormModel();
- assertThat(formModel.getFields().size()).isOne();
- assertThat(formModel.getFields().get(0).getId()).isEqualTo("input1");
- assertThat(formMod... |
codereview_java_data_12806 | } else {
continue;
}
-
if (!ignoreInterface(ifc.getDisplayName())) {
for (Enumeration<InetAddress> addrs = ifc.getInetAddresses(); addrs.hasMoreElements(); ) {
... |
codereview_java_data_12813 | for (DLNAResource dlnaResource : files) {
if (dlnaResource instanceof PlaylistFolder) {
- ((PlaylistFolder) dlnaResource).resolve();
}
}
We are already looping through `files` further down on line `1202`, can you add this logic to that existing loop for performance?
for (DLNAResource dlnaResource ... |
codereview_java_data_12815 | while (radius <= MAX_RADIUS) {
try {
places = getFromWikidataQuery(curLatLng, lang, radius);
- }catch (Exception e){
Timber.d("exception in fetching nearby places", e.getLocalizedMessage());
return null;
... |
codereview_java_data_12833 | }
}
- if (MediaDatabase.isInstanciated()) {
MediaDatabase.shutdown();
if (configuration.getDatabaseLogging()) {
MediaDatabase.createReport();
I think it's spelled `Instantiated`
}
}
+ if (MediaDatabase.isInstantiated()) {
MediaDatabase.shutdown();
if (configu... |
codereview_java_data_12836 | rowBuilder.set(i, Double.NaN);
break;
}
default:
rowBuilder.set(i, s);
break;
Could you move the three ```break;``` clauses to the end of the ```case``` block? No need to have three.
rowBuilder.set(i, Double.NaN);
break;
... |
codereview_java_data_12837 | ClientContext.getConditionalWriterConfig(props);
assertNotNull(conditionalWriterConfig);
- // If the value of BATCH_WRITER_TIMEOUT_MAX is set to zero, Long.MAX_VALUE is returned.
// Effectively, this indicates there is no timeout for BATCH_WRITER_TIMEOUT_MAX. Due to this
// behavior, the test... |
codereview_java_data_12845 | private final RecentLogs recentLogs = new RecentLogs();
private long scansFetchedNanos = 0L;
private long compactsFetchedNanos = 0L;
- private final long fetchTimeNanos = TimeUnit.NANOSECONDS.convert(1, TimeUnit.MINUTES);
- private final long ageOffEntriesMillis = TimeUnit.MILLISECONDS.convert(15, TimeUnit.M... |
codereview_java_data_12846 | pipeline.readFrom(TestSources.items(1, 2))
.map(Value::new)
.writeTo(Sinks.observable(OBSERVABLE_NAME));
- long timeout = 120;
// When
Observable<Value> observable = client().getObservable(OBSERVABLE_NAME);
Why not to simply inline it? Why 120?
... |
codereview_java_data_12863 | * @since 4.0
*/
@Nonnull
- File getAttachedDirectory(@Nonnull String id);
/**
* Returns the attached file to the job with the given id.
you can skip the `get` (so just have `attachedDirectory` as it's the convention on this interface
* @since 4.0
... |
codereview_java_data_12869 | package net.sourceforge.pmd.lang.java.metrics.impl.visitors;
-import java.util.ArrayList;
import java.util.List;
import net.sourceforge.pmd.lang.java.ast.ASTConditionalExpression;
Would it work here to use `findChildrenOfType(ASTStatement.class)` instead of checking the type directly?
package net.sourceforge.pmd.... |
codereview_java_data_12877 | // Copy options if flag was set
if (cl.hasOption(createTableOptCopyConfig.getOpt())) {
if (shellState.getAccumuloClient().tableOperations().exists(tableName)) {
- final Iterable<Entry<String,String>> configuration =
- shellState.getAccumuloClient().tableOperations()
- .... |
codereview_java_data_12886 | @Override
public boolean hasNext() {
while (that.hasNext()) {
- queue = queue.append(that.next());
if(queue.length() > n) {
queue = queue.dequeue()._2;
}
I would ... |
codereview_java_data_12892 | private static final double FAV3_DEFAULT = 20;
private CheckBox suspendLoopCheckbox;
private CheckBox startActivityTTCheckbox;
- private CheckBox ESMCheckbox;
private Integer maxCarbs;
Could you please rename this to start wit a lowercase letter.
private static final double FAV3_DEFAULT = ... |
codereview_java_data_12904 | /**
* TODO to be improved by loading only if required and only in the user language
* Load ingredients from (the server or) local database
- * If SharedPreferences lastDLIngredients is set try this :
* if file from the server is newer than last download delete database, load the file and fil... |
codereview_java_data_12905 | Preconditions.checkArgument(serde.nonEmpty() || table.provider().nonEmpty(),
"Partition format should be defined");
- URI uri = locationUri.get();
String format = serde.nonEmpty() ? serde.get() : table.provider().get();
Map<String, String> partitionSpec = JavaConverters.mapAsJavaMapConverter(... |
codereview_java_data_12908 | * exception occurs calling {@code supplier.get()}.
*/
static <T> Try<T> ofSupplier(Supplier<? extends T> supplier) {
- try {
- return new Success<>(supplier.get());
- } catch (Throwable t) {
- return new Failure<>(t);
- }
}
/**
Let's return `of(supp... |
codereview_java_data_12909 | this.password = password;
}
- public float getCurrentPlaybackSpeed() {
float speed = 0.0f;
if (!"global".equals(feedPlaybackSpeed)) {
I think this method should return some magic value if it is set to global speed (public static float SPEED_USE_GLOBAL=-1 etc). Currently, the UserPref... |
codereview_java_data_12913 | return false;
}
- if (!validateRoundChangeIsForCurrentHeightAndTargetsFutureRound(msg)) {
return false;
}
The correct check is pepareCertRound.getRoundNumber() < RounChnageMesage.getRoundChangeIdentifier().getRoundIdentifier()
return false;
}
+ final ConsensusRoundIdentifier ... |
codereview_java_data_12920 | contribution.setDescription("");
}
- String license = prefs.getString(Prefs.DEFAULT_LICENSE, null);
contribution.setLicense(license);
//FIXME: Add permission request here. Only executeAsyncTask if permission has been granted
`license` is nullable now. Add null checks befo... |
codereview_java_data_12921 | import org.thoughtcrime.securesms.util.Util;
public class ConversationUpdateItem extends LinearLayout
- implements Recipients.RecipientsModifiedListener, Recipient.RecipientModifiedListener, View.OnClickListener
{
private static final String TAG = ConversationUpdateItem.class.getSimpleName();
dupe code, throw... |
codereview_java_data_12922 | import java.util.Objects;
import java.util.concurrent.CompletableFuture;
-import software.amazon.awssdk.annotations.SdkPreviewApi;
-import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.transfer.s3.CompletedDirectoryUpload;
import software.amazon.awssdk.transfer.s3.DirectoryUpload;
... |
codereview_java_data_12928 | */
package tech.pegasys.pantheon.cli.custom;
import java.net.URI;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
should we have consts for these magic numbers?
*/
package tech.pegasys.pantheon.cli.custom;
+import static com.google.common.base.Preconditions.checkArgument;
+
+import tech.pegas... |
codereview_java_data_12929 | String videoType = "V_MPEG4/ISO/AVC";
String codecV = media.getCodecV();
- if (codecV != null && configuration.isUseMediaInfo()) {
if (codecV.equals(FormatConfiguration.MPEG2)) {
videoType = "V_MPEG-2";
} else if (codecV.equals(FormatConfiguration.H265)) {
Why do we need `isUseMediaInfo` here? That... |
codereview_java_data_12935 | if (!assignments.isEmpty()) {
Master.log.info(String.format("Assigning %d tablets", assignments.size()));
-
- for (Assignment assignment : assignments)
- store.setFutureLocation(assignment);
}
assignments.addAll(assigned);
for (Assignment a : assignments) {
It seems like this cod... |
codereview_java_data_12959 | public FlatModule toFlatModule(Module m) {
CheckListDecl.check(m);
- String name = m.getName();
- moduleName = name;
Set<org.kframework.definition.Sentence> items = m.getItems().stream()
.filter(j -> !(j instanceof org.kframework.kil.Import))
Can we just get rid of... |
codereview_java_data_12972 | .iterator();
while (iterator.hasNext()) {
String topic = iterator.next().getKey();
- if (topicList.getTopicList().contains(topic) || !specialTopic && (topic.startsWith(MixAll.RETRY_GROUP_TOPIC_PREFIX) || topic.startsWith(MixAll.DLQ_GROUP_TOPIC_PREFIX))) {
i... |
codereview_java_data_12994 | final KeyPair keyPair = KeyPair.generate();
return Transaction.builder()
- .nonce(0)
.gasPrice(privateTransaction.getGasPrice())
.gasLimit(privateTransaction.getGasLimit())
.to(getPrivacyPrecompileAddress())
Just to note - this can only be used in networks where the minimum ... |
codereview_java_data_12998 | private String shellCommandUserPlaceholder = "{USER}";
@JsonProperty
- private String shellCommandPidFile = ".shell_command_pid";
public SingularityExecutorConfiguration() {
super(Optional.of("singularity-executor.log"));
this is the PID file for the command that the shell command should operate on, rig... |
codereview_java_data_13004 | builder.setContentTitle(recipient.toShortString());
builder.setContentText(notifications.get(0).getText());
builder.setContentIntent(notifications.get(0).getPendingIntent(context));
- builder.setContentInfo(notificationState.getMessageCount()+"");
if (masterSecret != null) {
builder.addAct... |
codereview_java_data_13005 | private CompactionCoordinatorService.Client coordinatorClient;
private final String coordinatorMissingMsg =
"Error getting the compaction coordinator. Check that it is running. It is not "
- + "started automatically with other cluster processes so must be started by running"
- + "'accumul... |
codereview_java_data_13006 | .addBreadcrumb(PreferenceActivity.getTitleOfPage(R.xml.preferences_gpodder));
config.index(R.xml.preferences_notifications)
.addBreadcrumb(PreferenceActivity.getTitleOfPage(R.xml.preferences_notifications));
- config.index(R.xml.feed_settings)
- .addBread... |
codereview_java_data_13008 | /**
* Narrows the given {@code CheckedFunction8<? super T1, ? super T2, ? super T3, ? super T4, ? super T5, ? super T6, ? super T7, ? super T8, ? extends R>} to {@code CheckedFunction8<T1, T2, T3, T4, T5, T6, T7, T8, R>}
*
- * @param wideFunction A {@code CheckedFunction8}
* @param <R> return... |
codereview_java_data_13014 | /**
* HATest
*
- * @author yanglibo@qccr.com
- * @version HATest.java 2019年01月14日 17:34:31
*/
public class HATest {
private final String StoreMessage = "Once, there was a chance for me!";
It is better to remove "author" and "version" here.
/**
* HATest
*
*/
public class HATest {
private fina... |
codereview_java_data_13027 | }
/**
- * Utility for registring completable futures for cleanup if this EthTask is cancelled.
*
* @param <S> the type of data returned from the CompletableFuture
* @param subTaskFuture the future to be registered.
This creates a new future that is then immediately thrown away so I think this whole... |
codereview_java_data_13031 | public class Util {
- public static final String VERSION_HINT_TXT_FILENAME = "version-hint.text";
private static final Logger LOG = LoggerFactory.getLogger(Util.class);
+1 for creating a constant. I think we can drop `TXT` in the constant name, `VERSION_HINT_FILENAME` should be descriptive enough.
public class ... |
codereview_java_data_13037 | private final SparkSession spark;
private final JavaSparkContext sparkContext;
- private AtomicInteger counter = new AtomicInteger();
protected BaseSparkAction(SparkSession spark) {
this.spark = spark;
I think this can be final. I'd also call it `jobCounter` or something to be specific. If we decide to ... |
codereview_java_data_13039 | if (bl>contained.getBeginLine()) return false;
if (bl==contained.getBeginLine() && bc>contained.getBeginColumn()) return false;
if (container.getEndLine()<contained.getEndLine()) return false;
return !(container.getEndLine() == contained.getEndLine() && container.getE... |
codereview_java_data_13052 | .getSourceSets()
.matching(ss -> hasCompileDependenciesMatching(proj, ss, this::isJunitJupiter))
.forEach(ss -> {
- log.info("Detected 'org:junit.jupiter:junit-jupiter', enabling useJUnitPlatform()");
... |
codereview_java_data_13057 | @Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
public BlockComment asBlockComment() {
- return (BlockComment) this;
}
@Generated("com.github.javaparser.generator.core.node.TypeCastingGenerator")
this one could be empty I guess
@Generated("com.github.javapa... |
codereview_java_data_13061 | public void execute() {
try {
LOG.info("Starting Ethereum main loop ... ");
- Runtime.getRuntime().addShutdownHook(shutdownTask());
networkRunner.start();
pantheonController.getSynchronizer().start();
jsonRpc.ifPresent(service -> service.start().join());
I think this needs to b... |
codereview_java_data_13064 | assertEquals(i, key.get());
}
reader.close();
}
}
Will other test see this file?
assertEquals(i, key.get());
}
reader.close();
+
+ assertTrue(fs.delete(new Path(manyMaps, SortedLogState.FAILED.getMarker())));
}
} |
codereview_java_data_13065 | @JsonProperty("forcePullImage") Optional<Boolean> forcePullImage,
@JsonProperty("parameters") Optional<Map<String, String>> parameters,
@JsonProperty("dockerParameters") Optional<List<SingularityDockerParameter>> dockerParam... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.