id stringlengths 23 26 | content stringlengths 182 2.49k |
|---|---|
codereview_java_data_4222 | private void initializeGestureDetector(){
gestureDetector = new GestureDetectorCompat(this, gestureDetectorListener);
- gestureDetector.setOnDoubleTapListener(gestureDetectorListener);
}
private void initializeResources() {
you can use `TAG` instead of "ConversationActivity"
private void initializ... |
codereview_java_data_4236 | private final OSS client;
private final OSSURI uri;
- private final AliyunProperties aliyunProperties;
private final File currentStagingFile;
private final OutputStream stream;
Nit: Any usage for this variable ? Seems it could be converted to use a local variable.
private final OSS client;
private ... |
codereview_java_data_4237 | return nodeWhitelist.remove(node);
}
- public boolean isNodeWhitelisted(final Peer node) {
return (!nodeWhitelistSet || (nodeWhitelistSet && nodeWhitelist.contains(node)));
}
}
Suggestion: s/isNodeWhiteListed/contains Reason: as a public scoped method, it would reduce repetition in context when calli... |
codereview_java_data_4240 | "COALESCE(?0.i, +(?0.i, ?0.h), 1)");
// not(x) is null should not optimized to x is not null
- checkSimplify(isNull(not(fRef)), "IS NULL(NOT(?0.f))");
- checkSimplify(isNotNull(not(fRef)), "IS NOT NULL(?0.f)");
}
Please rebase and use `isNull(not(vBool()))`
"COALESCE(?0.i, +(?0.i, ?0.h... |
codereview_java_data_4249 | try {
if (enterPath(parser, "version", "number") != null) version = parser.getText();
} catch (RuntimeException | IOException possiblyParseException) {
- throw new IllegalArgumentException(
- "could not parse .version.number in response: " + contentString.get());
}
if (version =... |
codereview_java_data_4262 | return set;
}
- private StructLikeSet rowSetWithoutIds(Table iTable, List<Record> recordList, int... idsToRemove) {
Set<Integer> deletedIds = Sets.newHashSet(ArrayUtil.toIntList(idsToRemove));
- StructLikeSet set = StructLikeSet.create(iTable.schema().asStruct());
recordList.stream()
.fil... |
codereview_java_data_4263 | if (currentSize <= maxSize) {
this.eventQueue.add(event);
} else {
- log.warn("event queue size[{}] enough, so drop this event {}", currentSize, event.toString());
}
}
IMO, print currentSize and maxSize will be better.
if (cu... |
codereview_java_data_4270 | @Override
default Iterator<T> dropWhile(Predicate<? super T> predicate) {
if (!hasNext()) {
return empty();
} else {
let's do `Objects.requireNonNull(predicate, "predicate is null")`. I've also forgotten in in various places and will add them later...
@Override
defau... |
codereview_java_data_4274 | throw new MQBrokerException(response.getCode(), response.getRemark());
}
public ClusterInfo getBrokerClusterInfo(String cluster,
final long timeoutMillis) throws InterruptedException, RemotingTimeoutException,
RemotingSendRequestException, RemotingConnectException, MQBrokerException... |
codereview_java_data_4275 | return SUPPORTED_TOKENS;
}
}
I think this was intended as part of the design to eventually support multi-tiered authentication, just like the `passwd` entry in Linux's `/etc/nsswitch.conf` can include an ordered list of authentication storage mechanisms or (at a higher level) PAM can be configured to use mult... |
codereview_java_data_4277 | "Usage:\n" +
" PutItem <tableName> <key> <keyVal> <albumtitle> <albumtitleval> <awards> <awardsval> <Songtitle> <songtitleval>\n\n" +
"Where:\n" +
- " tableName - the Amazon DynamoDB table in which an item is placed (for example, Music3).\n" +
- ... |
codereview_java_data_4284 | private static final int NODE_ID_SIZE = 64;
private static final Pattern DISCPORT_QUERY_STRING_REGEX =
- Pattern.compile("discport=([0-9]{1,5})");
private static final Pattern NODE_ID_PATTERN = Pattern.compile("^[0-9a-fA-F]{128}$");
private final BytesValue nodeId;
If we're being really strict this sh... |
codereview_java_data_4297 | if (address == null) {
return null;
}
- return address.getHost() + ":" + address.getPort();
}
/**
I think the `toString()` of our `HostAndPort` in core util already does this.
if (address == null) {
return null;
}
+ return address.toString();
}
/** |
codereview_java_data_4299 | String MANDATORY_NETWORK_FORMAT_HELP = "<NETWORK>";
String MANDATORY_NODE_ID_FORMAT_HELP = "<NODEID>";
Wei DEFAULT_MIN_TRANSACTION_GAS_PRICE = Wei.of(1000);
- long DEFAULT_RETENTION_PERIOD = 1000;
long DEFAULT_TRANSIENT_FORK_OUTLIVING_PERIOD = 10;
BytesValue DEFAULT_EXTRA_DATA = BytesValue.EMPTY;
lon... |
codereview_java_data_4301 | return true;
}
- public static String getHadoopNonExistingPath() {
return System.getProperty("os.name").toLowerCase().contains("windows")
? "c:\\non\\existing\\path"
- : "/non/existing/path/";
}
/**
simply `getNonExistingPath()` or even `nonExistingPa... |
codereview_java_data_4303 | ProbeBuilder probeBuilder = this.nodeEngine.getMetricsRegistry().newProbeBuilder()
.withTag("module", "jet")
- .withTag("job", Long.toHexString(jobId))
- .withTag("exId", Long.toHexString(executionId))
.with... |
codereview_java_data_4305 | */
public static Password promptUser() throws IOException {
if (System.console() == null) {
- return null;
}
ConsoleReader reader = new ConsoleReader();
String enteredPass = reader.readLine("Enter password: ", '*');
I'm thinking that throwing an exception here would be mor... |
codereview_java_data_4312 | TableParams<T> clientProperties(Properties clientProperties);
/**
- * Set path to HDFS location containing accumulo-client.properties file. This setting is more
* secure than {@link #clientProperties(Properties)}
*
* @param clientPropsPath
- * HDFS path to accumulo-client.pr... |
codereview_java_data_4314 | if (pstmt.executeUpdate() == 1) {
final Data result = new Data(currentID, newID);
sequenceBlocks.put(type, result);
return result;
} else {
throw new IllegalStateException("Failed at attempt to obtain an ID, aborting...");
As... |
codereview_java_data_4316 | * @return {@link HttpRestResult}
* @throws Exception ex
*/
- public <T> HttpRestResult<T> exchangeFrom(String url, Header header,
Map<String, String> paramValues, Map<String, String> bodyValues, String httpMethod, Type responseType) throws Exception{
... |
codereview_java_data_4355 | newHiveConf.set(HiveConf.ConfVars.METASTOREWAREHOUSE.varname, "file:" + hiveLocalDir.getAbsolutePath());
newHiveConf.set(HiveConf.ConfVars.METASTORE_TRY_DIRECT_SQL.varname, "false");
newHiveConf.set(HiveConf.ConfVars.METASTORE_DISALLOW_INCOMPATIBLE_COL_TYPE_CHANGES.varname, "false");
- newHiveConf.set... |
codereview_java_data_4356 | .title(R.string.title_clear_history_dialog)
.content(R.string.text_clear_history_dialog)
.onPositive((dialog, which) -> {
- Utils.getAppDaoSession(getParent()).getHistoryProductDao().deleteAll();;
... |
codereview_java_data_4359 | public class AliyunProperties implements Serializable {
/**
- * Location to put staging files for uploading to OSS, default to temp directory set in java.io.tmpdir.
*/
public static final String OSS_STAGING_DIRECTORY = "oss.staging-dir";
private final String ossStagingDirectory;
Nit: should be `default... |
codereview_java_data_4361 | in.enterList();
final BytesValue target = in.readBytesValue();
final long expiration = in.readLongScalar();
- in.leaveList(true);
return new FindNeighborsPacketData(target, expiration);
}
(optional) make leaveList parameter an enum. Much easier to understand what `in.leaveList(RLPInput.Ignore... |
codereview_java_data_4363 | /**
* Return a list of possible completions given a prefix string that the user has started typing.
* @param start the amount of text written so far
- * @param detailLevel the level of detail the user wants in completions
*/
@RequestMapping(value = "/stream")
public CompletionProposalsResource completi... |
codereview_java_data_4368 | final StringBuilder buff = new StringBuilder();
final String name =
"GeneratedMetadata_" + simpleNameForHandler(def.handlerClass);
- final Set<MetadataHandler<?>> providerSet = new HashSet<>();
final Map<MetadataHandler<?>, String> handlerToName = new LinkedHashMap<>();
for (MetadataHand... |
codereview_java_data_4371 | * Factory for providers of source code for JavaParser.
* Providers that have no parameter for encoding but need it will use UTF-8.
*/
-public abstract class Providers {
public static final Charset UTF8 = Charset.forName("utf-8");
private Providers() {
Why **abstract** and not **final** ?
* Factory for pro... |
codereview_java_data_4376 | import com.hazelcast.jet.impl.execution.init.JetInitDataSerializerHook;
import com.hazelcast.nio.tcp.FirewallingConnectionManager;
import com.hazelcast.test.HazelcastSerialClassRunner;
-import com.hazelcast.test.annotation.Repeat;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
T... |
codereview_java_data_4381 | EditText ingredientsUnauthorised;
@BindView(R.id.save_edits)
Button saveEdits;
- //Récupération de la langue (théorique) de saisie :
private String languageCode = Locale.getDefault().getLanguage();
private IDietRepository dietRepository;
```suggestion // Fetching of the (theoretical) langua... |
codereview_java_data_4383 | templatePath(),
"Compilation unit doesn't contain a class or interface declaration!"));
if (annotator == null) {
for (String section : sections) {
replaceSectionPlaceHolder(cls, section);
I'm not sure I get this change, can you ex... |
codereview_java_data_4391 | ts.exec("createtable twithcolontest");
ts.exec("insert row c:f cq value");
ts.exec("scan -r row -cf c:f", true, "value");
- String result = ts.exec("scan -b row -cf c:f -cq cq -e row");
- assertEquals(2, result.split("\n").length);
- result = ts.exec("scan -b row -c cf -cf c:f -cq cq -e row", ... |
codereview_java_data_4393 | //mAccount.setRemoteSearchFullText(mRemoteSearchFullText.isChecked());
}
- // Setting image attachment resize preferences.
mAccount.setResizeEnabled(mResizeEnabled.isChecked());
mAccount.setResizeFactor(Integer.parseInt(mResizeFactor.getValue()));
This isn't that useful.
... |
codereview_java_data_4395 | .to(() -> new CreateSession(this)),
post("/se/grid/distributor/node")
.to(() -> new AddNode(tracer, this, json, httpClientFactory)),
- post("/node/{nodeId}/drain")
- .to((params) -> new DrainNode(this, new NodeId(UUID.fromString(params.get("nodeId"))))),
pos... |
codereview_java_data_4396 | @JsonProperty
@NotNull
- private Boolean showTaskDiskSpace = false;
private boolean hideNewDeployButton = false;
private boolean hideNewRequestButton = false;
i know this is a nitpick, but `showTaskDiskResource` better describes what this is
@JsonProperty
@NotNull
+ private boolean showTaskDiskRes... |
codereview_java_data_4398 | */
// void setLocations(Collection<Assignment> assignments) throws DistributedStoreException;
- void setLocations(Collection<Assignment> assignments, TServerInstance prevLastLoc)
- throws DistributedStoreException;
/**
* Mark the tablets as having no known or future location.
At the hackathon we di... |
codereview_java_data_4411 | Map<String, String> rawArgs = new HashMap<>();
rawArgs.putAll(request.getDefinition().getParameters());
rawArgs.putAll(request.getDeploymentProperties());
- Map<String, String> transformed = ModuleLauncherArgumentsHelper.qualifyArgs(0, rawArgs);
- for (Map.Entry<String, String> entry : transformed.entrySet()... |
codereview_java_data_4413 | final ProposalMessageData message = ProposalMessageData.create(signedPayload);
- network.send(message, emptyList());
}
public void multicastPrepare(final ConsensusRoundIdentifier roundIdentifier, final Hash digest) {
Look like Mulitcaster.send(MessageData message) can be removed now since all messages ar... |
codereview_java_data_4420 | import android.widget.EditText;
import android.widget.LinearLayout;
import java.util.List;
public class SWUrl extends SWItem {
-
private List<String> labels;
private List<String> values;
private String groupName;
this is only for radiobuttons
import android.widget.EditText;
import android.widget... |
codereview_java_data_4423 | /*
- * Copyright 2016 Federico Tomassetti
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
.. that the ClassLoader can *load*.
/*
+ * Copyright (C) 2016-2018 The JavaParser Team.
*
* Licensed under the Apache License, Ve... |
codereview_java_data_4424 | */
@Configuration
@EnableConfigurationProperties(ZipkinUiProperties.class)
-@ConditionalOnProperty(value = "zipkin.ui.enabled", havingValue = "true", matchIfMissing = true)
@RestController
public class ZipkinUiAutoConfiguration extends WebMvcConfigurerAdapter {
Nits: `name` might be more clear than `value` (whic... |
codereview_java_data_4428 | }
}, 10000, 10000);
- DefaultMQPushConsumer consumer = new DefaultMQPushConsumer(group, AclClient.getAclRPCHook(), new AllocateMessageQueueAveragely(), msgTraceEnable, null);
if (commandLine.hasOption('n')) {
String ns = commandLine.getOptionValue('n');
co... |
codereview_java_data_4438 | return true;
}
}
-
- public boolean isNearbyLocked() {
- return isNearbyLocked;
- }
-
- public void setNearbyLocked(boolean nearbyLocked) {
- isNearbyLocked = nearbyLocked;
- }
}
Exposing code for test is a code smell. The option is to rewrite or use the nasty `@Vi... |
codereview_java_data_4448 | @Test
public void correctHttpResponse() throws Exception {
- final PublicMetrics publicMetrics = () -> Collections.singleton(new Metric<Number>("mem.free", 1024));
- final ResponseEntity<String> response = responseForMetrics(publicMetrics);
assertThat(response.getStatusCode(), equalTo(H... |
codereview_java_data_4452 | * Constructs a {@code TimestampedEntry} using the window end time as the
* timestamp.
*/
- public static <K, V> TimestampedEntry<K, V> mapWindowResult(long winStart, long winEnd, @Nonnull K key,
- @Nonnull V value) {
ret... |
codereview_java_data_4457 | @Override
public Capabilities getCanonicalCapabilities() {
- return new ImmutableCapabilities(CapabilityType.BROWSER_NAME, BrowserType.CHROME, PLATFORM_NAME, System.getProperty("os.name"));
}
@Override
This isn't correct. It means that only the current platform can be used for a remote webdriver.
@O... |
codereview_java_data_4466 | package com.actiontech.dble.services.mysqlsharding;
import com.actiontech.dble.backend.mysql.proto.handler.Impl.MySQLProtoHandlerImpl;
import com.actiontech.dble.backend.mysql.proto.handler.ProtoHandlerResult;
import com.actiontech.dble.net.handler.LoadDataInfileHandler;
reset protoHandler in here maybe a good ide... |
codereview_java_data_4470 | case UNKNOWN:
case WAITING:
case SUCCESS:
- case INVALID_REQUEST_NOOP:
return true;
default:
LOG.trace("Task {} had abnormal LB state {}", taskId, loadBalancerUpdate);
return false;
In this case, we don't need to remove from Baragon b/c Baragon doesn't know a... |
codereview_java_data_4483 | * @return RoleAccess object on success. ZTSClientException will be thrown in case of failure
*/
public RoleAccess getRoleAccess(String domainName, String principal) {
- updateServicePrincipal(); // TODO: Henry: what if this method returns true - the principal's credentials are changed: should... |
codereview_java_data_4493 | import java.util.List;
-public class ASTAnnotationTypeDeclaration extends ASTAnyTypeDeclaration {
public ASTAnnotationTypeDeclaration(int id) {
this is a breaking API change. Do we really need to do it in 6.2.0? Can't we just deprecate the methods?
import java.util.List;
+public class ASTAnnotationTypeDeclarat... |
codereview_java_data_4503 | private boolean isFunction(Production prod) {
Production realProd = prod.att().get("originalPrd", Production.class);
- if (!realProd.att().contains(Attribute.FUNCTION_KEY) && !realProd.att().contains(Attribute.ML_SYMBOL_KEY)) {
return false;
}
return true;
Again, I w... |
codereview_java_data_4504 | /**
* auth type AK/SK.
*/
- AKSK;
private String position;
Not need this enum. if you use enum, auth develop will need change the original codes when they add an new plugin.
/**
* auth type AK/SK.
*/
+ AKSK,
+ /**
+ * other auth type.
+ */
+ others;
pri... |
codereview_java_data_4508 | /** Cache of pre-generated handlers by provider and kind of metadata.
* For the cache to be effective, providers should implement identity
* correctly. */
- @SuppressWarnings("unchecked")
private static final LoadingCache<Key, MetadataHandler<?>> HANDLERS =
maxSize(CacheBuilder.newBuilder(),
... |
codereview_java_data_4514 | // Checks if input schema and table schema are same(default: true)
public static final String CHECK_ORDERING = "check-ordering";
- // File scan task set ID that is being rewritten
public static final String REWRITTEN_FILE_SCAN_TASK_SET_ID = "rewritten-file-scan-task-set-id";
}
Should we be sharing this prop... |
codereview_java_data_4524 | return (RET) attach(
flatMapUsingServiceAsyncBatchedTransform(
- transform, operationName, serviceFactory, 2, maxBatchSize, flattenedFn),
fnAdapter);
}
This `2` is burried to deeply, should extract a descriptive constant
return (RET) atta... |
codereview_java_data_4532 | }
@Test
- public void dropNamespace_notEmpty() {
Mockito.doReturn(GetTablesResponse.builder()
.tableList(
Table.builder().databaseName("db1").name("t1").parameters(
I think we should also test the case where the namespace is non-empty, but there is no Iceberg table.
}
@Test
+ ... |
codereview_java_data_4540 | allDemands.add(f.getName());
}
// also consider static fields, that are not public
- int requiredMod = Modifier.STATIC;
for (Field f : type.getDeclaredFields()) {
- if ((f.getModifiers() & requiredMod) == requiredMod) {
... |
codereview_java_data_4546 | private void initializeActionBar() {
ActionBar actionBar = getActionBar();
-
- actionBar.setDisplayShowCustomEnabled(true);
- actionBar.setCustomView(R.layout.actionbar_custom);
actionBar.setDisplayHomeAsUpEnabled(true);
}
We didn't use the custom action bar before. No need to... |
codereview_java_data_4548 | public abstract String getTable() throws TableNotFoundException;
/**
- * @return tablet that's is compacting
* @since 1.7.0
*/
public abstract TabletId getTablet();
Should be "that is" or "that's"
public abstract String getTable() throws TableNotFoundException;
/**
+ * @return tablet that i... |
codereview_java_data_4557 | import org.dom4j.Element;
import org.jivesoftware.openfire.Connection;
import org.xmpp.packet.Packet;
/**
* XEP-0198 Stream Manager.
Alternatively could use: `new PacketError(PacketError.Condition.unexpected_request).toXML()` ... initialized perhaps as a static for the sake of efficiency
import org.dom4j.Eleme... |
codereview_java_data_4558 | // exfiltrate the objects from a raw-typed WriteBatch.
private void addWriteRequestsToMap(WriteBatch writeBatch, Map<String, Collection<WriteRequest>> writeRequestMap) {
MappedTableResource mappedTableResource = writeBatch.mappedTableResource();
- Collection<BatchableWriteOperation> writeBatch... |
codereview_java_data_4568 | import java.io.File;
import java.io.IOException;
import java.nio.file.Path;
-import java.util.Optional;
import com.google.common.io.Files;
import org.apache.logging.log4j.LogManager;
Doesn't look like this needs to be wrapped in an `Optional` now?
import java.io.File;
import java.io.IOException;
import java.n... |
codereview_java_data_4576 | }
protected JobGroupInfo newJobGroupInfo(String groupId, String desc) {
- return new JobGroupInfo(groupId, desc + "-" + jobCounter.incrementAndGet(), false);
}
/**
* Returns all the path locations of all Manifest Lists for a given list of snapshots
I think I made a typo in the snippet. We should pro... |
codereview_java_data_4578 | String keyString = key;
try {
- synchronized (getName() + keyString.intern()) {
if (properties.containsKey(keyString)) {
String originalValue = properties.get(keyString);
answer = properties.put(keyString, va... |
codereview_java_data_4585 | @Test
public void descriptionAndBlockTagsAreRetrievable() {
Javadoc javadoc = JavaParser.parseJavadoc("first line\nsecond line\n\n@param node a node\n@return result the result");
- assertEquals(javadoc.getDescription().toText(), "first line\nsecond line");
- assertEquals(2, javadoc.getB... |
codereview_java_data_4597 | /*
Copyright 2007-2009 Selenium committers
Licensed under the Apache License, Version 2.0 (the "License");
Change this to: ``` Copyright 2015 Software Freedom Conservancy Copyright 2007-2009 Selenium committers ```
/*
+Copyright 2015 Software Freedom Conservancy
Copyright 2007-2009 Selenium committers
Licensed ... |
codereview_java_data_4607 | };
}
- static protected TextView getTxtvFFFromActivity(MediaplayerActivity activity) {
return activity.txtvFF;
}
- static protected TextView getTxtvRevFromActivity(MediaplayerActivity activity) {
return activity.txtvRev;
}
can you change this to `protected static`? This ... |
codereview_java_data_4628 | productRepository = ProductRepository.getInstance();
mDataObserver = new DataObserver();
bottomNavigationView = view.findViewById((R.id.bottom_navigation));
- bottomNavigationView.getMenu().getItem(0).setCheckable(false);
BottomNavigationListenerInstaller.install(bottomNaviga... |
codereview_java_data_4657 | if (countDownLatch.await(2, TimeUnit.SECONDS)) {
// Compare sessionPresent flag from AWSIotMqttManager with the actual one
assertEquals(testSessionPresentFlag.getSessionPresent(), actualSessionPresent);
}
}
```suggestion if (countDownLatch.await(2, TimeUnit.SECONDS)) { ... |
codereview_java_data_4658 | * the timestamps would be grouped into the following windows:
*
* <pre>
- * [0, 1], [0, 1, 2, 3], [3, 4, 5, 6], [5, 6]
* </pre>
*
* A sliding window where window size and slide by are the same is equivalent to a
Is it correct? Should not it be [0, 1], [0, 1, 2, 3], [2, 3, 4,... |
codereview_java_data_4659 | final static int ONE_SECOND = 1000;
final static long TIME_TO_WAIT_BETWEEN_SCANS = 60 * ONE_SECOND;
- final static long TIME_TO_CACHE_RECOVERY_WAL_EXISTENCE = 20 * ONE_SECOND;
final private static long TIME_BETWEEN_MIGRATION_CLEANUPS = 5 * 60 * ONE_SECOND;
final static long WAIT_BETWEEN_ERRORS = ONE_SECOND... |
codereview_java_data_4660 | }
public void testParseDateWithForCest() throws Exception {
- GregorianCalendar exp1 = new GregorianCalendar(2017, 0, 28, 22, 00, 00);
exp1.setTimeZone(TimeZone.getTimeZone("UTC"));
Date expected1 = new Date(exp1.getTimeInMillis());
Date actual1 = DateUtils.parse("Sun, 29 Jan... |
codereview_java_data_4670 | LOG.debug("retrieveJWSDomain: retrieving domain {}", domainName);
}
- AthenzDomain athenzDomain = getAthenzDomain(domainName, true);
if (athenzDomain == null) {
return null;
}
why was the master flag set to false removed here since it ends up calling the same... |
codereview_java_data_4679 | throw new RuntimeException(msg);
}
try {
long flushID = getFlushID();
if (lastFlushID != 0 && flushID == 0) {
Didn't look at the rest of the PR, but one quick note: we'd want to log or throw these exceptions, rather than print them.
throw new RuntimeException(msg);
}
+ //... |
codereview_java_data_4680 | @Override
public AccessResource parse(RemotingCommand request, String remoteAddr) {
PlainAccessResource accessResource = new PlainAccessResource();
- accessResource.setWhiteRemoteAddress(remoteAddr.split(":")[0]);
accessResource.setRequestCode(request.getCode());
accessResour... |
codereview_java_data_4691 | import org.h2.table.TableFilter;
/**
- * An index for a function that returns a result set. Search is this index
* performs scan over all rows and should be avoided.
*/
public class FunctionIndex extends BaseIndex {
search is -> search in
import org.h2.table.TableFilter;
/**
+ * An index for a function that ... |
codereview_java_data_4699 | viewBinding.subscribeButton.setEnabled(true);
viewBinding.subscribeButton.setText(R.string.subscribe_label);
if (UserPreferences.isEnableAutodownload()) {
- viewBinding.autoDownloadCheckBox.setChecked(true);
viewBinding.autoDownl... |
codereview_java_data_4706 | try {
return LOCAL_DATE_OF_YEAR_MONTH_DAY.invoke(null, year, month, day);
} catch (InvocationTargetException e) {
- if (month == 2 && day == 29) {
// If proleptic Gregorian doesn't have such date use the next day
return LOCAL_DATE_OF_YEAR_MONTH... |
codereview_java_data_4724 | * Helper to check all permissions defined on a plugin and see the state of each.
*
* @since 3.0.0
- * @return an map containing the permission names and the permission state
*/
public Map<String, PermissionState> getPermissionStates() {
return bridge.getPermissionStates(this);
... |
codereview_java_data_4741 | return transportProvider;
}
- public synchronized Transport getInstance(Context context, StoreConfig storeConfig)
throws MessagingException {
String uri = storeConfig.getTransportUri();
if (uri.startsWith("smtp")) {
`getInstance` is weird. This method should probably be ... |
codereview_java_data_4750 | assertThatThrownBy(() -> sqlService.execute(
"SELECT *"
+ " FROM TABLE ("
- + "avro_file (path => '" + path + "')"
+ ")"
)).isInstanceOf(HazelcastSqlException.class)
.hasMessageContaining("The directory '" + path + "'... |
codereview_java_data_4761 | String result =
ConsumerRunningInfo.analyzeProcessQueue(next.getKey(), next.getValue());
if (result.length() > 0) {
- System.out.printf("%s", result);
}
... |
codereview_java_data_4762 | }
}
for (Production prod : iterable(module.productions())) {
- if (prod.att().contains("mlOp")) {
continue;
}
prod = computePolyProd(prod);
I would rather we call the function that enumerates the klabels than check an attribute like t... |
codereview_java_data_4763 | public ResultWithGeneratedKeys executeUpdate(Object generatedKeysRequest) {
long start = 0;
Database database = session.getDatabase();
- Object sync = database.getMvStore() != null ? null : database.isMultiThreaded() ? session : database;
session.waitIfExclusiveModeEnabled();
... |
codereview_java_data_4764 | }
public void saveResult(Optional<Integer> statusCode, Optional<String> responseBody, Optional<String> errorMessage, Optional<Throwable> throwable) {
- boolean inStartup = false;
- if (throwable.isPresent() && throwable.get() instanceof ConnectException) {
- inStartup = true;
- }
try {
S... |
codereview_java_data_4768 | private static final int EXPECTED_DEFAULT_EPOCH_LENGTH = 30_000;
private static final int EXPECTED_DEFAULT_BLOCK_PERIOD = 1;
private static final int EXPECTED_DEFAULT_REQUEST_TIMEOUT = 1;
- private static final int EXPECTED_DEFAULT_MESSAGE_BUFFER_SIZE = 10_000;
@Test
public void shouldGetEpochLengthFrom... |
codereview_java_data_4770 | }
public boolean isInsideTranscodeFolder() {
- return parent != null && parent instanceof FileTranscodeVirtualFolder;
}
/**
`parent instanceof FileTranscodeVirtualFolder` also checks that it's non-null. `null` is never the instance of anything.
}
public boolean isInsideTranscodeFolder() {
+ return paren... |
codereview_java_data_4771 | sb.append(",");
}
- if (MESSAGE_DIGEST != null) {
- synchronized (LOCK) {
- checksum =
- new BigInteger(1, MESSAGE_DIGEST.digest((sb.toString()).getBytes(Charset.forName("UTF-8")))).toString(16);
- }
} else {
... |
codereview_java_data_4779 | //checks the product states_tags to determine which prompt to be shown
List<String> statesTags = product.getStatesTags();
- if (statesTags.contains(product.getLang()+":categories-to-be-completed")) {
showCategoryPrompt = true;
}
if (product.getNoNutritionData() !=... |
codereview_java_data_4781 | String getTraceId(HttpServletRequest req) {
final String stringValue = getStringParameter(req, "id", null);
return TRACE_ID_PATTERN.matcher(stringValue).matches() ? stringValue : null;
}
This looks like it could produce an NPE from the matcher if `stringValue` is null. We probably want to add a check f... |
codereview_java_data_4782 | }
@Override
- protected Long sequenceNumber() {
return replaceSequenceNumber;
}
With this approach, I think we need a validation that none of the data or delete files that are being replaced have sequence numbers newer than the override sequence number.
}
@Override
+ protected Long sequenceNumbe... |
codereview_java_data_4787 | // if the db name is equal to the schema name
ArrayList<String> list = Utils.newSmallArrayList();
do {
- if (currentTokenType == DOT) {
- list.add(null);
- } else {
list.add(readUniqueIdentifier());
... |
codereview_java_data_4788 | }
}
- if (tracing() != null) {
- options.decorator(BraveClient.newDecorator(tracing(), "elasticsearch"));
- }
-
clientCustomizer().accept(options);
HttpClientBuilder client = new HttpClientBuilder(clientUrl)
.factory(clientFactory())
I wonder if we can somehow bind auth to the c... |
codereview_java_data_4797 | return buf.append(arg);
}
- private static final Pattern SPLIT_NEWLINE_PATTERN;
- static {
- SPLIT_NEWLINE_PATTERN = Pattern.compile("\r\n|\r|\n");
- }
-
private void updateCursor(String arg) {
- String[] lines = SPLIT_NEWLINE_PATTERN.split(arg);
if ( lines.length == 0... |
codereview_java_data_4802 | @Unique
private String wikiDataId;
- private Boolean isWikiDataIdPresent;
-
@ToMany(joinProperties = {
@JoinProperty(name = "tag", referencedName = "ingredientTag")
})
Isn't **isWikiDataIdPresent** redundant since we can check by null/empty the **wikiDataId** itself?
@Unique
... |
codereview_java_data_4803 | private final Schema schema;
private final List<PartitionField> fields = Lists.newArrayList();
private final Set<String> partitionNames = Sets.newHashSet();
- private Map<String, PartitionField> partitionFields = Maps.newHashMap();
private int specId = 0;
private final AtomicInteger lastAssi... |
codereview_java_data_4808 | RelMdUtil.linear(querySpec.fieldNames.size(), 2, 100, 1d, 2d))
.multiplyBy(getQueryTypeCostMultiplier())
// a plan with sort pushed to druid is better than doing sort outside of druid
- .multiplyBy(Util.last(rels) instanceof Bindables.BindableSort ? 0.1 : 0.2);
}
private doub... |
codereview_java_data_4821 | public class ApexUnitTestMethodShouldHaveIsTestAnnotationRule extends AbstractApexUnitTestRule {
private static final String TEST = "test";
@Override
public Object visit(final ASTUserClass node, final Object data) {
// test methods should have @isTest annotation.
This rule could make use of ru... |
codereview_java_data_4825 | if (!PositionUtils.areInOrder(a, b)) {
return thereAreLinesBetween(b, a);
}
- int endOfA = a.getRange().get().end.line;
- return b.getRange().get().begin.line > endOfA + 1;
}
}
Maybe this is a little bit too long to write. Should we create & use a `getEndLine` method?... |
codereview_java_data_4827 | * A compatibility wrapper around {@link com.sun.tools.javac.util.Filter}.
* Adapted from {@link com.google.errorprone.util.ErrorProneScope} with additional methods.
*
* TODO(fwindheuser): Delete after upstreaming missing methods into "ErrorProneScope".
*/
@SuppressWarnings("ThrowError")
Let's add a link to ... |
codereview_java_data_4833 | */
public class DBWriter {
private static final String TAG = "DBWriter";
- private static final String PREF_QUEUE_ADD_TO_FRONT = "prefQueueAddToFront";
private static final ExecutorService dbExec;
Wouldn't this be better off in PreferenceController.java?
*/
public class DBWriter {
private stat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.