id
stringlengths
23
26
content
stringlengths
182
2.49k
codereview_java_data_584
} private int getRetentionDays() { - String val = env.getProperty("retention.days"); if (null == val) { return retentionDays; } It's better to use property in application.properties. And the property name should be with prefix 'nacos.config'. } private int get...
codereview_java_data_586
// ResolvedCatalogTable class into the iceberg-flink-runtime jar for compatibility purpose. private static final DynMethods.UnboundMethod GET_CATALOG_TABLE = DynMethods.builder("getCatalogTable") .impl(Context.class, "getCatalogTable") .build(); private final FlinkCatalog catalog; Won't this fai...
codereview_java_data_587
return MPEGPS; } - if (supportSpec.match(MPEGTS, MPEG2, AC3) || supportSpec.match(MPEGTS, MPEG2, AAC)) { return MPEGTS; } Wouldn't it be (MPEGTS, H264, AAC)? return MPEGPS; } + if (supportSpec.match(MPEGTS, MPEG2, AC3) || supportSpec.match(MPEGTS, H264, AAC)) { return MPEGTS; }
codereview_java_data_593
contributionsFragment.backButtonClicked(); } else if (nearbyParentFragment != null && activeFragment == ActiveFragment.NEARBY) { // Means that nearby fragment is visible - // function nearbyParentFragment.backButtonClick() return false mean bottomsheet is not expand then if...
codereview_java_data_601
{ adapterResult.addFragment( new NutritionProductFragment(), menuTitles[2] ); adapterResult.addFragment( new NutritionInfoProductFragment(), menuTitles[3] ); - adapterResult.addFragment( new EnvironmentProductFragment(), "Environment" ); if( PreferenceManager.getDefaultSharedPreferences( this ).getBool...
codereview_java_data_604
public synchronized void shutdown() { if (this.producerNum.decrementAndGet() == 0) { - this.getScheduledExecutorService().shutdown(); } } set the scheduledExecutorService to null? public synchronized void shutdown() { if (this.producerNum.decrementAndGet() == 0) { ...
codereview_java_data_606
command.setOldColumnName(columnName); command.setNewColumnName(newColumnName); return command; - } else if (readIf("CONVERT")) { readIf("TO"); readIf("CHARACTER"); readIf(SET); this needs a && database.getM...
codereview_java_data_610
} private boolean isEligibleForShuffle(SingularityTaskId task) { return ( - isLongRunning(task) && !configuration.getDoNotShuffleRequests().contains(task.getRequestId()) - && (TimeUnit.MILLISECONDS.toMinutes(System.currentTimeMillis() - task.getStartedAt()) > configuration.getM...
codereview_java_data_611
* @return <code>true</code> if there were any configuration errors, * <code>false</code> otherwise * - * @deprecated Use {@link #getConfigErrors()}.isEmpty() */ @Deprecated public boolean hasConfigErrors() { - return !getConfigErrors().isEmpty(); } /** ......
codereview_java_data_619
@Override public void onClick(View view) { if (eventListener != null && batchSelected.isEmpty() && messageRecord.isMms() && !((MmsMessageRecord) messageRecord).getSharedContacts().isEmpty()) { - eventListener.onSharedContactDetailsClicked(((SharedContactView) view).getContact(), ((SharedContactV...
codereview_java_data_622
@Parameter(names="--bison-file", description="C file containing functions to link into bison parser.") public String bisonFile; - @Parameter(names="--bison-stack-max-depth", description="Maximum size of bison parsing stack.") public long bisonStackMaxDepth = 10000; @Parameter(...
codereview_java_data_635
// Key is accountUuid:folderName:messageUid , value is unimportant private ConcurrentHashMap<String, String> deletedUids = new ConcurrentHashMap<String, String>(); - private static final Flag[] SYNCFLAGS = new Flag[] { Flag.SEEN, Flag.FLAGGED, Flag.ANSWERED, Flag.FORWARDED }; private String create...
codereview_java_data_639
@Override public String toString() { - if (dateUploaded != null) { return "UploadResult{" + "errorCode='" + errorCode + '\'' + ", resultStatus='" + resultStatus + '\'' + Do not add the check here. Add the check just for `dateuploaded`. @Over...
codereview_java_data_641
package org.apache.calcite.rel.metadata.janino; /** - * An key used in caching with descriptive to string. Note the key uses * reference equality for performance. */ public final class DescriptiveCacheKey { typo. `An` -> `A` package org.apache.calcite.rel.metadata.janino; /** + * A key used in caching with ...
codereview_java_data_645
upperBounds.containsKey(fieldId) ? fromByteBuffer(type, upperBounds.get(fieldId)) : null); } - private File writeRecords(Schema schema, Record... records) throws IOException { - return TestParquet.writeRecords(temp, schema, Collections.emptyMap(), null, records); - } } Tests shouldn't use methods in ...
codereview_java_data_647
return this; } - public RunnerBuilder advertisedHost(final String advertisedHost) { - this.advertisedHost = advertisedHost; return this; } - public RunnerBuilder listenPort(final int listenPort) { - this.listenPort = listenPort; return this; } `listenPort` feels too generic here. I wond...
codereview_java_data_649
public static class ScanBuilder { private final Table table; private TableScan tableScan; - private final Expression defaultWhere = Expressions.alwaysTrue(); - private final List<String> defaultColumns = ImmutableList.of("*"); private boolean reuseContainers = false; - private final boolean d...
codereview_java_data_671
* * @return a new {@link RewriteManifests} */ - RewriteManifests newRewriteManifests(); /** * Create a new {@link OverwriteFiles overwrite API} to overwrite files by a filter expression. Can we change this to just `rewriteManifests` and use the verb? I know this matches `newRewrite`, but that rewri...
codereview_java_data_676
anyBoolean(), fileArgumentCaptor.capture()); - assertThat(fileArgumentCaptor.getValue().compareTo(file)).isZero(); assertThat(commandOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty(); This is a particularly unusual form of assertion and won't provi...
codereview_java_data_690
long cachedUidValidity = localFolder.getUidValidity(); long currentUidValidity = imapFolder.getUidValidity(); - if (localFolder.isCachedUidValidityValid() && cachedUidValidity != currentUidValidity) { Timber.v("SYNC: Deleting all local messages in folder %s due to UIDVALIDITY chang...
codereview_java_data_692
private static String getCause(Exception e) { StringBuilder sb = new StringBuilder(); if (e.getMessage() != null) { - sb.append(" : ").append(e.getMessage()); } if (e.getCause() != null && e.getCause().getMessage() != null) { - sb.append(" : ").append(e.get...
codereview_java_data_694
private long batchCount = 0; private long readaheadThreshold; - private Set<ScannerIterator> activeIters; private static ThreadPoolExecutor readaheadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 3L, TimeUnit.SECONDS, new SynchronousQueue<>(), I see you are using a SynchronizedSet in ScannerImpl ...
codereview_java_data_701
Integer productionPower = 0; for (String chargerId : this.config.charger_ids()) { EssDcCharger charger; - try { - charger = this.componentManager.getComponent(chargerId); - } catch (OpenemsNamedException e) { - this.logError(this.log, e.getMessage()); - continue; - } productionPow...
codereview_java_data_727
} // Add a junk file, should be ignored - FSDataOutputStream out = fs.create(new Path(dir + "/junk")); out.writeChars("ABCDEFG\n"); out.close(); ~I think that the `Paths.get(dir, "junk")` syntax might be a bit cleaner than the concatenation. Not a bug, but probably better, in that it's...
codereview_java_data_731
return statusAssembler.toResource(status); } - @RequestMapping("/logs/{streamName}") public String getLog(@PathVariable String streamName) { return this.streamDeployer.getLog(streamName); } - @RequestMapping("/logs/{streamName}/{appName}") public String getLog(@PathVariable String streamName, @PathVariabl...
codereview_java_data_751
return null; } - protected SqlNode emulateNullDirectionForLowNulls( - SqlNode node, boolean nullsFirst, boolean desc) { - // No emulation required for the following 2 cases - if (/*order by id nulls first*/ (nullsFirst && !desc) - || /*order by id desc nulls last*/ (!nullsFirst && desc)) { ...
codereview_java_data_765
private String pendingQueueKey(SingularityPendingRequest pendingRequest) { SingularityDeployKey deployKey = new SingularityDeployKey(pendingRequest.getRequestId(), pendingRequest.getDeployId()); - return String.format("%s%s", deployKey.toString(), pendingRequest.getTimestamp()); } private String getCle...
codereview_java_data_768
import org.apache.iceberg.io.CloseableIterable; public class FindFiles { private static final DateTimeFormatter DATE_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss.SSS"); public static Builder in(Table table) { I assume `snapshotLog()` is in ascending order. Should we then `break` after the conditio...
codereview_java_data_775
private final BlockTimer blockTimer; private final IbftMessageTransmitter transmitter; private final MessageFactory messageFactory; - private final Map<Integer, RoundState> futureRoundStateBuffer; private final NewRoundMessageValidator newRoundMessageValidator; private final Clock clock; private fina...
codereview_java_data_781
return Sets.union(scopesConfiguration.getRead(), scopesConfiguration.getWrite()); case WRITE: return scopesConfiguration.getWrite(); - case DEPLOY: - return scopesConfiguration.getDeploy().isEmpty() - ? scopesConfiguration.getWrite() - : scopesConfiguration.getDepl...
codereview_java_data_786
"Usage:\n" + " <functionName> \n\n" + "Where:\n" + - " functionName - the name of the function to delete. \n"; if (args.length != 1) { System.out.println(USAGE); "function to delete" again. "Usage:\n" + ...
codereview_java_data_788
final MutableAccount account = updater.createAccount(ADDRESS); account.setBalance(Wei.of(100000)); account.setCode(BytesValue.of(1, 2, 3)); account.setCode(BytesValue.of(3, 2, 1)); updater.commit(); assertEquals(BytesValue.of(3, 2, 1), worldState.get(ADDRESS).getCode()); assertEquals(...
codereview_java_data_790
} } - static public void bulkImport(Connector c, FileSystem fs, String table, String dir) - throws Exception { - // Ensure server can read/modify files - c.tableOperations().addFilesTo(table).from(dir).load(); - } - static public void checkSplits(Connector c, String table, int min, int max) thro...
codereview_java_data_797
Column c = cols[j]; DataType dataType = c.getDataType(); String precision = Integer.toString(c.getPrecisionAsInt()); - boolean isDateTime; - switch (dataType.type) { - case Value.TIME: - ...
codereview_java_data_798
// Start playback immediately if continuous playback is enabled // Repeat episode implementation - if (UserPreferences.repeatEpisode() && !wasSkipped) { nextMedia = currentMedia; nextMedia.setPosition(0); } else ...
codereview_java_data_812
private boolean isUsesMultifile; private boolean isUsesTyperesolution; public RuleBuilder(String name, ResourceLoader resourceLoader, String clazz, String language) { this.name = name; this.resourceLoader = resourceLoader; In order to keep backwards compatible, we need to provide an ov...
codereview_java_data_815
conf.setStrings(enumToConfKey(implementingClass, ScanOpts.RANGES), rangeStrings.toArray(new String[0])); } catch (IOException ex) { - throw new UncheckedIOException("Unable to encode ranges to Base64", ex); } } The user-facing exception should be IAE. conf.setStrings(enumToC...
codereview_java_data_823
} private static void apply(UpdateSchema pendingUpdate, TableChange.AddColumn add) { Type type = SparkSchemaUtil.convert(add.dataType()); - if (add.isNullable()) { - pendingUpdate.addColumn(parentName(add.fieldNames()), leafName(add.fieldNames()), type, add.comment()); - } else { - pendingUpd...
codereview_java_data_826
txtvPosition = findViewById(R.id.txtvPosition); SharedPreferences prefs = getSharedPreferences(PREFS, MODE_PRIVATE); - showTimeLeft = UserPreferences.getShowRemainTimeSetting(); Log.d("timeleft", showTimeLeft ? "true" : "false"); txtvLength = findViewById(R.id.txtvLength); ...
codereview_java_data_829
inner.next(); return result; } catch (IOException ex) { - throw new UncheckedIOException(ex); } } The NSEE makes a little more sense here, since it matches the Iterator interface's behavior when calling next without any more elements. inner.next(); return result; } c...
codereview_java_data_835
@Override public void onBackPressed() { - if (getSupportFragmentManager().getBackStackEntryCount()==1){ // back to search so show search toolbar and hide navigation toolbar toolbar.setVisibility(View.VISIBLE); setNavigationBaseToolbarVisibility(false); spaces aro...
codereview_java_data_836
@Test public void parseModuleDeclaration() { - JavaParser.getStaticConfiguration().setLanguageLevel(JAVA_9); JavaParser.parseModuleDeclaration("module X {}"); } Is it good to change the static configuration in a test? @Test public void parseModuleDeclaration() { JavaP...
codereview_java_data_840
super.onStart(); EventBus.getDefault().register(this); - autoDownload = prefs.getString(PREF_AUTO_DOWNLOAD,STRING_NO_FILTER); - keepUpdated = prefs.getString(PREF_KEEP_UPDATED,STRING_NO_FILTER); - autoDelete = prefs.getString(PREF_AUTO_DELETE,STRING_NO_FILTER); loadSubscr...
codereview_java_data_842
loadModule(OfflineMessageStrategy.class.getName()); loadModule(OfflineMessageStore.class.getName()); loadModule(VCardManager.class.getName()); - loadModule(SoftwareVersionManager.class.getName()); // Load standard modules loadModule(IQBindHandler.class.getName()); ...
codereview_java_data_843
CommonsApplication application = CommonsApplication.getInstance(); compositeDisposable.add( - RxJava2Tasks.getUploadCount(application.getCurrentAccount().name) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) ...
codereview_java_data_844
} public Builder contractAccountVersion(final int contractAccountVersion) { this.contractAccountVersion = contractAccountVersion; return this; } Probably worth asserting the value is `>= 0`. } public Builder contractAccountVersion(final int contractAccountVersion) { + check...
codereview_java_data_851
String jsonFilePath = String.format("META-INF/resources/%s", jsonFile); storeFile(GeneratedFileType.RESOURCE, jsonFilePath, jsonContent); } catch (Exception e) { - System.out.println("Failed to write OAS schema"); ...
codereview_java_data_874
} @Test public void syncModeOptionMustBeUsed() { parseCommand("--sync-mode", "FAST"); Also 2 new tests similar to `syncModeOptionMustBeUsed` to check the two new options values are well passed from the CLI to the SynchronizerConfiguration would help make sure we don't have an issue with a valid integer p...
codereview_java_data_880
} default Tuple2<Seq<K>, Seq<V>> unzip() { - return this.unzip(Function.identity()); } default <T1, T2> Tuple2<Seq<T1>, Seq<T2>> unzip(BiFunction<? super K, ? super V, Tuple2<? extends T1, ? extends T2>> unzipper) { we can remove `this.` } default Tuple2<Seq<K>, Seq<V>> unzip() { ...
codereview_java_data_889
@Deprecated public void setSourceCodeFilename(String filename) { // ignored, does nothing. } /** we could nag (log an error) about the usage of a deprecated API @Deprecated public void setSourceCodeFilename(String filename) { // ignored, does nothing. + LOG.warni...
codereview_java_data_891
nonSynchronizedAction = () -> mc.writeJobExecutionRecord(false); } else if (failure != null && !wasCancelled && mc.jobConfig().isSuspendOnFailure()) { mc.setJobStatus(SUSPENDED); - mc.jobExecutionRecord().setSuspended("Due to failure:\n" + Ex...
codereview_java_data_893
throw new NoSuchTableException("No such table: " + identifier); } TableMetadata metadata; if (ops.current() != null) { String baseLocation = location != null ? location : ops.current().location(); - Map<String, String> tableProperties = properties != null ? properties : Maps.newHashMap...
codereview_java_data_896
methodUsage = ((TypeVariableResolutionCapability) methodDeclaration) .resolveTypeVariables(this, argumentsTypes); } else { - return Optional.empty(); } return Optional.of(methodUsage); mmm, why a method declar...
codereview_java_data_901
try { return getDaoCareportalEvents().queryForId(timestamp); } catch (SQLException e) { - e.printStackTrace(); } return null; } could you please change that to a log statement like `log.error("Unhandled exception", e);`? (and while you are editing, pleas...
codereview_java_data_902
startActivity(new Intent(getActivity(), PreferenceActivity.class))); getContext().getSharedPreferences(PREF_NAME, Context.MODE_PRIVATE) .registerOnSharedPreferenceChangeListener(this); - - progressBar = root.findViewById(R.id.progressBar); - progressBar.bringToFr...
codereview_java_data_913
import java.util.UUID; @RunWith(RobolectricTestRunner.class) -@Config(manifest = Config.NONE, sdk = 27) public class KinesisRecorderTest { private static final String WORKING_DIRECTORY = "KinesisRecorderTest"; You can make a single `src/test/resources/robolectric.properties` that includes these values and then...
codereview_java_data_923
stateCache.getActiveTaskIds().remove(taskId); } - if (task.isPresent() && task.get().getTaskRequest().getRequest().isLoadBalanced()) { taskManager.createLBCleanupTask(taskId); } Is this an optimization? Is it 100% safe? What if the task isn't present but it's being load balanced due to a dat...
codereview_java_data_936
private void checkImports(JavaNode node, Object data) { String name = node.getImage(); - matches.clear(); // Find all "matching" import declarations for (ASTImportDeclaration importDeclaration : imports) { I've seen, that matches is actually only used in this method, so I would r...
codereview_java_data_943
switch (item.getItemId()) { case R.id.archived: if (item.getTitle().equals(getString(R.string.menu_option_archived))) { refresh(true); isarchivedvisible = true; }else if (item.getTitle().equals(getString(R.string.menu_opti...
codereview_java_data_951
private final Set<Integer> selected; PruneColumns(Set<Integer> selected) { - Preconditions.checkNotNull(selected, "Selected cannot be null"); this.selected = selected; } Rather than just using the name of the variable, I think this should give more context to users when it happens. "Field id set" or "...
codereview_java_data_955
ConsumeQueue logicQueue = this.findConsumeQueue(topic, queueId); if (logicQueue != null) { SelectMappedBufferResult result = logicQueue.getIndexBuffer(consumeQueueOffset); - long storeTime = getStoreTime(result); } return -1; Convert Long to long ? may lead t...
codereview_java_data_963
protected abstract void doDeployStream(String name, Map<String, String> deploymentProperties); - @Override - public void undeployStream(String streamName) { - doUndeployStream(streamName); - } - - protected abstract void doUndeployStream(String streamName); - protected StreamDefinition createStreamDefinitionForDep...
codereview_java_data_973
} @Test - public void testVerifiedIllegalNumBucket() { AssertHelpers.assertThrows("Should fail if numBucket is less than or equal to zero", IllegalArgumentException.class, - "The number of bucket must larger than zero", () -> Bucket.get(Types.IntegerType.get(), 0)); } bucket -> ...
codereview_java_data_975
closeStream(null); } if (xmppSession != null) { - xmppSession.getStreamManager().formalClose(); - if (!xmppSession.getStreamManager().getResume()) { Log.debug( "Closing session {}", xmppSession ); xmppSession.close(); This does no...
codereview_java_data_980
/** * The settings of open indexes. */ - private static final Map<String, FullTextSettings> SETTINGS = Collections.synchronizedMap(New.<String, FullTextSettings>hashMap()); /** * Whether this instance has been initialized. why do all these need to be synch collections? In general I do no...
codereview_java_data_991
*/ public static Address recoverProposerAddress( final BlockHeader header, final CliqueExtraData cliqueExtraData) { - if (header.getNumber() == 0) { - return ADDRESS_ZERO; } if (!cliqueExtraData.getProposerSeal().isPresent()) { throw new IllegalArgumentException( ```suggestion if...
codereview_java_data_996
if (pendingConfiguration.port != null) { pendingRequest.configuration.port = pendingConfiguration.port; } - if (pendingConfiguration.remoteHost != null) { - pendingRequest.configuration.remoteHost = pendingConfiguration.remoteHost; - } // make sure we have a valid host pendingReque...
codereview_java_data_1006
case FLOAT: case DOUBLE: Expression condition = operand; - if(operand instanceof MethodCallExpression) { condition = ((MethodCallExpression) operand).targetExpression; } operand = Expressions.call(BuiltInMethod.STRING_VALUEOF.method, operand); We assume notnull by default, ...
codereview_java_data_1017
.replace(R.id.fragment_container, frag) .commit(); currentScreen = HomeScreenState.GALLERY; - keycode = 0; } else { AlertDialog.Builder alertbox = new AlertDialog.Builder(ctx); alertbox.setMe...
codereview_java_data_1035
queryRequest.setIncludeTaskLocalVariables(Boolean.valueOf(allRequestParams.get("includeTaskLocalVariables"))); } - if (requestParams.containsKey("includeProcessVariables")) { - request.setIncludeProcessVariables(Boolean.valueOf(requestParams.get("includeProcessVariables"))); ...
codereview_java_data_1041
mProfile.put("exercise_mode", SMBDefaults.exercise_mode); mProfile.put("half_basal_exercise_target", SMBDefaults.half_basal_exercise_target); mProfile.put("maxCOB", SMBDefaults.maxCOB); - if (!manufacturer.name().equals("Medtronic")) { - mProfile.put("skip_neutral_temps",SMB...
codereview_java_data_1046
@Override public ObjectNode queryService(String namespaceId, String serviceName) throws NacosException { Service service = getServiceFromGroupedServiceName(namespaceId, serviceName, true); - boolean serviceExist = ServiceManager.getInstance().containSingleton(service); - if (!serviceExi...
codereview_java_data_1053
public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); - if (orientation != newConfig.orientation) { - orientation = newConfig.orientation; - } - configureForOrientation(orientation, newConfig); } public float conver...
codereview_java_data_1062
return current; } abstract Pair<Schema, Iterator<T>> getJoinedSchemaAndIteratorWithIdentityPartition( DataFile file, FileScanTask task, Schema requiredSchema, Set<Integer> idColumns, PartitionSpec spec); Since this is part of the Base Readers api, would be good to add a docstring on what this ...
codereview_java_data_1065
* Stores all nearby places found and related users response for * each place while uploading media */ - public static HashMap<Place,Boolean> existingPlaces; @SuppressLint("CheckResult") @Override I think we need a more explicit name for this. How about `nearbyPopupAnswers`? Or any other ...
codereview_java_data_1066
category = Category.ONE_OFF, link = "https://github.com/palantir/gradle-baseline#baseline-error-prone-checks", linkType = LinkType.CUSTOM, - severity = SeverityLevel.WARNING, summary = "log statement in catch block does not log the caught exception.") public final class Catch...
codereview_java_data_1074
return new ExpectEthAccountsException(transactions.accounts(), expectedMessage); } - public Condition getTransactionReceipt(final Hash transactionHash) { return new ExpectEthGetTransactionReceiptIsPresent( transactions.getTransactionReceipt(transactionHash.toString())); } - public Condition g...
codereview_java_data_1088
*/ package org.apache.accumulo.test.functional; -import static org.apache.accumulo.core.conf.Property.TABLE_CRYPTO_PREFIX; import org.apache.accumulo.core.cli.BatchWriterOpts; import org.apache.accumulo.core.cli.ScannerOpts; It looks like `keyManager` property is just set to `uri`. Does it not need to be set? ...
codereview_java_data_1091
return homeDirectory; } - @Override - public boolean jsonRpcEnabled() { - return isJsonRpcEnabled(); - } - JsonRpcConfiguration jsonRpcConfiguration() { return jsonRpcConfiguration; } (nit) `getHomeDirectory` ? return homeDirectory; } JsonRpcConfiguration jsonRpcConfiguration() { ...
codereview_java_data_1092
}; /** - * Operand type-checking strategy type must be a positive numeric non-NULL * literal in the range 0 - 1. */ - public static final SqlSingleOperandTypeChecker POSITIVE_NUMERIC_LITERAL = new FamilyOperandTypeChecker(ImmutableList.of(SqlTypeFamily.NUMERIC), i -> false) { ...
codereview_java_data_1093
ExtMetadata metadata = imageInfo.getMetadata(); if (metadata == null) { Media media = new Media(null, imageInfo.getOriginalUrl(), - page.title(), "", 0, null, null, null, null); if (!StringUtils.isBlank(imageInfo.getThumbUrl())) { media.set...
codereview_java_data_1095
* * @return {@code true} if there are more tokens to process */ - protected boolean more() { return position < tokenStream.size(); } maybe change to `hasNext()`? (or at least `hasMore()` but the latter is more consistent with an Iterator) * * @return {@code true} if there are more tokens to proces...
codereview_java_data_1099
package org.springframework.cloud.dataflow.core.dsl; /** - * After parsing a composed task definition from a DSL string, the validation visitor may optionally run. * Even though it parses successfully there may be issues with how the definition is constructed. The * {@link TaskValidatorVisitor} will find those pr...
codereview_java_data_1100
String brokerAddr = findBrokerResult.getBrokerAddr(); if (PullSysFlag.hasClassFilterFlag(sysFlagInner)) { - brokerAddr = computePullFromWhichFilterServer(mq.getTopic(), brokerAddr); } PullResult pullResult = this.mQClientFactory.getMQClientAPIImpl().pul...
codereview_java_data_1123
return result; } - @Nullable static InetAddress InetAddressOrNull(@Nullable String string, @Nullable byte[] bytes) { try { return bytes == null ? null : InetAddress.getByAddress(bytes); } catch (UnknownHostException e) { Lowercase since method return result; } + @Nullable static Ine...
codereview_java_data_1128
response.setOpaque(request.getOpaque()); - if (log.isDebugEnabled()) { - log.debug("receive PullMessage request command, {}", request); - } if (!PermName.isReadable(this.brokerController.getBrokerConfig().getBrokerPermission())) { response.setCode(ResponseCode.NO_...
codereview_java_data_1145
@NotNull @JsonProperty - private String metricsFilePath = "/var/run/singularity/s3uploader-metrics.out"; public SingularityS3UploaderConfiguration() { super(Optional.of("singularity-s3uploader.log")); random thought, if we don't want everyone to have to have this enabled, maybe this could be an optional...
codereview_java_data_1149
return Optional.empty(); } - public static BlockHeaderBuilder insertVoteToHeaderBuilder( final BlockHeaderBuilder builder, final Optional<ValidatorVote> vote) { final BlockHeaderBuilder voteHeaderBuilder = BlockHeaderBuilder.fromBuilder(builder); if (vote.isPresent()) { I know this was a bad ...
codereview_java_data_1154
List<Presence> presences = applyAffiliationChange(getRole(), groupMember, null); if (presences.size() == 0 && isMembersOnly()) { - sendAffiliationChangeNotification(groupMember, affiliation); } else { // member is in MUC, send presence stanzas for (Presen...
codereview_java_data_1157
mediaAdapter.notifyItemChanged(toggleSelectPhoto(m)); editMode = true; } - else { - selectAllPhotosUpTo(getImagePosition(m.getPath()),mediaAdapter); - } } else if (fav_photos && !all_photos) { ...
codereview_java_data_1159
@JavascriptEnabled @Ignore({IE, PHANTOMJS, SAFARI, MARIONETTE}) public void testShouldRetainImplicitlyWaitFromTheReturnedWebDriverOfFrameSwitchTo() { - driver.manage().timeouts().implicitlyWait(3, SECONDS); driver.get(pages.xhtmlTestPage); driver.findElement(By.name("windowOne")).click(); Str...
codereview_java_data_1160
public final static String generateHash(String data) throws Exception { String hashedData = data; try { - byte[] bytes = data.getBytes(StandardCharsets.US_ASCII); MessageDigest digest = MessageDigest.getInstance("SHA-256"); digest.update(bytes, 0, bytes.length...
codereview_java_data_1169
} @Override - public void setRebalanceKeyForInput(int ordinal, FunctionEx<?, ?> keyFn) { - upstreamPartitionKeyFns[ordinal] = keyFn; } @Override - public boolean shouldRebalanceInput(int ordinal) { - return upstreamRebalancingFlags[ordinal]; } @Override Rename to `setP...
codereview_java_data_1172
return collector.getReferenced(); } - final ExecutorService executorService = Executors.newCachedThreadPool(); - final class ChunkIdsCollector { - private final Set<Integer> referencedChunks = ConcurrentHashMap.newKeySet(); private final ChunkIdsCollector parent; ...
codereview_java_data_1174
private void killPantheonProcess(final String name, final Process process) { LOG.info("Killing " + name + " process"); - Awaitility.waitAtMost(60, TimeUnit.SECONDS) .until( () -> { if (process.isAlive()) { Did you mean to keep this duration change? private void killP...
codereview_java_data_1194
substanceProduct.append(" "); String allergen; - for (int i = 0; i <= allergens.size() - 1; i++) { allergen = allergens.get(i); substanceProduct.append(Utils.getClickableText(allergen, allergen, SearchType.ALLERGEN, getActivity(), customTabsIntent))...
codereview_java_data_1200
enforceConnectionLimits(); } - private boolean doTheFractionOfRemoteConnectionsAllowsNewOne() { final int remotelyInitiatedConnectionsCount = Math.toIntExact( connectionsById.values().stream() I think this should be against the max allowed connection count, not a ratio against the c...
codereview_java_data_1210
appUrlConfig = Config.getString("server.url"); appAllowNavigationConfig = Config.getArray("server.allowNavigation"); - String authority = "app"; - localUrl = "capacitor://" + authority + "/"; boolean isLocal = true; Should we ditch authority completely and move to a fixed, configurable hostname? T...
codereview_java_data_1212
} @Override - public void undo(long tid, Master env) throws Exception { // Clean up split files if create table operation fails - Path p = tableInfo.getSplitPath().getParent(); - FileSystem fs = p.getFileSystem(env.getContext().getHadoopConf()); - fs.delete(p, true); Utils.unreserveNamespace(e...
codereview_java_data_1224
public class ByteBuffers { - public static byte[] copy(ByteBuffer buffer) { if (buffer.hasArray()) { byte[] array = buffer.array(); if (buffer.arrayOffset() == 0 && buffer.position() == 0 This method doesn't actually provide a defensive copy in all cases, so it shouldn't be a helper that claims to...