id stringlengths 23 26 | content stringlengths 182 2.49k |
|---|---|
codereview_java_data_8283 | LOG.debug("Request {} already has a shuffling task, skipping", taskIdWithUsage.getTaskId().getRequestId());
continue;
}
- if ((mostOverusedResource.overusage <= 0) || shuffledTasksOnSlave > configuration.getMaxTasksToShufflePerHost() || currentShuffleCleanupsTotal >= configuration.... |
codereview_java_data_8293 | .setTarget(nav_cam)
.setDismissText(getResources().getString(R.string.ok_button))
.setContentText(getResources().getString(R.string.camera_button))
- .hideOnTouchOutside()
.build()
);
Try... |
codereview_java_data_8294 | }
}).iterator();
this.workerPool = workerPool;
- this.taskFutures = new Future[parallelism];
}
@Override
Is it possible to base this on the size of the `ExecutorService`, rather than pass it in?
}
}).iterator();
this.workerPool = workerPool;... |
codereview_java_data_8296 | private String readIdentifierWithSchema2(String s) {
schemaName = s;
- if (readIf(DOT)) {
- if (equalsToken(schemaName, database.getShortName()) || database.getIgnoreCatalogs()) {
- schemaName = session.getCurrentSchemaName();
- s = readColumnIdentifier();
-... |
codereview_java_data_8300 | @After
public void after() {
if (mysql != null) {
- mysql = stopContainer(mysql);
}
}
I think it would be clearer to assign null directly here: ``` stopContainer(mysql); mysql = null; ```
@After
public void after() {
if (mysql != null) {
+ stop... |
codereview_java_data_8301 | @Override
public String get(Property property) {
- return get(property, true);
- }
-
- public String get(Property property, boolean useDefault) {
if (CliConfiguration.get(property) != null) {
return CliConfiguration.get(property);
}
Instead of putting this functionality into SiteConfig did ... |
codereview_java_data_8303 | }
@Override
- public Consumer<Value<T>> onSetNextValue(Consumer<Value<T>> callback) {
this.onSetNextValueCallbacks.add(callback);
- return callback;
}
@Override
Is there a usage for the returned callback?
}
@Override
+ public void onSetNextValue(Consumer<Value<T>> callback) {
this.onSetNextValueCal... |
codereview_java_data_8312 | throw new RuntimeException("Minor compaction after recovery fails for " + extent);
}
Assignment assignment = new Assignment(extent, server.getTabletSession());
- TabletStateStore.setLocation(server.getContext(), assignment, assignment.server);
synchronized (server.openingTablets) {
... |
codereview_java_data_8319 | */
public class CmmnParserImpl implements CmmnParser {
- private final Logger LOGGER = LoggerFactory.getLogger(CmmnParserImpl.class);
protected CmmnParseHandlers cmmnParseHandlers;
protected CmmnActivityBehaviorFactory activityBehaviorFactory;
This is an instance field, not a `static final` one. The lo... |
codereview_java_data_8330 | // eventMessage
protected int eventMessageLength = 163;
- protected int eventMessageSubLength = 163;
/** postprocessor for a task builder */
protected TaskPostProcessor taskPostProcessor = null;
Shouldn't this value be 160 and not 163 (to leave room for `...`)?
// eventMessage
protect... |
codereview_java_data_8335 | */
public static String getCPU() {
if (!isPlatformAvailable())
- throw new UnsupportedOperationException("JNR Platform class not loaded");
return PlatformLoader.PLATFORM.getCPU().toString();
}
I see that similar methods in this class use `IllegalStateException`, shouldn't we do the same here?
... |
codereview_java_data_8336 | /**
* Store the assigned locations in the data store.
*/
- void setFutureLocations(Collection<Assignment> assignments);
/**
* Tablet servers will update the data store with the location when they bring the tablet online
*/
- // void setLocations(Collection<Assignment> assignments) throws Distrib... |
codereview_java_data_8337 | JavadocInlineTag that = (JavadocInlineTag) o;
- return type == that.type && content.equals(that.content);
}
If we allow for the Unknown type we should probably store the actual name of the tag used and use it also in the equals method and the toString method
JavadocInlineTag that = (Java... |
codereview_java_data_8344 | package com.hazelcast.jet.elasticsearch;
-import com.hazelcast.function.SupplierEx;
import com.hazelcast.jet.JetInstance;
import com.hazelcast.jet.JetTestInstanceFactory;
import com.hazelcast.jet.config.JetConfig;
-import org.apache.http.HttpHost;
-import org.elasticsearch.client.RestClient;
-import org.elasticsear... |
codereview_java_data_8347 | menu.findItem(R.id.menu_context_details).setVisible(false);
menu.findItem(R.id.menu_context_save_attachment).setVisible(false);
menu.findItem(R.id.menu_context_resend).setVisible(false);
- menu.findItem(R.id.menu_context_copy).setVisible(!actionMessage);
} else {
MessageRecord mess... |
codereview_java_data_8351 | private void save(CompilationUnit cu, Path path) throws IOException {
Files.createDirectories(path.getParent());
final String code = new PrettyPrinter().print(cu);
- Files.write(path, code.getBytes());
}
/**
Oops, pass a character set to getBytes() please.
private void sav... |
codereview_java_data_8353 | contained = false;
List<Instance> instances = service.allIPs();
for (Instance instance : instances) {
- String[] containedInstanceIpPort = IpUtil.splitIpPortStr(containedInstance);
- if (containedInstanceIpPort.length == IpUtil.SPL... |
codereview_java_data_8363 | count,
skip,
reverse,
- labels -> () -> () -> 0.0D);
final AtomicReference<AbstractPeerTask.PeerTaskResult<List<BlockHeader>>> actualResult =
new AtomicReference<>();
final AtomicBoolean done = new AtomicBoolean(false);
Should we make this a constant... |
codereview_java_data_8367 | package com.hazelcast.jet.impl.exception;
import com.hazelcast.jet.JetException;
-import com.hazelcast.jet.impl.TerminationMode;
-
-import javax.annotation.Nonnull;
public class EventLimitExceededException extends JetException {
- public EventLimitExceededException() {
- this(TerminationMode.CANCEL_GRACEFU... |
codereview_java_data_8369 | private void sendMessageToSpecificAddresses(
final Collection<Address> recipients, final MessageData message) {
LOG.trace(
- "Sending message to peers messageCode={} messageData={} recipients={}",
- message.getCode(),
- message.getData(),
- recipients);
recipients
... |
codereview_java_data_8372 | textView.setVisibility(View.VISIBLE);
}
else
- textView.setVisibility(View.INVISIBLE);
}
//region MENU
Just hide the textview
textView.setVisibility(View.VISIBLE);
}
else
+ textView.setVisibility(View.GONE);
}
//re... |
codereview_java_data_8378 | pendingRequest.getSkipHealthchecks(),
pendingRequest.getMessage(),
pendingRequest.getResources(),
- null,
pendingRequest.getActionId()));
nextInstanceNumber++;
this should be the last missing piece of the puzzle to connect it all the way t... |
codereview_java_data_8381 | @When("I type `$text` in field located `$locator` and keep keyboard opened")
public void typeTextInFieldAndKeepKeyboard(String text, Locator locator)
{
- baseValidations.assertElementExists("The element to type text", locator)
- .ifPresent(e -> keyboardActions.typeTextAndHide(e, tex... |
codereview_java_data_8385 | import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
Could you please make this verbose at least? It spams my entire logcat screen each time any page loads. :)
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
+import java.text.Pars... |
codereview_java_data_8396 | static GridView gv_local_gallery;
static ImageButton btn_local_more;
static int local_rows_display = 0;
- static LinearLayout ln_local_gallery;
// Flickr Public
static LinearLayout ln_flickr;
TextView txtPFlickr;
error: variable ln_local_gallery is already defined in class newGallery S... |
codereview_java_data_8398 | if (task.isBeta) {
header.addParam("isBeta", "true");
}
- AsyncNotifyCallBack asyncNotifyCallBack = new AsyncNotifyCallBack(task);
- try {
- restTemplate.get(task.url, ... |
codereview_java_data_8405 | import com.google.idea.blaze.kotlin.sync.importer.BlazeKotlinWorkspaceImporter;
import com.google.idea.blaze.kotlin.sync.model.BlazeKotlinImportResult;
import com.google.idea.blaze.kotlin.sync.model.BlazeKotlinSyncData;
import com.intellij.openapi.module.Module;
import com.intellij.openapi.project.Project;
import... |
codereview_java_data_8409 | assert aggregate == EXPECTED_AGGREGATE;
return aggregate;
}
-
- @Benchmark
- public int slang_persistent_int() {
- int aggregate = 0;
- for (int i : RANDOMIZED_INDICES) {
- final int[] leaf = (int[]) slangPersistentInt.leafUnsafe(i);
... |
codereview_java_data_8419 | assertThat(flowElement).isInstanceOf(ReceiveTask.class);
assertThat(flowElement.getId()).isEqualTo("receiveTask");
- assertThat(model.getMainProcess().getCandidateStarterUsers()).isEqualTo(Arrays.asList("user1", "user2"));
- assertThat(model.getMainProcess().getCandidateStarterGroups()).... |
codereview_java_data_8422 | /**
* Resolves the SecurityContext
* @author Dan Zheng
- * @since 5.2.x
*/
public class CurrentSecurityContextArgumentResolver extends HandlerMethodArgumentResolverSupport {
@rwinch, it may be a good time to consider whether this ought to be moved elsewhere since it's in four places now. What do you think?
/... |
codereview_java_data_8432 | runningTaskIds = getRunningTaskIds();
} catch (Exception e) {
LOG.error("While fetching running tasks from singularity", e);
- exceptionNotifier.notify(String.format("Error fetchign running tasks (%s)", e.getMessage()), e, Collections.<String, String>emptyMap());
statisticsBldr.setErrorMe... |
codereview_java_data_8438 | nextQueue.add(result);
} else {
if (term.equals(result)) {
- System.err.println("Step " + step + ": infinite loop after applying a spec rule.");
proofResults.add(result);
... |
codereview_java_data_8443 | ActivityResultLauncher<Intent> productActivityResultLauncher = registerForActivityResult(
new ActivityResultContracts.StartActivityForResult(),
(ActivityResultCallback<ActivityResult>) result -> {
- setShownProduct(lastBarcode);
});
/**
```suggestion if (result.getResult... |
codereview_java_data_8459 | * Flag that indicates whether the connections of this type are client-oriented.
* @return true if it is SOCKET_C2S or its fallback is SOCKET_C2S.
*/
- public boolean isC2S()
{
return SOCKET_C2S == this || SOCKET_C2S == this.getFallback();
}
The naming of this method might be con... |
codereview_java_data_8468 | }
}
- throw new IOException("readStringUntil(): end of stream reached. Read: "
- + sb.toString() + " while waiting for '"+end+"'");
}
private String readStringUntilEndOfLine() throws IOException {
Code style: operator should be at the end of the line; missing space... |
codereview_java_data_8475 | // visible (not private) for testing
VolumeChooser getDelegateChooser(VolumeChooserEnvironment env) {
- switch (env.getScope()) {
- case TABLE:
- return getVolumeChooserForTable(env);
- default:
- return getVolumeChooserForScope(env);
}
}
private VolumeChooser getVolumeChoose... |
codereview_java_data_8477 | initializeSuccessfulRegistry(appRegistry);
when(this.taskLauncher.launch(any())).thenReturn("0");
taskExecutionService.executeTask("demo", new HashMap<>(), new LinkedList<>());
}
}
Can we test the task definitions repo to see if the task definition was created?
initializeSuccessfulRegistry(appReg... |
codereview_java_data_8480 | public void addHostedFeedData() throws IOException {
if (feedDataHosted) throw new IllegalStateException("addHostedFeedData was called twice on the same instance");
for (int i = 0; i < NUM_FEEDS; i++) {
- Feed feed = new Feed(0, null, "Title " + i, "https://news.google.com/news/rss?" +... |
codereview_java_data_8481 | @Override
public int getTypeParameterCount() {
if (typeParameterCount == -1) {
- typeParameterCount = getTypeParameters(clazz).length;
}
return typeParameterCount;
}
I think, we should add here a try-catch for LinkageError. In case, we couldn't determine the type pa... |
codereview_java_data_8493 | PreparedStatement prepareDomainScanStatement(String prefix, long modifiedSince)
throws SQLException {
-
- Calendar cal = getCalendarInstance();
PreparedStatement ps;
if (prefix != null && prefix.length() > 0) {
this becomes a wasted operation if the command itself doe... |
codereview_java_data_8494 | keystoreScanner.setScanInterval(reloadSslContextSeconds);
server.addBean(keystoreScanner);
} catch (IllegalArgumentException exception) {
- LOG.error("Keystore will not be automatically reloaded when \"{}\" is changed: {}", sslContextFactory.getKeyStorePath(... |
codereview_java_data_8501 | cmdList.add("-t");
cmdList.add("" + params.timeend);
}
-
- // Streaming support
-// cmdList.add("-movflags");
-// cmdList.add("frag_keyframe+empty_moov");
// Support for ffmpeg Experimental features
cmdList.add("-strict");
@atamariya That's a speedy one, more well supported as well ;-) Is that "ism... |
codereview_java_data_8504 | public static final int TIME_OR_TIMEZONE_CHANGE = 58;
public static final int OMNIPOD_POD_NOT_ATTACHED = 59;
public static final int CARBS_REQUIRED = 60;
- public static final int IMPORTANCE_HIGH = 2;
public static final int OMNIPOD_POD_SUSPENDED = 61;
public static final int OMNIPOD_POD_ALE... |
codereview_java_data_8509 | default void removeChildAtIndex(final int childIndex) {
throw new UnsupportedOperationException("Out of scope for antlr current implementations");
}
-
- @Override
- default List<Node> findChildNodesWithXPath(final String xpathString) throws JaxenException {
- throw new UnsupportedOperati... |
codereview_java_data_8517 | import io.reactivex.Observable;
/**
- * Uses the PageEditInterface to make edit calls to MW API
*/
public class PageEditClient {
Most of the java docs for methods in this class are not descriptive. Either make it descriptive or remove it if you are not sure what it does. Please check the same for other classes as... |
codereview_java_data_8539 | * @return
*/
public static boolean isMonumentsEnabled(final Date date) {
- if (date.getDate() >= 1 && date.getMonth() >= 8 && date.getDate() <= 30
- && date.getMonth() <= 8) {
return true;
}
return false;
Shouldn't the month be `== 9` exactly? We want i... |
codereview_java_data_8546 | );
}
}
-
- protected int getMaxDecommissioningAgents() {
- return validator.getMaxDecommissioningAgents();
- }
}
The abstract machine resource serves both racks (e.g. aws availability zones) and agents. This would not apply for racks unless we have an equivalent maxDecommissioningRacks somewhere
... |
codereview_java_data_8554 | public HttpResponse handleException(RequestContext ctx, HttpRequest req, Throwable cause) {
ZipkinHttpCollector.metrics.incrementMessagesDropped();
- LOGGER.warn("Unexpected error handling request.", cause);
-
String message = cause.getMessage() != null ? cause.getMessage() : "";
if (cause instance... |
codereview_java_data_8564 | name = "UnclosedFilesStreamUsage",
category = Category.ONE_OFF,
severity = SeverityLevel.ERROR,
- summary = "Ensure a stream returned by java.nio.file.Files#{list,walk} is closed.")
public final class UnclosedFilesStreamUsage extends BugChecker implements BugChecker.MethodInvocationTr... |
codereview_java_data_8571 | /**
* @see <a href= "http://jonisalonen.com/2014/efficient-and-accurate-rolling-standard-deviation/">Efficient and accurate rolling standard deviation</a>
*/
- private void update(double n, double o, int w) {
- double delta = n - o;
double oldAverage = average;
- average = average + delta / w;
- ... |
codereview_java_data_8580 | * @author Glenn Renfro
*/
@RunWith(SpringRunner.class)
-@SpringBootTest(classes = { TaskDependencies.class, TaskServiceDependencies.class }, properties = {
"spring.main.allow-bean-definition-overriding=true" })
@DirtiesContext(classMode = ClassMode.BEFORE_EACH_TEST_METHOD)
@AutoConfigureTestDatabase(replace =... |
codereview_java_data_8582 | recipientsPanel.setPanelChangeListener(new RecipientsPanelChangeListener());
sendButton.setOnClickListener(sendButtonListener);
- // Only enable send button if version is >4.4 and default sms app
- boolean sendEnabled = false;
- if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
- if(Te... |
codereview_java_data_8583 | public class JsonUtil {
/**
- * Converts all to lowercase for easier lookup. This is useful incases such as the 'genesis.json'
* file where all keys are assumed to be case insensitive.
*
* @param objectNode The ObjectNode to be normalized
```suggestion * Converts all to lowercase for easier lookup. T... |
codereview_java_data_8596 | */
package org.apache.rocketmq.acl.common;
-import com.alibaba.fastjson.JSONArray;
import java.util.HashSet;
import java.util.Set;
import org.apache.commons.lang3.StringUtils;
import org.apache.rocketmq.acl.plain.PlainAccessResource;
public class Permission {
It will be better to use Variable than raw integer.... |
codereview_java_data_8598 | }
- private boolean isContinuationChar(byte b) {
return b >= (byte)0b1000_0000 && b <= (byte)0b1011_1111;
}
- private int numberOfFollowingBytes(byte b) {
if (b >= (byte)0b1100_0000 && b <= (byte)0b1101_1111) {
return 1;
} else if (b >= (byte)0b1110_0000 && b <= (byte)0b1110_1111) {
- mak... |
codereview_java_data_8604 | log.warn("Use of {} and {} are deprecated. Consider using {} instead.", INSTANCE_DFS_URI, INSTANCE_DFS_DIR, Property.INSTANCE_VOLUMES);
}
- if (cipherSuite.equals(NULL_CIPHER) && !keyAlgorithm.equals(NULL_CIPHER)) {
- fatal(Property.CRYPTO_CIPHER_SUITE.getKey() + " should be configured when " + Prop... |
codereview_java_data_8608 | EnumSet.allOf(ColumnType.class), false);
assertEquals(extent, tm.getExtent());
- assertEquals(HostAndPort.fromParts("server1", 8555), tm.getLocation().getLocation());
assertEquals("s001", tm.getLocation().getSession());
assertEquals(LocationType.FUTURE, tm.getLocation().getType());
asser... |
codereview_java_data_8610 | private void performMapReadyActions() {
if (((MainActivity)getActivity()).activeFragment == ActiveFragment.NEARBY && isMapBoxReady) {
- if(!applicationKvStore.getBoolean("NotDisplayLocationPermissionAlertBox", false) ||
PermissionUtils.hasPermission(getActivity(), Manifest.perm... |
codereview_java_data_8623 | * @param spec {@link PartitionSpec} used to produce {@link DataFile} partition tuples
* @param outputFile the destination file location
* @return a manifest writer
*/
public static ManifestWriter write(PartitionSpec spec, OutputFile outputFile) {
return ManifestFiles.write(spec, outputFile);
... |
codereview_java_data_8627 | }
@Test
- public void testLambdaBug1470() throws Exception {
- String code = IOUtils.toString(ParserCornersTest.class.getResourceAsStream("LambdaBug1470.java"),
- StandardCharsets.UTF_8);
parseJava18(code);
}
We should make use of the method `readAsString(...)` instead.... |
codereview_java_data_8631 | private DbException getSingleSortKeyException() {
String sql = getSQL();
- return DbException.getSyntaxError(sql, sql.length() - 1, "single sort key is required for RANGE units");
}
@Override
exactly one sort key is required for RANGE units
private DbException getSingleSortKeyExcep... |
codereview_java_data_8633 | return 44_000;
case ENUM:
return 45_000;
case ARRAY:
return 50_000;
case ROW:
return 51_000;
case RESULT_SET:
return 52_000;
- case JSON:
- return 53_000;
default:
if (JdbcUtils.c... |
codereview_java_data_8637 | } else {
throw new IllegalArgumentException("This process does not support parameters!");
}
- }
- variableScopeInstance.setDefaultValue(process, variableScope, variableScopeInstance);
variableScopeInstance.enforceRequiredVariables();
return proc... |
codereview_java_data_8639 | }
@Test
- public void permissionsSmartContractWithoutOptionMustDisplayUsage() {
parseCommand("--permissions-nodes-contract-address");
verifyZeroInteractions(mockRunnerBuilder);
I believe we want the CLI to fail when the user enables smart contract based permissioning but doesn't specify the contract a... |
codereview_java_data_8649 | }
/**
- * Factory method for the subclasses of this class.
*
* @param range the range the import declaration covers. Range.UNKNOWN if not known.
* @param name the qualified name of the import.
This is not instantiating EmptyImportDeclarations, right? So it is not all subclass... |
codereview_java_data_8659 | }
/**
- * Check if file destroyed in local dirs
*/
public static boolean fileExists(Uri localUri) {
try {
I think you may need to revert most of these "Find and replace" accidents ;)
}
/**
+ * Check if file exists in local dirs
*/
public static boolean fileEx... |
codereview_java_data_8661 | import com.hazelcast.function.SupplierEx;
import com.hazelcast.jet.pipeline.Sink;
import com.hazelcast.jet.pipeline.SinkBuilder;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.action.ActionRequest;
import org.elasticsearch.action.DocWriteRequest;
how about changing this to `SupplierEx<... |
codereview_java_data_8665 | private int collectStatus;
- private Map<String, String> listenersGrouperStatus;
public int getCollectStatus() {
return collectStatus;
Why you change the name to 'listenersGrouperStatus', maybe 'listenersGroupKeyStatus' is better? I understand the word 'listener' is spelled wrong.
private i... |
codereview_java_data_8666 | private void testRecursiveTable() throws Exception {
String[] expectedRowData =new String[]{"|meat|null","|fruit|3","|veg|2"};
String[] expectedColumnNames =new String[]{"VAL",
- "SUM(SELECT X FROM ( SELECT SUM(1) AS X, A FROM PUBLIC.C INNER JOIN PUB... |
codereview_java_data_8670 | if (ds.getTotalConCount() <= 0) {
ds.initMinConnection(null, true, getConHandler, null);
} else {
- LOGGER.info("connection with null schema has been created,because testConnection in pool");
getConHandler.initIncrement();
hasCo... |
codereview_java_data_8677 | public static final String APP_IS_DEFAULT = "APP_IS_DEFAULT";
public static final String STREAM_DEFINITION_DSL_TEXT = "streamDefinitionDslText";
public static final String TASK_DEFINITION_NAME = "taskDefinitionName";
I think app `uri` and `metadataUri` are the most important ones which are now not added.
publ... |
codereview_java_data_8692 | @Nonnull Properties properties,
@Nonnull FunctionEx<? super E, ProducerRecord<K, V>> toRecordFn
) {
- // TODO [viliam] what should be the default for exactlyOnce?
return Sinks.fromProcessor("writeKafka", writeKafkaP(properties, toRecordFn, true));
}
Don't forget abou... |
codereview_java_data_8694 | import java.util.Collections;
import java.util.List;
import fr.free.nrw.commons.R;
import fr.free.nrw.commons.location.LatLng;
import fr.free.nrw.commons.utils.UriDeserializer;
import timber.log.Timber;
-public class NearbyListFragment extends Fragment {
private static final Type LIST_TYPE = new TypeToken<Li... |
codereview_java_data_8698 | severity = BugPattern.SeverityLevel.WARNING,
summary = "Calling address.getHostName may result in a DNS lookup which is a network request, making the "
+ "invocation significantly more expensive than expected depending on the environment.\n"
- + "This check is intended... |
codereview_java_data_8702 | controllingMetaTag.setCapability(capabilities, meta);
}
}
-
- public static boolean isContainedIn(Meta meta, String metaName)
- {
- return new MetaWrapper(meta).getOptionalPropertyValue(metaName).isPresent();
- }
}
no need to make this method a part of ControllingMetaTag
... |
codereview_java_data_8707 | try {
List<ByteBuffer> messageBufferList = getMessageResult.getMessageBufferList();
for (ByteBuffer bb : messageBufferList) {
- MessageExt msgExt = MessageDecoder.decode(bb);
if (msgExt != null) {
foundList.add(msgExt);
... |
codereview_java_data_8709 | public void clear() {
- service.getConnection().setProto(new MySQLProtoHandlerImpl());
isStart = false;
schema = null;
tableConfig = null;
should keep this status in new "ProtoHandler" .
public void clear() {
+ ProtoHandler proto = service.getConnection().getProto();... |
codereview_java_data_8717 | if (StringUtils.isNotBlank(sparkUploadFiles)) {
sb.append("--files ").append(sparkUploadFiles).append(" ");
}
- sb.append("--principal ").append(config.getKerberosPrincipal()).append(" ");
- sb.append("--keytab ").append(config.getKerberosKeytabPath()).append(" ");
... |
codereview_java_data_8732 | import org.apache.iceberg.types.Types.StringType;
import org.apache.iceberg.types.Types.StructType;
-import java.nio.ByteBuffer;
-import java.util.List;
-import java.util.Map;
import static org.apache.iceberg.types.Types.NestedField.optional;
import static org.apache.iceberg.types.Types.NestedField.required;
My gu... |
codereview_java_data_8733 | EventBus.getDefault().register(this);
chip = layout.findViewById(R.id.feed_title_chip);
- if ((getArguments().getLong(ARG_FEED) != 0) && !FEED_TITLE.isEmpty()) {
- chip.setText(FEED_TITLE);
- } else {
- chip.setVisibility(View.GONE);
- }
return layou... |
codereview_java_data_8739 | // using the connection for the aborted session is expected to throw an
// exception
- assertThrows(ErrorCode.DATABASE_CALLED_AT_SHUTDOWN, stat2).executeQuery("select count(*) from test");
conn2.close();
conn.close();
It looks like you need to replace `ErrorCode.DATABASE_CALL... |
codereview_java_data_8741 | /**
* Auto load suggestions into various NachoTextViews
- * */
-
private void loadAutoSuggestions() {
- DaoSession daoSession = OFFApplication.getInstance().getDaoSession();
AsyncSession asyncSessionCountries = daoSession.startAsyncSession();
AsyncSession asyncSessionLabels ... |
codereview_java_data_8758 | }
public void updateHeightEstimate(final long blockNumber) {
- estimatedHeightKnown = true;
- if (blockNumber > estimatedHeight) {
- estimatedHeight = blockNumber;
- estimatedHeightListeners.forEach(e -> e.onEstimatedHeightChanged(estimatedHeight));
}
}
This will need a `synchronized` blo... |
codereview_java_data_8763 | {
String roundingModes = Stream.of(RoundingMode.values()).map(e -> e.name().toLowerCase())
.collect(Collectors.joining("|"));
- String pattern = String.format("^round(?:\\((-?\\d+(?:\\.\\d*)?[Ee]?-?\\+?\\d*)"
- + "(?:,\\s*(\\d+))?(?:,\\s*(%s))?\\))$", roundin... |
codereview_java_data_8772 | if (!s.isGoogleChromeAvailable()) {
htmlClass += "browserNotAvailable ";
imgSrc = imgSrc.split(".png")[0].concat("_unavailable.png");
- title = "browser not available";
} else { htmlClass += "browserAvailable "; }
else if (browserName.contains(BrowserType.IE) || browserName.c... |
codereview_java_data_8778 | try {
var config = new PropertiesConfiguration();
try (var reader = new FileReader(accumuloConfigUrl.getFile())) {
- config.getLayout().load(config, reader);
}
String value = config.getString(propertyName);
if (value != null)
I wasn't aware of the `read()` method before. ... |
codereview_java_data_8781 | }
// remove map files that have no more key extents to assign
- assignmentFailures.entrySet().removeIf(entry -> entry.getValue().size() == 0);
Set<Entry<Path,Integer>> failureIter = failureCount.entrySet();
for (Entry<Path,Integer> entry : failureIter) {
may be able to use `a... |
codereview_java_data_8782 | * Account stores all of the settings for a single account defined by the user. It is able to save
* and delete itself given a Preferences to work with. Each account is defined by a UUID.
*/
-@SuppressWarnings("unused") // unused methods are public API
public class Account implements BaseAccount, StoreConfig {
... |
codereview_java_data_8791 | Object actualValue = actualRow[col];
if (expectedValue != null && expectedValue.getClass().isArray()) {
String newContext = String.format("%s (nested col %d)", context, col + 1);
- if (expectedValue.getClass().getComponentType().isPrimitive()) {
- new ExactComparisonCriteria().arr... |
codereview_java_data_8792 | public static final String DEFAULT_LICENSE = "defaultLicense";
public static final String UPLOADS_SHOWING = "uploadsshowing";
public static final String MANAGED_EXIF_TAGS = "managed_exif_tags";
- public static final String KEY_DESCRIPTION_LANGUAGE_VALUE = "languageDescription";
- public static fina... |
codereview_java_data_8801 | if (badArgs.isEmpty()) {
return Description.NO_MATCH;
}
-
- return buildDescription(tree)
- .setMessage("slf4j log statement does not use logsafe parameters for arguments " + badArgs)
- .build();
}
}
prefer symmetry for return cases: ``` Foo foo... |
codereview_java_data_8816 | List<Bound> newBounds = new ArrayList<>();
while (!constraints.isEmpty()) {
- List<BoundOrConstraint> reduceResult = constraints.get(constraints.size() - 1).reduce();
- constraints.remove(constraints.size() - 1);
-
for (BoundOrConstraint boundOrConstraint... |
codereview_java_data_8828 | return data;
}
- protected void init() {
- reportPrivate = getProperty(REPORT_PRIVATE_DESCRIPTOR);
- reportProtected = getProperty(REPORT_PROTECTED_DESCRIPTOR);
- }
-
private void handleClassOrInterface(ApexNode<?> node, Object data) {
ApexDocComment comment = getApexDocC... |
codereview_java_data_8831 | threw = false;
} catch (TException | UnknownHostException e) {
if (e.getMessage().contains("Table/View 'HIVE_LOCKS' does not exist")) {
- LOG.error("Failed to acquire locks from metastore because 'HIVE_LOCKS' doesn't exist, " +
- "this probably happened when using embedded metastore... |
codereview_java_data_8833 | });
}
- private Activity getActivity() {
- return this.getActivity();
- }
-
private boolean isProductIncomplete() {
return product != null && (product.getImageUrl() == null || product.getQuantity() == null ||
product.getProductName() == null || product.getBrands... |
codereview_java_data_8836 | import android.widget.LinearLayout;
import android.widget.TextView;
import java.util.List;
public class SWString extends SWItem {
private List<String> labels;
private List<String> values;
private String groupName;
this is only for radiobuttons ... (on more places)
import android.widget.LinearLayo... |
codereview_java_data_8842 | }
public double getQueueFullness() {
- LOG.info("Queue size: {}", statusUpdatesExecutor.getQueue().size());
return (
(double) statusUpdatesExecutor.getQueue().size() /
statusUpdatesExecutor.getQueueLimit()
should I add more, like queue limit and the computation of queue fullness?
}
p... |
codereview_java_data_8843 | }
}
- @Override
- public void onResume() {
- super.onResume();
- backToCover(false);
- }
-
public void backToCover(Boolean smoothScroll) {
if (pager == null) {
return;
Please do this in `onStart` instead. Otherwise, it breaks using the app in multiwindow ... |
codereview_java_data_8847 | }
@Test
- public void shutdown() throws NacosException {
Properties properties = new Properties();
properties.put(PropertyKeyConst.SERVER_ADDR, "127.0.0.1:8848");
final ServerListManager serverListManager = new ServerListManager(properties);
- serverListManager.shutdown();... |
codereview_java_data_8853 | deleteDb("fullTextReopen");
}
- private static void close(Collection<Connection> list) throws SQLException {
for (Connection conn : list) {
- try { conn.close(); } catch (SQLException ignore) {/**/}
}
}
we have IOUtils.closeSilently for this
deleteDb("fullTe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.