id stringlengths 23 26 | content stringlengths 182 2.49k |
|---|---|
codereview_java_data_3662 | public List<Node> getNodes() {
return distributorStatus.get().getNodes().stream()
- .map(summary -> new Node(summary.getNodeId(), summary.getUri(), summary.isUp(),
- summary.getMaxSessionCount(), summary.getStereotypes()))
.collect(ImmutableList.toImmutableList());
}... |
codereview_java_data_3664 | JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());
closeResponse(response);
assertThatJson(responseNode)
- .when(Option.IGNORING_EXTRA_FIELDS, Option.IGNORING_EXTRA_ARRAY_ITEMS, Option.IGNORING_ARRAY_ORDER)
.is... |
codereview_java_data_3665 | /** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-4724">[CALCITE-4724]
- * As for ClickHouse do not support values in from clause.
*/
@Test void testAliasedValueForClickHouse() {
final String query = "select 1";
1. the test descript should be the same as the CALCITE-4724. ... |
codereview_java_data_3668 | * @return Whether condition is supported
*/
private static boolean canJoinOnCondition(RexNode node) {
- if (node.isAlwaysTrue() || node.isAlwaysFalse()) {
- return true;
- }
final List<RexNode> operands;
switch (node.getKind()) {
case AND:
case OR:
... |
codereview_java_data_3672 | int[] pri;
// user privilege config
UserPrivilegesConfig userPrivilegesConfig = user.getPrivilegesConfig();
- boolean isCheck = userPrivilegesConfig == null || !userPrivilegesConfig.isCheck();
for (String schema : user.getSchemas()) {
- if (i... |
codereview_java_data_3690 | private HttpResponseHandler<? extends Throwable> exceptionResponseHandler;
private Executor executor;
private CompletableFuture<Void> future;
private Builder() {
}
I think this might be misleading. `isDone` is set to true when the the stream completes normally as well (in `... |
codereview_java_data_3698 | }
private void useRequestSlot(final EthPeer peer) throws PeerNotConnected {
- peer.getNodeData(emptyList());
}
@SuppressWarnings("unchecked")
private void assertRequestSuccessful(final PendingPeerRequest pendingRequest) {
final Consumer<ResponseStream> onSuccess = mock(Consumer.class);
- pendi... |
codereview_java_data_3704 | public static final String EMPTY = "";
public static String newString4UTF8(byte[] bytes) {
- return new String(bytes, Charset.forName("UTF-8"));
}
public static boolean isBlank(String str) {
like before said, I think use constant value will be better.
public static final String EMPTY =... |
codereview_java_data_3705 | try (BufferedWriter nsWriter = new BufferedWriter(new FileWriter(namespaceScript, UTF_8))) {
nsWriter.write(createNsFormat.format(new String[] {namespace}));
TreeMap<String,String> props = new TreeMap<>();
- for (Entry<String,String> p : accumuloClient.namespaceOperations().getPropertiesMap(name... |
codereview_java_data_3712 | return spec;
}
public static MetricsConfig fromProperties(Map<String, String> props) {
MetricsConfig spec = new MetricsConfig();
String defaultModeAsString = props.getOrDefault(DEFAULT_WRITE_METRICS_MODE, DEFAULT_WRITE_METRICS_MODE_DEFAULT);
Will we fail jobs if the default mode is invalid? Will i... |
codereview_java_data_3713 | @Nonnull SourceBufferConsumerSide<? extends T> buffer,
@Nullable WatermarkGenerationParams<? super T> wmParams
) {
this.createFn = createFn;
this.fillBufferFn = fillBufferFn;
this.destroyFn = destroyFn;
Processor is not marked as non-cooperative.
... |
codereview_java_data_3714 | try {
BatchScanner scanner = client.createBatchScanner(level.metaTable(), Authorizations.EMPTY);
- List<Range> ranges =
- extents.stream().map(e -> e.toMetaRange()).collect(Collectors.toList());
scanner.setRanges(ranges);
configureColumns(scanner);
3 possible changes... |
codereview_java_data_3718 | * are enabled. Otherwise empty metrics will be returned.
* <p>
* Keep in mind that the collections may occur at different times on
- * each member, metrics from various members aren't from the same instant
- * of time.
* <p>
* When a job is restarted (or resumed after being previou... |
codereview_java_data_3728 | if (sgv.getMills() > latestDateInReceivedData)
latestDateInReceivedData = sgv.getMills();
}
- // Was that sgv more than 15 mins ago ?
- boo... |
codereview_java_data_3734 | @Override
public Iterable<FileScanTask> split(long splitSize) {
- if (file.splitOffsets() != null) {
- return () -> new OffsetsBasedSplitScanTaskIterator(file.splitOffsets(), this);
- } else if (file.format().isSplittable()) {
- return () -> new FixedSizeSplitScanTaskIterator(splitSize, this);
... |
codereview_java_data_3738 | * @param b the second key
* @return -1 if the first key is smaller, 1 if bigger, 0 if equal
*/
final int compare(Object a, Object b) {
return keyType.compare((K)a, (K)b);
}
`@SuppressWarnings("unchecked")` is needed on this method.
* @param b the second key
* @return -... |
codereview_java_data_3740 | * it before returning it. If the elements of the list are mutated, they
* must be copied as well.
* <p>
- * The returned function must not return {@code null} for any accumulator.
*/
@Nonnull
DistributedFunction<? super A, ? extends R> exportFn();
It should just say "must not retu... |
codereview_java_data_3753 | static class PositionReader implements ParquetValueReader<Long> {
private long rowOffsetInCurrentRowGroup = -1;
- private long rowGroupRowOffsetInfile;
@Override
public Long read(Long reuse) {
rowOffsetInCurrentRowGroup = rowOffsetInCurrentRowGroup + 1;
- return rowGroupRowOffsetInfile ... |
codereview_java_data_3763 | progressBar.setVisibility(View.GONE);
}, error -> Log.e(TAG, Log.getStackTraceString(error)));
- if (UserPreferences.getFeedFilter() != UserPreferences.FEED_FILTER_NONE)
filterMsg.setVisibility(View.VISIBLE);
- else
filterMsg.setVisibility(Vi... |
codereview_java_data_3777 | private DefaultStreamService defaultStreamService;
@Mock
- private StreamDeploymentRepository stramDeploymentRepository;
@Before
public void setup() {
controller = new StreamDeploymentController(streamDefinitionRepository, deploymentIdRepository, appRegistry,
- appDeployer, metadataResolver, commonApplica... |
codereview_java_data_3779 | final List<Address> committers =
IbftBlockHashing.recoverCommitterAddresses(header, ibftExtraData);
- if (!validateCommitters(committers, validatorProvider.getValidators())) {
- return false;
- }
- return true;
}
private boolean validateCommitters(
nit: this can be simplified to retur... |
codereview_java_data_3781 | import static java.lang.String.format;
import static org.assertj.core.api.Assertions.assertThat;
-import static org.junit.jupiter.api.Assertions.assertThrows;
import org.flowable.common.engine.api.FlowableException;
import org.flowable.engine.impl.test.PluggableFlowableTestCase;
import org.flowable.engine.test.Dep... |
codereview_java_data_3783 | return create(
new PantheonFactoryConfigurationBuilder()
.setName(name)
- .jsonRpcEnabled()
.setJsonRpcConfiguration(jsonRpcConfigWithAdmin())
.webSocketEnabled()
.setDiscoveryEnabled(false)
I think this is redundant.
return create(
... |
codereview_java_data_3788 | }
TokenEntry cpdToken = new TokenEntry(token.getImage(),
filename,
- token.getBeginLine() + 1,
- token.getBeginColumn() + 1,
- ... |
codereview_java_data_3792 | assertEntryPointIdExists("simpleFactList");
}
- @Disabled
public void getDatasourceType() {
final Optional<Class<?>> dataSourceType = ruleUnitDescr.getDatasourceType("nonexisting");
Assertions.assertThat(dataSourceType).isNotPresent();
Can't we fix those tests instead of disabli... |
codereview_java_data_3793 | package org.apache.accumulo.core.clientImpl.bulk;
import static org.junit.Assert.assertEquals;
import java.util.SortedMap;
import java.util.TreeMap;
@keith-turner Try adding this line. Looks like the checkstyle is expecting Assert methods to be static imports. import static org.junit.Assert.assertEquals;
package... |
codereview_java_data_3805 | }
}
- private K parseKore(Module mod) {
- try {
- return KoreToK.parseKoreToK(options.fileToParse(), idsToLabelsProvider.getKoreToKLabels(), mod.sortAttributesFor());
- } catch (ParseError parseError) {
- throw KEMException.criticalError("Parse error" );
- }
... |
codereview_java_data_3817 | import org.kframework.definition.Production;
import org.kframework.definition.Terminal;
import org.kframework.parser.Constant;
import org.kframework.parser.SetsTransformerWithErrors;
import org.kframework.parser.Term;
import org.kframework.parser.TermCons;
This is not a sound way of generating names for variable... |
codereview_java_data_3835 | private static final Logger LOGGER = LoggerFactory.getLogger(NotifyCenter.class);
- public static int RING_BUFFER_SIZE = 16384;
- public static int SHARE_BUFFER_SIZE = 1024;
private static final AtomicBoolean CLOSED = new AtomicBoolean(false);
No `static final` use camel naming. Your changes can't pass... |
codereview_java_data_3837 | c.tableOperations().setProperty(tableName, propertyName, description1);
// Loop through properties to make sure the new property is added to the list
- int count = 0;
- for (Entry<String,String> property : c.tableOperations().getPropertiesMap(tableName)
- .entrySet()) {
- if (pro... |
codereview_java_data_3842 | public Constraint<Double> applyBolusConstraints(Constraint<Double> insulin) {
if (statusResult != null) {
insulin.setIfSmaller(statusResult.maximumBolusAmount, String.format(MainApp.gs(R.string.limitingbolus), statusResult.maximumBolusAmount, MainApp.gs(R.string.pumplimit)), this);
}... |
codereview_java_data_3852 | import org.apache.calcite.avatica.util.ByteString;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.ByteBuffer;
The MySQL says that > This function requires MySQL to have been compiled with a compression library such as zlib Should we follow that ?
import org.apache.calcite.avati... |
codereview_java_data_3861 | // Decode the identity header when loading a draft.
// See buildIdentityHeader(TextBody) for a detailed description of the composition of this blob.
Map<IdentityField, String> k9identity = new HashMap<IdentityField, String>();
- if (message.getHeader(K9.IDENTITY_HEADER).length > 0 && m... |
codereview_java_data_3864 | this.cacheType = StringUtils.toUpperEnglish(
ci.removeProperty("CACHE_TYPE", Constants.CACHE_TYPE_DEFAULT));
this.ignoreCatalogs = ci.getProperty("IGNORE_CATALOGS",
- dbSettings.ignoreCatalogs ? "TRUE" : "FALSE").equals("TRUE");
openDatabase(traceLevelFile, tra... |
codereview_java_data_3867 | public CompletableFuture<Void> eventStreamOperation(EventStreamOperationRequest eventStreamOperationRequest,
Publisher<InputEventStream> requestStream, EventStreamOperationResponseHandler asyncResponseHandler) {
try {
JsonOperationMetad... |
codereview_java_data_3868 | import com.google.gson.JsonPrimitive;
import com.pinterest.secor.util.BackOffUtil;
import org.apache.hadoop.hive.common.type.HiveDecimal;
-import org.apache.hadoop.hive.ql.exec.vector.*;
import org.apache.orc.TypeDescription;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Please list out the each impor... |
codereview_java_data_3873 | }
break;
default:
break;
}
} else {
Why did you remove this line "rowBuilder.set(i, s);"? We still want to set the value if the type is not numeric.
}
break;
default:
+ rowBuilder.set(i, s);
break;
}
... |
codereview_java_data_3879 | return true;
}
- @SuppressWarnings("ByteBufferBackingArray")
private Object convertPartitionValue(Type type, Object value) {
if (type.typeId() == Types.BinaryType.get().typeId()) {
ByteBuffer buffer = (ByteBuffer) value;
- return new DataByteArray(buffer.get(new byte[buffer.re... |
codereview_java_data_3885 | }
@Override
- public <R> Try<R> then(CheckedFunction1<T, R> f) {
return flatMap(value -> Try.of(() -> f.apply(value)));
}
- @Override
- public Try<T> thenRun(CheckedConsumer<T> f) {
- Try<Void> result = flatMap(value -> Try.run(() -> f.accept(value)));
- return result.isSu... |
codereview_java_data_3893 | */
@SafeVarargs
@SuppressWarnings("varargs")
- static <U> Arbitrary<U> fixed(U... values) {
- return forAll(Gen.choose(values));
}
/**
Hi @talios, finally I'm able to answer... Thanks - the code looks great. Instead of `fixed` and `forAll` I would name the methods `of(T...)` and `of... |
codereview_java_data_3895 | createLbCleanupRequest(requestId, matchingActiveTaskIds);
}
} else {
- if (matchingActiveTaskIds.iterator().hasNext()) {
delete(requestCleanup, matchingActiveTaskIds);
} else {
Optional<SingularityRequestHistory> maybeHistory =... |
codereview_java_data_3901 | * @throws PatternSyntaxException if the regular expression's syntax is invalid
* @see Pattern
*/
- public Seq<CharSeq> split(String regex, int limit) {
- final Seq<String> split = Array.wrap(toString().split(regex, limit));
return split.map(CharSeq::of);
}
this is the `3.0.0` ... |
codereview_java_data_3905 | jobMetrics.delete(id);
JobResult jobResult = jobResults.get(id);
if (jobResult != null) {
- jobResult.destroy(instance);
jobResults.delete(id);
}
... |
codereview_java_data_3910 | *
* <ul>
* <li>{@link #existsUnique(Predicate)}</li>
* <li>{@link #isDistinct}</li>
* <li>{@link #isOrdered}</li>
- * <li>{@link #hasDefiniteSize()}</li>
* <li>{@link #isTraversableAgain()}</li>
* </ul>
*
Please move these below hasDefiniteSize()
*
* <ul>
* <li>{@link #existsUnique(Predicate)}</... |
codereview_java_data_3925 | @Override
protected String operation() {
- return DataOperations.APPEND;
}
@Override
This isn't an append because no data is added. Instead, use `DataOperations.REPLACE` to signal that the data in the table did not change.
@Override
protected String operation() {
+ return DataOperations.REPLAC... |
codereview_java_data_3926 | */
public static SQLException getJdbcSQLException(int errorCode)
{
- return getJdbcSQLException(errorCode, null);
}
/**
It should be `getJdbcSQLException(errorCode, (Throwable) null)` after renaming of methods, now this call is ambiguous.
*/
public static SQLException getJd... |
codereview_java_data_3937 | if (wasStored || store.getAutoCommitDelay() == 0) {
store.tryCommit();
} else {
- boolean empty = true;
- BitSet openTrans = openTransactions.get();
- for (int i = openTrans.nextSetBit(0); empty && i >= 0; i = openTrans.nextSetBit(i... |
codereview_java_data_3939 | }
for (Tablet tablet : getOnlineTablets()) {
tablet.removeInUseLogs(candidates);
- if (candidates.size() == 0) {
break;
}
}
Should be `isEmpty()`?
}
for (Tablet tablet : getOnlineTablets()) {
tablet.removeInUseLogs(candidates);
+ if (candidates.isEmpty(... |
codereview_java_data_3945 | * @see Authentication
*/
public final class InMemoryOAuth2AuthorizedClientService implements OAuth2AuthorizedClientService {
private final ClientRegistrationRepository clientRegistrationRepository;
- private Map<OAuth2AuthorizedClientId, OAuth2AuthorizedClient> authorizedClients = new ConcurrentHashMap<>();
/*... |
codereview_java_data_3952 | import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eth.EthTransactions;
public class ExpectBeneficiary implements Condition {
-
- private EthTransactions eth;
- private String beneficiary;
public ExpectBeneficiary(final EthTransactions eth, final PantheonNode node) {
this.eth = eth;
You could ma... |
codereview_java_data_3954 | public class Quotes {
/**
- * Convert strings with both quotes and ticks into: foo'"bar -> concat("foo'", '"', "bar")
*
* @param toEscape a text to escape quotes in, e.g. "f'oo"
* @return the same text with escaped quoted, e.g. "\"f'oo\""
This sentence doesn't make sense. Converts strings into what?... |
codereview_java_data_3955 | */
private boolean isRequiredToUploadAtTime(TopicPartition topicPartition) throws Exception{
final String topic = topicPartition.getTopic();
- final String topicFilter = mConfig.getKafkaTopicUploadAtMinuteMarkFilter();
- if (topicFilter == null || topicFilter.isEmpty()){ return false; ... |
codereview_java_data_3960 | throws AccumuloSecurityException, AccumuloException, NamespaceNotFoundException {
if (!exists(namespace))
throw new NamespaceNotFoundException(null, namespace, null);
- Map<String,String> copy = new TreeMap<>();
- this.getConfiguration(namespace).forEach(copy::put);
for (IteratorScope scop... |
codereview_java_data_3964 | link = "https://github.com/palantir/gradle-baseline#baseline-error-prone-checks",
linkType = BugPattern.LinkType.CUSTOM,
severity = BugPattern.SeverityLevel.WARNING,
- summary = "Calling address.getHostName may result in a DNS lookup which is a network request, making the "
... |
codereview_java_data_3965 | */
package com.alibaba.nacos.config.server.utils;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
Close the connection using the try-with-resource mechanism,like this ``` java try(ZipInputStream zipIn = new ZipInputStream(new ByteArrayInputStream(source))){ // ur code } ``... |
codereview_java_data_3973 | void loadDomainChangePublisher() {
String topicNames = System.getProperty(ZMS_PROP_DOMAIN_CHANGE_TOPIC_NAMES, "");
for (String topic : topicNames.split(",")) {
if (!topic.isEmpty()) {
if (domainChangePublishers == null) {
domainChangePublishers =... |
codereview_java_data_3974 | // for any given table. The logic here uses the setting of the first getItem in a table batch and then checks
// the rest are identical or throws an exception.
private KeysAndAttributes generateKeysAndAttributes(ReadBatch readBatch) {
- Collection<BatchableReadOperation> readOperations = readBatch... |
codereview_java_data_3985 | *
* @param job
* Hadoop job instance to be configured
- * @param connectionInfo
* Connection information for Accumulo
* @since 2.0.0
*/
- public static void setConnectionInfo(JobConf job, ConnectionInfo connectionInfo) throws AccumuloSecurityException {
- ConnectionInfoIm... |
codereview_java_data_3986 | @Override
public boolean isValidAuthorizations(String user, List<ByteBuffer> auths) throws AccumuloSecurityException {
- if (auths.size() == 0) {
// avoid deserializing auths from ZK cache
return true;
}
You should call `.isEmpty()`
@Override
public boolean isValidAuthorizations(Stri... |
codereview_java_data_3989 | /**
- * Counts the operations matching the signature mask in this class.
*
* @param classNode The class on which to count
* @param mask The mask
*
- * @return The number of operations matching the signature mask
*/
protected int countMatchingFieldSigs(ASTAnyTypeDecla... |
codereview_java_data_3992 | proposals.clear();
}
- public ImmutableMap<Address, VoteType> getProposals() {
- return ImmutableMap.copyOf(proposals);
}
public Optional<VoteType> get(final Address address) {
Do we want to copy this or just return an immutable view of it e.g. `Collections.unmodifiableMap`?
proposals.clear();
... |
codereview_java_data_3999 | }
@Provides
public AppDatabase provideAppDataBase() {
return Room.databaseBuilder(applicationContext, AppDatabase.class, "commons_room.db").build();
}
This should be `@Singelton`
}
@Provides
+ @Singleton
public AppDatabase provideAppDataBase() {
return Room.data... |
codereview_java_data_4000 | return item;
}
- private void setEvaluatable(TableFilter join) {
- setEvaluatable(true);
- }
-
/**
* Set what plan item (index, cost, masks) to use.
*
function can now be inlined?
return item;
}
/**
* Set what plan item (index, cost, masks) to use.
... |
codereview_java_data_4011 | // org.jivesoftware.util.cache.CacheFactory.joinedCluster). This means that they now hold data that's
// available on all other cluster nodes. Data that's available on the local node needs to be added again.
restoreCacheContent();
}
@Override
Is it necessary to tell any listeners t... |
codereview_java_data_4019 | {
Pair<Long, Long> messageAndThreadId;
- if (!message.getSyncContext().isPresent()) {
- messageAndThreadId = insertStandardTextMessage(masterSecret, envelope, message, smsMessageId);
- } else {
messageAndThreadId = insertSyncTextMessage(masterSecret, envelope, message, smsMessageId);
}
... |
codereview_java_data_4038 | pumpDescription.basalStep = 0.01d;
pumpDescription.basalMinimumRate = 0.02d;
- pumpDescription.isRefillingCapable = false;
//pumpDescription.storesCarbInfo = false; // uncomment when PumpDescription updated to include this
this.connector = Connector.get();
@jamorham Forgot to... |
codereview_java_data_4041 | if (tree.isLeaf()) {
return value;
} else {
- return "(" + value + " " + (tree.getChildren().map(Node::toLispString).mkString(" ")) + ")";
}
}
could you please separate computations from string concatenation?
if (tree.isLeaf(... |
codereview_java_data_4043 | if (removeIt) {
return; // nothing to do
} else {
- throw new IllegalStateException();
}
}
NormalAnnotationExpr parentExpr = findAll.get(0);
What about something like ```suggestion throw new IllegalStateException("Impossible to fi... |
codereview_java_data_4051 | @SuppressWarnings("unchecked")
default N setName(String name) {
return setName(Name.parse(name));
}
Do you hate static imports? :)
@SuppressWarnings("unchecked")
default N setName(String name) {
+ assertNonEmpty(name);
return setName(Name.parse(name));
} |
codereview_java_data_4054 | new ExtensionAttribute(ATTRIBUTE_FORM_FIELD_VALIDATION),
new ExtensionAttribute(ATTRIBUTE_TASK_SERVICE_EXTENSIONID),
new ExtensionAttribute(ATTRIBUTE_TASK_USER_SKIP_EXPRESSION),
- new ExtensionAttribute(ATTRIBUTE_TASK_USER_SKIP_EXPRESSION),
new ExtensionAtt... |
codereview_java_data_4057 | }
private FileVisitResult callback(Path absolutePath, ParserConfiguration configuration, Callback callback) throws IOException {
- if (!Files.exists(absolutePath)) {
- return TERMINATE;
- }
Path localPath = root.relativize(absolutePath);
Log.trace("Parsing %s", local... |
codereview_java_data_4065 | import com.esotericsoftware.kryo.io.Input;
import com.esotericsoftware.kryo.io.Output;
import com.google.common.collect.ImmutableList;
-import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
impo... |
codereview_java_data_4067 | public static final CalciteSystemProperty<Boolean> TOPDOWN_OPT =
booleanProperty("calcite.planner.topdown.opt", false);
- /**
- * Whether to enable index-based access for struct fields.
- *
- * <p>Note: the feature is experimental as it relies on field order which is JVM-dependent
- * (see CALCITE-24... |
codereview_java_data_4073 | */
public class MainnetTransactionValidator implements TransactionValidator {
- public static final BigInteger NO_CHAIN_ID = BigInteger.valueOf(-1);
-
public static MainnetTransactionValidator create() {
return new MainnetTransactionValidator(new FrontierGasCalculator(), false);
}
Shouldn't be using a s... |
codereview_java_data_4074 | @Nonnull
List<Transform> upstream();
- boolean isLocalParallelismDetermined();
-
- void setLocalParallelismDetermined(boolean localParallelismDetermined);
-
void determineLocalParallelism(Context context);
void addToDag(Planner p);
We never use these methods.
@Nonnull
List<Transfor... |
codereview_java_data_4076 | public void setHint(@NonNull String hint, @Nullable CharSequence subHint) {
this.hint = hint;
-
- if (subHint != null) {
- this.subHint = subHint;
- } else {
- this.subHint = null;
- }
if (this.subHint != null) {
super.setHint(new SpannableStringBuilder().append(ellipsizeToWidth(t... |
codereview_java_data_4081 | javaConvention.getTargetCompatibility().toString())));
project.getPluginManager().apply(ScalaStylePlugin.class);
TaskCollection<ScalaStyleTask> scalaStyleTasks = project.getTasks().withType(ScalaStyleTask.class);
scalaStyleTasks
... |
codereview_java_data_4093 | import java.util.Collections;
import java.util.List;
import java.util.concurrent.ScheduledExecutorService;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.annotations.SdkInternalApi;
import software.amazon.awssdk.awscore.client.handler.AwsSyncClientHandler;
I'm not sure if usin... |
codereview_java_data_4094 | PooledDataSource pooledDataSource = (PooledDataSource) standaloneInMemFormEngineConfiguration.getDataSource();
PoolState state = pooledDataSource.getPoolState();
- assertThat(state.getIdleConnectionCount()).isGreaterThan(0);
// then
// if the engine is closed
AssertJ also ha... |
codereview_java_data_4095 | RoleMember rm;
while (roleit.hasNext()) {
rm = roleit.next();
- if (rm != null && rm.getActive() != null && rm.getActive() == Boolean.FALSE) {
roleit.remove();
}
}
we don't really ne... |
codereview_java_data_4097 | @Option(
names = {"--nodes-whitelist"},
paramLabel = "<enode://id@host:port>",
- description =
- "Comma separated enode URLs for Permissioned networks. " + "Default is an empty list.",
split = ",",
- arity = "1..*"
)
private final Collection<String> nodesWhitelist = null;
It might ... |
codereview_java_data_4106 | jet.newJobIfAbsent(p, config);
}
- private static void printResults(List<Long> top10numbers) {
- System.out.println("Top " + TOP + " random numbers observed since last print: ");
- for (int i = 0; i < top10numbers.size(); i++) {
- System.out.println(String.format("%d. %,d", i +... |
codereview_java_data_4109 | */
@XmlJavaTypeAdapter(JaxbAbstractIdSerializer.class)
public static class ID extends AbstractId {
- private static final long serialVersionUID = -155513612834787244L;
static final Cache<String,ID> cache = CacheBuilder.newBuilder().weakValues().build();
public static final ID METADATA = of("!0");... |
codereview_java_data_4113 | normalizedMember + " from group: " + groupName, ctx.getApiName());
}
- // update our role and domain time-stamps, and invalidate local cache entry
con.updateGroupModTimestamp(domainName, groupName);
con.updateDomainModTimesta... |
codereview_java_data_4121 | }
String provider = ipAddressAttributes[0];
- String[] providerAddr = IpUtil.splitIpPortStr(provider);
- if (providerAddr.length != IpUtil.SPLIT_IP_PORT_RESULT_LENGTH) {
- // not ip:port string
return null;
}
Is the same behavior when provider without po... |
codereview_java_data_4126 | public void testNoDataflowConfig() {
SpringApplication app = new SpringApplication(LocalTestNoDataFlowServer.class);
context = app.run(new String[] { "--server.port=0", "--spring.jpa.database=H2", "--spring.flyway.enabled=false" });
- // we still have deployer beans
assertThat(context.containsBean("appRegis... |
codereview_java_data_4134 | import org.apache.iceberg.expressions.Expression;
import org.apache.iceberg.io.CloseableIterable;
-class StaticTableScan extends BaseTableScan {
private final Function<StaticTableScan, DataTask> buildTask;
// Metadata table name that the buildTask that this StaticTableScan will return data for.
private final... |
codereview_java_data_4136 | }
@ApiModelProperty(required=false, value="Additional artifacts to download for this run")
- public Optional<List<SingularityMesosArtifact>> getExtraArtifacts() {
return extraArtifacts;
}
Instead of passing Optional lists around, let's just default it to an empty list if the constructor arg is null. Sam... |
codereview_java_data_4145 | import org.apache.accumulo.core.client.MutationsRejectedException;
import org.apache.accumulo.core.client.Scanner;
import org.apache.accumulo.core.client.TableNotFoundException;
-import org.apache.accumulo.core.client.impl.ClientContext;
import org.apache.accumulo.core.client.impl.Table;
import org.apache.accumulo... |
codereview_java_data_4146 | import io.openmessaging.rocketmq.config.ClientConfig;
import io.openmessaging.rocketmq.domain.ConsumeRequest;
import io.openmessaging.rocketmq.domain.NonStandardKeys;
-import io.openmessaging.rocketmq.utils.OMSUtil;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
It's not a good ... |
codereview_java_data_4157 | private void showSnackBarWithRetry() {
progressBar.setVisibility(View.GONE);
- if (onClickListener == null) {
- onClickListener = view -> {
- setAchievements();
- };
- }
ViewUtil.showDismissibleSnackBar(findViewById(android.R.id.content),
- ... |
codereview_java_data_4162 | <R_NEW> AggregateOperation1<T, A, R_NEW> andThen(DistributedFunction<? super R, ? extends R_NEW> thenFn);
/**
- * Turns this aggregate operation into a collector which can be passed to
* {@link java.util.stream.Stream#collect(Collector)}.
*/
@Nonnull
"Adapts" might be better than "turns"... |
codereview_java_data_4163 | Object object = f.get(parentNode);
if (object == null)
continue;
- if (List.class.isAssignableFrom(object.getClass())) {
- List<?> l = (List<?>) object;
success &= l.remove(this);
... |
codereview_java_data_4175 | Preconditions.checkArgument(repeatedElement.isRepetition(Type.Repetition.REPEATED),
"Invalid list: inner group is not repeated");
- Preconditions.checkArgument(repeatedElement.isPrimitive() || repeatedElement.asGroupType().getFieldCount() <= 1,
"Invalid list: repeated group is not a single fie... |
codereview_java_data_4180 | static void checkCompatibility(PartitionSpec spec, Schema schema) {
for (PartitionField field : spec.fields) {
Type sourceType = schema.findType(field.sourceId());
- ValidationException.check(sourceType != null,
- "Cannot find source column for partition field: %s", field);
Validatio... |
codereview_java_data_4184 | import javax.inject.Inject;
import javax.inject.Singleton;
@Singleton
public class UploadRepository {
Same with this class
import javax.inject.Inject;
import javax.inject.Singleton;
+/**
+ * The repository class for UploadActivity
+ */
@Singleton
public class UploadRepository { |
codereview_java_data_4186 | final Throwable originalErr = error;
executionService.schedule(() -> {
try {
- if (!tryRetry(partitions, entries, doneLatch, completionFuture)) {
completionFuture.completeExceptionally(original... |
codereview_java_data_4187 | }
public static SingularityDeployKey fromPendingTask(SingularityPendingTask pendingTask) {
- return new SingularityDeployKey(pendingTask.getTaskId().getRequestId(), pendingTask.getTaskId().getDeployId());
}
public static SingularityDeployKey fromDeployMarker(SingularityDeployMarker deployMarker) {
consi... |
codereview_java_data_4199 | return lst;
}
- @Override
- public List<Short> check(SystemEnvironment env, Mutation mutation) {
- context = env.getServerContext();
- return check((Environment) env, mutation);
- }
-
@Override
public List<Short> check(Environment env, Mutation mutation) {
ArrayList<Short> violations = null;... |
codereview_java_data_4211 | return buff.toString();
}
if (table.isView() && ((TableView) table).isRecursive()) {
- buff.append(table.getSchema().getSQL()).append('.').append(table.getName());
} else {
buff.append(table.getSQL());
}
It looks like `buff.append(table.getSQL())... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.