id stringlengths 23 26 | content stringlengths 182 2.49k |
|---|---|
codereview_java_data_5407 | return convertDMNOutput(decisionModel.evaluateAll(dmnContext), predictInput);
}
- DecisionModel getDecisionModel(DecisionModels decisionModels, ModelIdentifier modelIdentifier) {
String[] namespaceAndName = extractNamespaceAndName(modelIdentifier.getResourceId());
return decisionModel... |
codereview_java_data_5412 | this.defaultMessageStore.getRunningFlags().makeLogicsQueueError();
}
- private void multiDispatchQueue(DispatchRequest request, int maxRetries) {
Map<String, String> prop = request.getPropertiesMap();
String multiDispatchQueue = prop.get(MessageConst.PROPERTY_INNER_MULTI_DISPATCH);
... |
codereview_java_data_5419 | import org.apache.thrift.TException;
import org.junit.Assert;
import org.junit.Test;
-import static org.mockito.Matchers.anyLong;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.spy;
nit: this itself gives the TableMetadataV2, no?
import org.apache.thrift.TException;
import org.jun... |
codereview_java_data_5423 | throws AccumuloException, AccumuloSecurityException;
/**
- * List all compactions running in Accumulo
*
* @return the list of active compactions
* @since 2.1.0
Should mention this will return internal and external compactions.
throws AccumuloException, AccumuloSecurityException;
/**
... |
codereview_java_data_5431 | AlertDialog alert = alertDialogBuilder.create();
alert.show();
}
}
show a toast in the `else` block that location service already enabled.
AlertDialog alert = alertDialogBuilder.create();
alert.show();
+ ... |
codereview_java_data_5436 | }
private void testOldClientNewServer() throws Exception {
- // TODO fails in pagestore mode
- if (!config.mvStore) {
- return;
- }
Server server = org.h2.tools.Server.createTcpServer();
server.start();
int port = server.getPort();
The whole test is ... |
codereview_java_data_5437 | super.onCreate(savedInstanceState);
wasPreviouslyDarkTheme = systemThemeUtils.isDeviceInNightMode();
setTheme(wasPreviouslyDarkTheme ? R.style.DarkAppTheme : R.style.LightAppTheme);
- float fontScale = android.provider.Settings.System.getFloat(getBaseContext().getContentResolver(),andr... |
codereview_java_data_5439 | + "Examples of invalid host lists are '', ':1000', and 'localhost:80000'"),
@SuppressWarnings("unchecked")
- PORT("port", Predicates.or(new Bounds(1024, 65535), in(true, "0"), new Matches("\\d{1,5}-\\d{1,5}")),
"An positive integer in the range 1024-65535 (not already in use or specified elsewhere... |
codereview_java_data_5442 | public void pendingTransactionRetentionPeriod() {
final int pendingTxRetentionHours = 999;
parseCommand("--tx-pool-retention-hours", String.valueOf(pendingTxRetentionHours));
- verify(mockTransactionPoolConfigurationBuilder)
- .pendingTxRetentionPeriod(pendingTxRetentionHours);
assertThat(co... |
codereview_java_data_5447 | */
JAR,
/**
- * Represents a ZIP file contains JAR files.
*/
JARS_IN_ZIP
}
"contains" -> "containing" or "that contains"
*/
JAR,
/**
+ * Represents a ZIP file that contains JAR files.
*/
JARS_IN_ZIP
} |
codereview_java_data_5474 | boolean pass = l % 2 == 0;
if (!pass) {
- Metrics.metric("dropped").inc();
}
- Metrics.metric("total").inc();
return pass;
})
We should use the thread-safe version here. We cou... |
codereview_java_data_5480 | String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);
String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID, Constants.DEFAULT_NAMESPACE_ID);
- String agent = request.getHeader(HttpHeaderConsts.USER_AGENT_HEADER);
ClientInfo clientInfo = new Cl... |
codereview_java_data_5486 | return defaultMQAdminExtImpl.queryMessage(topic, key, maxNum, begin, end);
}
- public QueryResult queryMessageByUniqueKey(String topic, String key, int maxNum, long begin, long end)
throws MQClientException, InterruptedException {
return defaultMQAdminExtImpl.queryMessageByUniqKey(top... |
codereview_java_data_5492 | return null;
}
- public Object createNonNullArray() {
return new Object @NonNull[0];
}
`public Object[] createNonNullArray() {` maybe?
return null;
}
+ public Object[] createNonNullArray() {
return new Object @NonNull[0];
} |
codereview_java_data_5493 | // PMD 6.0.0
addFilterRuleMoved("java", "controversial", "unnecessary", "UnnecessaryParentheses");
- addFilterRuleMoved("java", "unnecessary", "UnnecessaryParentheses", "UselessParentheses");
}
this one should be `addFilterRuleRenamed`, isn't it?
// PMD 6.0.0
addFilterR... |
codereview_java_data_5496 | "}} ~~~~";
String creator = media.getCreator();
- if (creator == null || creator.isEmpty())
throw new RuntimeException("Failed to nominate for deletion");
String creatorName = creator.replace(" (page does not exist)", "");
return pageEditClient.prependEdit... |
codereview_java_data_5500 | @Override
public PriorityQueue read(ObjectDataInput in) throws IOException {
int size = in.readInt();
- Comparator comparator = in.readObject();
- PriorityQueue res = size < 1 ? new PriorityQueue(comparator) : new PriorityQueue(size, comparator);
... |
codereview_java_data_5501 | private final Optional<Long> healthcheckMaxTotalTimeoutSeconds;
private final Optional<HealthcheckOptions> healthcheck;
- private final Optional<String> healthCheckResultFilePath;
private final Optional<Boolean> skipHealthchecksOnDeploy;
private final Optional<Long> deployHealthTimeoutSeconds;
private f... |
codereview_java_data_5510 | }
public void handleGoAway(Channel parentChannel, int lastStreamId, GoAwayException exception) {
- log.warn(() -> "Received GOAWAY on " + parentChannel + " with lastStreamId of " + lastStreamId);
try {
MultiplexedChannelRecord multiplexedChannel = parentChannel.attr(MULTIPLEXED_CH... |
codereview_java_data_5513 | Map<String, Object> aclAccessConfigMap = AclUtils.getYamlDataObject(fileHome + File.separator + fileName,
Map.class);
if (aclAccessConfigMap == null || aclAccessConfigMap.isEmpty()) {
- throw new AclException(String.format("%s file is not data", fileHome + File.separator + fil... |
codereview_java_data_5514 | + "[^,]*hive-metastore[^,]*?\\.jar" + "|" + "[^,]*hive-hcatalog-core[^,]*?\\.jar");
}
- public boolean isNotifyEnabled() {
return Boolean.parseBoolean(getOptional("kylin.job.notification-enabled", FALSE));
}
IMO, `isNotificationEnabled` looks better?
+ "[^,]*hiv... |
codereview_java_data_5521 | * username: username
* password: password
* credentials-file: credentialsFile
- * credentials-refresh-interval: 5000
* http-logging: HEADERS
* ssl:
* key-store: keystore.p12
```suggestion * credentials-refresh-interval: 5 ```
* username: username
* password: password
* credenti... |
codereview_java_data_5531 | this.brokerController.getTopicConfigManager().updateTopicConfig(topicConfig);
- if (brokerController.getBrokerConfig().getRegisterNameServerPeriod() == 0) {
- this.brokerController.registerBrokerAll(false, true, true);
- }
return null;
}
- private RemotingCommand delet... |
codereview_java_data_5537 | SingleMemberAnnotationExpr retrieved = retrievedOpt.get();
assertEquals("Path", retrieved.getName().asString());
pmmlRestResourceGenerator.setPathValue(TEMPLATE);
- try {
- String classPrefix = getSanitizedClassName(KIE_PMML_MODEL.getName());
- String expected = U... |
codereview_java_data_5539 | places = getFromWikidataQuery(curLatLng, lang, radius);
} catch (Exception e) {
Timber.d("exception in fetching nearby places", e.getLocalizedMessage());
- return null;
}
Timber.d("%d results at radius: %f", ... |
codereview_java_data_5540 | }
var encrypter = newCryptoService.getEncrypter();
encrypter.init(initParams);
return encrypter;
}
Should this also load the TABLE_CRYPTO_ENCRYPT_SERVICE decrypter under the expectation that the service currently configured to encrypt will also be needed to decrypt? If not, should we add a note ... |
codereview_java_data_5549 | String stringPref = prefs.getString(key, defaultEnum.name());
try {
return Enum.valueOf(defaultEnum.getDeclaringClass(), stringPref);
- } catch (Exception ex) {
Log.w(K9.LOG_TAG, "Unable to convert preference key [" + key +
"] value [" + stringPref... |
codereview_java_data_5550 | @Test
public void testFilterManuallyClosable() throws IOException {
TestableCloseableIterable iterable = new TestableCloseableIterable();
- TestableCloseableIterable.TestableCloseableIterator iterator =
- (TestableCloseableIterable.TestableCloseableIterator) iterable.iterator();
CloseableI... |
codereview_java_data_5560 | private String password;
private String sender;
-
public MailService(KylinConfig config) {
- this(config.isNotifyEnabled(), config.isStarttlsEnabled(), config.getMailHost(), config.getSmtpPort(), config.getMailUsername(), config.getMailPassword(), config.getMailSender());
}
private MailS... |
codereview_java_data_5561 | @Override
public SMTLibTerm transform(UninterpretedToken uninterpretedToken) {
if (uninterpretedToken.sort() == Sort.KVARIABLE) {
- if (binders.search(uninterpretedToken) != -1) {
return new SMTLibTerm(uninterpretedToken.javaBackendValue());
} else {
... |
codereview_java_data_5565 | sb.append("]");
}
- private static final Pattern identChar = Pattern.compile("[A-Za-z0-9\\-]");
-
private static String[] asciiReadableEncodingKoreCalc() {
- String[] koreEncoder = StringUtil.asciiReadableEncodingDefault;
koreEncoder[0x2d] = "-";
koreEncoder[0x3c] = "-LT-"... |
codereview_java_data_5578 | case DECIMAL:
return new BigDecimal(asString);
case DATE:
- return (int) LocalDate.parse(asString, DateTimeFormatter.ofPattern("yyyy-MM-dd")).toEpochDay();
default:
throw new UnsupportedOperationException(
"Unsupported type for fromPartitionString: " + type);
... |
codereview_java_data_5584 | import software.amazon.awssdk.annotations.SdkPublicApi;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.Validate;
/**
* Represents a completed download directory transfer to Amazon S3. It can be used to track
Defensive copy in case of builder reuse?
import software.amazon.awss... |
codereview_java_data_5590 | package org.apache.iceberg.mr.hive;
import org.apache.hadoop.hive.ql.io.sarg.PredicateLeaf;
import org.apache.hadoop.hive.ql.io.sarg.SearchArgument;
import org.apache.hadoop.hive.ql.io.sarg.SearchArgumentFactory;
import org.apache.iceberg.expressions.And;
import org.apache.iceberg.expressions.Expressions;
import... |
codereview_java_data_5591 | account = preferences.getAccount(accountUuids[0]);
List<String> folderServerIds = search.getFolderServerIds();
singleFolderMode = folderServerIds.size() == 1;
}
}
This doesn't set `account` to null in case the condition isn't met.
... |
codereview_java_data_5603 | * Serializes an AST or a partial AST to JSON.
*/
public class JavaParserJsonSerializer {
public void serialize(Node node, JsonGenerator generator) {
requireNonNull(node);
Log.info("Serializing Node to JSON.");
Perhaps we could use a constant for that or maybe give a way to set this name in ... |
codereview_java_data_5606 | void createOAuth2LoginFilter(BeanReference sessionStrategy, BeanReference authManager) {
Element oauth2LoginElt = DomUtils.getChildElementByTagName(this.httpElt, Elements.OAUTH2_LOGIN);
if (oauth2LoginElt != null) {
- OAuth2LoginBeanDefinitionParser parser = new OAuth2LoginBeanDefinitionParser();
- BeanDefi... |
codereview_java_data_5607 | }
}
- /**
- * Scale up or down the number of application instances.
- * @param application App in the stream to scale.
- * @param count Number of instance to scale to.
- */
- public void scaleApplicationInstances(StreamApplication application, int count) {
- this.scaleApplicationInstances(application, count, ... |
codereview_java_data_5613 | package org.apache.rocketmq.common.protocol;
-import org.apache.rocketmq.remoting.protocol.RemotingSysRequestCode;
-
-public class RequestCode extends RemotingSysRequestCode {
public static final int SEND_MESSAGE = 10;
I am not sure it's a good idea that `RequestCode` in `common` module has a dependency `Remotin... |
codereview_java_data_5624 | }
}
- private File getNodePrivateKeyFile(@Nullable final File nodePrivateKeyFile) {
return nodePrivateKeyFile != null
? nodePrivateKeyFile
: KeyPairUtil.getDefaultKeyFile(dataDir());
Pantheon doesn't currently use `@Nullable` so better to leave it off for consistency.
}
}
+ pr... |
codereview_java_data_5630 | private static Set<String> ownedObservables(DAG dag) {
return StreamSupport.stream(Spliterators.spliteratorUnknownSize(dag.iterator(), 0), false)
.map(vertex -> (String) vertex.getMetaSupplier().getTags().get(ObservableRepository.OWNED_OBSERVABLE))
.collect(Collectors.toS... |
codereview_java_data_5631 | try {
List<ImapResponse> expungeResponses = executeSimpleCommand("EXPUNGE");
- handleExpungeResponses(expungeResponses);
return ImapUtility.extractVanishedUids(expungeResponses);
} catch (IOException ioe) {
throw ioExceptionHandler(connection, ioe);
... |
codereview_java_data_5637 | import de.danoeh.antennapod.core.feed.FeedMedia;
import de.danoeh.antennapod.core.gpoddernet.model.GpodnetEpisodeAction;
import de.danoeh.antennapod.core.preferences.GpodnetPreferences;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.core.service.playback.PlaybackService;
... |
codereview_java_data_5642 | package com.hazelcast.jet.impl.serialization;
import com.hazelcast.internal.nio.BufferObjectDataInput;
-import com.hazelcast.internal.serialization.impl.AbstractSerializationService;
public interface DataInput {
This is confusing with the standard `java.io.DataInput`. We should use different name, esp. when the pur... |
codereview_java_data_5658 | description =
"Refresh delay of websocket subscription sync in milliseconds. "
+ "default: ${DEFAULT-VALUE}",
- defaultValue = "5000"
)
private void setRefreshDelay(final Long refreshDelay) {
- if (refreshDelay < 1 || refreshDelay > 3600000) {
throw new ParameterException(
... |
codereview_java_data_5663 | }
if (proposedBlock.getHeader().getNumber()
- != signedPayload.getPayload().getRoundIdentifier().getRoundNumber()) {
LOG.info("Invalid proposal/block - message sequence does not align with block number.");
return false;
}
this looks like it's comparing the chain height to the round ... |
codereview_java_data_5664 | ConsumeQueue logic = this.findConsumeQueue(topic, queueId);
if (logic != null) {
long consumeQueueOffset = logic.getMinOffsetInQueue();
- MessageExt msgExt = null;
long commitLogOffset = 0L;
if (realOffset) {
- for (;consumeQueueOffset <... |
codereview_java_data_5670 | }
}
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- super.onConfigurationChanged(newConfig);
- }
}
Why do we need to override this if all we're doing is passing it up?
}
}
} |
codereview_java_data_5673 | }
public KPrint(KompileOptions kompileOptions) {
- this(new KExceptionManager(new GlobalOptions()), FileUtil.testFileUtil(), new TTYInfo(false, false, false), new PrintOptions(), kompileOptions);
}
@Inject
I should think this should be kompileOptions.global
}
public KPrint(Kompile... |
codereview_java_data_5674 | import java.net.URI;
import java.util.Collections;
import java.util.List;
-import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
-import zipkin2.elasticsearch.ElasticsearchStorage;
final class HostsConverter {
- static final Logger LOG = Logger.getLogger(Elasticsear... |
codereview_java_data_5679 | private Date playbackCompletionDate;
private int startPosition = -1;
private int playedDurationWhenStarted;
- private String lastPlaybackSpeed = null;
// if null: unknown, will be checked
private Boolean hasEmbeddedPicture;
I think a float value fits better.
private Date playbackCompl... |
codereview_java_data_5692 | * @return the iterator
*/
public Iterator<ConfigurationError> configErrors() {
- return configErrors == null ? Collections.emptyIterator() : configErrors.iterator();
}
/**
this should be ```suggestion return configErrors == null ? Collections<ConfigurationError>.emptyIterator() : conf... |
codereview_java_data_5695 | }
private SynchronizerConfiguration buildSyncConfig() {
- synchronizerConfigurationBuilder.syncMode(DEFAULT_SYNC_MODE);
synchronizerConfigurationBuilder.maxTrailingPeers(maxTrailingPeers);
return synchronizerConfigurationBuilder.build();
}
It would be good not to remove the sync-mode flag. I have... |
codereview_java_data_5699 | this.compressExt = compressExt;
}
- public static LogrotateCompressionSettings gzip() {
return new LogrotateCompressionSettings(Optional.<String>absent(), Optional.<String>absent(), Optional.<String>absent(), Optional.<String>absent());
}
i'd consider renaming this to `default()`, since it's just an i... |
codereview_java_data_5704 | final Optional<BlockHeader> genesisBlockHeader =
context.getBlockchain().getBlockHeader(GENESIS_BLOCK_NUMBER);
if (!genesisBlockHeader.isPresent()) {
- LOG.error("Genesis block cannot be retriefed from chain.");
return false;
}
final CliqueExtraData extraData = CliqueExtraData.d... |
codereview_java_data_5706 | } else {
conf = new Configuration();
}
- }
-
- public WriteBuilder forTable(Table table) {
- schema(table.schema());
- setAll(table.properties());
- return this;
}
public WriteBuilder metadata(String property, String value) {
I think this change is unrelated and sh... |
codereview_java_data_5708 | long currentLogicOffset = mappedFile.getWrotePosition() + mappedFile.getFileFromOffset();
if (expectLogicOffset < currentLogicOffset) {
log.warn("build consume queue idempotent, expectLogicOffset: {} currentLogicOffset: {} Topic: {} QID: {} Diff: {}",
... |
codereview_java_data_5718 | testCancelScript();
testEncoding();
testClobPrimaryKey();
- testComment();
deleteDb("runscript");
}
Please, move this test to `createTable.sql`. `SCRIPT TABLE TEST1` output is not too big and I don't see any reason to use custom checks for presence of substrings.
... |
codereview_java_data_5720 | @Override
public ExpireSnapshotsActionResult execute() {
SparkContext context = spark().sparkContext();
JobGroupInfo info = JobGroupUtils.getJobGroupInfo(context);
return withJobGroupInfo(info, () -> {
Can we simplify this a bit? ``` @Override public ExpireSnapshotsActionResult execute() { JobGrou... |
codereview_java_data_5722 | return drawerLayout != null && navDrawer != null && drawerLayout.isDrawerOpen(navDrawer);
}
- @Override
- public boolean onCreateOptionsMenu(Menu menu) {
- return super.onCreateOptionsMenu(menu);
- }
-
- @Override
- public boolean onPrepareOptionsMenu(Menu menu) {
- return sup... |
codereview_java_data_5723 | import org.apache.maven.shared.dependency.analyzer.DefaultClassAnalyzer;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
-import org.gradle.api.artifacts.ConfigurationContainer;
-import org.gradle.api.artifacts.ModuleDependency;
import org.gradle.api.artifacts.ResolvedArtifact;
import... |
codereview_java_data_5725 | if (checkInit) {
DbException.throwInternalError();
}
- Collections.sort(filters, TableFilter.ORDER_IN_FORM_COMPARATOR);
expandColumnList();
visibleColumnCount = expressions.size();
ArrayList<String> expressionSQL;
what is a "form" ?
if (checkIn... |
codereview_java_data_5726 | edge.add("to", e.getDestName());
edge.add("toOrdinal", e.getDestOrdinal());
edge.add("priority", e.getPriority());
- edge.add("distributedTo", e.getDistributedTo() + "");
edge.add("type", e.getRoutingPolicy().toString().toLowerCase());
edges.ad... |
codereview_java_data_5730 | if (syncMode == FolderMode.NONE && oldSyncMode != FolderMode.NONE) {
return true;
}
- return syncMode != FolderMode.NONE && oldSyncMode == FolderMode.NONE;
}
public synchronized FolderMode getFolderPushMode() {
If you combine the last two `return` statements you might as... |
codereview_java_data_5731 | @Deprecated
public Date getSessionCredentitalsExpiration() {
- credentialsLock.readLock().lock();
- try {
- return sessionCredentialsExpiration;
- } finally {
- credentialsLock.readLock().unlock();
- }
}
public String getIdentityPoolId() {
This meth... |
codereview_java_data_5743 | * conveyor has as many 1-to-1 concurrent queues as there are upstream
* tasklets contributing to it.
*/
-public abstract class ConcurrentInboundEdgeStream {
- // Prevent subclassing
private ConcurrentInboundEdgeStream() {
}
We prevent subclassing of an abstract class? I think we can remove the `abst... |
codereview_java_data_5749 | String pathToDelete = path + "/" + createdNodeName;
LOG.debug("[{}] Failed to acquire lock in tryLock(), deleting all at path: {}", vmLockPrefix,
pathToDelete);
- recursiveDelete(pathToDelete, NodeMissingPolicy.SKIP);
createdNodeName = null;
}
With ZooKeeper 3.5.x there is a s... |
codereview_java_data_5755 | */
@Nonnull
public static <K, V, R> ProcessorMetaSupplier readHdfsP(
- @Nonnull Configuration configuration, @Nonnull BiFunctionEx<K, V, R> mapper
) {
configuration = SerializableConfiguration.asSerializable(configuration);
if (configuration.get("mapreduce.job.inputform... |
codereview_java_data_5762 | }
- @SuppressWarnings("WeakerAccess") // public interface
- public void resetVisibleLimits() {
try {
getLocalStore().resetVisibleLimits(getDisplayCount());
} catch (MessagingException e) {
This method is only used by this class. We could make this `private` now and increase vi... |
codereview_java_data_5765 | }
persistService.insertTenantInfoAtomic("1", namespaceId, namespaceName, namespaceDesc, "nacos",
System.currentTimeMillis());
- namespaceService.addTenantId(namespaceId);
return true;
}
replace method name by addNamespaceId?
}
persistService.in... |
codereview_java_data_5777 | "2.1.0"),
TABLE_COMPACTION_DISPATCHER_OPTS("table.compaction.dispatcher.opts.", null, PropertyType.PREFIX,
"Options for the table compaction dispatcher", "2.1.0"),
- TABLE_COMPACTION_SELECTION_EXPIRATION("table.compaction.selection.expiration.ms", "1m",
PropertyType.TIMEDURATION,
"User c... |
codereview_java_data_5780 | bottomSheetCallback.onSlide(null, 1.0f);
} else if (Intent.ACTION_VIEW.equals(intent.getAction())) {
handleDeeplink(intent.getData());
- } else if (Intent.ACTION_CREATE_SHORTCUT.equals(intent.getAction())) {
- intent = new Intent(this, SelectSubscriptionActivity.clas... |
codereview_java_data_5790 | import de.danoeh.antennapod.activity.SplashActivity;
import de.danoeh.antennapod.core.ApCoreEventBusIndex;
import de.danoeh.antennapod.core.ClientConfig;
-import de.danoeh.antennapod.core.preferences.UserPreferences;
import de.danoeh.antennapod.error.CrashReportWriter;
import de.danoeh.antennapod.error.RxJavaError... |
codereview_java_data_5804 | public final class UpdateMapP<T, K, V> extends AsyncHazelcastWriterP {
private final String mapName;
private final FunctionEx<? super T, ? extends K> toKeyFn;
private final BiFunctionEx<? super V, ? super T, ? extends V> updateFn;
We need to apply backpressure.
public final class UpdateMapP<T, K, V> ... |
codereview_java_data_5809 | /*
- * Copyright 2005 JBoss Inc
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
back to the future :P
/*
+ * Copyright 2020 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "L... |
codereview_java_data_5811 | }
if (pref instanceof EditTextPreference) {
EditTextPreference editTextPref = (EditTextPreference) pref;
- if (pref.getTitle().toString().toLowerCase().contains("password")) {
pref.setSummary("******");
} else if (editTextPref.getText() != null && ... |
codereview_java_data_5815 | * ADDED} and {@link com.hazelcast.core.EntryEventType#UPDATED UPDATED} events
* @param projectionFn the projection to map the events, you may use
* {@link Util#mapEventToEntry()} to project new value from the event
- * If the projection returns a {@code null} for some items, that item... |
codereview_java_data_5820 | name, generatePrivacyParameters(orion), keyFilePath, orion);
} else {
node =
- pantheonNodeFactory.createIbftTwoNodePrivacyEnabled(
name, generatePrivacyParameters(orion), keyFilePath, orion);
}
Not for here - but that's a horrible interface, think it... |
codereview_java_data_5822 | SYNC_HTTP_CLIENT.close();
ASYNC_HTTP_CLIENT.close();
}
- catch (Exception ignore) {
}
logger.warn("[HttpClientManager] Destruction of the end");
}
Here, you can print the expcetion error info.
SYNC_HTTP_CLIENT.close();
ASYNC_HTTP_CLIENT.close();
}
+ catch (Exception ex) {
+ logger.er... |
codereview_java_data_5824 | import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
-import com.google.common.base.Throwables;
import com.google.protobuf.Message;
import com.pinterest.secor.common.LogFilePath;
import com.pinterest.secor.common.SecorConfig;
The indentation seems inconsistent with rest of the classes. In secor, we use 4 spac... |
codereview_java_data_5838 | @Override
public int getItemCount() {
- return contributions==null?0:contributions.size();
}
public void setContributions(List<Contribution> contributionList) {
how could contributions be null? Create it at the field level if you want. It should also be final. There are minor style violation... |
codereview_java_data_5856 | Map<String, VariableInstance> variableInstances = runtimeService.getVariableInstances(processInstance.getId());
assertThat(variableInstances.get("stringVar"))
- .extracting("name", "value")
.containsExactly("stringVar", "coca-cola");
List<String> variableNames ... |
codereview_java_data_5858 | long length = file.length()/1024;
String img_width = exif_data.getAttribute(ExifInterface.TAG_IMAGE_WIDTH);
String img_height = exif_data.getAttribute(ExifInterface.TAG_IMAGE_LENGTH);
- if(img_width.isEmpty() || img_height.isEmpty() || img_width.equals("0") || img_heigh... |
codereview_java_data_5864 | MulticastSocket multicastSocket = null;
SocketAddress sa = null;
NetworkInterface ni = PMS.get().getServer().getNetworkInterface();
- try {
- sa = new InetSocketAddress(getIPv4MulticastAddress(), UPNP_PORT);
- } catch (IOException e1) {
- }
-
try {
multicastSocket = getNewMulticastSocket();
mul... |
codereview_java_data_5865 | this.slaveDiskTotal = slaveDiskTotal;
}
- @JsonIgnore
- public boolean isOverloaded() {
- // Any host where load5 is > 1 is overloaded. Also consider a higher threshold for load1 to take into account spikes large enough to be disruptive
- return systemLoad5Min > 1.0 || systemLoad1Min > 1.5;
- }
-
p... |
codereview_java_data_5868 | try {
if ((replServer.get() == null)
&& !getConfiguration().get(Property.REPLICATION_NAME).isEmpty()) {
- log.info(Property.REPLICATION_NAME.getKey() + " was set, starting repl services.");
replServer.set(setupReplication());
}
... |
codereview_java_data_5873 | ServiceContainerUtil.registerServiceInstance(componentManager, key, implementation);
Disposer.register(
parentDisposable,
- () -> new ComponentManagerWrapper(componentManager).unregisterComponent(key.getName()));
}
}
Even though this can be implemented as a Wrapper, it's not directly nece... |
codereview_java_data_5881 | }
void printNodeInfo(ILogger log, String addToProductName) {
- log.info("Cluster name: " + node.getConfig().getClusterName());
log.info(versionAndAddressMessage(addToProductName));
log.fine(serializationVersionMessage());
log.info('\n' + JET_LOGO);
log.info(COPYRIGHT... |
codereview_java_data_5884 | @Override
public void multicastToValidators(final MessageData message) {
- validatorNodes.stream().forEach(v -> v.handleReceivedMessage(message));
}
}
could just use validatorNodes.forEach and avoid need to create stream
@Override
public void multicastToValidators(final MessageData message) {
+ ... |
codereview_java_data_5891 | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.junit.Test;
import net.sourceforge.pmd.lang.apex.ast.ASTMethod;
Same here - please put the source code in a separate file - oh, it s... |
codereview_java_data_5896 | private void displayMediaInfo(@NonNull Playable media) {
if (media.getClass() == FeedMedia.class) {
String pubDateStr = DateUtils.formatAbbrev(getActivity(), ((FeedMedia) media).getPubDate());
- txtvPodcastTitle.setText(media.getFeedTitle() + ", " + pubDateStr);
} else {
... |
codereview_java_data_5900 | };
}
- protected static final Schema SUPPORTED_PRIMITIVES = new Schema(
required(100, "id", Types.LongType.get()),
required(101, "data", Types.StringType.get()),
required(102, "b", Types.BooleanType.get()),
nit: Why protected? Do we expect `TestPartitionValues` to be extended and used in ... |
codereview_java_data_5904 | if (partition != null) {
this.lazyPartitionSchema = (StructType) SparkSchemaUtil.convert(partition.type());
} else {
- lazyPartitionSchema = new StructType();
}
}
I think partition metadata is the data file col's statistics.
if (partition != null) {
this.lazyP... |
codereview_java_data_5907 | // TODO: Determine reasonable defaults here
public static final int DEFAULT_PIVOT_DISTANCE_FROM_HEAD = 500;
public static final float DEFAULT_FULL_VALIDATION_RATE = .1f;
- public static final int DEFAULT_FAST_SYNC_MINIMUM_PEERS = 1;
private static final Duration DEFAULT_FAST_SYNC_MAXIMUM_PEER_WAIT_TIME = D... |
codereview_java_data_5914 | byte[] exp;
if (byteBuffer.hasArray()) {
exp = byteBuffer.array();
- pos = compressStart;
} else {
exp = Utils.newBytes(expLen);
buff.position(compressStart).get(exp);
Here we need `pos ... |
codereview_java_data_5926 | LOG.warn("HivePrefix is not defined. Skip hive registration");
}
}
- if (hiveTableName != null && !mConfig.getSkipQuboleAddPartition()) {
mQuboleClient.addPartition(hiveTableName, sb.toString());
... |
codereview_java_data_5938 | private OAuth2AccessTokenResponseClient<OAuth2ClientCredentialsGrantRequest> clientCredentialsTokenResponseClient =
new DefaultClientCredentialsTokenResponseClient();
- private Clock clock = Clock.systemUTC();
- private Duration accessTokenExpiresSkew = Duration.ofMinutes(1);
-
-
/**
* Constructs an {@code O... |
codereview_java_data_5940 | *
* @param str An hexadecimal string representing a valid account address (strictly 20 bytes).
* @return The parsed address.
- * @throws NullPointerException if the provided string is {@code null}.
* @throws IllegalArgumentException if the string is either not hexadecimal, or not the valid
* r... |
codereview_java_data_5944 | service = services.get(csid);
if (service == null) {
log.error(
- "Tablet {} returned non existant compaction service {} for compaction type {}. Check"
+ " the table compaction dispatcher configuration. Attempting to fall back to "
+ "{} s... |
codereview_java_data_5947 | appendExecCmdParameters(cmd, BatchConstants.ARG_SEGMENT_ID, seg.getUuid());
appendExecCmdParameters(cmd, BatchConstants.ARG_PARTITION,
getRowkeyDistributionOutputPath(jobId) + "/part-r-00000");
if(this.seg.getConfig().isHFileDistCP()){
- String partitionOutputPath ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.