id stringlengths 23 26 | content stringlengths 182 2.49k |
|---|---|
codereview_java_data_6539 | receivedMessages
.values()
.stream()
- .map(message -> message.getSignedPayload())
.collect(Collectors.toList()));
} else {
throw new IllegalStateException("Unable to create RoundChangeCertificate at this time.");
nit: can u... |
codereview_java_data_6542 | */
package tech.pegasys.pantheon.metrics;
public interface MetricCategory {
String getName();
- boolean isApplicationSpecific();
}
Instead of having a `boolean` here + the `applicationPrefix` configured on the `MetricsSystem`, what about just storing an `Optional<String> applicationPrefix` on `MetricsCategory... |
codereview_java_data_6543 | }
private T readInternal(T struct, ColumnVector[] columnVectors, int row) {
- for (int c = 0; c < readers.length; ++c) {
- set(struct, c, reader(c).read(columnVectors[c], row));
}
return struct;
}
Is `ColumnVector` still materialized? Is it possible to avoid reading that entire... |
codereview_java_data_6547 | import java.io.File;
import java.net.URI;
import java.util.List;
import java.util.stream.Collectors;
Should this be more explicit that the file doesn't exist at the specified location? I feel like this could be interpreted as "something went wrong", not "it wasn't there."
import java.io.File;
import java.net.UR... |
codereview_java_data_6549 | // eth_sendTransaction specific error message
ETH_SEND_TX_NOT_AVAILABLE(
-32604,
- "The method eth_sendTransaction is not supported. Use eth_sendRawTransaction with a supported signer, e.g. ethsigner."),
// P2P related errors
P2P_DISABLED(-32000, "P2P has been disabled. This functionality is not... |
codereview_java_data_6559 | /**
* Creates a key with the specified row, empty column family, empty column qualifier, empty column
* visibility, timestamp {@link Long#MAX_VALUE}, and delete marker false. This constructor creates
- * a copy of row. If you don't want to create a copy of row, you should call
- * {@link Key#Key(byte[] ... |
codereview_java_data_6563 | long dateValue = fieldDateAndTime[0];
long timeNanosRetrieved = fieldDateAndTime[1];
- // Variable that contains the number of nanoseconds in 'hour', 'minute',
- // etc.
- long nanoInHour = 3_600_000_000_000l;
- long nanoInMinute = 60_000_000_000l;
- long nanoInSecon... |
codereview_java_data_6564 | final String topic = ClassUtils.getCanonicalName(subscribeType);
EventPublisher eventPublisher = INSTANCE.publisherMap.get(topic);
- if (eventPublisher == null) {
- return false;
}
- eventPublisher.removeSubscriber(consumer);
- return true;
}
/**
I t... |
codereview_java_data_6574 | import com.hazelcast.config.SerializerConfig;
import com.hazelcast.jet.Observable;
import com.hazelcast.jet.SimpleTestInClusterSupport;
import com.hazelcast.jet.config.JetConfig;
import com.hazelcast.jet.config.JobConfig;
import com.hazelcast.jet.pipeline.Pipeline;
We should not register the serializer for the c... |
codereview_java_data_6577 | final Object updateSync = new Object();
- public enum CHARTTYPE {PRE, BAS, IOB, COB, DEV, SEN}
- ;
private static final ScheduledExecutorService worker = Executors.newSingleThreadScheduledExecutor();
private static ScheduledFuture<?> scheduledUpdate = null;
... here the semicolon wanted to run awa... |
codereview_java_data_6581 | return commitSeal;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
what about the roundIdentifier stored in the baseclass?
return commitSeal;
}
+ @Override
+ public ConsensusRoundIdentifier getRoundIdentifier() {
+ return roundIdentifier;
+ }
+
@Override
pub... |
codereview_java_data_6584 | } else {
final View notification=menu.findItem(R.id.notifications).getActionView();
txtViewCount=notification.findViewById(R.id.notification_count_badge);
- txtViewCount.setText(String.valueOf(1));
}
this.menu = menu;
is this value hardcoded?
} ... |
codereview_java_data_6589 | // log to standard Linux log location
if (Platform.isLinux())
- if (checkCreateLogFileFolder(DEFAILT_LOG_FOLDER_LINUX))
return defaultLogFileDir;
// log to profile directory if it is writable.
Why having set `DEFAILT` ? typo ?
// log to standard Linux log location
if (Platform.isLinu... |
codereview_java_data_6590 | SymbolTable(5, "Symbol table"),
DFA(6, "DFA"),
TypeResolution(7, "Type resolution"),
- MetricsVisitor(8, "Metrics visitor"),
RuleChainVisit(9, "RuleChain visit"),
Reporting(10, "Reporting"),
RuleTotal(11, "Rule total"),
Just a minor thing: I think, I wouldn't name this here Metrics*Vis... |
codereview_java_data_6592 | }
}
- private void queueLoad(HostAndPort server, KeyExtent extent,
Map<String,MapFileInfo> thriftImports) {
if (!thriftImports.isEmpty()) {
loadMsgs.increment(server, 1);
This is a confusing name, since we have different meanings for the term "load". I assume you are "loading th... |
codereview_java_data_6593 | }
/**
- * Gets the coordinates of the file.
- * </p>
- * Presumably indicates upload location.
* @return file coordinates as a LatLng
*/
public @Nullable
It is actually the location where the picture was taken :-)
}
/**
+ * Gets the coordinates of where the file wa... |
codereview_java_data_6596 | public static void validate(Iterable<Entry<String,String>> entries) {
String instanceZkTimeoutValue = null;
boolean usingVolumes = false;
- String cipherSuite = null;
- String keyAlgorithm = null;
- String secretKeyEncryptionStrategy = null;
- String cryptoModule = null;
for (Entry<String,... |
codereview_java_data_6599 | if (isAnyDistinct()) {
rows = distinctRows.values();
}
- if (sort != null) {
- if (offset > 0 || limit > 0) {
- sort.sort(rows, offset, limit < 0 || withTies ? rows.size() : limit);
} else {
sor... |
codereview_java_data_6606 | @NonNull @Override
public Constraint<Boolean> isSMBModeEnabled(@NonNull Constraint<Boolean> value) {
Constraint<Boolean> closedLoop = constraintChecker.isClosedLoopAllowed();
if (!closedLoop.value())
value.set(getAapsLogger(), false, getResourceHelper().gs(R.string.smbnotallowed... |
codereview_java_data_6608 | assertEquals("00000000-0000-4000-8000-000000000000", min.getString());
// Test conversion from ValueJavaObject to ValueUuid
- ValueJavaObject vo_uuid = ValueJavaObject.getNoCopy(UUID.randomUUID(), null, null);
- assertTrue(vo_uuid.convertTo(Value.UUID) instanceof ValueUuid);
Val... |
codereview_java_data_6614 | return jgrafana.serialize();
} catch (IOException e) {
logger.error("Could not serialize the grafana dashboard");
- throw new RuntimeException("Could not serialize the grafana dashboard.", e);
}
}
```suggestion throw new UncheckedIOException("Could not serial... |
codereview_java_data_6624 | return false;
}
ClientAuthenticationMethod that = (ClientAuthenticationMethod) obj;
- return this.getValue().toLowerCase(Locale.ROOT).equals(that.getValue().toLowerCase(Locale.ROOT));
}
@Override
public int hashCode() {
- return this.getValue().toLowerCase(Locale.ROOT).hashCode();
}
}
Please remov... |
codereview_java_data_6625 | * This method should be called while committing non-idempotent overwrite operations.
* If a concurrent operation commits a new file after the data was read and that file might
* contain rows matching the specified conflict detection filter, the overwrite operation
- * will detect this during retries and f... |
codereview_java_data_6635 | else if(collectionType == DataType.Name.SET)
return ImmutableSet.of(SAMPLE_DATA.get(dataType));
else if(collectionType == DataType.Name.MAP)
- if(dataType.getName() == DataType.Name.BLOB)
- return new HashMap<Object, Object>().put(SAMPLE_DATA.get(DataType.ascii()... |
codereview_java_data_6642 | // When
BatchStage<String> mapped = stage.mapUsingService(bidirectionalStreaming(port), (service, key, item) -> {
HelloRequest req = HelloRequest.newBuilder().setName(item).build();
- try {
- return service.call(req).get().getMessage();
- } catch (Exce... |
codereview_java_data_6645 | // cached because calling clazz.getTypeParameters().length create a new array every time
private final int typeParameterCount;
private final boolean isGeneric;
private final JavaTypeDefinition enclosingClass;
protected JavaTypeDefinitionSimple(Class<?> clazz, JavaTypeDefinition... boundGenerics... |
codereview_java_data_6655 | */
package javaslang.collection.euler;
import javaslang.collection.List;
import javaslang.collection.Stream;
import static javaslang.collection.euler.Utils.isPrime;
we could omit the reverse by providing a comparator: ``` java sorted(Comparator.reverseOrder()) ``` (does that compile?)
*/
package javaslang.co... |
codereview_java_data_6664 | }
private void check(@Nullable StatementTree tree, VisitorState state) {
- if (tree != null && tree.getKind() == Tree.Kind.EXPRESSION_STATEMENT) {
state.reportMatch(buildDescription(tree)
.addFix(SuggestedFix.replace(tree, "{" + state.getSourceForNode(tree) + "}"))
... |
codereview_java_data_6667 | @Test
public void testRuleEvaluation() {
- KieSession ksession = runtimeBuilder.newKieSession("canDrinkKS");
Result result = new Result();
ksession.insert(result);
Why this change? As far as I can see `canDrinkKS` is marked as default session so it should work also without the explic... |
codereview_java_data_6680 | progressBar.setVisibility(View.GONE);
}, error -> Log.e(TAG, Log.getStackTraceString(error)));
- if (UserPreferences.getSubscriptionsFilter().areSubscriptionsFiltered()) {
feedsFilteredMsg.setText("{md-info-outline} " + getString(R.string.subscriptions_are_filte... |
codereview_java_data_6685 | public class K9MailLib {
private static DebugStatus debugStatus = new DefaultDebugStatus();
- private static ImapExtensionStatus imapExtensionStatus = new DefaultImapExtensionStatus();
private K9MailLib() {
}
I'm not a big fan of making this a super object in terms of configuration. `ImapConfig` wou... |
codereview_java_data_6691 | }
// Return null as secret hash if clientSecret is null or "".
- // We receive clientSecret as "" if we create cognitoUserPool from awsConfiguration file with "AppClientSecret": "
if (TextUtils.isEmpty(clientSecret)) {
return null;
}
nit: could you close the last... |
codereview_java_data_6694 | @Nonnull DistributedFunction<ConsumerRecord<K, V>, T> projectionFn,
@Nonnull WatermarkGenerationParams<T> wmGenParams
) {
- return new CloseableProcessorSupplier<StreamKafkaP>(() -> new StreamKafkaP<>(
properties, topics, projectionFn, wmGenParams
));
... |
codereview_java_data_6695 | private void initializePebbleNotificationSupport()
{
- Cursor c = getContentResolver().query(Uri.parse("content://com.getpebble.android.provider/state"),
- null, null, null, null);
- if (c == null || !c.moveToNext()) {
- this.findPreference(PEBBLE_NOTIFICATION_PREF).setEnabled(fals... |
codereview_java_data_6700 | * Because the data is of an unknown length, we cannot know the block size. To avoid corrupt RFiles, we throw an exception. This should be addressed by
* whatever object is putting data into the stream to ensure this condition is never reached.
*/
- if (size() == Integer.MAX_VALUE) {... |
codereview_java_data_6703 | }
}
- public CompletableFuture<Void> getSlaveUsage(SingularitySlave slave) {
return usageCollectionSemaphore.call(() ->
- CompletableFuture.runAsync(() -> {
- collectSlaveUsage(
slave,
System.currentTimeMillis(),
new ConcurrentHashMap<>(),
For ... |
codereview_java_data_6718 | */
Map<String, E> mappings();
-
- /**
- * Returns a set of choice tuples if available. This is kept for compatibility with the eclipse plugin, even
- * though it returns the same information as {@link #mappings()} (only it returns them ordered).
- *
- * @return An array of the label value ... |
codereview_java_data_6719 | Locale getLanguage();
/**
- * Returns all software version as reported by the peer on this connection,
* as obtained through XEP-0092.
- * @return The Software version information
*/
Map<String,String> getSoftwareVersion();
}
Returns all Software Version data as..
Locale getLa... |
codereview_java_data_6720 | for (int i = 0; i < indent; i++) {
System.out.print(" ");
}
- System.out.printf((fmtString) + "%n", args);
}
}
```suggestion System.out.printf(fmtString + "%n", args); ```
for (int i = 0; i < indent; i++) {
System.out.print(" ");
}
+ System.out.printf(fmtString, args);
}... |
codereview_java_data_6728 | Types.NestedField sourceColumn = findSourceColumn(sourceName);
PartitionField field = new PartitionField(
sourceColumn.fieldId(), nextFieldId(), targetName, Transforms.year(sourceColumn.type()));
- checkForRedundantPartitions(field, "dates");
fields.add(field);
return this;
... |
codereview_java_data_6731 | package org.apache.iceberg.mr.hive.serde.objectinspector;
/**
- * Interface for converting the Hive primitive objects for to the objects which could be added to an Iceberg Record.
* If the IcebergObjectInspector does not implement this then the default Hive primitive objects will be used without
* conversion.
*... |
codereview_java_data_6734 | Row row = rows.get(0);
assertEquals(row.getInt("a"), 0);
- assertEquals(row.getUDTValue("alldatatypes"), alldatatypes);
} catch (Exception e) {
errorOut();
Should be `row.getUDTValue("b")` (you want the name of the column here, not the name of the type).
... |
codereview_java_data_6742 | AccumuloConfiguration acuconf = options.getTableConfiguration();
long blockSize = acuconf.getAsBytes(Property.TABLE_FILE_COMPRESSED_BLOCK_SIZE);
- if (blockSize >= Integer.MAX_VALUE || blockSize < 0) {
- throw new IllegalArgumentException("table.file.compress.blocksize must be greater than 0 and less ... |
codereview_java_data_6746 | return CliqueBlockHashing.recoverProposerAddress(header, extraData);
}
- public static Optional<List<Address>> getValidatorsForBlockNumber(
final long blockNumber,
final EpochManager epochManager,
final BlockchainQueries blockchainQueries) {
rename this, it actually returns the validators... |
codereview_java_data_6752 | /**
* The canonical ID
*/
- public String canonicalID() {
return canonical;
}
Why make this non-final? Given how important this method is for its serialization/internal representation, it's pretty important that it not be overridden.
/**
* The canonical ID
*/
+ public final String cano... |
codereview_java_data_6757 | // The sibling before the operator is the left hand side
JavaNode lhs = assignment.getParent().getChild(assignment.getIndexInParent() - 1);
- ASTName name = lhs.getFirstDescendantOfType(ASTName.class);
- if (name != null) {
- NameDeclaration statementVariab... |
codereview_java_data_6758 | */
package org.kie.kogito.codegen.unit;
-import org.drools.ruleunits.impl.EventListDataStream;
import org.kie.kogito.codegen.data.StockTick;
import org.kie.kogito.codegen.data.ValueDrop;
import org.kie.kogito.rules.DataSource;
import org.kie.kogito.rules.DataStore;
import org.kie.kogito.rules.DataStream;
This ... |
codereview_java_data_6761 | return new Nutriment(additionalProperties.get(nutrimentName).toString(), get100g(nutrimentName), getServing(nutrimentName), getUnit(nutrimentName));
}catch (NullPointerException e){
// In case one of the getters was unable to get data as string
}
return null;
}
You... |
codereview_java_data_6762 | @Override
public String toString() {
return ToString.builder("ExecutionAttributes")
- .add("attributes", attributes)
.build();
}
Should we just log the keys in case there's sensitive information in the values?
@Override
public String toSt... |
codereview_java_data_6765 | // Assert there are three tasks with the default category
List<org.flowable.task.api.Task> tasks = taskService.createTaskQuery().processInstanceId(processInstance.getId()).list();
for (org.flowable.task.api.Task task : tasks) {
- assertEquals("approval", task.getCategory());
... |
codereview_java_data_6772 | int maxZoom = params.getMaxZoom();
int zoom = params.getZoom();
float newDist = getFingerSpacing(event);
- if (newDist > mDist) {
//zoom in
- if (zoom < maxZoom)
zoom+=6;
- } else if (newDist < mDist) {
//zoom out
- if (zoom > 0)
zoom-=6;
}
mDist = newDist;
This condition can be combin... |
codereview_java_data_6778 | }
}
@Test
public void testIllegalTableTransitionExceptionEmptyMessage() {
try {
In addition to `""`, could also try null.
}
}
+ @Test
+ public void testIllegalTableTransitionExceptionWithNull() {
+ try {
+ throw new TableManager.IllegalTableTransitionException(oldState, newState, ... |
codereview_java_data_6780 | level.setMaximumUniqueImagesUsed(5);
if(achievements.getImagesUploaded() >= 100 && achievements.getUniqueUsedImages() >= 45){
level.setLevel(10);
level.setLevelStyle(R.style.LevelFive);
} else if (achievements.getImagesUploaded() >= 90 && achievements.getUniqueUsedIm... |
codereview_java_data_6783 | if (newValue.equals("page")) {
final Context context = ui.getActivity();
final String[] navTitles = context.getResources().getStringArray(R.array.back_button_go_to_pages);
- final String[] navTags = { MainActiv... |
codereview_java_data_6785 | if (version != null) {
this.checkAndWriteString(basePath, KVPathUtil.VERSION, version);
} else {
- Stat stat = this.getCurator().checkExists().forPath(basePath + KVPathUtil.SEPARATOR + KVPathUtil.VERSION);
- if (stat != null) {
this.getCurator().dele... |
codereview_java_data_6787 | public class IncrementalRuleCodegenTest {
@BeforeEach
- public void blah() {
DecisionTableFactory.setDecisionTableProvider(ServiceRegistry.getInstance().get(DecisionTableProvider.class));
}
maybe not the best method name?
public class IncrementalRuleCodegenTest {
@BeforeEach
+ public v... |
codereview_java_data_6807 | *
* @return an object to modify replication configuration
*/
- @Deprecated
ReplicationOperations replicationOperations();
/**
I think we can add a `since = "2.1.0"` here. (new optional parameter in Java 9) This could be done for any public API and property deprecations. I wouldn't bother doing this ... |
codereview_java_data_6814 | /** Test case for
* <a href="https://issues.apache.org/jira/browse/CALCITE-4690">[CALCITE-4690]
- * Error when when executing query with CHARACTER SET in Redshift</a>. */
@Test void testRedshiftCharacterSet() {
String query = "select \"hire_date\", cast(\"hire_date\" as varchar(10))\n"
+ "from... |
codereview_java_data_6844 | *
* @param name the name of the processor
* @param createFn the function to create the sink context, given a
- * processor context. It must be stateless
* @param <C> type of the context object
*
* @since 3.0
```suggestion * processor context. It must be stateless. ```
... |
codereview_java_data_6854 | private final AllocateMappedFileService allocateMappedFileService;
/**
- * Flush offset within the queue.
*/
- private long flushOffset = 0;
- private long committedWhere = 0;
private volatile long storeTimestamp = 0;
Consider the abuse of `offset` in rocketmq-store, so we use `flushedWh... |
codereview_java_data_6856 | import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
Import is not used.
import java.io.InputStreamReader;
import java.io.OutputStreamWrit... |
codereview_java_data_6857 | *
* See https://docs.spring.io/spring-boot/docs/current/reference/html/production-ready-metrics.html
*/
-@UsesJava8
public final class ActuateCollectorMetrics implements CollectorMetrics, PublicMetrics
{
private final CounterBuffers counterBuffers;
mentioned offline, this is perfectly fine as our server is ... |
codereview_java_data_6859 | if (enableOCSP) {
// See https://stackoverflow.com/questions/49904935/jetty-9-enable-ocsp-stapling-for-domain-validated-certificate
- Security.setProperty("ocsp.enable", "true");
- System.setProperty("jdk.tls.server.enableStatusRequestExtension", "true");
- System.... |
codereview_java_data_6863 | return new RemoteWebDriverBuilder();
}
- private void init(Capabilities capabilities) {
- this.capabilities = capabilities == null ? new ImmutableCapabilities() : capabilities;
logger.addHandler(LoggingHandler.getInstance());
Assigning capabilities to the field here is not the best idea. Semantically ... |
codereview_java_data_6882 | bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() {
@Override
- public void onStateChanged(View bottomSheet, int newState) {
prepareViewsForSheetPosition();
}
To let other collaborators know that `newState` is intenti... |
codereview_java_data_6888 | }
@Override
- public Value atomize() throws XPathException {
if (value == null) {
- final Object v = attribute.getValue();
- value = SaxonXPathRuleQuery.getAtomicRepresentation(v);
}
return value;
}
Maybe inline that variable
}
@Override
+ ... |
codereview_java_data_6891 | // we have guarantees about the format of the output and thus we can apply the
// normal selector
if (numeric && extractionFunction == null) {
return new JsonCompositeFilter(JsonFilter.Type.AND,
- new JsonBound(dimName, tr(e, posConstant), true,
- ... |
codereview_java_data_6907 | * operations. Violations of this rule will manifest as less than 100% CPU
* usage under maximum load (note that this is possible for other reasons too,
* for example if the network is the bottleneck or if {@linkplain
- * JetProperties#JET_IDLE_COOPERATIVE_MIN_MICROSECONDS parking time} is too high... |
codereview_java_data_6928 | boolean sawInputEOS = false;
boolean sawOutputEOS = false;
int noOutputCounter = 0;
- final long BAR_FACTOR = (totalDurationUs / (BAR_COUNT * SAMPLES_PER_BAR) + 1);
- long barTimer = BAR_FACTOR;
... |
codereview_java_data_6932 | return !oldReference.equals(reference);
}
- public void updateReference(Reference ref) {
- Objects.requireNonNull(ref);
- this.reference = ref;
- }
-
public boolean isBranch() {
return reference instanceof Branch;
}
can `this.reference` ever be `null`?
return !oldReference.equals(refer... |
codereview_java_data_6934 | return null;
}
- if (isLocalFile(loadingUrl) || loadingUrl.getHost().contains(bridge.getHost()) || (bridge.getServerUrl() == null && !bridge.getAppAllowNavigationMask().matches(loadingUrl.getHost()))) {
Logger.debug("Handling local request: " + request.getUrl().toString());
return handleLoc... |
codereview_java_data_6935 | public void setPosition(int position) {
this.position = position;
- if(position > 0) {
this.item.setPlayed(false);
}
}
Perhaps I'm being daft, is this condition backwards? Why set 'played' to false when position is greater than 0? Should it be setting 'new' to false?
... |
codereview_java_data_6939 | + "The classpath will be searched if this property is not set")
private String propsPath;
- public String getPropertiesPath() {
if (propsPath == null) {
URL propLocation = SiteConfiguration.getAccumuloPropsLocation();
propsPath = propLocation.getFile();
could sync this method.
+ "... |
codereview_java_data_6943 | final String deployId = getAndCheckDeployId(requestId);
checkConflict(!(requestManager.markAsBouncing(requestId) == SingularityCreateResult.EXISTED), "%s is already bouncing", requestId);
- Optional<Boolean> removeFromLoadBalancer = Optional.absent();
requestManager.createCleanupRequest(
new ... |
codereview_java_data_6950 | import tech.pegasys.pantheon.ethereum.core.Address;
import tech.pegasys.pantheon.ethereum.core.Hash;
-import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.PantheonWeb3j;
import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.PantheonWeb3j.SignersBlockResponse;
import tech.pegasys.pantheon.tests.acce... |
codereview_java_data_6959 | @Value("${" + CREDENTIALS_REFRESH_INTERVAL + "}") Integer credentialsRefreshInterval,
@Qualifier(QUALIFIER) BasicCredentials basicCredentials) throws IOException {
ScheduledExecutorService ses = Executors.newSingleThreadScheduledExecutor(
- new NamedThreadFactory("zipkin-load-es-credentials-pool"));... |
codereview_java_data_6969 | /**
* @author Jitendra Singh
*/
public class UsernamePasswordAuthenticationTokenMixinTest extends AbstractMixinTests {
We should have test for when `UsernamePasswordAuthenitcationToken.clearCredentials()` has been invoked NOTE: This is applicable to the other `AuthenticationToken` mixins too
/**
* @author Ji... |
codereview_java_data_6976 | // 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_6978 | import net.sourceforge.pmd.lang.java.rule.AbstractJavaRule;
public class DontImportJavaLangRule extends AbstractJavaRule {
- private static final String IMPORT_JAVA_LANG = "java.lang.";
@Override
public Object visit(ASTImportDeclaration node, Object data) {
this extra dot at the end is causing a couple ... |
codereview_java_data_6979 | @Override
protected void init(@Nonnull Context context) {
// createFn is allowed to return null, we'll call `destroyFn` even for null `ctx`
- ManagedContext managedContext = context.serializationService().getManagedContext();
ctx = (C) managedContext.initialize(createFn.apply(context)... |
codereview_java_data_6996 | public static final String VALID_NAME_REGEX = "^(\\w+\\.)?(\\w+)$";
public static final Long TABLE_MAP_CACHE_EXPIRATION = TimeUnit.SECONDS.toNanos(1L);
- private static final AtomicLong tableMapTimestamp = new AtomicLong(System.nanoTime());
private static final SecurityPermission TABLES_PERMISSION = new Secur... |
codereview_java_data_7015 | }
}
- private void trimNonResidentQueue() {
Entry<V> e;
int maxQueue2Size = nonResidentQueueSize * (mapSize - queue2Size);
if (maxQueue2Size >= 0) {
This method should have default visibility too.
}
}
+ void trimNonReside... |
codereview_java_data_7022 | public static class TestPerson implements Serializable {
- private String name;
- private int age;
- private boolean status;
public TestPerson() {
}
Maybe use Jackson jr annotation support to get rid of all those getters & setters?
public static class TestPerson implem... |
codereview_java_data_7027 | return removed;
}
void initiateChop() {
Set<StoredTabletFile> allFiles = tablet.getDatafiles().keySet();
- ChopSelector chopSelector;
synchronized (this) {
if (fileMgr.getChopStatus() == FileSelectionStatus.NOT_ACTIVE) {
Should handle this TODO or create follow on ticket
return rem... |
codereview_java_data_7028 | import org.apache.accumulo.core.client.admin.DelegationTokenConfig;
import org.apache.accumulo.core.client.admin.SecurityOperations;
import org.apache.accumulo.core.client.impl.AuthenticationTokenIdentifier;
-import org.apache.accumulo.core.client.impl.ConnectionInfoImpl;
import org.apache.accumulo.core.client.impl... |
codereview_java_data_7047 | */
void destroy();
- /**
- * Exit maintenance mode
- */
- void exit();
}
I thought Maintainable was closable? Appears it isn't, but it probably should be.
*/
void destroy();
} |
codereview_java_data_7050 | * @see <a href="https://en.wikipedia.org/wiki/DUAL_table">Wikipedia: DUAL table</a>
*/
boolean isDualTable(String tableName) {
- return ((schemaName == null || equalsToken(schemaName, "SYS")) && equalsToken("F", tableName))
|| (database.getMode().sysDummy1 && (schemaName == null... |
codereview_java_data_7060 | * @return true if typed vector
*/
static boolean isTypedVector(int type) {
- return (type >= FBT_VECTOR_INT && type <= FBT_VECTOR_KEY) || type == FBT_VECTOR_BOOL;
}
/**
Shouldn't this still return true for existing data serialized this way?
* @return true if typed vector
... |
codereview_java_data_7061 | @JsonProperty
private String s3UploaderBucket;
- @NotEmpty
@JsonProperty
private boolean useLocalDownloadService = false;
`@NotEmpty` and `@NotNull` are unnecessary for `boolean` -- can't be set to `null` since it's a primitive type
@JsonProperty
private String s3UploaderBucket;
@JsonProperty
... |
codereview_java_data_7084 | import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
-import java.time.*;
import java.time.temporal.ChronoUnit;
import java.util.Iterator;
import java.util.List;
We avoid wildcard imports because it isn't clear where symbols are coming from and there is potential for collision. Could you... |
codereview_java_data_7085 | import java.util.Map;
import org.flowable.common.engine.impl.interceptor.CommandExecutor;
import org.flowable.engine.impl.cmd.CompleteTaskCmd;
import org.flowable.engine.impl.cmd.CompleteTaskWithFormCmd;
import org.flowable.task.api.TaskCompletionBuilder;
-import org.flowable.common.engine.api.variable.VariableCol... |
codereview_java_data_7086 | if (cooled instanceof KApply) {
KApply kApply = (KApply)cooled;
String name = kApply.klabel().name();
- K firstArg = kApply.klist().items().get(0);
- if (name.equals("#SemanticCastToK") && firstArg instanceof KApply) {
- name = ((KApply)firstArg).k... |
codereview_java_data_7089 | public class GPSExtractor {
private String filePath;
private double decLatitude, decLongitude;
private double currentLatitude, currentLongitude;
private Context context;
- private static final String TAG = GPSExtractor.class.getName();
public boolean imageCoordsExists;
private MyLocati... |
codereview_java_data_7096 | protected final boolean distinct;
/**
- * FILTER condition for aggregate/window
*/
protected Expression filterCondition;
H2 supports `FILTER` clause only in aggregate functions (including their window versions, unlike some other databases). H2 does not support it in window functions. SQL Stand... |
codereview_java_data_7105 | void queueMutations(final MutationSet mutationsToSend) {
if (mutationsToSend == null)
return;
- binningThreadPool.execute(Trace.wrap(() -> {
if (mutationsToSend != null) {
try {
log.trace("{} - binning {} mutations", Thread.currentThread().getName(),
Catching ... |
codereview_java_data_7107 | return mediaDetailPagerFragment;
}
- // click listener to toggle description
private View.OnClickListener toggleDescriptionListener = new View.OnClickListener() {
@Override
public void onClick(View view) {
- View view2 = limitedConnectionDescriptionTv;
if (view2.getVi... |
codereview_java_data_7112 | }
// add the method declaration of the superclass to the candidates, if present
- SymbolReference<ResolvedMethodDeclaration> superClassMethodRef = MethodResolutionLogic.solveMethodInFQN
- (getSuperclassFQN(), name, argumentsTypes, staticOnly, typeSolver);
- if (superClassM... |
codereview_java_data_7113 | * @return A new {@code Option} instance containing value of type {@code R}
* @throws NullPointerException if {@code partialFunction} is null
*/
- default <R> Option<R> collect(PartialFunction<? super T, ? extends R> partialFunction){
Objects.requireNonNull(partialFunction, "partialFunction... |
codereview_java_data_7115 | */
public static CharSeq of(char... characters) {
Objects.requireNonNull(characters, "characters is null");
- final char[] chrs = new char[characters.length];
- System.arraycopy(characters, 0, chrs, 0, characters.length);
- return characters.length == 0 ? empty() : new CharSeq(n... |
codereview_java_data_7123 | VolumeChooserEnvironment chooserEnv = new VolumeChooserEnvironment(extent.getTableId(),
context);
- Path newDir = new Path(vm.choose(chooserEnv,
- ServerConstants.getBaseUris(context.getConfiguration(), context.getHadoopConf()))
+ Path.SEPARATOR + ServerConstants.TABLE_DIR + Path.SEPARA... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.