auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void addCommitHooks(TaskAttemptContext context, Path outputPath) throws IOException { try { Path workPath = super.getWorkPath(); <START> log.debug("Attaching offset writer hooks"); <END> log.info("Adding offset writer hook: " + SequenceFileOffsetCommitter.class.getCanonicalName()); offsetWriterHooks.add(new SequenceFileOffsetCommitter(workPath, outputPath)); log.debug("Adding user-defined offset writer hooks"); for (Class<?> klass : context.getConfiguration().getClasses(ETL_OFFSET_WRITER_HOOKS)) { log.info("Adding offset writer hook: " + klass.getCanonicalName()); Constructor constructor = klass.getConstructor(Path.class, Path.class); OffsetWriterHook offsetWriterHook = (OffsetWriterHook) constructor.newInstance(workPath, outputPath); offsetWriterHooks.add(offsetWriterHook); } log.debug("All offset writer hooks added"); } catch (Exception e) { throw new IOException(e); } }</code><technical_language>Line 45 is needed next line logs information</technical_language>

Target:
private void addCommitHooks(TaskAttemptContext context, Path outputPath) throws IOException { try { Path workPath = super.getWorkPath(); log.debug("Adding offset writer hook: " + SequenceFileOffsetCommitter.class.getCanonicalName()); commitHooks.add(new SequenceFileOffsetCommitter()); for (Class<?> klass : context.getConfiguration().getClasses(ETL_COMMIT_HOOKS)) { log.debug("Adding offset writer hook: " + klass.getCanonicalName()); Constructor constructor = klass.getConstructor(); CommitHook commitHook = (CommitHook) constructor.newInstance(); commitHooks.add(commitHook); } } catch (Exception e) { throw new IOException(e); } }
Source:
<code>protected void lauchUpdateInstallTask() { InstallStagedUpdateTask<UpdateActivity> task = new InstallStagedUpdateTask<UpdateActivity>(DIALOG_UPGRADE_INSTALL) { @Override protected void deliverResult(UpdateActivity receiver, AppInstallStatus result) { if (result == AppInstallStatus.Installed) { <START> uiState.updateInstalledUiState(); <END> } else { uiState.errorUiState(); } } @Override protected void deliverUpdate(UpdateActivity receiver, int[]... update) { } @Override protected void deliverError(UpdateActivity receiver, Exception e) { uiState.errorUiState(); } }; task.connect(this); task.execute(); }</code><technical_language>receiver.uiState</technical_language>

Target:
protected void lauchUpdateInstallTask() { InstallStagedUpdateTask<UpdateActivity> task = new InstallStagedUpdateTask<UpdateActivity>(DIALOG_UPGRADE_INSTALL) { @Override protected void deliverResult(UpdateActivity receiver, AppInstallStatus result) { if (result == AppInstallStatus.Installed) { receiver.uiState.updateInstalledUiState(); } else { receiver.uiState.errorUiState(); } } @Override protected void deliverUpdate(UpdateActivity receiver, int[]... update) { } @Override protected void deliverError(UpdateActivity receiver, Exception e) { receiver.uiState.errorUiState(); } }; task.connect(this); task.execute(); }
Source:
<code>public Builder(String subject, List<String> addressReceiver, List<String> groupReceiver, Text content) { adminEmailAttributes = new AdminEmailAttributes(); adminEmailAttributes.addressReceiver = addressReceiver; adminEmailAttributes.groupReceiver = groupReceiver; adminEmailAttributes.subject = subject; adminEmailAttributes.content = content; <START> Assumption.assertNotNull("Non-null value expected for required AdminEmailAttributes", <END> adminEmailAttributes.addressReceiver, adminEmailAttributes.groupReceiver, adminEmailAttributes.subject, adminEmailAttributes.content); }</code><technical_language>move assumption check adminEmailAttributes creation, e.g line 175</technical_language>

Target:
public Builder(String subject, List<String> addressReceiver, List<String> groupReceiver, Text content) { Assumption.assertNotNull(Const.StatusCodes.NULL_PARAMETER, subject); Assumption.assertNotNull(Const.StatusCodes.NULL_PARAMETER, addressReceiver); Assumption.assertNotNull(Const.StatusCodes.NULL_PARAMETER, groupReceiver); Assumption.assertNotNull(Const.StatusCodes.NULL_PARAMETER, content); adminEmailAttributes = new AdminEmailAttributes(); adminEmailAttributes.addressReceiver = addressReceiver; adminEmailAttributes.groupReceiver = groupReceiver; adminEmailAttributes.subject = subject; adminEmailAttributes.content = content; }
Source:
<code>protected void teardown() { ThreadPoolUtil.execute(() -> { int sleepTimeInSec = Config.<Integer> getValue(ConfigValues.ServerRebootTimeout); <START> log.info("Waiting seconds, for server to finish boot process.", sleepTimeInSec); <END> ThreadUtils.sleep(TimeUnit.SECONDS.toMillis(sleepTimeInSec)); if (getParameters().isChangeHostToMaintenanceOnStart()) { setStatus(VDSStatus.Maintenance); } else { setStatus(VDSStatus.NonResponsive); } }); }</code><technical_language>Please mention for host waiting: log.info("Waiting seconds for host finish boot process.", sleepTimeInSec, getVds().getHostName());</technical_language>

Target:
protected void teardown() { }
Source:
<code>private List<ItemDefinition> itemDefinitions() { return dmnGraphUtils.getDefinitions().getItemDefinition(); <START> } <END></code><technical_language>src/main/java/org/kie/workbench/common/dmn/client/editors/types/persistence/handlers/ItemDefinitionCreateHandler.java:61: error: NULL_DEREFERENCE object returned ItemDefinitionCreateHandler.dmnGraphUtils.getDefinitions() null is dereferenced line 61. 59. 60. private List<ItemDefinition> itemDefinitions() { 61. > return dmnGraphUtils.getDefinitions().getItemDefinition(); 62. } 63. } please prevent NPE</technical_language>

Target:
private List<ItemDefinition> itemDefinitions() { return itemDefinitionUtils.all(); }
Source:
<code>public void test_JDK7171415() { <START> URI lower = URI.create("<LINK_3>"); <END> URI mixed = URI.create("<LINK_2>"); assertTrue(lower.equals(mixed)); assertEquals(lower.hashCode(), mixed.hashCode()); }</code><technical_language>add another case string extended characters, verify normalization for %2b further</technical_language>

Target:
public void test_JDK7171415() { URI lower, mixed; lower = URI.create("<LINK_3>"); mixed = URI.create("<LINK_2>"); assertTrue(lower.equals(mixed)); assertEquals(lower.hashCode(), mixed.hashCode()); lower = URI.create("<LINK_0>"); mixed = URI.create("<LINK_1>"); assertFalse(lower.equals(mixed)); assertFalse(lower.hashCode() == mixed.hashCode()); }
Source:
<code>private void assertColumnModify(String columnName, String schemaName, String tableName, Integer expectedLenValue, Integer expectedScalaValue, PDataType dataType) throws Exception { String query = "SELECT " + COLUMN_SIZE + ", "+ DECIMAL_DIGITS + "," + COLUMN_FAMILY + "," + DATA_TYPE + " FROM \"SYSTEM\".CATALOG WHERE " + TABLE_SCHEM + " = ? AND " + TABLE_NAME + " = ? AND " + COLUMN_NAME + " = ?" + " AND " + COLUMN_FAMILY + " = ?"; try (Connection conn = DriverManager.getConnection(getUrl())) { PreparedStatement stmt = conn.prepareStatement(query); stmt.setString(1, schemaName); stmt.setString(2, tableName); stmt.setString(3, columnName); stmt.setString(4, QueryConstants.DEFAULT_COLUMN_FAMILY); <START> ResultSet rs = stmt.executeQuery(); <END> assertTrue(rs.next()); if (expectedLenValue != null) { assertEquals(expectedLenValue.intValue(), rs.getInt(1)); } if (expectedScalaValue != null) { assertEquals(expectedScalaValue.intValue(), rs.getInt(2)); } if (dataType != null) { assertEquals(rs.getInt(4), dataType.getSqlType()); } assertFalse(rs.next()); } }</code><technical_language>if decrease length of a varchar column decreasing scale and/or precision of a decimal column existing data</technical_language>

Target:
private void assertColumnModify(String columnName, String schemaName, String tableName, Integer expectedLenValue, Integer expectedScalaValue, PDataType dataType) throws Exception { String query = "SELECT " + COLUMN_SIZE + ", "+ DECIMAL_DIGITS + "," + COLUMN_FAMILY + "," + DATA_TYPE + " FROM \"SYSTEM\".CATALOG WHERE " + TABLE_SCHEM + " = ? AND " + TABLE_NAME + " = ? AND " + COLUMN_NAME + " = ?"; try (Connection conn = DriverManager.getConnection(getUrl())) { PreparedStatement stmt = conn.prepareStatement(query); stmt.setString(1, schemaName); stmt.setString(2, tableName); stmt.setString(3, columnName); ResultSet rs = stmt.executeQuery(); assertTrue(rs.next()); if (expectedLenValue != null) { assertEquals(expectedLenValue.intValue(), rs.getInt(1)); } if (expectedScalaValue != null) { assertEquals(expectedScalaValue.intValue(), rs.getInt(2)); } if (dataType != null) { assertEquals(rs.getInt(4), dataType.getSqlType()); } assertFalse(rs.next()); } }
Source:
<code>public void testHolderLoad() throws Exception { File directory = folder.newFolder("testLoad"); String holderName = "myHolder"; StateHolder<Long, String> map = new TransientStateHolder<>(); map.putIfAbsent(42L, "Again? That's not even funny anymore!!"); <START> try (FileOutputStream fos = new FileOutputStream(new File(directory, HOLDER_FILE_NAME))) { <END> try (ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeObject(holderName); oos.writeObject(new FileBasedStateRepository.Tuple(0, map)); } } FileBasedStateRepository stateRepository = new FileBasedStateRepository(directory); StateHolder<Long, String> myHolder = stateRepository.getPersistentStateHolder(holderName, Long.class, String.class); assertThat(myHolder, is(map)); }</code><technical_language>Collapse in</technical_language>

Target:
public void testHolderLoad() throws Exception { File directory = folder.newFolder("testLoad"); String holderName = "myHolder"; StateHolder<Long, String> map = new TransientStateHolder<>(); map.putIfAbsent(42L, "Again? That's not even funny anymore!!"); try (FileOutputStream fos = new FileOutputStream(new File(directory, HOLDER_FILE_NAME)); ObjectOutputStream oos = new ObjectOutputStream(fos)) { oos.writeObject(holderName); oos.writeObject(new FileBasedStateRepository.Tuple(0, map)); } FileBasedStateRepository stateRepository = new FileBasedStateRepository(directory); StateHolder<Long, String> myHolder = stateRepository.getPersistentStateHolder(holderName, Long.class, String.class); assertThat(myHolder, is(map)); }
Source:
<code>protected void createSelection(Composite container) { Label lblSelect = new Label(container, SWT.NONE); <START> lblSelect.setText("Select one of the last five recently loaded configuration:"); <END> items = createTable(container, SWT.BORDER | SWT.V_SCROLL | extraListOptions, true); String[] names; names = recentConfigs.toArray(new String[0]); String[] timestamps; timestamps = recentTimestamps.toArray(new String[0]); for (int i = 0; i < timestamps.length; i++) { timestamps[i] = "Last modified: " + timestamps[i]; } setMultipleColumnItems(names, timestamps); }</code><technical_language>This "Select of loaded configurations:" if text</technical_language>

Target:
protected void createSelection(Composite container) { Label lblSelect = new Label(container, SWT.NONE); lblSelect.setText("Select configuration:"); items = createTable(container, SWT.BORDER | SWT.V_SCROLL | extraListOptions); setMultipleColumnItems(configNamesToArray(), timestampsToArray()); }
Source:
<code>public static void serializeHeader(ByteBuffer outputBuffer, long totalSize, int blobPropertiesRecordRelativeOffset, int deleteRecordRelativeOffset, int userMetadataRecordRelativeOffset, int blobRecordRelativeOffset) throws MessageFormatException { checkHeaderConstraints(totalSize, blobPropertiesRecordRelativeOffset, deleteRecordRelativeOffset, userMetadataRecordRelativeOffset, blobRecordRelativeOffset); int startOffset = outputBuffer.position(); outputBuffer.putShort(Message_Header_Version_V1); outputBuffer.putLong(totalSize); outputBuffer.putInt(blobPropertiesRecordRelativeOffset); outputBuffer.putInt(deleteRecordRelativeOffset); outputBuffer.putInt(userMetadataRecordRelativeOffset); outputBuffer.putInt(blobRecordRelativeOffset); Crc32 crc = new Crc32(); crc.update(outputBuffer.array(), startOffset, getHeaderSize() - Crc_Size); outputBuffer.putLong(crc.getValue()); Logger logger = LoggerFactory.getLogger("MessageHeader_Format_V1"); logger.trace("serializing header : version size blobpropertiesrecordrelativeoffset " + <START> "deleterecordrelativeoffset " + "usermetadatarecordrelativeoffset blobrecordrelativeoffset crc {}", <END> Message_Header_Version_V1, totalSize, blobPropertiesRecordRelativeOffset, deleteRecordRelativeOffset, userMetadataRecordRelativeOffset, blobPropertiesRecordRelativeOffset, crc.getValue()); }</code><technical_language>retry formatting change intellij settings</technical_language>

Target:
public static void serializeHeader(ByteBuffer outputBuffer, long totalSize, int blobPropertiesRecordRelativeOffset, int deleteRecordRelativeOffset, int userMetadataRecordRelativeOffset, int blobRecordRelativeOffset) throws MessageFormatException { checkHeaderConstraints(totalSize, blobPropertiesRecordRelativeOffset, deleteRecordRelativeOffset, userMetadataRecordRelativeOffset, blobRecordRelativeOffset); int startOffset = outputBuffer.position(); outputBuffer.putShort(Message_Header_Version_V1); outputBuffer.putLong(totalSize); outputBuffer.putInt(blobPropertiesRecordRelativeOffset); outputBuffer.putInt(deleteRecordRelativeOffset); outputBuffer.putInt(userMetadataRecordRelativeOffset); outputBuffer.putInt(blobRecordRelativeOffset); Crc32 crc = new Crc32(); crc.update(outputBuffer.array(), startOffset, getHeaderSize() - Crc_Size); outputBuffer.putLong(crc.getValue()); Logger logger = LoggerFactory.getLogger("MessageHeader_Format_V1"); logger.trace("serializing header : version size blobpropertiesrecordrelativeoffset " + "deleterecordrelativeoffset usermetadatarecordrelativeoffset blobrecordrelativeoffset crc {}", Message_Header_Version_V1, totalSize, blobPropertiesRecordRelativeOffset, deleteRecordRelativeOffset, userMetadataRecordRelativeOffset, blobPropertiesRecordRelativeOffset, crc.getValue()); }
Source:
<code>protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(GridLayoutFactory.swtDefaults().create()); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2); new Label(composite, SWT.WRAP) .setText(UIText.SelectSynchronizeResourceDialog_srcRef); srcRefCombo = new RemoteSelectionCombo(composite, syncRepos); srcRefCombo.setDefautlValue(UIText.SynchronizeWithAction_localRepoName, HEAD); srcRefCombo.setLayoutData(data); srcRefCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); shouldIncludeLocalButton = new Button(composite, SWT.CHECK | SWT.WRAP); shouldIncludeLocalButton .setText(UIText.SelectSynchronizeResourceDialog_includeUncommitedChnages); new Label(composite, SWT.WRAP) .setText(UIText.SelectSynchronizeResourceDialog_dstRef); dstRefCombo = new RemoteSelectionCombo(composite, syncRepos); <START> dstRefCombo.setDefautlValue(getDefaultRemoteName(), MASTER); <END> dstRefCombo.setLayoutData(data); dstRefCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); setTitle(NLS.bind(UIText.SelectSynchronizeResourceDialog_selectProject, repoName)); setMessage(UIText.SelectSynchronizeResourceDialog_header); setTitleImage(UIIcons.WIZBAN_CONNECT_REPO.createImage()); return composite; }</code><technical_language>method name is scrambled s/setDefautlValue/setDefaultValue/</technical_language>

Target:
protected Control createDialogArea(Composite parent) { Composite composite = (Composite) super.createDialogArea(parent); composite.setLayout(GridLayoutFactory.swtDefaults().create()); GridData data = new GridData(GridData.GRAB_HORIZONTAL | GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_CENTER); data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2); new Label(composite, SWT.WRAP) .setText(UIText.SelectSynchronizeResourceDialog_srcRef); srcRefCombo = new RemoteSelectionCombo(composite, syncRepos); srcRefCombo.setDefaultValue(UIText.SynchronizeWithAction_localRepoName, HEAD); srcRefCombo.setLayoutData(data); srcRefCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); shouldIncludeLocalButton = new Button(composite, SWT.CHECK | SWT.WRAP); shouldIncludeLocalButton .setText(UIText.SelectSynchronizeResourceDialog_includeUncommitedChnages); new Label(composite, SWT.WRAP) .setText(UIText.SelectSynchronizeResourceDialog_dstRef); dstRefCombo = new RemoteSelectionCombo(composite, syncRepos); dstRefCombo.setDefaultValue(getDefaultRemoteName(), MASTER); dstRefCombo.setLayoutData(data); dstRefCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create()); setTitle(NLS.bind(UIText.SelectSynchronizeResourceDialog_selectProject, repoName)); setMessage(UIText.SelectSynchronizeResourceDialog_header); setTitleImage(UIIcons.WIZBAN_CONNECT_REPO.createImage()); return composite; }
Source:
<code>public void onRatingTypeChange() { CompletableFuture<Void> statisicsFuture = switch (ratingTypeComboBox.getItems().indexOf(ratingTypeComboBox.getValue())) { <START> default -> loadStatistics(KnownFeaturedMod.FAF); case 1 -> loadStatistics(KnownFeaturedMod.LADDER_1V1); <END> }; statisicsFuture.thenRun(() -> Platform.runLater(this::plotPlayerRatingGraph)); }</code><technical_language>idk enums cooler</technical_language>

Target:
public void onRatingTypeChange() { CompletableFuture<Void> statisticsFuture = loadStatistics(ratingTypeComboBox.getValue().getFeaturedMod()); statisticsFuture.thenRun(() -> Platform.runLater(this::plotPlayerRatingGraph)); }
Source:
<code>public void checkPagingOneByOneThroughReferenceSets() throws AvroRemoteException { final List<ReferenceSet> listOfReferenceSets = Utils.getAllReferenceSets(client); assertThat(listOfReferenceSets).isNotEmpty(); final Set<ReferenceSet> setOfReferenceSets = new HashSet<>(listOfReferenceSets); assertThat(listOfReferenceSets).hasSize(setOfReferenceSets.size()); String pageToken = null; <START> for (ReferenceSet ignored : listOfReferenceSets) { <END> final SearchReferenceSetsRequest pageReq = SearchReferenceSetsRequest.newBuilder() .setPageSize(1) .setPageToken(pageToken) .build(); final SearchReferenceSetsResponse pageResp = client.references.searchReferenceSets(pageReq); final List<ReferenceSet> pageOfReferenceSets = pageResp.getReferenceSets(); pageToken = pageResp.getNextPageToken(); assertThat(pageOfReferenceSets).hasSize(1); assertThat(setOfReferenceSets).contains(pageOfReferenceSets.get(0)); setOfReferenceSets.remove(pageOfReferenceSets.get(0)); } assertThat(pageToken).isNull(); assertThat(setOfReferenceSets).isEmpty(); }</code><technical_language>This pagination pattern is repeated in a places. Consider test output endpoint returns results expected. This result in loop start emitting confusing assertion failures. accumulate results a set perform a set difference end. else, assert pageToken is non-null if more expected reference sets</technical_language>

Target:
public void checkPagingOneByOneThroughReferenceSets() throws AvroRemoteException { final List<ReferenceSet> listOfReferenceSets = Utils.getAllReferenceSets(client); assertThat(listOfReferenceSets).isNotEmpty(); final Set<ReferenceSet> setOfExpectedReferenceSets = new HashSet<>(listOfReferenceSets); assertThat(listOfReferenceSets).hasSize(setOfExpectedReferenceSets.size()); final Set<ReferenceSet> setOfReferenceSetsGathered1By1 = new HashSet<>(setOfExpectedReferenceSets.size()); String pageToken = null; do { final SearchReferenceSetsRequest pageReq = SearchReferenceSetsRequest.newBuilder() .setPageSize(1) .setPageToken(pageToken) .build(); final SearchReferenceSetsResponse pageResp = client.references.searchReferenceSets(pageReq); final List<ReferenceSet> pageOfReferenceSets = pageResp.getReferenceSets(); pageToken = pageResp.getNextPageToken(); assertThat(pageOfReferenceSets).hasSize(1); setOfReferenceSetsGathered1By1.add(pageOfReferenceSets.get(0)); } while (pageToken != null); assertThat(setOfReferenceSetsGathered1By1).containsAll(setOfExpectedReferenceSets); }
Source:
<code>public void validate(FailureCollector collector) { IdUtils.validateReferenceName(referenceName, collector); try { getSchema(); } catch (IllegalArgumentException e) { collector.addFailure(e.getMessage(), null).withConfigProperty(NAME_SCHEMA).withStacktrace(e.getStackTrace()); } <START> if (fileEncoding != null && !fileEncoding.isEmpty()) { <END> fileEncoding = cleanFileEncodingName(fileEncoding); if (!fileEncoding.equalsIgnoreCase(DEFAULT_FILE_ENCODING) && !FixedLengthCharset.isValidEncoding(fileEncoding)) { collector.addFailure("Specified file encoding is not valid.", "Use one of the supported file encodings."); } } if (collector.getValidationFailures().isEmpty()) { try { validate(); } catch (Exception e) { collector.addFailure(e.getMessage(), null).withStacktrace(e.getStackTrace()); } } }</code><technical_language>another change merged adding a shouldGetSchema() method (see #1288). new method needs updated check fileEncoding is macro enabled</technical_language>

Target:
public void validate(FailureCollector collector) { IdUtils.validateReferenceName(referenceName, collector); try { getSchema(); } catch (IllegalArgumentException e) { collector.addFailure(e.getMessage(), null).withConfigProperty(NAME_SCHEMA).withStacktrace(e.getStackTrace()); } if (getFileEncoding() != null && !getFileEncoding().equals(getDefaultFileEncoding())) { if (!FixedLengthCharset.isValidEncoding(getFileEncoding())) { collector.addFailure("Specified file encoding is not valid.", "Use one of the supported file encodings."); } } if (collector.getValidationFailures().isEmpty()) { try { validate(); } catch (Exception e) { collector.addFailure(e.getMessage(), null).withStacktrace(e.getStackTrace()); } } }
Source:
<code>public SitePluginModel getSitePluginFromSlug(String slug) { <START> return mPluginStore.getSitePluginBySlug(getSite(), slug); <END> }</code><technical_language>In main activity this call previously relied a quick HashMap lookup locate site plugin, hitting DB instead. list of site plugins, do a simple lookup here</technical_language>

Target:
public SitePluginModel getSitePluginFromSlug(String slug) { List<SitePluginModel> sitePlugins = getSitePlugins().getValue(); if (sitePlugins != null) { for (SitePluginModel plugin : sitePlugins) { if (plugin.getSlug().equals(slug)) { return plugin; } } } return mPluginStore.getSitePluginBySlug(getSite(), slug); }
Source:
<code>public static HashMap createCenter(final String name, final int officeId, final RequestSpecification requestSpec, <START> final ResponseSpecification responseSpec) { <END> final String CREATE_CENTER_URL = CENTERS_URL + "?" + Utils.TENANT_IDENTIFIER; HashMap hm = new HashMap(); hm.put("name", name); hm.put("officeId", officeId); hm.put("active", false); System.out.println("------------------------CREATING CENTER-------------------------"); return Utils.performServerPost(requestSpec, responseSpec, CREATE_CENTER_URL, new Gson().toJson(hm), ""); }</code><technical_language>return a CenterDomain here</technical_language>

Target:
public static int createCenter(final String name, final int officeId, final RequestSpecification requestSpec, final ResponseSpecification responseSpec) { return createCenter(name, officeId, null, -1, null, null, requestSpec, responseSpec); }
Source:
<code>public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(); setContentView(R.layout.cacheslist_activity); Bundle extras = getIntent().getExtras(); if (extras != null) { type = Intents.getListType(getIntent()); coords = extras.getParcelable(Intents.EXTRA_COORDS); } else { extras = new Bundle(); } if (isInvokedFromAttachment()) { type = CacheListType.OFFLINE; if (coords == null) { coords = Geopoint.ZERO; } } if (type == CacheListType.NEAREST) { coords = Sensors.getInstance().currentGeo().getCoords(); } setTitle(title); if (savedInstanceState != null) { currentFilter = savedInstanceState.getParcelable(STATE_FILTER); currentInverseSort = savedInstanceState.getBoolean(STATE_INVERSE_SORT); type = CacheListType.values()[savedInstanceState.getInt(STATE_LIST_TYPE, type.ordinal())]; listId = savedInstanceState.getInt(STATE_LIST_ID); markerId = savedInstanceState.getInt(STATE_MARKER_ID); } initAdapter(); prepareFilterBar(); if (type.canSwitch) { initActionBarSpinner(); } try { currentLoader = (AbstractSearchLoader) getSupportLoaderManager().initLoader(type.getLoaderId(), extras, this); <START> } catch (final NullPointerException e) { <END> Log.e("CacheListActivity.onCreate", e); } if (CollectionUtils.isNotEmpty(cacheList)) { if (currentLoader != null && currentLoader.isStarted()) { showFooterLoadingCaches(); } else { showFooterMoreCaches(); } } if (isInvokedFromAttachment()) { listNameMemento.rememberTerm(extras.getString(Intents.EXTRA_NAME)); importGpxAttachement(); } }</code><technical_language>I is good idea blindly swallow exception here. If loader is 'not needed', detect avoid calling creation</technical_language>

Target:
public void onCreate(final Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(); setContentView(R.layout.cacheslist_activity); Bundle extras = getIntent().getExtras(); if (extras != null) { type = Intents.getListType(getIntent()); coords = extras.getParcelable(Intents.EXTRA_COORDS); } else { extras = new Bundle(); } if (isInvokedFromAttachment()) { type = CacheListType.OFFLINE; if (coords == null) { coords = Geopoint.ZERO; } } if (type == CacheListType.NEAREST) { coords = Sensors.getInstance().currentGeo().getCoords(); } setTitle(title); if (savedInstanceState != null) { currentFilter = savedInstanceState.getParcelable(STATE_FILTER); currentInverseSort = savedInstanceState.getBoolean(STATE_INVERSE_SORT); type = CacheListType.values()[savedInstanceState.getInt(STATE_LIST_TYPE, type.ordinal())]; listId = savedInstanceState.getInt(STATE_LIST_ID); markerId = savedInstanceState.getInt(STATE_MARKER_ID); } initAdapter(); prepareFilterBar(); if (type.canSwitch) { initActionBarSpinner(); } currentLoader = (AbstractSearchLoader) getSupportLoaderManager().initLoader(type.getLoaderId(), extras, this); if (CollectionUtils.isNotEmpty(cacheList)) { if (currentLoader != null && currentLoader.isStarted()) { showFooterLoadingCaches(); } else { showFooterMoreCaches(); } } if (isInvokedFromAttachment()) { listNameMemento.rememberTerm(extras.getString(Intents.EXTRA_NAME)); importGpxAttachement(); } }
Source:
<code>public String toString() { <START> return getClass().getSimpleName() + "@" + this.id + "#" + this.version + " " + toJson(); <END> }</code><technical_language>suggestion return getClass().getSimpleName() + '@' + this.id + '#' + this.version + ' ' + toJson(); IntelliJ thinks this is</technical_language>

Target:
public String toString() { return getClass().getSimpleName() + '@' + this.id + '#' + this.version + ' ' + toJson(); }
Source:
<code>private void cancel(UUID nodeId) { synchronized (this) { if (isDone()) return; U.log(log, ("Cancelled rebalancing [grp=" + grp.cacheOrGroupName() + ", supplier=" + nodeId + ", topVer=" + topologyVersion() + ']')); cleanupRemoteContexts(nodeId); IgniteDhtDemandedPartitionsMap rmvd = remaining.remove(nodeId); if (rmvd != null) <START> grp.metrics().cancelRebalancingPartitions(rmvd.size()); <END> onDone(false); checkIsDone(); } }</code><technical_language>Do need this method? reset method used? need callback all</technical_language>

Target:
private void cancel(UUID nodeId) { synchronized (this) { if (isDone()) return; U.log(log, ("Cancelled rebalancing [grp=" + grp.cacheOrGroupName() + ", supplier=" + nodeId + ", topVer=" + topologyVersion() + ']')); cleanupRemoteContexts(nodeId); remaining.remove(nodeId); onDone(false); checkIsDone(); } }
Source:
<code>public MockResponse handleCreate(String path, String s) { <START> Serialization.unmarshal(s, KubernetesResource.class); <END> MockResponse response = new MockResponse(); AttributeSet features = AttributeSet.merge(attributeExtractor.fromPath(path), attributeExtractor.fromResource(s)); map.put(features, s); for (Map.Entry<AttributeSet, Set<WatchEventsListener>> entry: watchEventListenerMapping.entrySet()) { if (features.matches(entry.getKey())) { for (WatchEventsListener listener: entry.getValue()) { listener.sendWebSocketResponse(doGet(path), "ADDED"); } } } response.setBody(s); response.setResponseCode(202); return response; }</code><technical_language>Is this forgotten? ignoring returned object</technical_language>

Target:
public MockResponse handleCreate(String path, String s) { return new MockResponse().setResponseCode(doCreate(path, s, "ADDED")).setBody(s); }
Source:
<code>private ArrayDeque<TokenCredential> getCredentialsChain() { <START> ArrayDeque<TokenCredential> output = new ArrayDeque<>(5); <END> if (!excludeEnvironmentCredential) { output.add(new EnvironmentCredential(identityClientOptions)); } if (!excludeManagedIdentityCredential) { output.add(new ManagedIdentityCredential(null, identityClientOptions)); } if (!excludeSharedTokenCacheCredential) { output.add(new SharedTokenCacheCredential(null, "04b07795-8ddb-461a-bbee-02f9e1bf7b46", null, identityClientOptions)); } if (!excludeAzureCliCredential) { output.add(new AzureCliCredential(identityClientOptions)); } if (!excludeIntelliJCredential) { output.add(new IntelliJCredential(identityClientOptions)); } if (output.size() == 0) { throw logger.logExceptionAsError(new IllegalArgumentException("At least one credential type must be" + " included in the authentication flow.")); } return output; }</code><technical_language>FYI this PR VsCodeCredential PR increment this 5. merge need update other PR</technical_language>

Target:
private ArrayDeque<TokenCredential> getCredentialsChain() { ArrayDeque<TokenCredential> output = new ArrayDeque<>(6); if (!excludeEnvironmentCredential) { output.add(new EnvironmentCredential(identityClientOptions)); } if (!excludeManagedIdentityCredential) { output.add(new ManagedIdentityCredential(null, identityClientOptions)); } if (!excludeSharedTokenCacheCredential) { output.add(new SharedTokenCacheCredential(null, "04b07795-8ddb-461a-bbee-02f9e1bf7b46", null, identityClientOptions)); } if (!excludeIntelliJCredential) { output.add(new IntelliJCredential(tenantId, identityClientOptions)); } if (!excludeVsCodeCredential) { output.add(new VisualStudioCodeCredential(tenantId, identityClientOptions)); } if (!excludeAzureCliCredential) { output.add(new AzureCliCredential(identityClientOptions)); } if (output.size() == 0) { throw logger.logExceptionAsError(new IllegalArgumentException("At least one credential type must be" + " included in the authentication flow.")); } return output; }
Source:
<code>private void buildBlobIdAndAssert(short version, byte flag, byte datacenterId, short accountId, short containerId, PartitionId partitionId) throws Exception { BlobId blobId; switch (version) { case BLOB_ID_V1: blobId = new BlobId(flag, datacenterId, accountId, containerId, partitionId); break; <START> <END> case BLOB_ID_V2: blobId = new BlobIdV2(flag, datacenterId, accountId, containerId, partitionId); break; default: throw new IllegalArgumentException("Invalid version number blob" + version); } assertEquals("Wrong blobId version", version, getVersionFromBlobString(blobId.getID())); assertBlobIdFieldValues(version, blobId, flag, datacenterId, accountId, containerId, partitionId); }</code><technical_language>extra line</technical_language>

Target:
private void buildBlobIdAndAssert(short version, byte flag, byte datacenterId, short accountId, short containerId, PartitionId partitionId) throws Exception { BlobId blobId; switch (version) { case BLOB_ID_V1: blobId = new BlobId(flag, datacenterId, accountId, containerId, partitionId); break; case BLOB_ID_V2: blobId = new BlobIdV2(flag, datacenterId, accountId, containerId, partitionId); break; default: throw new Exception("Invalid version number blob" + version); } assertEquals("Wrong blobId version", version, getVersionFromBlobString(blobId.getID())); assertBlobIdFieldValues(version, blobId, flag, datacenterId, accountId, containerId, partitionId); }
Source:
<code>private void commonSectionFetchOnCatch(Throwable caught, int sequenceNum) { if (!isAdded() || sequenceNum != pageSequenceNum) { return; } tocDrawer.closeDrawers(); ((PageActivity) getActivity()).updateProgressBar(false, true, 0); refreshView.setRefreshing(false); if (caught instanceof SectionsFetchException) { if (((SectionsFetchException) caught).getCode().equals("missingtitle") || ((SectionsFetchException) caught).getCode().equals("invalidtitle")) { ViewAnimations.fadeIn(pageDoesNotExistError); } } else if (Utils.throwableContainsSpecificType(caught, SSLException.class)) { if (WikipediaApp.getInstance().incSslFailCount() < 2) { WikipediaApp.getInstance().setSslFallback(true); showNetworkError(null); try { connectionIssueFunnel.logConnectionIssue("mdot", "commonSectionFetchOnCatch"); } catch (Exception e) { } } else { showNetworkError(null); try { connectionIssueFunnel.logConnectionIssue("desktop", "commonSectionFetchOnCatch"); } catch (Exception e) { } } } else if (Utils.throwableContainsSpecificType(caught, JSONException.class)) { Log.d(TAG, "Caught JSONException"); <START> Log.d(TAG, "Message: " + caught.getMessage()); <END> Pattern p = Pattern.compile(" \\d{3} "); Matcher m = p.matcher(caught.getMessage()); if (m.find()) { statusCode = m.group(0).trim(); Log.d(TAG, "Found probable server response code " + statusCode); showNetworkError(statusCode); } else { showNetworkError(null); } } else if (caught instanceof ApiException) { showNetworkError(null); } else { throw new RuntimeException(caught); } }</code><technical_language>combine Log.d's</technical_language>

Target:
private void commonSectionFetchOnCatch(Throwable caught, int sequenceNum) { if (!isAdded() || sequenceNum != pageSequenceNum) { return; } tocDrawer.closeDrawers(); ((PageActivity) getActivity()).updateProgressBar(false, true, 0); refreshView.setRefreshing(false); if (caught instanceof SectionsFetchException) { if (((SectionsFetchException) caught).getCode().equals("missingtitle") || ((SectionsFetchException) caught).getCode().equals("invalidtitle")) { ViewAnimations.fadeIn(pageDoesNotExistError); } } else if (Utils.throwableContainsSpecificType(caught, SSLException.class)) { if (WikipediaApp.getInstance().incSslFailCount() < 2) { WikipediaApp.getInstance().setSslFallback(true); showNetworkError(null); try { connectionIssueFunnel.logConnectionIssue("mdot", "commonSectionFetchOnCatch"); } catch (Exception e) { } } else { showNetworkError(null); try { connectionIssueFunnel.logConnectionIssue("desktop", "commonSectionFetchOnCatch"); } catch (Exception e) { } } } else if (Utils.throwableContainsSpecificType(caught, JSONException.class)) { Log.d(TAG, "Caught JSONException. Message: " + caught.getMessage()); Pattern p = Pattern.compile(" \\d{3} "); Matcher m = p.matcher(caught.getMessage()); if (m.find()) { String statusCode = m.group(0).trim(); Log.d(TAG, "Found probable server response code " + statusCode); showNetworkError(statusCode); } else { showNetworkError(null); } } else if (caught instanceof ApiException) { showNetworkError(null); } else { throw new RuntimeException(caught); } }
Source:
<code>public ClangTidyParser() { super(Messages._Warnings_ClangTidy_ParserName(), Messages._Warnings_ClangTidy_LinkName(), Messages._Warnings_ClangTidy_TrendName(), CLANG_TIDY_WARNING_PATTERN, <START> false); <END> }</code><technical_language>false is default</technical_language>

Target:
public ClangTidyParser() { super(Messages._Warnings_ClangTidy_ParserName(), Messages._Warnings_ClangTidy_LinkName(), Messages._Warnings_ClangTidy_TrendName(), CLANG_TIDY_WARNING_PATTERN); }
Source:
<code>private void buildGroupToLeafWriterMap(PrimitiveColumnIO primitive, ColumnWriter writer) { GroupColumnIO parent = primitive.getParent(); <START> do { <END> getLeafWriters(parent).add(writer); } while ((parent = parent.getParent()) != null); }</code><technical_language>about: do { getLeafWriters(parent).add(writer); parent = parent.getParent(); } while (parent != null) this a easier read</technical_language>

Target:
private void buildGroupToLeafWriterMap(PrimitiveColumnIO primitive, ColumnWriter writer) { GroupColumnIO parent = primitive.getParent(); do { getLeafWriters(parent).add(writer); parent = parent.getParent(); } while (parent != null); }
Source:
<code>public static WikibaseUris <START> getURISystem() <END> { if (uriSystem == null) { String wikibaseUriProperty = System.getProperty(WIKIBASE_CONCEPT_URI); if (wikibaseUriProperty != null) { String commonsUriProperty = System.getProperty(COMMONS_CONCEPT_URI); try { if (commonsUriProperty != null) { uriSystem = new SDCUris(new URI(commonsUriProperty), new URI(wikibaseUriProperty)); } else { uriSystem = new WikibaseUris(new URI(wikibaseUriProperty)); } } catch (URISyntaxException e) { throw new RuntimeException("Bad URI: " + wikibaseUriProperty + (commonsUriProperty != null ? ", " + commonsUriProperty : ""), e); } return uriSystem; } String wikibaseHostProperty = System.getProperty(WIKIBASE_HOST_PROPERTY); if (wikibaseHostProperty != null) { uriSystem = WikibaseUris.forHost(wikibaseHostProperty); } else { uriSystem = WIKIDATA; } } return uriSystem; }</code><technical_language>This thread safe. call sites, //probably// outrageous happen in case of race. Still, this class tagged @NotThreadSafe. Note uriSystem set some point (at if load UriSchemeFactory), remove lazy loading a class variable bypass problem completely</technical_language>

Target:
private static WikibaseUris getURISystem() { return uriSystem; }
Source:
<code><START> public String getVerify() { return verify; } <END></code><technical_language>Nit: this.verify consistent other accessors</technical_language>

Target:
public String getVerify() { return this.verify; }
Source:
<code>public SimulatorSettings(HostInfo info, String sdkVersion, boolean is64bit, DeviceType device, <START> DeviceVariation variation) throws NotActiveException { <END> this.exactSdkVersion = sdkVersion; this.is64bit = is64bit; this.info = info; this.instrumentsVersion = info.getInstrumentsVersion(); setVariation(device, variation, sdkVersion); if (instrumentsVersion.getMajor() >= 6) { deviceUUID = determineDeviceUUID(); } this.contentAndSettingsFolder = getContentAndSettingsFolder(); this.globalPreferencePlist = getGlobalPreferenceFile(); }</code><technical_language>keen of NotActiveException here. java doc for NotActiveException is ; > Thrown serialization deserialization is active. is stream serializing / deserializing. SessionNotInitializedException instead</technical_language>

Target:
public SimulatorSettings(HostInfo info, String sdkVersion, boolean is64bit, DeviceType device, DeviceVariation variation) { this.exactSdkVersion = sdkVersion; this.is64bit = is64bit; this.info = info; this.instrumentsVersion = info.getInstrumentsVersion(); setVariation(device, variation, sdkVersion); if (instrumentsVersion.getMajor() >= 6) { deviceUUID = determineDeviceUUID(); } this.contentAndSettingsFolder = getContentAndSettingsFolder(); this.globalPreferencePlist = getGlobalPreferenceFile(); }
Source:
<code>protected void resultSelect(Event e) { super.resultSelect(e); searchResultsMouseOver(e); GQuery high = getResultHighlight(); resultClearHighlight(); high.removeClass(getCss().resultSelected()); <START> if(isMobileAnimated()) { <END> final String paddingTop = high.css("padding-top"); final String paddingBottom = high.css("padding-bottom"); final int speed = getMobileAnimationSpeed(); high.animate("height: 0, padding-top: 0, padding-bottom: 0", speed, new Function() { public void f() { $(this).animate("height: auto, padding-top: " + paddingTop + ", padding-bottom: " + paddingBottom, speed); $(this).addClass(getCss().resultSelected()); } }); } else { high.addClass(getCss().resultSelected()); } }</code><technical_language>format</technical_language>

Target:
protected void resultSelect(Event e) { super.resultSelect(e); searchResultsMouseOver(e); GQuery high = getResultHighlight(); resultClearHighlight(); high.removeClass(getCss().resultSelected()); if (getOptions().isMobileAnimation()) { final String paddingTop = high.css("padding-top"); final String paddingBottom = high.css("padding-bottom"); final int speed = getOptions().getMobileAnimationSpeed(); high.animate("height: 0, padding-top: 0, padding-bottom: 0", speed, new Function() { public void f() { $(this).animate("height: auto, padding-top: " + paddingTop + ", padding-bottom: " + paddingBottom, speed); $(this).addClass(getCss().resultSelected()); } }); } else { high.addClass(getCss().resultSelected()); } }
Source:
<code>public AccountDetailsPanel(AccountInfoDialog dialog, ProtocolProviderService protocolProvider) { this.dialog = dialog; this.R = AccountInfoActivator.R; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); setOpaque(false); this.setPreferredSize(new Dimension(600, 400)); this.protocolProvider = protocolProvider; this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); if (OSUtils.IS_MAC) { fontColor = "FFFFFF"; } else { fontColor = "000000"; } <START> <END> infoTextPane = createGeneralInfoPane(); SIPCommTabbedPane tabbedPane = new SIPCommTabbedPane(); accountInfoOpSet = protocolProvider .getOperationSet(OperationSetServerStoredAccountInfo.class); final JComponent contactPanel; if (accountInfoOpSet == null) { contactPanel = createUnsupportedPanel(); } else { contactPanel = createSummaryPanel(); if (protocolProvider.isRegistered()) { loadDetails(); } } tabbedPane.add(R.getI18NString("plugin.accountinfo.CONTACT_INFO"), contactPanel); tabbedPane.add(R.getI18NString("service.gui.OTHER"), infoTextPane); this.add(tabbedPane); }</code><technical_language>this font color, do a Mac test this? If I remember right, call info panel is kind of a chromeless hover window Mac (with black background), while is a standard window other OSs. text is a normal dialog here, I color change is necessary</technical_language>

Target:
public AccountDetailsPanel(AccountInfoDialog dialog, ProtocolProviderService protocolProvider) { this.dialog = dialog; this.R = AccountInfoActivator.R; setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); setOpaque(false); this.setPreferredSize(new Dimension(600, 400)); this.protocolProvider = protocolProvider; this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); infoTextPane = createGeneralInfoPane(); SIPCommTabbedPane tabbedPane = new SIPCommTabbedPane(); accountInfoOpSet = protocolProvider .getOperationSet(OperationSetServerStoredAccountInfo.class); final JComponent contactPanel; if (accountInfoOpSet == null) { contactPanel = createUnsupportedPanel(); } else { contactPanel = createSummaryPanel(); if (protocolProvider.isRegistered()) { loadDetails(); } } tabbedPane.add(R.getI18NString("plugin.accountinfo.CONTACT_INFO"), contactPanel); tabbedPane.add(R.getI18NString("service.gui.OTHER"), infoTextPane); this.add(tabbedPane); }
Source:
<code><START> public void canRetrieveEmptyValuesFromStudyParticipant() { <END> Account emptyAccount = new GenericAccount(); assertNull(ParticipantOption.DATA_GROUPS.fromAccount(emptyAccount)); assertEquals("true",ParticipantOption.EMAIL_NOTIFICATIONS.fromAccount(emptyAccount)); assertNull(ParticipantOption.EXTERNAL_IDENTIFIER.fromAccount(emptyAccount)); assertNull(ParticipantOption.LANGUAGES.fromAccount(emptyAccount)); assertNull(ParticipantOption.SHARING_SCOPE.fromAccount(emptyAccount)); assertNull(ParticipantOption.TIME_ZONE.fromAccount(emptyAccount)); }</code><technical_language>Nitpick: test names for fromAccount fromParticipant switched</technical_language>

Target:
public void canRetrieveEmptyValuesFromStudyParticipant() { StudyParticipant emptyParticipant = new StudyParticipant.Builder().build(); assertNull(ParticipantOption.DATA_GROUPS.fromParticipant(emptyParticipant)); assertEquals("true",ParticipantOption.EMAIL_NOTIFICATIONS.fromParticipant(emptyParticipant)); assertNull(ParticipantOption.EXTERNAL_IDENTIFIER.fromParticipant(emptyParticipant)); assertNull(ParticipantOption.LANGUAGES.fromParticipant(emptyParticipant)); assertNull(ParticipantOption.SHARING_SCOPE.fromParticipant(emptyParticipant)); assertNull(ParticipantOption.TIME_ZONE.fromParticipant(emptyParticipant)); }
Source:
<code>private PreviousPeriodDateDataSet copyWithUriQualifier(final PreviousPeriodDateDataSet dataSet, final ObjQualifierConverter objQualifierConverter) { <START> if (dataSet.getDataSet() instanceof IdentifierObjQualifier) { <END> final IdentifierObjQualifier dataSetIdentifier = (IdentifierObjQualifier) dataSet.getDataSet(); return objQualifierConverter.convertToUriQualifier(dataSetIdentifier) .map(uriObjQualifier -> new PreviousPeriodDateDataSet(uriObjQualifier, dataSet.getPeriodsAgo())) .orElseThrow(() -> new IllegalArgumentException(format("The converter cannot convert identifier '%s'!", dataSetIdentifier))); } return dataSet; }</code><technical_language>this piece of code in OverPeriod... shared</technical_language>

Target:
private PreviousPeriodDateDataSet copyWithUriQualifier(final PreviousPeriodDateDataSet dataSet, final ObjQualifierConverter objQualifierConverter) { return ObjIdentifierUtilities.copyIfNecessary( dataSet, dataSet.getDataSet(), uriObjQualifier -> new PreviousPeriodDateDataSet(uriObjQualifier, dataSet.getPeriodsAgo()), objQualifierConverter ); }
Source:
<code>public Response saveRule(RuleDTO ruleDTO) { final Rule rule = convert(ruleDTO); rule.setId(null); <START> rule.setPosition(0); END> final int ruleId = classificationService.saveRule(rule); final UriBuilder builder = UriBuilder.fromResource(ClassificationRestService.class); final URI uri = builder.path(ClassificationRestService.class, "getRule").build(ruleId); return Response.created(uri).build(); }</code><technical_language>this new rules get lowest position (highest priority)</technical_language>

Target:
public Response saveRule(RuleDTO ruleDTO) { final Rule rule = convert(ruleDTO); rule.setId(null); final int ruleId = classificationService.saveRule(rule); final UriBuilder builder = UriBuilder.fromResource(ClassificationRestService.class); final URI uri = builder.path(ClassificationRestService.class, "getRule").build(ruleId); return Response.created(uri).build(); }