id
stringlengths
23
26
content
stringlengths
182
2.49k
codereview_java_data_8857
import org.apache.accumulo.core.data.TableId; import org.apache.accumulo.core.dataImpl.KeyExtent; import org.apache.accumulo.core.metadata.RootTable; -import org.apache.accumulo.core.metadata.schema.*; import org.apache.accumulo.core.metadata.schema.TabletMetadata.ColumnType; -import org.apache.accumulo.core.metada...
codereview_java_data_8859
Type currentType = schema.asStruct(); while (pathIterator.hasNext()) { - if (currentType == null || !currentType.isStructType()) return false; String fieldName = pathIterator.next(); currentType = currentType.asStructType().fieldType(fieldName); } Style: control flow should always use...
codereview_java_data_8863
String topic = commandLine.getOptionValue("t").trim(); String timeStampStr = commandLine.getOptionValue("s").trim(); //when the param "timestamp" is set to now,it should return the max offset of this queue - long timestamp = timeStampStr.equals("now") ? -1 : 0; ...
codereview_java_data_8865
static final class isBasicAuthRequired implements Condition { @Override - public boolean matches(ConditionContext condition, AnnotatedTypeMetadata annotatedTypeMetadata) { - String userName = condition.getEnvironment().getProperty("zipkin.storage.elasticsearch.basic-auth-user-name"); - String passw...
codereview_java_data_8872
/** * Narrows the given {@code CheckedFunction0<? extends R>} to {@code CheckedFunction0<R>} * - * @param wideFunction A {@code CheckedFunction0} * @param <R> return type - * @return the given {@code wideFunction} instance as narrowed type {@code CheckedFunction0<R>} */ @Suppre...
codereview_java_data_8873
private final Optional<String> schedule; private final Optional<String> quartzSchedule; private final Optional<ScheduleType> scheduleType; - private final Optional<TimeZone> scheduledTimeZone; private final Optional<Long> killOldNonLongRunningTasksAfterMillis; private final Optional<Long> scheduledExpec...
codereview_java_data_8885
private final HazelcastInstance instance; private final ILogger logger; - private final IMap<Long, Integer> executionCounts; private final IMap<Long, JobRecord> jobRecords; private final IMap<Long, JobExecutionRecord> jobExecutionRecords; private final IMap<Long, JobResult> jobResults; This...
codereview_java_data_8902
this.instanceNumber = instanceNumber; builder.directory(workDir.toFile()); String workDirPath = workDir.toFile().getAbsolutePath(); - this.stdout = - Files.createFile(FileSystems.getDefault().getPath(workDirPath, "stdout_" + instanceNumber + ".log")).toFile(); - this.stderr = - Files.createFile(...
codereview_java_data_8905
db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEEDS + " ADD COLUMN " + PodDBAdapter.KEY_FEED_PLAYBACK_SPEED + " TEXT"); db.execSQL("ALTER TABLE " + PodDBAdapter.TABLE_NAME_FEED_MEDIA - + " ADD COLUMN " + PodDBAdapter.KEY_LAST_PLAYBACK_SPEED + " TEX...
codereview_java_data_8917
checkForFailures(); - if (startTime.compareAndSet(0, System.currentTimeMillis())) { List<GarbageCollectorMXBean> gcmBeans = ManagementFactory.getGarbageCollectorMXBeans(); for (GarbageCollectorMXBean garbageCollectorMXBean : gcmBeans) { Now that checkForFailures is not called in a synch block may...
codereview_java_data_8922
return readOnlyGroups; } - public boolean isBounceAfterScale() { - return bounceAfterScale.or(Boolean.FALSE).booleanValue(); } @Override You need one that is the Json getter that just returns the actual value. If you want to add a helper, you should @JsonIGnore it. return readOnlyGroups; } +...
codereview_java_data_8924
* ANY whenever possible.</p> */ public enum NullPolicy { - - /** Returns null if and only if all of the arguments are null; - * If all of the arguments are false return false otherwise true. */ - ALL, /** Returns null if and only if one of the arguments are null. */ STRICT, /** Returns null if one of ...
codereview_java_data_8929
listUsersResult = getUserpoolLL().listUsers(listUsersRequest); for (UserType user : listUsersResult.getUsers()) { if (USERNAME.equals(user.getUsername()) - || "bimin".equals(user.getUsername()) || "roskumr@amazon.com".equals(user.getUsername())) { ...
codereview_java_data_8936
final String children = tree.getChildren() .map(child -> toString(child, depth + 1)) .join(); - return String.format("%n%s%s%s", indent, value, children); } } ...
codereview_java_data_8941
public void toStringTest() { final NodeList<Name> list = nodeList(new Name("abc"), new Name("bcd"), new Name("cde")); - assertEquals("abcbcdcde", list.toString()); } } This could be instead be "[abc, bcd, cde]" with the changes I suggested public void toStringTest() { final No...
codereview_java_data_8943
cipher = new NullCipher(); } else { try { - cipher = Cipher.getInstance(cipherSuite, securityProvider); } catch (NoSuchAlgorithmException e) { log.error(String.format("Accumulo configuration file contained a cipher suite \"%s\" that was not recognized by any providers", cipherS...
codereview_java_data_8946
*/ void setVariable( String variableName, Object value ); KieRuntime getKieRuntime(); } \ No newline at end of file Can you add a `@Deprecated` annotation? What about also add a `getKogitoProcessRuntime()` method? If we can use this method instead of `getKieRuntime` we should be already on the safe si...
codereview_java_data_8947
import org.ehcache.clustered.common.messages.EhcacheEntityResponse; import org.ehcache.clustered.common.messages.EhcacheEntityResponse.Failure; import org.ehcache.clustered.common.messages.EhcacheEntityResponse.Type; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.terracotta.connection.entity....
codereview_java_data_8955
@Nullable public Map<String, String> getContinuation() { return continuation; } -} \ No newline at end of file Revert changes to this file. @Nullable public Map<String, String> getContinuation() { return continuation; } \ No newline at end of file +}
codereview_java_data_8957
import tech.pegasys.pantheon.tests.acceptance.dsl.node.Node; import java.io.IOException; -import javax.annotation.concurrent.Immutable; -@Immutable public class Blockchain { public Condition blockNumberMustBeLatest(final Node node) throws IOException { Might need a better name here as it's a little unclear wheth...
codereview_java_data_8967
T visit(LogicalTableModify modify) throws E; - T visit(T other) throws E; } Maybe we can add `T visit(RelNode other) throws E; too` T visit(LogicalTableModify modify) throws E; + T visit(RelNode other) throws E; }
codereview_java_data_8969
@RunWith(MockitoJUnitRunner.class) public class WithMockOidcUserSecurityContextTests { @Mock private WithMockOidcUser withUser; Would you please re-arrange the method names so that they look like `valueWhenUserNameIsNullThenDefaultsUserId`? In new classes, the team has standardized on `methodNameWhenCircumstance...
codereview_java_data_8971
remover.skipOnCompletion = true; int playerStatus = PlaybackPreferences.getCurrentPlayerStatus(); if(playerStatus == PlaybackPreferences.PLAYER_STATUS_PLAYING) { - sendBroadcast(new Intent( - ...
codereview_java_data_8991
Expression expressionObject = CommandContextUtil.getCmmnEngineConfiguration(commandContext).getExpressionManager().createExpression(expression); value = expressionObject.getValue(planItemInstanceEntity); if (resultVariable != null) { - if(storeResultVariableAsTransi...
codereview_java_data_8992
ByteString b0, long b1, BinaryOperator<Byte> bitOp) { final byte[] bytes0 = b0.getBytes(); - final byte[] result = new byte[bytes0.length]; for (int i = 0; i < bytes0.length; i++) { - result[i] = bitOp.apply((byte) (b1 >> 8 * (bytes0.length - i - 1)), bytes0[i]); } - return new ByteStri...
codereview_java_data_8995
public SimplePropertyDescriptor() { } - public SimplePropertyDescriptor(String name, Method readMethod, Method writeMethod, Field field) { this.name = name; this.readMethod = readMethod; this.writeMethod = writeMethod; - this.field = field; } public String getName() { Since you pass in n...
codereview_java_data_8996
// Use *only* for tracking the user preference change for EventLogging // Attempting to use anywhere else will cause kitten explosions public void log(boolean force) { - SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(application); - if (!settings.getBoolean(Prefs...
codereview_java_data_8998
lastRow = tablet.getExtent().toMetaRow(); if (loc != null) { - serverCounts.increment(loc.toString(), 1); } } This seems like a regression. In general, unless you're printing something, it's better to use a more specific type than a String type, and a more specific ...
codereview_java_data_9034
implements ServiceCreationConfiguration<ClusteringService>, CacheManagerConfiguration<PersistentCacheManager> { - private static final Collection<String> CLUSTER_SCHEMES = new HashSet<String>(Arrays.asList("terracotta", "passthrough")); private final URI clusterUri; private final boolean autoCreate; T...
codereview_java_data_9037
SortedPosDeleteWriter<Record> writer = new SortedPosDeleteWriter<>(appenderFactory, fileFactory, format, null, 100); try (SortedPosDeleteWriter<Record> closeableWriter = writer) { - for (int index = 0; index < rowSet.size(); index += 2) { closeableWriter.delete(dataFile.path(), index); } ...
codereview_java_data_9050
* @throws TableNotFoundException * if the table does not exist * @since 1.6.0 - * @deprecated since 2.1.0; use {@link #getConfiguration(String)} (String)} instead. */ - @Deprecated(since = "2.1.0") - Iterable<Entry<String,String>> getProperties(String tableName) - throws AccumuloExcep...
codereview_java_data_9062
private final HashMap<String/* topic */, List<QueueData>> topicQueueTable; private final HashMap<String/* brokerName */, BrokerData> brokerAddrTable; private final HashMap<String/* clusterName */, Set<String/* brokerName */>> clusterAddrTable; - private final Map<String/* brokerAddr */, BrokerLiveInfo...
codereview_java_data_9064
*/ package org.flowable.engine.impl.bpmn.behavior; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.List; -import static java.util.stream.Collectors.toList; import java.util.stream.Stream; import org.apache...
codereview_java_data_9091
private final ImageView icon; private final ImageView avatar; private final CheckBox checkBox; - private View parent; ContactFieldViewHolder(View itemView) { super(itemView); There's no need to hold an explicit reference to parent, since the super class exposes itemView as a public field...
codereview_java_data_9095
Map<String, Object> data = objectMapper.readValue(entry.getData(), new TypeReference<HashMap<String, Object>>() { }); - assertThat(data.get(Fields.PROCESS_DEFINITION_ID)).isNotNull(); - assertThat(data.get(Fields.PROCESS_INSTANCE_ID)).isNotNull(); - ...
codereview_java_data_9099
public abstract class StateHandler<STATE extends State<STATE, CONTEXT>, CONTEXT> { /** - * Holds the main logic of StateMachine State. * * @param context the {@link Context}. * @return the next State */ - protected abstract STATE getNextState(CONTEXT context) throws OpenemsNamedException; /** * Ge...
codereview_java_data_9111
String tenant, @RequestParam(value = "tag", required = false) String tag) throws IOException, ServletException, NacosException { - if (NAMESPACE_PUBLIC_KEY.equalsIgnoreCase(tenant)) { - tenant = ""; - } // check params ...
codereview_java_data_9116
/** * Remove the given map. * - * @param <K> the key type - * @param <V> the value type * @param map the map */ - <K, V> void removeMap(TransactionMap<K, V> map) { store.removeMap(map.map); } The type arguments can be removed. ```Java void removeMap(TransactionMap<...
codereview_java_data_9121
final SignedData<RoundChangePayload> msg) { if (!isMessageValid(msg)) { - LOG.error("RoundChange message was invalid."); return Optional.empty(); } probably not an error ... just can't use the message (typically pantheon treats malformed packets as bad, but not terrible, as there are so ma...
codereview_java_data_9127
PartitionField existingField = nameToField.get(newName); if (existingField != null && isVoidTransform(existingField)) { // rename the old deleted field that is being replaced by the new field - renameField(existingField.name(), existingField.name() + "_" + UUID.randomUUID()); } Partition...
codereview_java_data_9133
public static Monster getRootAsMonster(ByteBuffer _bb) { return getRootAsMonster(_bb, new Monster()); } public static Monster getRootAsMonster(ByteBuffer _bb, Monster obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); } public static Monster getS...
codereview_java_data_9144
platform = (Platform) getNativePlatform.invoke(null); } catch (Throwable t) { platform = null; - if (LOG.isDebugEnabled()) - LOG.debug("Could not load jnr.ffi.Platform class, this class will not be available.", t); - else - LOG.info( - "Could not loa...
codereview_java_data_9154
try { startFuture.get(60, TimeUnit.SECONDS); } catch (final InterruptedException e) { - LOG.debug("Interrupted while waiting for service to start", e); Thread.currentThread().interrupt(); - return; } catch (final ExecutionException e) { LOG.error("Service " ...
codereview_java_data_9157
try { logger.info(message.getContent().toString()); } catch (IOException ex) { - logger.error("Error occured while sending email: " + ex); } } I guess `logger.error("Error occurred while sending email", ex);` would be even better. What do you think? try { logger.info(message....
codereview_java_data_9166
return Iterables.getOnlyElement(tablets); } } - - public TableOptions readTablets() { - TableOptions builder = TabletsMetadata.builder(); - return builder; - } } The main difference with moving this Ampl is that the client can be supplied to the builder implementation at the beginning and the f...
codereview_java_data_9167
LayoutInflater inflater = LayoutInflater.from(container.getContext()); ViewGroup layout = (ViewGroup) inflater.inflate(PAGE_LAYOUTS[position], container, false); if( BuildConfig.FLAVOR == "beta"){ ViewHolder holder = new ViewHolder(layout); layout.setTag(holder); ...
codereview_java_data_9180
import tech.pegasys.pantheon.tests.acceptance.dsl.AcceptanceTestBase; import tech.pegasys.pantheon.tests.acceptance.dsl.account.Account; -import tech.pegasys.pantheon.tests.acceptance.dsl.condition.Condition; import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode; import java.io.IOException; Is a hard...
codereview_java_data_9181
try { TopicRouteData topicRouteData = this.mQClientAPIImpl.getTopicRouteInfoFromNameServer(topic, 1000 * 3); Map<String, BrokerData> brokerDataMap = new HashMap<>(); - for (BrokerData brokerData : topicRouteData.getBrokerDatas()) { - brokerDataMap.put(brokerD...
codereview_java_data_9182
} @Override - public List<Expression.OpType> getSupportedExpressionTypes() { LOG.info("[{}]: getSupportedExpressionTypes()", signature); - return Arrays.asList(OpType.OP_AND, OpType.OP_OR, OpType.OP_EQ, OpType.OP_NE, OpType.OP_NOT, OpType.OP_GE, OpType.OP_GT, OpType.OP_LE, OpType.OP_LT, OpType.O...
codereview_java_data_9183
Dataset<Row> validFileDF = validDataFileDF.union(validMetadataFileDF); Dataset<Row> actualFileDF = buildActualFileDF(); - Column joinCond = actualFileDF.col("file_path").contains(validFileDF.col("file_path")); List<String> orphanFiles = actualFileDF.join(validFileDF, joinCond, "leftanti") .as...
codereview_java_data_9193
setHint(ellipsizeToWidth(hint)); } } - setLayoutParams(getLayoutParams()); } private CharSequence ellipsizeToWidth(CharSequence text) { I haven't run this, but I feel like this will just constantly invalidate the layout, given that `setLayoutParams()` calls `requestLayout()` internally. ...
codereview_java_data_9198
* {@link NullPointerException}s for reasons that still require further investigation, but are assumed to be due to a * bug in the JDK. Propagating such NPEs is confusing for users and are not subject to being retried on by the default * retry policy configuration, so instead we bias towar...
codereview_java_data_9205
} private ChainDownloader downloader() { - final SynchronizerConfiguration syncConfig = SynchronizerConfiguration.builder().build(); return downloader(syncConfig); } @Test public void syncsToBetterChain_multipleSegments() { otherBlockchainSetup.importFirstBlocks(15); Should you set up these...
codereview_java_data_9226
} scanner.setRange(rangeSplit.getRange()); - - // do this last after setting all scanner options - scannerIterator = scanner.iterator(); scannerBase = scanner; } else if (split instanceof BatchInputSplit) { Duplicated call to `scanner.iterator()`. Looks like you do it do...
codereview_java_data_9231
private static final int STANDARD_DELAY_FINISH = 1000; public static final int BUSY_SIGNAL_DELAY_FINISH = 5500; - public static final String ANSWER_ACTION = RedPhone.class.getName() + ".ANSWER_ACTION"; - public static final String DENY_ACTION = RedPhone.class.getName() + ".DENY_ACTION"; - public stat...
codereview_java_data_9243
.with(requiresSecret), get("/se/grid/newsessionqueuer/queue/size") .to(() -> new GetNewSessionQueueSize(tracer, this)), - get("/se/grid/newsessionqueue") .to(() -> new GetSessionQueue(tracer, this)), delete("/se/grid/newsessionqueuer/queue") .to(() -> new ClearSess...
codereview_java_data_9248
} /** - * To get the data for Iceberg {@link Record}s we have to use the Hive ObjectInspectors (sourceInspector) to get - * the Hive primitive types and the Iceberg ObjectInspectors (writerInspector) also if conversion is needed for * generating the correct type for Iceberg Records. See: {@link WriteObjec...
codereview_java_data_9255
initGenerateXPathFromStackTrace(); EventStreams.valuesOf(xpathResultListView.getSelectionModel().selectedItemProperty()) .filter(Objects::nonNull) .subscribe(parent::onNodeItemSelected); There's a bug that shows up when selecting an XPath result, then trying ...
codereview_java_data_9259
private static final String PREFIX = "cv:"; private static final String IGNORE_KEY = "ignored"; - // map for computing summary incrementally stores information in efficient form private Map<ByteSequence,MutableLong> summary = new HashMap<>(); private long ignored = 0; Could use LongAddr on jdk8 privat...
codereview_java_data_9272
Constants.VERSION_MINOR < 4); /** - * System property {@code h2.oldResultSetGetObject}, {@code false} by default. * Return {@code Byte} and {@code Short} instead of {@code Integer} from * {@code ResultSet#getObject(...)} for {@code TINYINT} and {@code SMALLINT} * values. ...
codereview_java_data_9278
return CsvResolver.resolveFields(entry.keySet()); } - @Override - protected SupplierEx<QueryTarget> queryTargetSupplier(List<MappingField> resolvedFields) { - List<String> fieldMap = createFieldList(resolvedFields); - return () -> new CsvQueryTarget(fieldMap); - } - @Nonnull ...
codereview_java_data_9280
tablet.computeNumEntries(); - tablet.resetLastLocation(); tablet.setLastCompactionID(compactionId); t2 = System.currentTimeMillis(); This seems likely where the actual lastLocation information is lost. tablet.computeNumEntries(); + lastLocation = tablet.resetLastLocation(); ...
codereview_java_data_9282
@Override public GenericToken getNext() { - // not required - return null; } @Override Please either implement this or throw `NotImplementedException` (from lang3) or `UnsupportedOperationException` @Override public GenericToken getNext() { + throw new UnsupportedOpe...
codereview_java_data_9284
public class Main { - public static final long startTime = System.currentTimeMillis(); - /** * @param args * - the running arguments for the K3 tool. First argument must be one of the following: kompile|kast|krun. this is not going to play nice with the k server. Can you please put this...
codereview_java_data_9286
import java.util.concurrent.TimeUnit; import static com.amazonaws.mobile.auth.core.internal.util.ThreadUtils.runOnUiThread; -import static com.amazonaws.mobile.client.AWSMobileClientPersistenceTest.PASSWORD; import static com.amazonaws.mobile.client.AWSMobileClientTest.USERNAME; import static org.junit.Assert.asser...
codereview_java_data_9292
@JsonProperty("oldestDeployStep") long oldestDeployStep, @JsonProperty("activeDeploys") List<SingularityDeployMarker> activeDeploys, @JsonProperty("lateTasks") int lateTasks, - @JsonProperty("listLateTasks") List<S...
codereview_java_data_9295
prep.setObject(2, "D", Types.VARCHAR); prep.executeUpdate(); prep.setInt(1, 5); - prep.setObject(2, 4, Types.INTEGER); prep.executeUpdate(); ResultSet rs = stat.executeQuery("SELECT * FROM TEST ORDER BY ID"); if setObject(foo, enum or geometry, Types.OTHER) no longer...
codereview_java_data_9296
import software.amazon.awssdk.extensions.dynamodb.mappingclient.model.BatchWriteResult; import software.amazon.awssdk.extensions.dynamodb.mappingclient.model.TransactGetItemsEnhancedRequest; import software.amazon.awssdk.extensions.dynamodb.mappingclient.model.TransactWriteItemsEnhancedRequest; -import software.amaz...
codereview_java_data_9300
*/ package org.kie.kogito.monitoring.prometheus.common.rest; public interface MetricsResource { } Is this marker interface necessary? */ package org.kie.kogito.monitoring.prometheus.common.rest; +/** + * This class must always have exact FQCN as <code>org.kie.kogito.monitoring.prometheus.common.rest. MetricsR...
codereview_java_data_9313
@Override public String[] preferredLocations() { - if (!enableLocality) { return new String[0]; } Any chance `getFileBlockLocations ` returns `null` so we'd end up with a NPE for `b.getHosts()`? @Override public String[] preferredLocations() { + if (!localityPreferred) { ...
codereview_java_data_9319
return devMode; } - public boolean isDiscovery() { - return discovery; } PermissioningConfiguration getPermissioningConfiguration() { isDiscovery() or discoveryEnabled() ? return devMode; } + public boolean isDiscoveryEnabled() { + return discoveryEnabled; } PermissioningConfigurat...
codereview_java_data_9344
private boolean isFullInstantiation() { return !isDocker; } - - private MetricsSystem supplyMetricSystem() { - if (rpcApis.contains(RpcApis.METRICS)) { - return PrometheusMetricsSystem.init(); - } else { - return new NoOpMetricsSystem(); - } - } } Instead of overloading the rpc apis co...
codereview_java_data_9355
private static final String TAG_NOTIFICATION_WORKER_FRAGMENT = "NotificationWorkerFragment"; private NotificationWorkerFragment mNotificationWorkerFragment; - private boolean mIsRestoredToTop; @Override protected void onCreate(Bundle savedInstanceState) { I think this one escaped private s...
codereview_java_data_9359
AppAdapter.get().getPassword(), ""); } - //Get CSRFToken response off the main thread. - Response<MwQueryResponse> response = Executors.newSingleThreadExecutor().submit(new getCSRFTokenResponse(service)).get(); if (response.bod...
codereview_java_data_9361
private final static String DEPLOYER_PREFIX = "deployer."; private final static String COMMAND_ARGUMENT_PREFIX = "cmdarg."; private final static String DATA_FLOW_URI_KEY = "spring.cloud.dataflow.client.serverUri"; - private final static String KUBERNETES = "kubernetes"; private final static int MAX_SCHEDULE_NAM...
codereview_java_data_9365
if (!StringUtils.hasText(ldif)) { throw new IllegalArgumentException("Unable to load LDIF " + ldif); } - if (!ldif.endsWith(".ldif")) { - throw new IllegalArgumentException("Unable to load LDIF " + ldif); - } } public int getPort() { Please remove this check. We do not require the file to have a ".ld...
codereview_java_data_9366
package com.palantir.baseline.errorprone; -import com.google.errorprone.BugCheckerRefactoringTestHelper; import com.google.errorprone.CompilationTestHelper; import org.junit.Test; import org.junit.jupiter.api.parallel.Execution; one more nit: mind using our `RefactoringValidator` instead of `BugCheckerRefactoringT...
codereview_java_data_9368
} URL resource = this.getClass().getResource(fileName); if (resource != null) { - return Files.size(Paths.get(this.getClass().getResource(fileName).toURI())); } else { return 0; } why not just `...
codereview_java_data_9369
public class GenesisConfigOptions { private static final String IBFT_CONFIG_KEY = "ibft"; private static final String CLIQUE_CONFIG_KEY = "clique"; private final JsonObject configRoot; is there a reason this doesn't do the same as IBFT/clique with regard a class constant? public class GenesisConfigOptions ...
codereview_java_data_9380
resilienceStrategy.possiblyInconsistent(key, e, e1); } } - return inCache == value ? null : inCache; } @Override I think this is dodgy. At least for the case when the value of `inCache` is loaded from SOR (and possibly for stores that use serialization/copying for values, regardless of th...
codereview_java_data_9381
}); /** - * Constructore that attaches gossip logic to a set of peers * * @param peers The always up to date set of connected peers that understand IBFT */ nit: typo for constructor }); /** + * Constructor that attaches gossip logic to a set of peers * * @param peer...
codereview_java_data_9387
if (this.recipients != null) { recipientsPanel.addRecipients(this.recipients); } else { - InputMethodManager input = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE); - input.toggleSoftInput(InputMethodManager.SHOW_FORCED, 0); } } Two space indents please. Shoul...
codereview_java_data_9391
@BeforeClass public static void startMetastore() throws Exception { HiveMetastoreTest.metastore = new TestHiveMetastore(); - metastore.start(new HiveConf(HiveMetastoreTest.class)); HiveMetastoreTest.hiveConf = metastore.hiveConf(); HiveMetastoreTest.metastoreClient = new HiveMetaStoreClient(hive...
codereview_java_data_9392
* false} otherwise */ public boolean contentEquals(CharSequence cs) { - return toString().contentEquals(cs); } /** Could be ``` Java delegate.map(Character::toLowerCase).equals(that.delegate.map(Character::toLowerCase)) ``` also, but this should be a lot more optimal (it can short cir...
codereview_java_data_9406
} } if (node instanceof MethodCallExpr) { - Optional<ResolvedMethodDeclaration> result = JavaParserFacade.get(typeSolver) .solve((MethodCallExpr) node) .getCorrespondingDeclaration(); - if (result.isPresent()) { - ...
codereview_java_data_9412
() -> { try { return createRemotes(); - } catch (URISyntaxException | SSLException | CertificateException e) { throw new RuntimeException(e); } }, Nit please alphabetise. () -> { try { return createRemotes(); +...
codereview_java_data_9418
private void getTagline() { OpenFoodAPIService openFoodAPIService = new OpenFoodAPIClient(getActivity(), "https://ssl-api.openfoodfacts.org").getAPIService(); - Call<ArrayList<TaglineLanguageModel>> call = openFoodAPIService.getTagline(getString(R.string.app_name) + " " + Utils.getUserAgent("OTHERS...
codereview_java_data_9425
package org.openqa.selenium; /** - * Created by James Reed on 11/04/2016. * Thrown to indicate that a click was attempted on an element but was intercepted by another * element on top of it */ We keep who wrote the code anonymous. package org.openqa.selenium; /** * Thrown to indicate that a click was atte...
codereview_java_data_9428
if (StringUtils.isBlank(userName)) { return; } - wikidataEditsText.setText(String.valueOf(0)); compositeDisposable.add(okHttpJsonApiClient .getWikidataEdits(userName) .subscribeOn(Schedulers.io()) Is there a reason why you use `String.val...
codereview_java_data_9438
return getProject() .provider(() -> getProject().getConvention().getPlugin(JavaPluginConvention.class).getSourceSets().stream() - .filter(ss -> !ss.getName().equals(IGNORE_MAIN_CONFIGURATION)) .map(SourceS...
codereview_java_data_9439
} /** SQL {@code string compare string} operator. */ - public static Integer strcmp(String s0, String s1) { return s0.compareTo(s1); } I thin It is better to return `int` instead of `Integer`. } /** SQL {@code string compare string} operator. */ + public static int strcmp(String s0, String s1) {...
codereview_java_data_9445
@NonNull Uri uri, @NonNull String defaultMime, long size, ...
codereview_java_data_9446
public static void main(String... a) throws Exception { TestBase test = TestBase.createCaller().init(); // test.config.traceTest = true; - FilePathEncrypt.register(); - for (int i = 0; i < 100; i++) { - ((TestFileSystem)test).testConcurrent("encrypt:0007:" + test.getBaseD...
codereview_java_data_9448
if (trieNode.isReferencedByHash()) { // If child nodes are reference by hash, we need to download them final Hash hash = Hash.wrap(trieNode.getHash()); - if (hash.equals(MerklePatriciaTrie.EMPTY_TRIE_NODE_HASH) || hash.equals(BytesValue.EMPTY)) { return Stream.empty(); } f...
codereview_java_data_9468
@Parameter(names="--md-selector", description="Preprocessor: for .md files, select only the md code blocks that match the selector expression. Ex:'k&(!a|b)'.") public String mdSelector = "k"; - - @Parameter(names="--profile-rule-parsing", description="Generate time in seconds to parse each rule in the sema...
codereview_java_data_9471
*/ updater.updateState(download.id, TransferState.WAITING_FOR_NETWORK); LOGGER.debug("Network Connection Interrupted: " + "Moving the TransferState to WAITING_FOR_NETWORK"); progressListener.progressChanged(new ProgressEvent(0)); ...
codereview_java_data_9481
*/ package org.apache.calcite.rel.rel2sql; -import org.apache.calcite.linq4j.Ord; import org.apache.calcite.linq4j.tree.Expressions; import org.apache.calcite.rel.RelFieldCollation; import org.apache.calcite.rel.RelNode; what's the difference just use A.class ? */ package org.apache.calcite.rel.rel2sql; imp...
codereview_java_data_9488
} else { // The current user has no credentials, let it fail naturally at the RPC layer (no ticket) // We know this won't work, but we can't do anything else - log.warn("The current user is a proxy user but there is no underlying real user (RPCs will fail): {}", c...
codereview_java_data_9523
* Call with the user's response to the sign-in challenge. * * @param signInChallengeResponse obtained from user * @return the result containing next steps or done. * @throws Exception */ This would be a breaking change in terms of compilation for a publicly available API. Would pref...
codereview_java_data_9541
try { String commaSeparatedUids = ImapUtility.join(",", uidWindow); String command = String.format("UID FETCH %s (%s)", commaSeparatedUids, spaceSeparatedFetchFields); - Timber.d("Sending command "+command); connection.sendCommand(command, f...