auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public int write(ByteBuffer src) throws IOException { if (state == State.CLOSING) throw closingException(); if (state != State.READY) return 0; if (!flush(netWriteBuffer)) return 0; netWriteBuffer.clear(); SSLEngineResult wrapResult = sslEngine.wrap(src, netWriteBuffer); netWriteBuffer.flip(); if (wrapResult.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING && wrapResult.getStatus() == Status.OK) throw renegotiationException(); if (wrapResult.getStatus() == Status.OK) { <START> int written = wrapResult.bytesConsumed(); <END> flush(netWriteBuffer); return written; } else if (wrapResult.getStatus() == Status.BUFFER_OVERFLOW) { int currentNetWriteBufferSize = netWriteBufferSize(); netWriteBuffer.compact(); netWriteBuffer = Utils.ensureCapacity(netWriteBuffer, currentNetWriteBufferSize); netWriteBuffer.flip(); if (netWriteBuffer.limit() >= currentNetWriteBufferSize) throw new IllegalStateException("SSL BUFFER_OVERFLOW when available data size (" + netWriteBuffer.limit() + ") >= network buffer size (" + currentNetWriteBufferSize + ")"); } else if (wrapResult.getStatus() == Status.BUFFER_UNDERFLOW) { throw new IllegalStateException("SSL BUFFER_UNDERFLOW during write"); } else if (wrapResult.getStatus() == Status.CLOSED) { throw new EOFException(); } return 0; }</code><technical_language>this point, clear if bytes src read. So, useful loop writes sslEngine flush() write bytes sockets return. This potentially avoid caller re-populating bytes fileChannel again</technical_language>

Target:
public int write(ByteBuffer src) throws IOException { if (state == State.CLOSING) throw closingException(); if (state != State.READY) return 0; int written = 0; while (flush(netWriteBuffer) && src.hasRemaining()) { netWriteBuffer.clear(); SSLEngineResult wrapResult = sslEngine.wrap(src, netWriteBuffer); netWriteBuffer.flip(); if (wrapResult.getHandshakeStatus() != HandshakeStatus.NOT_HANDSHAKING && wrapResult.getStatus() == Status.OK) throw renegotiationException(); if (wrapResult.getStatus() == Status.OK) { written += wrapResult.bytesConsumed(); } else if (wrapResult.getStatus() == Status.BUFFER_OVERFLOW) { netWriteBuffer = Utils.ensureCapacity(netWriteBuffer, netWriteBufferSize()); netWriteBuffer.position(netWriteBuffer.limit()); } else if (wrapResult.getStatus() == Status.BUFFER_UNDERFLOW) { throw new IllegalStateException("SSL BUFFER_UNDERFLOW during write"); } else if (wrapResult.getStatus() == Status.CLOSED) { throw new EOFException(); } } return written; }
Source:
<code><START> public Envelope findCode(String refId) throws Exception { <END> Envelope projectionBounds = null; CoordinateReferenceSystem crs = null; CRSAuthorityFactory authorityFactory = CRS.getAuthorityFactory(true); Set<String> authorityCodes = authorityFactory.getAuthorityCodes(CoordinateReferenceSystem.class); if (refId.contains("WGS 84")) { crs = authorityFactory.createCoordinateReferenceSystem("EPSG:4326"); projectionBounds = getExtents(crs); } else { for (String code : authorityCodes) { if (code.startsWith("EPSG:") && code.contains(refId)) { try { crs = authorityFactory.createCoordinateReferenceSystem(code); } catch (Exception e) { System.err.printf("%s: Unable to create CRS: %s\n", code, e.getMessage()); } projectionBounds = getExtents(crs); System.err.printf("%s, %s \n", code, projectionBounds); } } } return projectionBounds; }</code><technical_language>want rename this "getCRSExtent()"</technical_language>

Target:
public Envelope findCode(String refId) throws Exception { Envelope projectionBounds = null; CoordinateReferenceSystem crs = null; CRSAuthorityFactory authorityFactory = CRS.getAuthorityFactory(true); crs = authorityFactory.createCoordinateReferenceSystem(refId); projectionBounds = getExtents(crs); return projectionBounds; }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!BuildConfig.DEBUG) { Fabric.with(this, new Crashlytics()); } this.setContentView(R.layout.main); if (savedInstanceState == null) { Uri uri = BaseballCardContract.getUri(this.getPackageName()); Cursor cursor = this.getContentResolver().query(uri, BaseballCardContract.PROJECTION, null, null, null); FragmentTransaction ft = this.getSupportFragmentManager().beginTransaction(); <START> ft.add(R.id.fragment_holder, new BaseballCardList(), FragmentTags.CARD_LIST); <END> ft.commit(); if (cursor == null || cursor.getCount() == 0) { this.getSupportFragmentManager().beginTransaction() .replace(R.id.fragment_holder, new BaseballCardDetails(), FragmentTags.EDIT_CARD) .addToBackStack(FragmentTags.EDIT_CARD).commit(); } cursor.close(); this.getSupportFragmentManager().addOnBackStackChangedListener(this); } prefs = getSharedPreferences(SharedPreferenceKeys.PREFS, MODE_PRIVATE); showSurvey1Dialog(); showSurvey2Dialog(); }</code><technical_language>call addToBackStack() here</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); if (!BuildConfig.DEBUG) { Fabric.with(this, new Crashlytics()); } this.setContentView(R.layout.main); fragmentManager = getSupportFragmentManager(); if (savedInstanceState == null) { Uri uri = BaseballCardContract.getUri(this.getPackageName()); Cursor cursor = this.getContentResolver().query(uri, BaseballCardContract.PROJECTION, null, null, null); fragmentManager.beginTransaction() .add(R.id.fragment_holder, new BaseballCardList(), FragmentTags.CARD_LIST) .addToBackStack(FragmentTags.CARD_LIST) .commit(); if (cursor == null || cursor.getCount() == 0) { fragmentManager.beginTransaction() .replace(R.id.fragment_holder, new BaseballCardDetails(), FragmentTags.EDIT_CARD) .addToBackStack(FragmentTags.EDIT_CARD) .commit(); } cursor.close(); fragmentManager.addOnBackStackChangedListener(this); } prefs = getSharedPreferences(SharedPreferenceKeys.PREFS, MODE_PRIVATE); showSurvey1Dialog(); showSurvey2Dialog(); }
Source:
<code>public byte[] getCacheKey() { byte[] dimensionBytes = StringUtils.toUtf8(dimension); final byte[][] valuesBytes = new byte[values.size()][]; int valuesBytesSize = 0; int index = 0; boolean hasNull = false; for (String value : values) { if (value == null) { hasNull = true; } valuesBytes[index] = StringUtils.toUtf8(Strings.nullToEmpty(value)); valuesBytesSize += valuesBytes[index].length + 1; ++index; } byte[] extractionFnBytes = extractionFn == null ? new byte[0] : extractionFn.getCacheKey(); <START> ByteBuffer filterCacheKey = ByteBuffer.allocate(5 <END> + dimensionBytes.length + valuesBytesSize + extractionFnBytes.length) .put(DimFilterUtils.IN_CACHE_ID) .put(dimensionBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(extractionFnBytes) .put(DimFilterUtils.STRING_SEPARATOR) .put(hasNull ? NullHandling.IS_NULL_BYTE : NullHandling.IS_NOT_NULL_BYTE) .put(DimFilterUtils.STRING_SEPARATOR); for (byte[] bytes : valuesBytes) { filterCacheKey.put(bytes) .put((byte) 0xFF); } return filterCacheKey.array(); }</code><technical_language>nit: CacheKeyBuilder here</technical_language>

Target:
public byte[] getCacheKey() { boolean hasNull = false; for (String value : values) { if (value == null) { hasNull = true; break; } } return new CacheKeyBuilder(DimFilterUtils.IN_CACHE_ID) .appendString(dimension) .appendByte(DimFilterUtils.STRING_SEPARATOR) .appendByteArray(extractionFn == null ? new byte[0] : extractionFn.getCacheKey()) .appendByte(DimFilterUtils.STRING_SEPARATOR) .appendByte(hasNull ? NullHandling.IS_NULL_BYTE : NullHandling.IS_NOT_NULL_BYTE) .appendByte(DimFilterUtils.STRING_SEPARATOR) .appendStrings(values).build(); }
Source:
<code>public List<UsagePermission> getEffectivePermissions() { List<UsagePermission> ps = buildPermissions(); Set<String> inheritedClouds = getInheritedClouds(); <START> <END> for (UsagePermission p : ps) { if (inheritedClouds.contains(p.name)) { p.setGranted(true); p.setInherited(true); } if (getPermittedClouds().contains(p.name)) { p.setGranted(true); } } if (!userHasAdministerPermission()) { ps = ps.stream().filter(f -> f.granted).collect(Collectors.toList()); } return ps; }</code><technical_language>Add @SuppressWarnings("unused") // jelly @Restricted(DoNotUse.class) // jelly</technical_language>

Target:
public List<UsagePermission> getEffectivePermissions() { List<UsagePermission> ps = buildPermissions(); Set<String> inheritedClouds = getInheritedClouds(); for (UsagePermission p : ps) { if (inheritedClouds.contains(p.name)) { p.setGranted(true); p.setInherited(true); } if (getPermittedClouds().contains(p.name)) { p.setGranted(true); } } if (!userHasAdministerPermission()) { ps = ps.stream().filter(UsagePermission::isGranted).collect(Collectors.toList()); } return ps; }
Source:
<code><START> private void setLeader(HelixManager manager) <END> throws Exception { System.out.println("Setting controller " + manager.getInstanceName() + " as leader"); HelixDataAccessor accessor = manager.getHelixDataAccessor(); final LiveInstance leader = new LiveInstance(manager.getInstanceName()); leader.setLiveInstance(ManagementFactory.getRuntimeMXBean().getName()); leader.setSessionId(manager.getSessionId()); leader.setHelixVersion(manager.getVersion()); while (!manager.isLeader()) { accessor.getBaseDataAccessor() .remove(PropertyPathBuilder.controllerLeader(manager.getClusterName()), AccessOption.EPHEMERAL); Thread.sleep(50); } }</code><technical_language>nit, I latest style file changed exception throws non-wrapping. Please update local style configuration</technical_language>

Target:
private void setLeader(HelixManager manager) throws Exception { HelixDataAccessor accessor = manager.getHelixDataAccessor(); final LiveInstance leader = new LiveInstance(manager.getInstanceName()); leader.setLiveInstance(ManagementFactory.getRuntimeMXBean().getName()); leader.setSessionId(manager.getSessionId()); leader.setHelixVersion(manager.getVersion()); while (!manager.isLeader()) { accessor.getBaseDataAccessor() .remove(PropertyPathBuilder.controllerLeader(manager.getClusterName()), AccessOption.EPHEMERAL); Thread.sleep(50); } }
Source:
<code>public synchronized void updatePartitionStatistics(String databaseName, String tableName, String partitionName, Function<PartitionStatistics, PartitionStatistics> update) { PartitionStatistics originalStatistics = requireNonNull(getPartitionStatistics(databaseName, tableName, ImmutableSet.of(partitionName)).get(partitionName), "originalStatistics is null"); PartitionStatistics updatedStatistics = update.apply(originalStatistics); <START> <END> Table table = getRequiredTable(databaseName, tableName); List<String> partitionValues = extractPartitionKeyValues(partitionName); Path partitionDirectory = getPartitionMetadataDirectory(table, partitionValues); PartitionMetadata partitionMetadata = readSchemaFile("partition", partitionDirectory, partitionCodec) .orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), partitionValues)); PartitionMetadata updatedMetadata = partitionMetadata .withParameters(updateStatisticParameters(partitionMetadata.getParameters(), updatedStatistics.getBasicStatistics())) .withColumnStatistics(updatedStatistics.getColumnStatistics()); writeSchemaFile("partition", partitionDirectory, partitionCodec, updatedMetadata, true); }</code><technical_language>Put a separate line a message "getPartitionStatistics() returned null"</technical_language>

Target:
public synchronized void updatePartitionStatistics(String databaseName, String tableName, String partitionName, Function<PartitionStatistics, PartitionStatistics> update) { PartitionStatistics originalStatistics = requireNonNull( getPartitionStatistics(databaseName, tableName, ImmutableSet.of(partitionName)).get(partitionName), "getPartitionStatistics() returned null"); PartitionStatistics updatedStatistics = update.apply(originalStatistics); Table table = getRequiredTable(databaseName, tableName); List<String> partitionValues = extractPartitionKeyValues(partitionName); Path partitionDirectory = getPartitionMetadataDirectory(table, partitionValues); PartitionMetadata partitionMetadata = readSchemaFile("partition", partitionDirectory, partitionCodec) .orElseThrow(() -> new PartitionNotFoundException(new SchemaTableName(databaseName, tableName), partitionValues)); PartitionMetadata updatedMetadata = partitionMetadata .withParameters(updateStatisticParameters(partitionMetadata.getParameters(), updatedStatistics.getBasicStatistics())) .withColumnStatistics(updatedStatistics.getColumnStatistics()); writeSchemaFile("partition", partitionDirectory, partitionCodec, updatedMetadata, true); }
Source:
<code>public synchronized boolean isComplete(int requestId, boolean remove) { <START> if (!operations.containsKey(requestId)) <END> return true; if (operations.get(requestId).getStatus().isComplete()) { if (logger.isDebugEnabled()) logger.debug("Operation complete " + requestId); if (remove) operations.remove(requestId); return true; } return false; }</code><technical_language>I a good idea change this behavior. Instead, for case consider a non-existent requestId equivalent a completed one, surround call in a try catch ignore exception</technical_language>

Target:
public synchronized boolean isComplete(int requestId, boolean remove) { if (!operations.containsKey(requestId)) throw new VoldemortException("No operation with id " + requestId + " found"); if (operations.get(requestId).getStatus().isComplete()) { if (logger.isDebugEnabled()) logger.debug("Operation complete " + requestId); if (remove) operations.remove(requestId); return true; } return false; }
Source:
<code>private void initFolder() { mFolder = new Folder(); mFolder.id = (getIntent().hasExtra(EXTRA_FOLDER_ID)) ? getIntent().getStringExtra(EXTRA_FOLDER_ID) : generateRandomFolderId(); mFolder.label = getIntent().getStringExtra(EXTRA_FOLDER_LABEL); <START> mFolder.rescanIntervalS = 3600; <END> mFolder.versioning = new Folder.Versioning(); }</code><technical_language>default in syncthing, 60s is default in syncthing. suggested folder watcher is enabled is hour, in case hour if watcher is enabled not</technical_language>

Target:
private void initFolder() { mFolder = new Folder(); mFolder.id = (getIntent().hasExtra(EXTRA_FOLDER_ID)) ? getIntent().getStringExtra(EXTRA_FOLDER_ID) : generateRandomFolderId(); mFolder.label = getIntent().getStringExtra(EXTRA_FOLDER_LABEL); mFolder.fsWatcherEnabled = true; mFolder.fsWatcherDelayS = 10; mFolder.rescanIntervalS = 3600; mFolder.versioning = new Folder.Versioning(); }
Source:
<code>private void changePreferenceSummary(String preferenceKey) { if (preferenceKey.equalsIgnoreCase(getString(R.string.preference_key_region)) || preferenceKey.equalsIgnoreCase(getString(R.string.preference_key_oba_api_url))) { if (Application.get().getCurrentRegion() != null) { mPreference.setSummary(Application.get().getCurrentRegion().getName()); mCustomApiUrlPref .setSummary(getString(R.string.preferences_oba_api_servername_summary)); String customOtpApiUrl = Application.get().getCustomOtpApiUrl(); <START> if (customOtpApiUrl == null) { <END> mCustomOtpApiUrlPref .setSummary(getString(R.string.preferences_otp_api_servername_summary)); } else { mCustomOtpApiUrlPref.setSummary(customOtpApiUrl); } } else { mPreference.setSummary(getString(R.string.preferences_region_summary_custom_api)); mCustomApiUrlPref.setSummary(Application.get().getCustomApiUrl()); } } else if (preferenceKey .equalsIgnoreCase(getString(R.string.preference_key_preferred_units))) { preferredUnits.setSummary(preferredUnits.getValue()); } else if (preferenceKey .equalsIgnoreCase(getString(R.string.preference_key_otp_api_url))) { String otpApiUrl = Application.get().getCustomOtpApiUrl(); if (!TextUtils.isEmpty(otpApiUrl)) { mCustomOtpApiUrlPref.setSummary(otpApiUrl); } else { mCustomOtpApiUrlPref.setSummary( getString(R.string.preferences_otp_api_servername_summary)); } Application.get().setUseOldOtpApiUrlVersion(false); mOtpCustomAPIUrlChanged = true; } }</code><technical_language>code line 289, I this if (!TextUtils.isEmpty(customOtpApiUrl))</technical_language>

Target:
private void changePreferenceSummary(String preferenceKey) { if (preferenceKey.equalsIgnoreCase(getString(R.string.preference_key_region)) || preferenceKey.equalsIgnoreCase(getString(R.string.preference_key_oba_api_url))) { if (Application.get().getCurrentRegion() != null) { mPreference.setSummary(Application.get().getCurrentRegion().getName()); mCustomApiUrlPref .setSummary(getString(R.string.preferences_oba_api_servername_summary)); String customOtpApiUrl = Application.get().getCustomOtpApiUrl(); if (!TextUtils.isEmpty(customOtpApiUrl)) { mCustomOtpApiUrlPref.setSummary(customOtpApiUrl); } else { mCustomOtpApiUrlPref .setSummary(getString(R.string.preferences_otp_api_servername_summary)); } } else { mPreference.setSummary(getString(R.string.preferences_region_summary_custom_api)); mCustomApiUrlPref.setSummary(Application.get().getCustomApiUrl()); } } else if (preferenceKey .equalsIgnoreCase(getString(R.string.preference_key_preferred_units))) { preferredUnits.setSummary(preferredUnits.getValue()); } else if (preferenceKey .equalsIgnoreCase(getString(R.string.preference_key_otp_api_url))) { String customOtpApiUrl = Application.get().getCustomOtpApiUrl(); if (!TextUtils.isEmpty(customOtpApiUrl)) { mCustomOtpApiUrlPref.setSummary(customOtpApiUrl); } else { mCustomOtpApiUrlPref.setSummary( getString(R.string.preferences_otp_api_servername_summary)); } Application.get().setUseOldOtpApiUrlVersion(false); mOtpCustomAPIUrlChanged = true; } }
Source:
<code>public void init() { executorService.schedule(this::setPublications, 1, TimeUnit.MILLISECONDS); <START> } <END></code><technical_language>waiting 1 millisecond call setPublications() help</technical_language>

Target:
public void init() { executorService.submit(this::setPublications); }
Source:
<code>public CloseableIterable<RyaStatement> query(final BatchRyaQuery batchRyaQuery) throws RyaDAOException { <START> final Map<RyaStatement, BindingSet> queries = new HashMap<>(); <END> for (final RyaStatement stmt : batchRyaQuery.getQueries()) { queries.put(stmt, new MapBindingSet()); } Iterator<RyaStatement> iterator = new RyaStatementCursorIterator(queryWithBindingSet(queries.entrySet(), getConf())); return CloseableIterables.wrap((Iterable<RyaStatement>) () -> iterator); }</code><technical_language>Null check</technical_language>

Target:
public CloseableIterable<RyaStatement> query(final BatchRyaQuery batchRyaQuery) throws RyaDAOException { Preconditions.checkNotNull(batchRyaQuery); final Map<RyaStatement, BindingSet> queries = new HashMap<>(); for (final RyaStatement stmt : batchRyaQuery.getQueries()) { queries.put(stmt, new MapBindingSet()); } Iterator<RyaStatement> iterator = new RyaStatementCursorIterator(queryWithBindingSet(queries.entrySet(), getConf())); return CloseableIterables.wrap((Iterable<RyaStatement>) () -> iterator); }
Source:
<code>public String save() { String login = this.userObject.getLogin(); <START> if (Objects.isNull(userObject.getId()) && !userService.isLoginValid(login)) { <END> Helper.setErrorMessage("loginNotValid", new Object[] {login }); return this.stayOnCurrentPage; } if (isMissingClient()) { Helper.setErrorMessage("errorMissingClient"); return this.stayOnCurrentPage; } try { if (userService.getAmountOfUsersWithExactlyTheSameLogin(this.userObject.getId(), login) == 0) { if (Objects.nonNull(this.passwordToEncrypt)) { this.userObject.setPassword(passwordEncoder.encrypt(this.passwordToEncrypt)); } userService.saveToDatabase(this.userObject); if (userService.getAuthenticatedUser().getId().equals(this.userObject.getId())) { loginForm.setLoggedUser(this.userObject); } return userListPath; } else { Helper.setErrorMessage("loginInUse"); return this.stayOnCurrentPage; } } catch (DAOException | RuntimeException e) { Helper.setErrorMessage(ERROR_SAVING, new Object[] {ObjectType.USER.getTranslationSingular() }, logger, e); return this.stayOnCurrentPage; } }</code><technical_language>Please move this isLoginValid method instead of removing</technical_language>

Target:
public String save() { String login = this.userObject.getLogin(); if (!isUserExistingOrLoginValid(login)) { Helper.setErrorMessage("loginNotValid", new Object[] {login }); return this.stayOnCurrentPage; } if (isMissingClient()) { Helper.setErrorMessage("errorMissingClient"); return this.stayOnCurrentPage; } try { if (userService.getAmountOfUsersWithExactlyTheSameLogin(this.userObject.getId(), login) == 0) { if (Objects.nonNull(this.passwordToEncrypt)) { this.userObject.setPassword(passwordEncoder.encrypt(this.passwordToEncrypt)); } userService.saveToDatabase(this.userObject); if (userService.getAuthenticatedUser().getId().equals(this.userObject.getId())) { loginForm.setLoggedUser(this.userObject); } return userListPath; } else { Helper.setErrorMessage("loginInUse"); return this.stayOnCurrentPage; } } catch (DAOException | RuntimeException e) { Helper.setErrorMessage(ERROR_SAVING, new Object[] {ObjectType.USER.getTranslationSingular() }, logger, e); return this.stayOnCurrentPage; } }
Source:
<code><START> public void fireSolvingStarted(DefaultSolverScope<Solution_> solverScope) { <END> if (eventListenerSet.isEmpty()) { return; } final SolvingStartedEvent<Solution_> event = new SolvingStartedEvent<>(solver); for (SolverListener<Solution_> listener : eventListenerSet) { listener.solvingStarted(event); } }</code><technical_language>Unused parameter - consistent confusing</technical_language>

Target:
public void fireSolvingStarted(DefaultSolverScope<Solution_> solverScope) { if (eventListenerSet.isEmpty()) { return; } final SolvingStartedEvent event = new SolvingStartedEvent(solver); for (SolverListener listener : eventListenerSet) { listener.solvingStarted(event); } }
Source:
<code>public void invokeCallbackMethods() { initCommandExecutor(); Iterator<Entry<Guid, CommandContainer>> iterator = cmdCallbackMap.entrySet().iterator(); while (iterator.hasNext()) { Entry<Guid, CommandContainer> entry = iterator.next(); <START> if (--entry.getValue().executionCountdown > 1) { <END> continue; } Guid cmdId = entry.getKey(); CommandCallback callback = entry.getValue().callback; CommandStatus status = coco.getCommandStatus(cmdId); boolean errorInCallback = false; try { switch (status) { case FAILED: callback.onFailed(cmdId, coco.getChildCommandIds(cmdId)); break; case SUCCEEDED: callback.onSucceeded(cmdId, coco.getChildCommandIds(cmdId)); break; case ACTIVE: if (coco.getCommandEntity(cmdId).isExecuted()) { callback.doPolling(cmdId, coco.getChildCommandIds(cmdId)); } break; default: break; } } catch (Exception ex) { errorInCallback = true; handleError(ex, status, cmdId); } finally { if (CommandStatus.FAILED.equals(status) || (CommandStatus.SUCCEEDED.equals(status) && !errorInCallback)) { coco.updateCallbackNotified(cmdId); iterator.remove(); } else { int maxDelay = Config.<Integer>getValue(ConfigValues.AsyncCommandPollingRateInSeconds); entry.getValue().executionDelay = Math.min(maxDelay, entry.getValue().executionDelay * 2); entry.getValue().executionCountdown = entry.getValue().executionDelay; } } } }</code><technical_language>here. elaborate</technical_language>

Target:
public void invokeCallbackMethods() { initCommandExecutor(); Iterator<Entry<Guid, CommandContainer>> iterator = cmdCallbackMap.entrySet().iterator(); while (iterator.hasNext()) { Entry<Guid, CommandContainer> entry = iterator.next(); if (--entry.getValue().executionCountdown > 0) { continue; } Guid cmdId = entry.getKey(); CommandCallback callback = entry.getValue().callback; CommandStatus status = coco.getCommandStatus(cmdId); boolean errorInCallback = false; try { switch (status) { case FAILED: callback.onFailed(cmdId, coco.getChildCommandIds(cmdId)); break; case SUCCEEDED: callback.onSucceeded(cmdId, coco.getChildCommandIds(cmdId)); break; case ACTIVE: if (coco.getCommandEntity(cmdId).isExecuted()) { callback.doPolling(cmdId, coco.getChildCommandIds(cmdId)); } break; default: break; } } catch (Exception ex) { errorInCallback = true; handleError(ex, status, cmdId); } finally { if (CommandStatus.FAILED.equals(status) || (CommandStatus.SUCCEEDED.equals(status) && !errorInCallback)) { coco.updateCallbackNotified(cmdId); iterator.remove(); } else { int maxDelay = Config.<Integer>getValue(ConfigValues.AsyncCommandPollingRateInSeconds); entry.getValue().executionDelay = Math.min(maxDelay, entry.getValue().executionDelay * 2); entry.getValue().executionCountdown = entry.getValue().executionDelay; } } } }
Source:
<code>public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) { final Player player = event.getPlayer(); final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH); if (ess.getUser(player).isMuted() && (ess.getSettings().getMuteCommands().contains(cmd) || ess.getSettings().getMuteCommands().contains("*"))) { event.setCancelled(true); player.sendMessage(tl("voiceSilenced")); LOGGER.info(tl("mutedUserSpeaks", player.getName())); return; } if (ess.getSettings().getSocialSpyCommands().contains(cmd) || ess.getSettings().getSocialSpyCommands().contains("*")) { if (!player.hasPermission("essentials.chat.spy.exempt")) { for (User spyer : ess.getOnlineUsers()) { if (spyer.isSocialSpyEnabled() && !player.equals(spyer.getBase())) { spyer.sendMessage(player.getDisplayName() + " : " + event.getMessage()); } } } } boolean broadcast = true; boolean update = true; PluginCommand pluginCommand = ess.getServer().getPluginCommand(cmd); if (pluginCommand != null) { switch (pluginCommand.getName()) { case "afk": update = false; case "vanish": broadcast = false; } } if (update) { final User user = ess.getUser(player); user.updateActivity(broadcast); } <START> } <END></code><technical_language>changes in this class included in this PR? unrelated</technical_language>

Target:
public void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) { final Player player = event.getPlayer(); final String cmd = event.getMessage().toLowerCase(Locale.ENGLISH).split(" ")[0].replace("/", "").toLowerCase(Locale.ENGLISH); if (ess.getUser(player).isMuted() && (ess.getSettings().getMuteCommands().contains(cmd) || ess.getSettings().getMuteCommands().contains("*"))) { event.setCancelled(true); player.sendMessage(tl("voiceSilenced")); LOGGER.info(tl("mutedUserSpeaks", player.getName())); return; } if (ess.getSettings().getSocialSpyCommands().contains(cmd) || ess.getSettings().getSocialSpyCommands().contains("*")) { if (!player.hasPermission("essentials.chat.spy.exempt")) { for (User spyer : ess.getOnlineUsers()) { if (spyer.isSocialSpyEnabled() && !player.equals(spyer.getBase())) { spyer.sendMessage(player.getDisplayName() + " : " + event.getMessage()); } } } } else { boolean broadcast = true; boolean update = true; PluginCommand pluginCommand = ess.getServer().getPluginCommand(cmd); if (pluginCommand != null) { switch (pluginCommand.getName()) { case "afk": update = false; case "vanish": broadcast = false; } } if (update) { final User user = ess.getUser(player); user.updateActivity(broadcast); } } }
Source:
<code>private void showShiftDateSnackBar(boolean isSuccess) { SnackbarErrorNotification snackbarErrorNotification = new SnackbarErrorNotification(authWebView); if (isSuccess) { snackbarErrorNotification.showError(R.string.assessment_shift_dates_success_msg, <START> null, R.string.assessment_view_all_dates, Snackbar.LENGTH_LONG, v -> Log.i("showPopupWindow", "Error Click")); <END> } else { snackbarErrorNotification.showError(R.string.course_dates_reset_unsuccessful, null, 0, Snackbar.LENGTH_LONG, null); } }</code><technical_language>create intent move dates</technical_language>

Target:
private void showShiftDateSnackBar(boolean isSuccess) { SnackbarErrorNotification snackbarErrorNotification = new SnackbarErrorNotification(authWebView); if (isSuccess) { snackbarErrorNotification.showError(R.string.assessment_shift_dates_success_msg, null, R.string.assessment_view_all_dates, SnackbarErrorNotification.COURSE_DATE_MESSAGE_DURATION, v -> environment.getRouter().showCourseDashboardTabs(getActivity(), null, unit.getCourseId(), null, null, false, Screen.COURSE_DATES)); } else { snackbarErrorNotification.showError(R.string.course_dates_reset_unsuccessful, null, 0, SnackbarErrorNotification.COURSE_DATE_MESSAGE_DURATION, null); } }
Source:
<code>public void beginTask(int max) { done(); <START> progressBar = new ProgressBar(this, styleForProgressBar); <END> this.totalWork = max; this.sumWorked = 0; progressBar.setMinimum(0); progressBar.setMaximum(PROGRESS_MAX); progressBar.setSelection(0); requestLayout(); animated = false; }</code><technical_language>this a performance issue misbehaved code calls beginTask frequently? safe, check if current progressBar correct style omit recreation & requestLayout completely</technical_language>

Target:
public void beginTask(int max) { if (progressBar == null || progressBar.isDisposed()) { progressBar = new ProgressBar(this, styleForProgressBar); requestLayout(); } this.totalWork = max; this.sumWorked = 0; progressBar.setMinimum(0); progressBar.setMaximum(PROGRESS_MAX); progressBar.setSelection(0); animated = false; }
Source:
<code>public void test000_openrepo_default_relative_workdirconfig() throws IOException { File repo1Parent = new File(trash.getParentFile(), "r1"); File workdir = new File(trash.getParentFile(), "rw"); <START> assertTrue(workdir.mkdir()); <END> FileRepository repo1initial = new FileRepository(new File(repo1Parent, Constants.DOT_GIT)); repo1initial.create(); final FileBasedConfig cfg = repo1initial.getConfig(); cfg.setString("core", null, "worktree", "../../rw"); cfg.save(); repo1initial.close(); File theDir = new File(repo1Parent, Constants.DOT_GIT); FileRepository r = new FileRepositoryBuilder().setGitDir(theDir) .build(); assertEqualsPath(theDir, r.getDirectory()); assertEqualsPath(workdir, r.getWorkTree()); assertEqualsPath(new File(theDir, "index"), r.getIndexFile()); assertEqualsPath(new File(theDir, "objects"), r.getObjectDatabase() .getDirectory()); }</code><technical_language>FileUtils.mkdirs</technical_language>

Target:
public void test000_openrepo_default_relative_workdirconfig() throws IOException { File repo1Parent = new File(trash.getParentFile(), "r1"); File workdir = new File(trash.getParentFile(), "rw"); FileUtils.mkdir(workdir); FileRepository repo1initial = new FileRepository(new File(repo1Parent, Constants.DOT_GIT)); repo1initial.create(); final FileBasedConfig cfg = repo1initial.getConfig(); cfg.setString("core", null, "worktree", "../../rw"); cfg.save(); repo1initial.close(); File theDir = new File(repo1Parent, Constants.DOT_GIT); FileRepository r = new FileRepositoryBuilder().setGitDir(theDir) .build(); assertEqualsPath(theDir, r.getDirectory()); assertEqualsPath(workdir, r.getWorkTree()); assertEqualsPath(new File(theDir, "index"), r.getIndexFile()); assertEqualsPath(new File(theDir, "objects"), r.getObjectDatabase() .getDirectory()); }
Source:
<code>public static void updateVmInitFromDB(VmBase vm, boolean secure) { VmInitDAO db = DbFacade.getInstance().getVmInitDao(); vm.setVmInit(db.get(vm.getId())); if (secure && vm.getVmInit() != null) { <START> vm.getVmInit().setPasswordAlreadyStored(!StringUtils.isEmpty(vm.getVmInit().getRootPassword())); <END> vm.getVmInit().setRootPassword(null); } }</code><technical_language>i guess update this field (even if secure is false)</technical_language>

Target:
public static void updateVmInitFromDB(VmBase vm, boolean secure) { VmInitDAO db = DbFacade.getInstance().getVmInitDao(); vm.setVmInit(db.get(vm.getId())); if (vm.getVmInit() != null) { if (secure) { vm.getVmInit().setPasswordAlreadyStored(!StringUtils.isEmpty(vm.getVmInit().getRootPassword())); } else { vm.getVmInit().setPasswordAlreadyStored(false); } vm.getVmInit().setRootPassword(null); } }
Source:
<code>private static String resolvePathParameters(final String basePath, final String classPathAnnotation, final String methodPathAnnotation, final Map<String, Object> pathParameterValues) { final UriBuilder builder = UriBuilder.fromUri(basePath); if (classPathAnnotation != null && !classPathAnnotation.equals("")) { builder.path(classPathAnnotation); } if (methodPathAnnotation != null && !methodPathAnnotation.equals("")) { builder.path(methodPathAnnotation); } String returnUri = null; Map<String, Object> parameters = pathParameterValues; <START> if (pathParameterValues == null) parameters = new HashMap<String, Object>(); <END> final URI resolvedUri = builder.buildFromMap(parameters); if (resolvedUri != null) { returnUri = resolvedUri.toString(); } return returnUri; }</code><technical_language>This is semantics original handling of null pathParameterValues provided a default path if specified. a matter of style, I this approach. code is converting a null empty reasoning other prevent a null pointer exception stack. If a null pathParameterValues is valid coming resolvePathParameters, valid is used, require this conversion null empty in middle</technical_language>

Target:
private static String resolvePathParameters(final String basePath, final String classPathAnnotation, final String methodPathAnnotation, final Map<String, Object> pathParameterValues) { final UriBuilder builder = UriBuilder.fromUri(basePath); if (classPathAnnotation != null && !classPathAnnotation.equals("")) { builder.path(classPathAnnotation); } if (methodPathAnnotation != null && !methodPathAnnotation.equals("")) { builder.path(methodPathAnnotation); } final URI resolvedUri = builder.buildFromMap(pathParameterValues); if (resolvedUri != null) { return resolvedUri.toString(); } log.warn("Could not build a path URI for basePath={} and path annotations (class='{}',method='{}')", basePath, classPathAnnotation, methodPathAnnotation ); return null; }
Source:
<code>public void copyFile_shouldNotCopyTheOutputstreamWhenOutputstreamIsNull() throws Exception { String exampleInputStreamString = "ExampleInputStream"; ByteArrayInputStream input = new ByteArrayInputStream(exampleInputStreamString.getBytes()); OutputStream output = null; OpenmrsUtil.copyFile(input, output); <START> assertEquals(null, output); <END> assertNotEquals(null, input); }</code><technical_language>assertNull assertNotNull</technical_language>

Target:
public void copyFile_shouldNotCopyTheOutputstreamWhenOutputstreamIsNull() throws Exception { String exampleInputStreamString = "ExampleInputStream"; ByteArrayInputStream input = new ByteArrayInputStream(exampleInputStreamString.getBytes()); OutputStream output = null; OpenmrsUtil.copyFile(input, output); assertNull(output); assertNotNull(input); }
Source:
<code>public AggregateExpression(ExpressionType type) { super(type); m_userAggregateId = "-1"; <START> m_name = "notUDAF"; <END> }</code><technical_language>empty string is better, if works</technical_language>

Target:
public AggregateExpression(ExpressionType type) { super(type); m_userAggregateId = -1; m_name = ""; }
Source:
<code>@Override public void addPathParam(String name, String value) { <START> boolean disableUrlEncoding = false; <END> addPathParam(name, value, disableUrlEncoding); }</code><technical_language>While I appreciate explicit-ness, this inlined method call. If want specific do: java addPathParam(name, value, false /* do URL encode */);</technical_language>

Target:
@Override public void addPathParam(String name, String value) { addPathParam(name, value, true); }
Source:
<code><START> private boolean sponge$onCreateDataDirectory(File dir) { <END> return WorldManager.mkdirsIfSaveable(dir); }</code><technical_language>Prefix forgeImpl$, sponge$</technical_language>

Target:
private boolean forgeImpl$onCreateDataDirectory(File dir) { return WorldManager.mkdirsIfSaveable(dir); }
Source:
<code>public void testMigration(EntitySpec<? extends JavaWebAppSoftwareProcess> webServerSpec) throws Exception { final JavaWebAppSoftwareProcess server = app.createAndManageChild(webServerSpec .addInitializer(new JavaWebAppMigrateEffector()) .configure(JavaWebAppSoftwareProcess.OPEN_IPTABLES, true) .configure("war", getTestWar())); app.start(ImmutableList.of(amazonProvisioningLocation)); EntityTestUtils.assertAttributeEqualsEventually(server, Attributes.SERVICE_UP, Boolean.TRUE); String preMigrationUrl = server.getAttribute(JavaWebAppSoftwareProcess.ROOT_URL); HttpTestUtils.assertUrlReachable(preMigrationUrl); <START> Effectors.invocation(AllowsMigration.MIGRATE, MutableMap.of("locationSpec", LOCATION_SPEC), server).asTask().blockUntilEnded(); <END> EntityTestUtils.assertAttributeEqualsEventually(server, Attributes.SERVICE_UP, Boolean.TRUE); String afterMigrationUrl = server.getAttribute(JavaWebAppSoftwareProcess.ROOT_URL); HttpTestUtils.assertUrlReachable(afterMigrationUrl); HttpTestUtils.assertUrlUnreachable(preMigrationUrl); }</code><technical_language>Give a Duration timeout argument blockUntilEnded in case wrong</technical_language>

Target:
public void testMigration(EntitySpec<? extends JavaWebAppSoftwareProcess> webServerSpec) throws Exception { final JavaWebAppSoftwareProcess server = app.createAndManageChild(webServerSpec .addInitializer(new AddMigrateEffectorEntityInitializer()) .configure(JavaWebAppSoftwareProcess.OPEN_IPTABLES, true) .configure("war", getTestWar())); app.start(ImmutableList.of(amazonProvisioningLocation)); EntityTestUtils.assertAttributeEqualsEventually(server, Attributes.SERVICE_UP, Boolean.TRUE); String preMigrationUrl = server.getAttribute(JavaWebAppSoftwareProcess.ROOT_URL); HttpTestUtils.assertUrlReachable(preMigrationUrl); Effectors.invocation(MigrateEffector.MIGRATE, MutableMap.of("locationSpec", LOCATION_SPEC), server).asTask().blockUntilEnded(Duration.FIVE_MINUTES); EntityTestUtils.assertAttributeEqualsEventually(server, Attributes.SERVICE_UP, Boolean.TRUE); String afterMigrationUrl = server.getAttribute(JavaWebAppSoftwareProcess.ROOT_URL); HttpTestUtils.assertUrlReachable(afterMigrationUrl); HttpTestUtils.assertUrlUnreachable(preMigrationUrl); }
Source:
<code>public static CreateMode fromFlag(int flag) throws KeeperException { switch (flag) { case 0: return CreateMode.PERSISTENT; case 1: return CreateMode.EPHEMERAL; case 2: return CreateMode.PERSISTENT_SEQUENTIAL; case 3: return CreateMode.EPHEMERAL_SEQUENTIAL; case 4: return CreateMode.CONTAINER; case 5: return CreateMode.PERSISTENT_WITH_TTL; case 6: return CreateMode.PERSISTENT_SEQUENTIAL_WITH_TTL; default: String errMsg = "Received an invalid flag value: " + flag + " to convert to a CreateMode"; LOG.error(errMsg); <START> throw new KeeperException.BadArgumentsException(); <END> } }</code><technical_language>good catchm this is a "path". I if preserve "message" I KeeperException a bad of dealing "exception message". clean it. Is is bad errMsg ? clean this stuff in a separate commit</technical_language>

Target:
public static CreateMode fromFlag(int flag) throws KeeperException { switch (flag) { case 0: return CreateMode.PERSISTENT; case 1: return CreateMode.EPHEMERAL; case 2: return CreateMode.PERSISTENT_SEQUENTIAL; case 3: return CreateMode.EPHEMERAL_SEQUENTIAL; case 4: return CreateMode.CONTAINER; case 5: return CreateMode.PERSISTENT_WITH_TTL; case 6: return CreateMode.PERSISTENT_SEQUENTIAL_WITH_TTL; default: String errMsg = "Received an invalid flag value: " + flag + " to convert to a CreateMode"; LOG.error(errMsg); throw new KeeperException.BadArgumentsException(errMsg); } }
Source:
<code>public void setUp() { <START> checkXmlRequest("hosts/123/setupnetworks", 200, "<action><modified_bonds><host_nic><bonding><options><option><name>mode</name><type>4</type></option></options><slaves><slave><name>eth1</name></slave><slave><name>eth2</name></slave></slaves></bonding><name>bond0</name></host_nic></modified_bonds></action>"); <END> startServer(); connection = testConnection(); hostService = connection.systemService().hostsService().hostService("123"); }</code><technical_language>suggest this line shorter, if requires ugly line breaks string concatenations: checkXmlRequest( "hosts/123/setupnetwors", 200, "<action>" + "<modified_bonds>" + ... );</technical_language>

Target:
public void setUp() { expectXmlRequest( "hosts/123/setupnetworks", 200, "<action>" + "<modified_bonds>" + "<host_nic>" + "<bonding>" + "<options>" + "<option>" + "<name>mode</name>" + "<type>4</type>" + "</option>" + "</options>" + "<slaves>" + "<slave>" + "<name>eth1</name>" + "</slave>" + "<slave>" + "<name>eth2</name>" + "</slave>" + "</slaves>" + "</bonding>" + "<name>bond0</name>" + "</host_nic>" + "</modified_bonds>" + "</action>" ); startServer(); connection = testConnection(); hostService = connection.systemService().hostsService().hostService("123"); }
Source:
<code>private VoltTable constructFragmentResultsTable() { ColumnInfo[] result_columns = new ColumnInfo[10]; int ii = 0; result_columns[ii++] = new ColumnInfo(VoltSystemProcedure.CNAME_HOST_ID, VoltSystemProcedure.CTYPE_ID); result_columns[ii++] = new ColumnInfo("HOSTNAME", VoltType.STRING); result_columns[ii++] = new ColumnInfo("PATH", VoltType.STRING); <START> result_columns[ii++] = new ColumnInfo("PATHTYPE", VoltType.STRING); <END> result_columns[ii++] = new ColumnInfo("NONCE", VoltType.STRING); result_columns[ii++] = new ColumnInfo("NAME", VoltType.STRING); result_columns[ii++] = new ColumnInfo("SIZE", VoltType.BIGINT); result_columns[ii++] = new ColumnInfo("DELETED", VoltType.STRING); result_columns[ii++] = new ColumnInfo("RESULT", VoltType.STRING); result_columns[ii++] = new ColumnInfo("ERR_MSG", VoltType.STRING); return new VoltTable(result_columns); }</code><technical_language>fyi, is a convenience constructor for VoltTable takes a variable number (one more) ColumnInfo arguments instead of explicit array. kinds of changes a easier</technical_language>

Target:
private VoltTable constructFragmentResultsTable() { return new VoltTable(new ColumnInfo( VoltSystemProcedure.CNAME_HOST_ID, VoltSystemProcedure.CTYPE_ID) , new ColumnInfo("HOSTNAME", VoltType.STRING) , new ColumnInfo("PATH", VoltType.STRING) , new ColumnInfo("PATHTYPE", VoltType.STRING) , new ColumnInfo("NONCE", VoltType.STRING) , new ColumnInfo("NAME", VoltType.STRING) , new ColumnInfo("SIZE", VoltType.BIGINT) , new ColumnInfo("DELETED", VoltType.STRING) , new ColumnInfo("RESULT", VoltType.STRING) , new ColumnInfo("ERR_MSG", VoltType.STRING)); }
Source:
<code>public Map<String, JsonElement> allFlags(LDUser user) { if (isOffline()) { <START> logger.warn("allFlags() was called when client is in offline mode!"); <END> } if (!initialized()) { logger.warn("allFlags() was called before Client has been initialized! Returning null."); return null; } if (user == null || user.getKey() == null) { logger.warn("allFlags() was called with null user or null user key! returning null"); return null; } Map<String, FeatureFlag> flags = this.config.featureStore.all(); Map<String, JsonElement> result = new HashMap<>(); for (Map.Entry<String, FeatureFlag> entry : flags.entrySet()) { try { JsonElement evalResult = entry.getValue().evaluate(user, config.featureStore).getValue(); result.put(entry.getKey(), evalResult); } catch (EvaluationException e) { logger.error("Exception caught when evaluating all flags:", e); } } return result; }</code><technical_language>This info this point</technical_language>

Target:
public Map<String, JsonElement> allFlags(LDUser user) { if (isOffline()) { logger.debug("allFlags() was called when client is in offline mode."); } if (!initialized()) { logger.warn("allFlags() was called before Client has been initialized! Returning null."); return null; } if (user == null || user.getKey() == null) { logger.warn("allFlags() was called with null user or null user key! returning null"); return null; } Map<String, FeatureFlag> flags = this.config.featureStore.all(); Map<String, JsonElement> result = new HashMap<>(); for (Map.Entry<String, FeatureFlag> entry : flags.entrySet()) { try { JsonElement evalResult = entry.getValue().evaluate(user, config.featureStore).getValue(); result.put(entry.getKey(), evalResult); } catch (EvaluationException e) { logger.error("Exception caught when evaluating all flags:", e); } } return result; }
Source:
<code>@Test public void testBigDecimalLiteral() { final RelDataTypeFactory typeFactory = new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT); final RexBuilder builder = new RexBuilder(typeFactory); final RexNode literal1 = builder.makeExactLiteral(new BigDecimal("25")); <START> assertThat(((RexLiteral) literal1).getValueAs(BigDecimal.class) <END> .toString(), is("25")); final RexNode literal2 = builder.makeExactLiteral(new BigDecimal("9.9")); assertThat(((RexLiteral) literal2).getValueAs(BigDecimal.class) .toString(), is("9.9")); final RexNode literal3 = builder.makeExactLiteral(new BigDecimal("0")); assertThat(((RexLiteral) literal3).getValueAs(BigDecimal.class) .toString(), is("0")); final RexNode literal4 = builder.makeExactLiteral(new BigDecimal("-75.5")); assertThat(((RexLiteral) literal4).getValueAs(BigDecimal.class) .toString(), is("-75.5")); final RexNode literal5 = builder.makeExactLiteral(new BigDecimal("10000000")); assertThat(((RexLiteral) literal5).getValueAs(BigDecimal.class) .toString(), is("10000000")); final RexNode literal6 = builder.makeExactLiteral(new BigDecimal("100000.111111111111111111")); assertThat(((RexLiteral) literal6).getValueAs(BigDecimal.class) .toString(), is("100000.111111111111111111")); final RexNode literal7 = builder.makeExactLiteral(new BigDecimal("73786976294838206464")); assertThat(((RexLiteral) literal7).getValueAs(BigDecimal.class) .toString(), is("73786976294838206464")); }</code><technical_language>please factor common logic assertBigDecimalLiteral(String inputText, String expectedOutputText)? test more readable (it include repeated builder.makeExactLiteral...), failure message easier understand. Thanks</technical_language>

Target:
@Test public void testBigDecimalLiteral() { final RelDataTypeFactory typeFactory = new SqlTypeFactoryImpl(RelDataTypeSystem.DEFAULT); final RexBuilder builder = new RexBuilder(typeFactory); assertBigDecimalLiteral(builder, "25"); assertBigDecimalLiteral(builder, "9.9"); assertBigDecimalLiteral(builder, "0"); assertBigDecimalLiteral(builder, "-75.5"); assertBigDecimalLiteral(builder, "10000000"); assertBigDecimalLiteral(builder, "100000.111111111111111111"); assertBigDecimalLiteral(builder, "-100000.111111111111111111"); assertBigDecimalLiteral(builder, "73786976294838206464"); assertBigDecimalLiteral(builder, "-73786976294838206464"); }
Source:
<code>private void help(CommandSender sender) { sender.sendMessage(Prism.messenger.playerHeaderMsg(ChatColor.GOLD + "--- Flags Help ---")); sender.sendMessage(Prism.messenger.playerMsg( ChatColor.GRAY + "Flags control how Prism applies a rollback/restore, or formats lookup results.")); sender.sendMessage(Prism.messenger <START> .playerMsg(ChatColor.GRAY + "Use them after parameters, like /pr l p:[player] -extended")); <END> for (final Flag flag : Flag.values()) { sender.sendMessage(Prism.messenger.playerMsg(ChatColor.LIGHT_PURPLE + flag.getUsage().replace("_", "-") + ChatColor.WHITE + " " + flag.getDescription())); } }</code><technical_language>change? Standard syntax <player> for required values. Typically [player] optional values</technical_language>

Target:
private void help(CommandSender sender) { sender.sendMessage(Prism.messenger.playerHeaderMsg(ChatColor.GOLD + "--- Flags Help ---")); sender.sendMessage(Prism.messenger.playerMsg( ChatColor.GRAY + "Flags control how Prism applies a rollback/restore, or formats lookup results.")); sender.sendMessage(Prism.messenger .playerMsg(ChatColor.GRAY + "Use them after parameters, like /pr l p:<player> -extended")); for (final Flag flag : Flag.values()) { sender.sendMessage(Prism.messenger.playerMsg(ChatColor.LIGHT_PURPLE + flag.getUsage().replace("_", "-") + ChatColor.WHITE + " " + flag.getDescription())); } }
Source:
<code>public void testListDList() { DList<Integer> d = listDList(List.range(0, 1000)); <START> assertThat(d.toJavaList(), is(d.run().toJavaList())); <END> }</code><technical_language>instead of testing assertThat(d.toJavaList(), is(d.run().toJavaList())); (that check toJavaList() is alias of run().toJavaList()) I test assertThat(d.toJavaList(), is(List.range(0, 1000).toJavaList())); (same for methods)</technical_language>

Target:
public void testListDList() { DList<Integer> d = listDList(List.range(0, 1000)); assertThat(d.toJavaList(), is(List.range(0, 1000).toJavaList())); }