id stringlengths 23 26 | content stringlengths 182 2.49k |
|---|---|
codereview_java_data_9543 | private Date lastSeen;
private String barcode;
- public HistoryProduct() {}
-
public HistoryProduct(String title, String brands, String url, String barcode) {
this.title = title;
this.brands = brands;
you could remove the default constructor right ?
private Date lastSeen;
... |
codereview_java_data_9549 | */
public void setCurrentGroupExprData(Expression expr, Object obj) {
if (cachedLookup == expr) {
- assert currentGroupByExprData[cachedLookupIndex] != null;
currentGroupByExprData[cachedLookupIndex] = obj;
}
Integer index = exprToIndexInGroupByData.get(expr... |
codereview_java_data_9557 | import org.apache.zookeeper.KeeperException;
import org.apache.zookeeper.KeeperException.NoNodeException;
import org.apache.zookeeper.KeeperException.NotEmptyException;
public class ZooQueueLock implements QueueLock {
- private static final String PREFIX = "zlock#" + UUID.randomUUID() + "#";
private ZooReaderWr... |
codereview_java_data_9568 | public ApplicationGenerator withAddons(AddonsConfig addonsConfig) {
if (addonsConfig.useMonitoring()) {
- this.labelers.add(new PrometheusLabeler());
}
return this;
}
Side note because it is not related to this PR. This code is quite error prone, if `withAddons` is invok... |
codereview_java_data_9570 | * populated list of locks held by transaction - or an empty map if none.
* @return current fate and lock status
*/
- public FateStatus getTransactionStatus(ReadOnlyTStore<T> zs, Set<Long> filterTxid,
EnumSet<TStatus> filterStatus, Map<Long,List<String>> heldLocks,
Map<Long,List<Strin... |
codereview_java_data_9572 | Package timePackage = pkg.getDependencies().get(0);
assertThat(timePackage).isNotNull();
- assertThat(timePackage.getConfigValues().getRaw()).contains("\"foo.expression\": \"\\\\\\\\d\"");
assertThat(timePackage.getConfigValues().getRaw()).contains("\"bar\": \"\\\\d\"");
- assertThat(timePackage.getConfigVal... |
codereview_java_data_9574 | "ArrayEquals",
"MissingOverride",
"UnnecessaryParentheses",
- "PreferJavaTimeOverload",
- "UnnecessaryLambda");
private final ListProperty<String> patchChecks;
I recall this creating code that didn't compile, might want to test it on something large and... |
codereview_java_data_9578 | @Override
public void handleRoundChangePayload(final RoundChange message) {
final ConsensusRoundIdentifier targetRound = message.getRoundIdentifier();
- LOG.trace("Received a RoundChange Payload for {}", targetRound.toString());
final MessageAge messageAge =
determineAgeOfPayload(message.get... |
codereview_java_data_9581 | link = "https://github.com/palantir/gradle-baseline#baseline-error-prone-checks",
linkType = LinkType.CUSTOM,
severity = SeverityLevel.SUGGESTION,
- summary = "Avoid default cases in switch statements to correctly handle new enum variants")
public final class SwitchStatementDefaultCas... |
codereview_java_data_9585 | */
@Nonnull
public static <K, V> ServiceFactory<?, ReplicatedMap<K, V>> replicatedMapService(@Nonnull String mapName) {
- return ServiceFactory.withCreateContainerFn(ctx -> ctx.jetInstance().<K, V>getReplicatedMap(mapName))
.withCreateServiceFn((ctx, map) -> map);
... |
codereview_java_data_9591 | private UploadContract.View view = DUMMY;
private CompositeDisposable compositeDisposable;
- public static final String COUNTER_OF_NO_LOCATION
- = "how_many_consecutive_uploads_have_no_coordinates";
@Inject
@misaochan Do we have a convention for these store key values? I think there was an iss... |
codereview_java_data_9595 | }
private T getSessionCatalog() {
- Preconditions.checkNotNull(sessionCatalog, "Delegated SessionCatalog is not provided by Spark. " +
- "Please make sure you are replacing Spark's default catalog.");
return sessionCatalog;
}
}
How about adding the name of the session catalog, like this: "Plea... |
codereview_java_data_9603 | public class CompactorInfo {
// Variable names become JSON keys
- public long lastContact;
- public String server;
- public String queueName;
public CompactorInfo(long fetchedTimeMillis, String queue, String hostAndPort) {
lastContact = System.currentTimeMillis() - fetchedTimeMillis;
Should these public... |
codereview_java_data_9621 | }
private void validatePercentileFunctions(SqlCall call) {
- // Percentile functions must have a single argument in the order by clause
if (call.getOperandList().size() == 2) {
SqlBasicCall sqlBasicCall = null;
SqlNodeList list = null;
Is it necessary to hard-code the SqlKind values here? O... |
codereview_java_data_9622 | package org.apache.rocketmq.common.protocol.body;
-import org.apache.rocketmq.common.protocol.body.QueryCorrectionOffsetBody;
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... |
codereview_java_data_9631 | nodeNameToXPaths.clear();
addQueryToNode(originalXPath, AST_ROOT);
if (LOG.isLoggable(Level.FINE)) {
- LOG.log(Level.FINE, "Unable to use RuleChain for for XPath: " + xpath);
}
}
Duplicate "for" in the message
nodeNameToXPaths.cl... |
codereview_java_data_9654 | // Combined with criteria
TokenQuery query = idmIdentityService.createTokenQuery().userAgentLike("%firefox%").orderByTokenDate().asc();
List<Token> tokens = query.list();
- assertThat(tokens).hasSize(2);
- assertThat(tokens.get(0).getUserAgent()).isEqualTo("firefox");
- a... |
codereview_java_data_9656 | this.sw = sw;
if (kompileOptions.backend.equals("ocaml")) {
- kem.registerCriticalWarning(ExceptionType.DEPRECATED_BACKEND, "The OCaml backend is in the process of being deprecated (final date May 31, 2020). Please switch to the LLVM backend.");
}
}
Is there much use in disti... |
codereview_java_data_9664 | stream(modules).forEach(m -> stream(m.localSentences()).forEach(new CheckHOLE(errors, m)::check));
- stream(modules).forEach(m -> stream(m.localSentences()).forEach(new CheckTokens(errors, m, isSymbolic && isKast)::check));
stream(modules).forEach(m -> stream(m.localSentences()).forEach(new Che... |
codereview_java_data_9665 | legacyIndex.contentType(MediaType.HTML_UTF_8).cacheControl(maxAgeMinute);
lensIndex.contentType(MediaType.HTML_UTF_8).cacheControl(maxAgeMinute);
return new IndexSwitchingService(
legacyIndex.build().asService(), lensIndex.build().asService());
}
Our JS/CSS bundles get a hash appended right?
... |
codereview_java_data_9667 | Service singleton = ServiceManager.getInstance().getSingleton(service);
Client client = clientManager.getClient(clientId);
if (null == client || !client.isEphemeral()) {
return;
}
InstancePublishInfo instanceInfo = getPublishInfo(instance);
abstract a method na... |
codereview_java_data_9675 | final boolean devMode,
final Function<Collection<PantheonNode>, Optional<String>> genesisConfig)
throws IOException {
- final Path homeDirectory = Files.createTempDirectory("acctest");
this.name = name;
- this.homeDirectory = homeDirectory;
this.keyPair = KeyPairUtil.loadKeyPair(hom... |
codereview_java_data_9683 | }
// DEV-NOTE: Use this method for non-infinite and direct-access collection only
// see https://github.com/vavr-io/vavr/issues/2007
@SuppressWarnings("unchecked")
static <T, S extends IndexedSeq<T>> S dropRightUntil(S seq, Predicate<? super T> predicate) {
Could you rather add a little explan... |
codereview_java_data_9685 | Cursor cursor = DatabaseFactory.getImageDatabase(c).getImagesForThread(threadId);
List<SaveAttachmentTask.Attachment> attachments = new ArrayList<>(cursor.getCount());
- cursor.moveToFirst();
- do {
ImageRecord record = Ima... |
codereview_java_data_9688 | return findRecursive(first, last);
}
setupQueryParameters(session, first, last, intersection);
- query.setNeverLazy(true);
ResultInterface result = query.query(0);
return new ViewCursor(this, result, first, last);
}
All the subqueries will become never-lazy ... |
codereview_java_data_9689 | maxValue >= value &&
maxValue > minValue &&
increment != 0 &&
- // Math.abs(increment) < maxValue - minValue
// Can use Long.compareUnsigned() on Java 8
- Math.abs(increment) + Long.MIN_VALUE < maxValue - minValue + Long.MIN_VALUE;
}
pr... |
codereview_java_data_9694 | private void reportUnnecessaryModifiers(Object data, Node node,
Modifier unnecessaryModifier, String explanation) {
- reportUnnecessaryModifiers(data, node, Collections.singletonList(unnecessaryModifier), explanation);
}
private void reportUnnecessaryMo... |
codereview_java_data_9701 | private static final String SQL_LAST_INSERT_ID = "SELECT LAST_INSERT_ID();";
private static final String SQL_INSERT_ROLE_MEMBER = "INSERT INTO role_member (role_id, principal_id, expiration, active) VALUES (?,?,?,?);";
private static final String SQL_DELETE_ROLE_MEMBER = "DELETE FROM role_member WHERE ro... |
codereview_java_data_9703 | public void remoteConnectionsPercentageWithInvalidFormatMustFail() {
parseCommand(
- "--remote-connections-limit-enabled",
- "--remote-connections-percentage",
- "not-a-percentage");
verifyZeroInteractions(mockRunnerBuilder);
assertThat(commandOutput.toString()).isEmpty();
as... |
codereview_java_data_9729 | // set manual x bounds to have nice steps
graphData.formatAxis(fromTime, endTime);
- // insulin activity
- graphData.addActivity(fromTime, endTime, graphData.maxY);
// Treatments
graphData.addTreatments(fromTime, endTime);
make it conditional li... |
codereview_java_data_9730 | import ws.com.google.android.mms.pdu.PduPart;
public class AttachmentDownloadJob extends MasterSecretJob implements InjectableType {
-
- private static final String TAG = AttachmentDownloadJob.class.getSimpleName();
@Inject transient TextSecureMessageReceiver messageReceiver;
If you have to do this, you have to ... |
codereview_java_data_9733 | "\" with \"" + definitionFileName.substring(0, definitionFileName.length() - 2) + ".md\".", di);
}
- ArrayList<File> allLookupDirectoris = new ArrayList<>(lookupDirectories);
- allLookupDirectoris.add(1, currentDirectory);
- Optional... |
codereview_java_data_9740 | private CharSeqComparator() {
}
- private boolean isCharInUTF16HighSurrogateRange(char c1) {
- if (c1 >= '\uD800' && c1 <= '\uDBFF') { // High surrogate pair range is U+D800—U+DBFF
- return true;
- }
- return false;
- }
-
/**
* Java character supports only upto 3 byte UT... |
codereview_java_data_9741 | import java.util.concurrent.atomic.AtomicInteger;
import java.util.stream.Stream;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
public abstract class NodeDataRequest {
- private static final Logger LOG = LogManager.getLogger();
private final RequestType requestType;
p... |
codereview_java_data_9743 | */
public class SourceEditorController implements Initializable, SettingsOwner {
- private final DesignerApp designerApp;
private final MainDesignerController parent;
@FXML
I see no reason to even think about disabling syntax highlighting.
*/
public class SourceEditorController implements Initializ... |
codereview_java_data_9750 | * @return {@code true} if notifications are persistent, {@code false} otherwise
*/
public static boolean setLockscreenBackground() {
- return prefs.getBoolean(PREF_LOCKSCREEN_BACKGROUND, false);
}
/**
I think 'false' needs to get changed to true. For some reason the 'default' in the ... |
codereview_java_data_9751 | createAndInitSourceTable(sourceName);
append(targetName, new Employee(1, "emp-id-one"), new Employee(6, "emp-id-6"));
append(sourceName, new Employee(2, "emp-id-2"), new Employee(1, "emp-id-1"), new Employee(6, "emp-id-6"));
- String sqlText = "MERGE INTO " + targetName + " AS target \n" +
- ... |
codereview_java_data_9760 | "session closed");
}
Command command;
- if (queryCache != null) {
- synchronized (queryCache) {
long newModificationMetaID = database.getModificationMetaId();
if (newModificationMetaID != modificationMetaID) {
... |
codereview_java_data_9763 | }
public static TomlParseResult loadConfiguration(final String toml) {
- TomlParseResult result;
- result = Toml.parse(toml);
if (result.hasErrors()) {
final String errors =
Any reason this wasn't a single line?
}
public static TomlParseResult loadConfiguration(final String toml) {
+ ... |
codereview_java_data_9764 | return command;
}
- void releaseDatabaseObjectId(int id) {
idsToRelease.set(id);
}
this method has a verb form i.e. "do it now", perhaps a better name, something like "markDatabaseObjectIdForDelayedRelease" or something else equally obvious
return command;
}
+ /**
+ ... |
codereview_java_data_9770 | try {
remembered.shutdown();
} catch (Throwable t) {
- System.err.println("Client shutdown failed with:");
t.printStackTrace();
}
}
Shouldn't we use the `LOGGER` that's in the class?
... |
codereview_java_data_9781 | import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.List;
-import javax.inject.Inject;
import javax.xml.transform.TransformerException;
import org.gradle.api.DefaultTask;
import org.gradle.api.Project;
It's probably fine to use this method, but Gradle regards these `G` prefixed... |
codereview_java_data_9798 | Pattern jpegPattern = Pattern.compile("\\.jpeg$", Pattern.CASE_INSENSITIVE);
// People are used to ".jpg" more than ".jpeg" which the system gives us.
- if (extension != null && extension.toLowerCase(Locale.US).equals("jpeg")) {
extension = "jpg";
}
title = jpegPa... |
codereview_java_data_9801 | public static ProcessorMetaSupplier writeObservableSupplier(@Nonnull String name) {
return new ProcessorMetaSupplier() {
- private final Map<Object, Object> tags = Collections.singletonMap(
ObservableUtil.OWNED_OBSERVABLE,
name
);
... |
codereview_java_data_9804 | @Override
protected void onResume() {
- dynamicTheme.onCreate(this);
super.onResume();
}
I haven't actually tested the code... but: 1. should use `onResume` here? 2. in `RegistrationActivity` there is no call to `dynamicTheme.onResume`
@Override
protected void onResume() {
+ dynamicTheme.onR... |
codereview_java_data_9807 | // Create a test table with multiple versions
TableIdentifier tableId = TableIdentifier.of("tbl");
Table table = catalog.createTable(tableId, SCHEMA, PartitionSpec.unpartitioned());
DataFile dataFile1 = DataFiles.builder(SPEC)
.withPath("/a.parquet")
I don't think this is correct. If the h... |
codereview_java_data_9819 | * Demonstrates the usage of observable results on client side in their
* {@link CompletableFuture} form (applicable only to batch jobs).
* <p>
- * The concrete job we are observing the results of is a simple Word Count.
* It inserts the text of The Complete Works of William Shakespeare into a
* Hazelcast IMap... |
codereview_java_data_9826 | return websocket -> {
final SocketAddress socketAddress = websocket.remoteAddress();
final String connectionId = websocket.textHandlerID();
- String token = getToken(websocket);
- LOG.trace("token {}", token);
LOG.debug("Websocket Connected ({})", socketAddressAsString(socketAddress)... |
codereview_java_data_9827 | return saslSupplier.get();
}
- public synchronized static BatchWriterConfig getBatchWriterConfig(Properties props) {
BatchWriterConfig batchWriterConfig = new BatchWriterConfig();
Long maxMemory = ClientProperty.BATCH_WRITER_MEMORY_MAX.getBytes(props);
Synchronized should go with the instance method... |
codereview_java_data_9834 | if (statement instanceof MySqlPrepareStatement) {
String simpleName = ((MySqlPrepareStatement) statement).getName().getSimpleName();
nameSet.add(simpleName);
- rwSplitService.setTxStart(true);
}
if (statement instanceof MysqlDealloc... |
codereview_java_data_9856 | package com.hazelcast.jet.core;
import com.hazelcast.jet.JetInstance;
-import com.hazelcast.jet.JetTestInstanceFactory;
import com.hazelcast.jet.Job;
import com.hazelcast.jet.Observable;
import com.hazelcast.jet.function.Observer;
why not use `JetTestSupport` ?
package com.hazelcast.jet.core;
import com.hazelc... |
codereview_java_data_9869 | String ELEMENT_SCROLL_BEHAVIOR = "elementScrollBehavior";
String HAS_TOUCHSCREEN = "hasTouchScreen";
String OVERLAPPING_CHECK_DISABLED = "overlappingCheckDisabled";
- String ENABLE_DOWNLOADING = "chromium:enableDownloading";
String LOGGING_PREFS = "loggingPrefs";
The name `enableDownloading` implies this ... |
codereview_java_data_9879 | Optional<BytesValue> getNodeData(Hash hash);
- // TODO: look into optimizing this call in implementing classes
default boolean contains(final Hash hash) {
return getNodeData(hash).isPresent();
}
Jira subtask to track this todo? That said, it looks like the optimisation potential is fairly limited with R... |
codereview_java_data_9888 | /** Executes the task while timed by a timer. */
public void executeTaskTimed() {
final OperationTimer.TimingContext timingContext = taskTimer.startTimer();
- executeTask();
- taskTimeInSec = timingContext.stopTimer();
}
public double getTaskTimeInSec() {
We should probably use the `try (final O... |
codereview_java_data_9891 | }
public void setParameters(List<Parameter> parameters) {
this.parameters = parameters;
- setAsParentNodeOf(this.parameters);
}
public Statement getBody() {
What happens if parameters is null?
}
public void setParameters(List<Parameter> parameters) {
+ setAsParentNodeOf(parameters);
this.parameter... |
codereview_java_data_9895 | stream(modules).forEach(m -> stream(m.localSentences()).forEach(new CheckHOLE(errors, m)::check));
- if (!(isSymbolic && isKast)) {
stream(modules).forEach(m -> stream(m.localSentences()).forEach(new CheckTokens(errors, m)::check));
}
```suggestion if (!(isSymbolic && isKast)) { /... |
codereview_java_data_9896 | package org.thoughtcrime.securesms.color;
import org.thoughtcrime.securesms.util.Util;
import java.util.Map;
seems like we can avoid this whole ThemeType thing all together by having a `<attr name="materialWeight" format="string|reference" />` or something that is "900" or "500" per theme and resolving it just like... |
codereview_java_data_9899 | import java.util.List;
import java.util.Optional;
import javax.lang.model.element.Modifier;
-import software.amazon.awssdk.awscore.protocol.query.AwsQueryProtocolFactory;
import software.amazon.awssdk.codegen.model.intermediate.IntermediateModel;
import software.amazon.awssdk.codegen.model.intermediate.Metadata;
... |
codereview_java_data_9901 | signupButton.setOnClickListener(view -> signUp());
if(BuildConfig.FLAVOR == "beta"){
- loginCredentials.setText("Use Commons Beta Credentials");
} else {
loginCredentials.setVisibility(View.GONE);
}
Can you please move this into strings.xml, so that we can ge... |
codereview_java_data_9903 | import org.flowable.common.engine.impl.util.CollectionUtil;
import org.flowable.engine.ProcessEngineConfiguration;
import org.flowable.engine.history.HistoricActivityInstance;
-import org.flowable.engine.repository.MergeMode;
import org.flowable.engine.impl.test.HistoryTestHelper;
import org.flowable.engine.impl.t... |
codereview_java_data_9906 | }
default String getNameAsString(){
- return getName().getId();
}
}
Good :D I wanted to suggest this one and I forgot
}
default String getNameAsString(){
+ return getName().getIdentifier();
}
} |
codereview_java_data_9909 | return getName().hashCode();
}
- ImapStore getStore() {
return store;
}
protected String getLogId() {
String id = store.getStoreConfig().toString() + ":" + getName() + "/" + Thread.currentThread().getName();
if (connection != null) {
Why is this necessary?
... |
codereview_java_data_9917 | * @param place place which is bookmarked
* @param isBookmarked true is bookmarked, false if bookmark removed
*/
public static void updateMarkerLabelListBookmark(Place place, boolean isBookmarked) {
for (ListIterator<MarkerPlaceGroup> iter = markerLabelList.listIterator(); iter.hasNext();... |
codereview_java_data_9918 | set("parquet.avro.write-old-list-structure", "false");
MessageType type = ParquetSchemaUtil.convert(schema, name);
- // Check that our metrics make sense
- metricsConfig.validateProperties(schema);
-
if (createWriterFunc != null) {
Preconditions.checkArgument(writeSupport == null... |
codereview_java_data_9922 | try (JarFile jarFile = new JarFile(jar)) {
if (StringUtil.isNullOrEmpty(mainClass)) {
if (jarFile.getManifest() == null) {
- error("No manifest file in " + jar);
}
mainClass = jarFile.getManifest().getMainAttributes().getValue("... |
codereview_java_data_9927 | return logger.getName();
}
- // FIXME: 2018/3/2
@Override
public boolean isEnabled(InternalLogLevel internalLogLevel) {
return nettyLogLevel.ordinal() <= internalLogLevel.ordinal();
How to fix this issue?
return logger.getName();
}
... |
codereview_java_data_9935 | */
private final ReentrantLock l;
- /*
- * Used as null value for ConcurrentSkipListSet
- */
- private final Entry<V> ENTRY_NULL = new Entry<>();
-
/**
* Create a new cache segment.
* @param maxMemory the maximum memory to use
I think it wo... |
codereview_java_data_9948 | */
package tech.pegasys.pantheon.ethereum.jsonrpc.internal.results.tracing;
-public interface Trace {
- @FunctionalInterface
- interface ResultWriter {
- void write(Trace trace);
- }
-}
Style: why an interface in an interface? I would expect just one interface `TraceResultWriter`
*/
package tech.pegasys.p... |
codereview_java_data_9952 | }
}
- if (request.getIncludeProcessVariables() != null) {
- if (request.getIncludeProcessVariables()) {
- taskQuery.includeProcessVariables();
}
}
I think `request` should be `queryRequest` instead.
}
}
+ if (que... |
codereview_java_data_9953 | }
public static Option startRowOpt() {
- final Option o = new Option(START_ROW_OPT, "begin-row", true, "begin row (NOT) inclusive");
o.setArgName("begin-row");
return o;
}
Parens should go around "(NOT inclusive)" instead of just "(NOT)". Personally, I prefer "(exclusive)".
}
public static... |
codereview_java_data_9961 | @Override
public int hashCode() {
- if (LoadDataBatch.getInstance().isEnableBatchLoadData() && !Objects.isNull(loadData) && !Strings.isNullOrEmpty(loadData.getFileName())) {
- return loadData.getFileName().hashCode();
- }
return name.hashCode();
}
maybe cause problems i... |
codereview_java_data_9969 | setContentView(getContentViewResourceId());
sbPosition = findViewById(R.id.sbPosition);
txtvPosition = findViewById(R.id.txtvPosition);
- seekDisplay = findViewById(R.id.seek_display);
SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE);
showTimeLeft =... |
codereview_java_data_9976 | }
}
- public void onDataSetInvalidated() {
- //Doing nothing as of now
- }
-
public interface MediaDetailProvider {
Media getMediaAtPosition(int i);
Removing these unused methods from the interface is a good idea.
}
}
public interface MediaDetailProvider {
... |
codereview_java_data_9982 | try (AccumuloClient c = Accumulo.newClient().from(getClientProperties()).build()) {
String tableName = getUniqueNames(1)[0];
c.instanceOperations().setProperty(Property.TABLE_DURABILITY.getKey(), "none");
- Map<String,String> props = c.tableOperations().getPropertiesMap(MetadataTable.NAME);
... |
codereview_java_data_9987 | return secretKeyBytes;
}
- public IdentifyPositionTypes getAuthorizationLocation() {
- authorizationLocation = IdentifyPositionTypes.valueOf(EnvUtil.getProperty("nacos.core.auth.authorizationLocation", ""));
- return authorizationLocation;
}
public String[] getAuthorityKey() {
-... |
codereview_java_data_9990 | if (undoLog != null) {
MVMap.RootReference rootReference = undoLog.flushAppendBuffer();
undoLogRootReferences[i] = rootReference;
- undoLogSize += rootReference.root.getTotalCount() + rootReference.appendCounter;
}
... |
codereview_java_data_9996 | return new RelFieldCollation(field, direction, nullDirection);
}
public RelDistribution toDistribution(Object o) {
final Map map = (Map) o;
final RelDistribution.Type type = RelEnumTypes.toEnum((String) map.get("type"));
Is there a need to check if Object is a Map?
return new RelFieldCollati... |
codereview_java_data_10004 | propertyMap.put(ID, loan.getId().toString());
propertyMap.put(OFFICE_NAME, loan.getOffice().getName());
propertyMap.put(LOAN_PRODUCT_SHORT_NAME, loan.loanProduct().getShortName());
- propertyMap.put(OFFICE_AND_LOAD_PRODUCT_NAME, loan.getOffice().getName()+ loan.loanProduct().getShortNa... |
codereview_java_data_10005 | break;
}
final List<RexNode> reducedValues = new ArrayList<>();
- RexNode simplifiedExpr = rexBuilder.makeCast(e.getType(), operand);
executor.reduce(rexBuilder, ImmutableList.of(simplifiedExpr), reducedValues);
return Objects.requireNonNull(
Iterables.getOnlyElement... |
codereview_java_data_10009 | CompactionConfigurer configurer = CompactableUtils.newInstance(tablet.getTableConfiguration(),
cfg.getClassName(), CompactionConfigurer.class);
- configurer.init(new CompactionConfigurer.InitParamaters() {
-
- private final ServiceEnvironment senv = new ServiceEnvironmentImpl(tablet.getContext());... |
codereview_java_data_10011 | switch (from.typeId()) {
case INTEGER:
- return to.equals(Types.LongType.get());
case FLOAT:
- return to.equals(Types.DoubleType.get());
case DECIMAL:
Types.DecimalType fromDecimal = (Types.DecimalType) from;
why is this change necessary?
switch (from.typeId()) {
... |
codereview_java_data_10021 | // If the HighlyAvailableService is not initialized or it's not the active service, throw an exception
// to prevent processing of the servlet.
if (null == Monitor.HA_SERVICE_INSTANCE || !Monitor.HA_SERVICE_INSTANCE.isActiveService()) {
- throw new IOException("This is not the active Monitor", new N... |
codereview_java_data_10023 | terminal.close();
reader = null;
} catch (IOException e) {
- e.printStackTrace();
}
}
if (accumuloClient != null) {
I suggest adding a log.warn or log.error here to capture the exception within the logs.
terminal.close();
reader = null;
} catch... |
codereview_java_data_10025 | * if the user does not have permission
* @throws NamespaceNotFoundException
* if the specified namespace doesn't exist
- * @deprecated since 2.1.0; use {@link #getPropertiesMap(String)} instead.
*/
@Deprecated(since = "2.1.0")
Iterable<Entry<String,String>> getProperties(Stri... |
codereview_java_data_10027 | * @param beginLine the linenumber, 1-based.
*/
public TokenEntry(String image, String tokenSrcID, int beginLine) {
- setImage(image);
- this.tokenSrcID = tokenSrcID;
- this.beginLine = beginLine;
- this.beginColumn = -1;
- this.endColumn = -1;
- this.index = TO... |
codereview_java_data_10030 | private static final long serialVersionUID = 1L;
- private final Seq<? extends E> errors;
/**
* Construct an {@code Invalid}
I think it can be `Seq<E> errors`. Maybe it needs to be casted when assigned/at creation time in one of our factory methods.
private static final lon... |
codereview_java_data_10034 | String image = deploy.getContainerInfo().get().getDocker().get().getImage();
checkBadRequest(
validDockerRegistries.contains(URI.create(image).getHost()),
- String.format("%s does not point to an allowed docker registry", image)
);
}
}
Maybe include the allowe... |
codereview_java_data_10038 | if (result.hasErrors()) {
final String errors =
result.errors().stream().map(TomlParseError::toString).collect(Collectors.joining("\n"));
- throw new Exception("Invalid TOML configuration : \n" + errors);
}
return checkConfigurationValidity(result, toml);
spurious space between co... |
codereview_java_data_10039 | super.snapshotState(context);
long checkpointId = context.getCheckpointId();
LOG.info("Start to flush snapshot state to state backend, table: {}, checkpointId: {}", table, checkpointId);
- long current = System.currentTimeMillis();
- if (checkNeedCommit(current)) {
- // Update the checkpoint s... |
codereview_java_data_10047 | requestsDropped.increment();
delegate.onDropped();
}
};
}
Maybe want to override toString
requestsDropped.increment();
delegate.onDropped();
}
+
+ @Override public String toString() {
+ return "LimiterMetrics{" + delegate + "}";
+ }
};
... |
codereview_java_data_10048 | * creation (usually close to execution order) without step execution data filtered by job
* names matching query string.
*
- * @param queryString search query string to filter job names
* @param start the index of the first execution to return
* @param count the maximum number of executions
* @return... |
codereview_java_data_10050 | } catch (TableNotFoundException ex) {}
try {
client.createConditionalWriter(creds, doesNotExist, new ConditionalWriterOptions());
} catch (TableNotFoundException ex) {}
}
If this thrift call does not throw a NNFE, it seems like the test will still pass? If this is the case, could place an Asse... |
codereview_java_data_10051 | for (final SingularityEventSender eventListener : eventListeners) {
builder.add(
listenerExecutorService.submit(
- new Callable<Void>() {
-
- @Override
- public Void call() {
- eventListener.elevatedAccessEvent(elevatedAccessEvent);
- return ... |
codereview_java_data_10052 | */
@Nonnull
public static <T> ProcessorMetaSupplier writeJmsTopicP(
@Nonnull SupplierEx<? extends Connection> newConnectionFn,
- @Nonnull BiFunctionEx<? super Session, ? super T, ? extends Message> messageFn,
- @Nonnull String name
) {
- return WriteJmsP.su... |
codereview_java_data_10055 | -package main.java.com.getcapacitor.util;
import android.graphics.Color;
Shouldn't this be `com.getcapacitor.util`?
+package com.getcapacitor.util;
import android.graphics.Color; |
codereview_java_data_10056 | storage.put(key, value);
} catch (Exception e) {
throw new KvStorageException(ErrorCode.KVStorageWriteError.getCode(),
- "Put data failed, key: " + new String(key) + ",detail: " + e.getMessage(), e);
}
// after actual storage put success, put it in... |
codereview_java_data_10062 | else
selectFiles();
- tablet.updateTimer(MAJOR, queuedTime, startTime, stats.getEntriesRead(), failed);
}
}
Could shorten the code a bit by removing failed boolean. Please ignore this suggestion if it does not suit you. Just something I thought of when I looked at the code. ```suggestion t... |
codereview_java_data_10071 | }
mRvAllergens = (RecyclerView) view.findViewById(R.id.alergens_recycle);
- mAllergens = Utils.getAppDaoSession(this.getActivity()).getAllergenDao().queryBuilder().where(AllergenDao.Properties.Enable.eq("true")).list();
- mAdapter = new AllergensAdapter(mAllergens, getActivity());
... |
codereview_java_data_10073 | boolean actionMessage = false;
boolean mediaMessage = false;
for (MessageRecord messageRecord : messageRecords) {
if (messageRecord.isGroupAction() || messageRecord.isCallLog() ||
messageRecord.isJoined() || messageRecord.isExpirationTimerUpdate() ||
Why remove ... |
codereview_java_data_10075 | throw new IllegalArgumentException(
"Unsupported write ahead log version " + new String(magicBuffer));
}
- } catch (Exception e) {
- log.warn("Got EOFException trying to read WAL header information,"
+ " assuming the rest of the file has no data.");
// A TabletServ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.