auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void forceMemoizationTest() { final List<Integer> res = new ArrayList<>(); final PackageStats toplevel = Metrics.getTopLevelPackageStats(); ASTCompilationUnit acu = parseAndVisitForClass15(MetricsVisitorTestData.class); acu.jjtAccept(new JavaParserVisitorReducedAdapter() { @Override public Object visit(ASTMethodOrConstructorDeclaration node, Object data) { res.add((int) toplevel.compute(opMetricKey, node, true, Version.STANDARD)); return super.visit(node, data); } @Override public Object visit(ASTAnyTypeDeclaration node, Object data) { res.add((int) toplevel.compute(classMetricKey, node, true, Version.STANDARD)); return super.visit(node, data); } }, null); System.out.println(); final List<Integer> cmp = new ArrayList<>(); acu.jjtAccept(new JavaParserVisitorReducedAdapter() { @Override public Object visit(ASTMethodOrConstructorDeclaration node, Object data) { cmp.add((int) toplevel.compute(opMetricKey, node, true, Version.STANDARD)); return super.visit(node, data); } @Override public Object visit(ASTAnyTypeDeclaration node, Object data) { cmp.add((int) toplevel.compute(classMetricKey, node, true, Version.STANDARD)); return super.visit(node, data); } }, null); for (int i = 0; i < res.size(); i++) { assertNotEquals(res.get(i), cmp.get(i)); <START> } <END> }</code><technical_language>Is cmp.size() > res.size() allowed</technical_language>

Target:
public void forceMemoizationTest() { ASTCompilationUnit acu = parseAndVisitForClass15(MetricsVisitorTestData.class); List<Integer> reference = visitWith(acu, true); List<Integer> real = visitWith(acu, true); assertEquals(reference.size(), real.size()); for (int i = 0; i < reference.size(); i++) { assertNotEquals(reference.get(i), real.get(i)); } }
Source:
<code>protected void performDefaults() { IPreferenceStore store = getPreferenceStore(); saveInterval.loadDefault(); stickyCycleButton.setSelection(store.getBoolean(IPreferenceConstants.STICKY_CYCLE)); openOnSingleClick = store.getDefaultBoolean(IPreferenceConstants.OPEN_ON_SINGLE_CLICK); selectOnHover = store.getDefaultBoolean(IPreferenceConstants.SELECT_ON_HOVER); openAfterDelay = store.getDefaultBoolean(IPreferenceConstants.OPEN_AFTER_DELAY); singleClickButton.setSelection(openOnSingleClick); doubleClickButton.setSelection(!openOnSingleClick); selectOnHoverButton.setSelection(selectOnHover); openAfterDelayButton.setSelection(openAfterDelay); selectOnHoverButton.setEnabled(openOnSingleClick); openAfterDelayButton.setEnabled(openOnSingleClick); stickyCycleButton.setSelection(store.getDefaultBoolean(IPreferenceConstants.STICKY_CYCLE)); showUserDialogButton.setSelection(store.getDefaultBoolean(IPreferenceConstants.RUN_IN_BACKGROUND)); showHeapStatusButton.setSelection( PrefUtil.getAPIPreferenceStore().getDefaultBoolean(IWorkbenchPreferenceConstants.SHOW_MEMORY_MONITOR)); readRenameModeFromPreferences(); <START> renameModeInlineButton.setSelection(renameModeInline); <END> renameModeDialogButton.setSelection(!renameModeInline); super.performDefaults(); }</code><technical_language>true, reset default, some intermediate is set radio box listeners. I "last selected" mode is default if clicking "Restore defaults"</technical_language>

Target:
protected void performDefaults() { IPreferenceStore store = getPreferenceStore(); saveInterval.loadDefault(); stickyCycleButton.setSelection(store.getBoolean(IPreferenceConstants.STICKY_CYCLE)); openOnSingleClick = store.getDefaultBoolean(IPreferenceConstants.OPEN_ON_SINGLE_CLICK); selectOnHover = store.getDefaultBoolean(IPreferenceConstants.SELECT_ON_HOVER); openAfterDelay = store.getDefaultBoolean(IPreferenceConstants.OPEN_AFTER_DELAY); singleClickButton.setSelection(openOnSingleClick); doubleClickButton.setSelection(!openOnSingleClick); selectOnHoverButton.setSelection(selectOnHover); openAfterDelayButton.setSelection(openAfterDelay); selectOnHoverButton.setEnabled(openOnSingleClick); openAfterDelayButton.setEnabled(openOnSingleClick); stickyCycleButton.setSelection(store.getDefaultBoolean(IPreferenceConstants.STICKY_CYCLE)); showUserDialogButton.setSelection(store.getDefaultBoolean(IPreferenceConstants.RUN_IN_BACKGROUND)); showHeapStatusButton.setSelection( PrefUtil.getAPIPreferenceStore().getDefaultBoolean(IWorkbenchPreferenceConstants.SHOW_MEMORY_MONITOR)); renameModeInline = true; renameModeInlineButton.setSelection(renameModeInline); renameModeDialogButton.setSelection(!renameModeInline); super.performDefaults(); }
Source:
<code>public static TableMetadata getMetadataOrDefaultToGeneric(byte[] metadata) { if (metadata == null || Arrays.equals(metadata, AtlasDbConstants.EMPTY_TABLE_METADATA)) { return TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(AtlasDbConstants.GENERIC_TABLE_METADATA); } else { return TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(metadata); <START> } <END> }</code><technical_language>nit: else is unnecessary</technical_language>

Target:
static TableMetadata getMetadataOrDefaultToGeneric(byte[] metadata) { if (metadata == null || Arrays.equals(metadata, AtlasDbConstants.EMPTY_TABLE_METADATA)) { return TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(AtlasDbConstants.GENERIC_TABLE_METADATA); } return TableMetadata.BYTES_HYDRATOR.hydrateFromBytes(metadata); }
Source:
<code>private static String name(Tree tree) { if (tree.is(Tree.Kind.NEW_CLASS)) { return ((NewClassTree) tree).symbolType().name(); } <START> MethodInvocationTree mit = (MethodInvocationTree) tree; <END> if (mit.symbolType().is("void")) { Type type = mit.methodSelect().symbolType(); if (type.isUnknown()) { return SyntaxTreeNameFinder.getName(mit.methodSelect()); } return type.name(); } return mit.symbolType().name(); }</code><technical_language>symbolType of method is return type, reason void. type of owner of method in cases? more precise. I rewrite method this: MethodInvocationTree mit = (MethodInvocationTree) tree; if (mit.symbolType().isVoid()) { return mit.symbol().owner().type().name(); } return mit.symbolType().name(); }</technical_language>

Target:
private static String name(Tree tree) { if (tree.is(Tree.Kind.NEW_CLASS)) { return ((NewClassTree) tree).symbolType().name(); } MethodInvocationTree mit = (MethodInvocationTree) tree; if (mit.symbolType().isVoid()) { return mit.symbol().owner().name(); } return mit.symbolType().name(); }
Source:
<code>public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Log.i("onEditorAction", "view=" + v + " actionId=" + actionId + " event=" + event); <START> if ((event != null && event.getAction() == KeyEvent.ACTION_UP) || event == null) { <END> String pc = entry.getText().toString(); if (pc.length() > 0 && pc.length() < getMinPasscodeLength()) { error.setText(getMinLengthInstructions(getMinPasscodeLength())); return false; } return pc.length() > 0 ? onSubmit(pc) : false; } else { return true; } }</code><technical_language>event null here, if is, fall in else block now</technical_language>

Target:
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) { Log.i("onEditorAction", "view=" + v + " actionId=" + actionId + " event=" + event); if (event != null && event.getAction() == KeyEvent.ACTION_UP) { String pc = entry.getText().toString(); if (pc.length() > 0 && pc.length() < getMinPasscodeLength()) { error.setText(getMinLengthInstructions(getMinPasscodeLength())); return false; } return pc.length() > 0 ? onSubmit(pc) : false; } else { return true; } }
Source:
<code>private void synchronizeMembersAndSaveResult(PerunSession sess, Group group) { String exceptionMessage = null; String skippedMembersMessage = null; boolean failedDueToException = false; try { List<String> skippedMembers = perunBl.getGroupsManagerBl().synchronizeGroup(sess, group); <START> <END> skippedMembersMessage = prepareSkippedObjectsMessage(skippedMembers, "members"); exceptionMessage = skippedMembersMessage; } catch (WrongAttributeValueException | WrongReferenceAttributeValueException | InternalErrorException | WrongAttributeAssignmentException | GroupNotExistsException | AttributeNotExistsException | ExtSourceNotExistsException e) { failedDueToException = true; exceptionMessage = "Cannot synchronize group "; log.error(exceptionMessage + group, e); exceptionMessage += "due to exception: " + e.getName() + " => " + e.getMessage(); } catch (Exception e) { failedDueToException = true; exceptionMessage = "Cannot synchronize group "; log.error(exceptionMessage + group, e); exceptionMessage += "due to unexpected exception: " + e.getClass().getName() + " => " + e.getMessage(); } finally { try { perunBl.getGroupsManagerBl().saveInformationAboutGroupSynchronizationInNestedTransaction(sess, group, failedDueToException, exceptionMessage); } catch (Exception ex) { log.error("When synchronization group " + group + ", exception was thrown.", ex); log.info("Info about exception from synchronization: " + skippedMembersMessage); } } }</code><technical_language>empty lines there</technical_language>

Target:
private void synchronizeMembersAndSaveResult(PerunSession sess, Group group) { String exceptionMessage = null; String skippedMembersMessage = null; boolean failedDueToException = false; try { List<String> skippedMembers = perunBl.getGroupsManagerBl().synchronizeGroup(sess, group); skippedMembersMessage = prepareSkippedObjectsMessage(skippedMembers, "members"); exceptionMessage = skippedMembersMessage; } catch (Exception e) { failedDueToException = true; exceptionMessage = "Cannot synchronize group "; log.error(exceptionMessage + group, e); exceptionMessage += "due to exception: " + e.getClass().getName() + " => " + e.getMessage(); } finally { try { perunBl.getGroupsManagerBl().saveInformationAboutGroupSynchronizationInNestedTransaction(sess, group, failedDueToException, exceptionMessage); } catch (Exception ex) { log.error("When synchronization group " + group + ", exception was thrown.", ex); log.info("Info about exception from synchronization: " + skippedMembersMessage); } } }
Source:
<code>public void setup() { noName = Invocation.create(method(VersionedApi.class, "noName"), ImmutableList.of()); named = Invocation.create(method(VersionedApi.class, "named"), ImmutableList.of()); config = createMock(InvocationConfig.class); expect(config.getCommandName(noName)).andReturn("VersionedApi.noName"); <START> expect(config.getCommandName(named)).andReturn("named:getVault"); <END> replay(config); }</code><technical_language>I get more approriate</technical_language>

Target:
public void setup() { noName = Invocation.create(method(VersionedApi.class, "noName"), ImmutableList.of()); named = Invocation.create(method(VersionedApi.class, "named"), ImmutableList.of()); config = createMock(InvocationConfig.class); expect(config.getCommandName(noName)).andReturn("VersionedApi.noName"); expect(config.getCommandName(named)).andReturn("named:get"); replay(config); }
Source:
<code>public void appendUpdateRecord(final long id, final byte recordType, final EncodingSupport record, final boolean sync, final IOCompletion callback) throws Exception { checkJournalIsLoaded(); lineUpContext(callback); checkKnownRecordID(id); Future<?> result = appendExecutor.submit(new Runnable() { @Override public void run() { journalLock.readLock().lock(); try { JournalRecord jrnRecord = records.get(id); JournalInternalRecord updateRecord = new JournalAddRecord(false, id, recordType, record); JournalFile usedFile = appendRecord(updateRecord, false, sync, null, callback); if (logger.isTraceEnabled()) { logger.trace("appendUpdateRecord::id=" + id + ", userRecordType=" + recordType + ", usedFile = " + usedFile); } if (jrnRecord == null) { compactor.addCommandUpdate(id, usedFile, updateRecord.getEncodeSize()); } else { jrnRecord.addUpdateFile(usedFile, updateRecord.getEncodeSize()); } } catch (Exception e) { <START> ActiveMQJournalLogger.LOGGER.error(e.getMessage(), e); <END> } finally { journalLock.readLock().unlock(); } } }); if (sync && callback == null) { result.get(); } }</code><technical_language>above</technical_language>

Target:
public void appendUpdateRecord(final long id, final byte recordType, final EncodingSupport record, final boolean sync, final IOCompletion callback) throws Exception { checkJournalIsLoaded(); lineUpContext(callback); checkKnownRecordID(id); final SimpleFuture<Boolean> result = newSyncAndCallbackResult(sync, callback); appendExecutor.execute(new Runnable() { @Override public void run() { journalLock.readLock().lock(); try { JournalRecord jrnRecord = records.get(id); JournalInternalRecord updateRecord = new JournalAddRecord(false, id, recordType, record); JournalFile usedFile = appendRecord(updateRecord, false, sync, null, callback); if (logger.isTraceEnabled()) { logger.trace("appendUpdateRecord::id=" + id + ", userRecordType=" + recordType + ", usedFile = " + usedFile); } if (jrnRecord == null) { compactor.addCommandUpdate(id, usedFile, updateRecord.getEncodeSize()); } else { jrnRecord.addUpdateFile(usedFile, updateRecord.getEncodeSize()); } if (result != null) { result.set(true); } } catch (Exception e) { if (result != null) { result.fail(e); } logger.error("appendUpdateRecord:" + e, e); } finally { journalLock.readLock().unlock(); } } }); if (result != null) { result.get(); } }
Source:
<code>public void testGetCookies() throws Exception { TestMultiClientSessionCookieStore cookieStore = new TestMultiClientSessionCookieStore(); cookieStore.setTestClientSession(Mockito.mock(IClientSession.class)); createCookies(cookieStore); List<HttpCookie> cookies = cookieStore.getCookies(); <START> assertNotNull(cookies); <END> assertEquals(2, cookies.size()); if (COOKIE1.equals(CollectionUtility.firstElement(cookies))) { checkCookieDeepEquality(COOKIE1, CollectionUtility.firstElement(cookies)); checkCookieDeepEquality(COOKIE2, cookies.get(1)); } else if (COOKIE2.equals(CollectionUtility.firstElement(cookies))) { checkCookieDeepEquality(COOKIE2, CollectionUtility.firstElement(cookies)); checkCookieDeepEquality(COOKIE1, cookies.get(1)); } else { fail("No created cookie matches retrieved element " + CollectionUtility.firstElement(cookies)); } }</code><technical_language>extract assertContains(cookies,COOKIE1,COOKIE2)</technical_language>

Target:
public void testGetCookies() throws Exception { TestMultiClientSessionCookieStore cookieStore = new TestMultiClientSessionCookieStore(); cookieStore.setTestClientSession(SESSION1); createCookies(cookieStore); List<HttpCookie> cookies = cookieStore.getCookies(); assertNotNull(cookies); assertEquals(2, cookies.size()); assertContainsCookies(Arrays.asList(COOKIE1, COOKIE2), cookies); }
Source:
<code>public void setEnablePII(final boolean enablePII) { <START> LoggerSettings.setAllowPii(enablePII); <END> }</code><technical_language>assuming this change settings moves Logger class, calling out this need get updated</technical_language>

Target:
public void setEnablePII(final boolean enablePII) { com.microsoft.identity.common.internal.logging.Logger.setAllowPii(enablePII); }
Source:
<code>public void testDdlWrongColumnName() throws SQLException { checkSqlErrorMessage("create index idx1 on test (wrong)", "42000", "Column doesn't exist: WRONG"); checkSqlErrorMessage("alter table test drop column wrong", "42000", "Failed to parse query. Column \"WRONG\" not found"); checkSqlErrorMessage("create table test(id integer primary key, AgE integer, AGe integer)", "42000", "Duplicate column name: AGE"); checkSqlErrorMessage("create table test(\"id\" integer primary key, \"age\" integer, \"age\" integer)", "42000", <START> "Duplicate column name: age"); <END> }</code><technical_language>for IgniteCacheSqlQueryErrorSelfTest.java</technical_language>

Target:
public void testDdlWrongColumnName() throws SQLException { checkSqlErrorMessage("create index idx1 on test (wrong)", "42000", "Column doesn't exist: WRONG"); checkSqlErrorMessage("alter table test drop column wrong", "42000", "Failed to parse query. Column \"WRONG\" not found"); checkSqlErrorMessage("create table test(id integer primary key, AgE integer, AGe integer)", "42000", "Duplicate column name: AGE"); checkSqlErrorMessage("create table test(\"id\" integer primary key, \"age\" integer, \"age\" integer)", "42000", "Duplicate column name: age"); checkSqlErrorMessage("create table test(id integer primary key, age integer, age varchar)", "42000", "Duplicate column name: AGE"); }
Source:
<code>protected static void addWorkflowJobUserContent(final HelixManager manager, String workflowJobResource, final String key, final String value) { final String path = Joiner.on("/") .join(TaskConstants.REBALANCER_CONTEXT_ROOT, workflowJobResource, USER_CONTENT_NODE); manager.getHelixPropertyStore().update(path, new DataUpdater<ZNRecord>() { @Override public ZNRecord update(ZNRecord znRecord) { <START> ZNRecord r = manager.getHelixPropertyStore().get(path, null, AccessOption.PERSISTENT); <END> r.setSimpleField(key, value); return r; } }, AccessOption.PERSISTENT); }</code><technical_language>do read znrecord in updater again, znRecord passed is supposed lastest record. do in updater is like: znRecord.setSimpleField(key, value); return znRecord; property store read lastest znode, call updater this znode content, write new record returned updater</technical_language>

Target:
protected static void addWorkflowJobUserContent(final HelixManager manager, String workflowJobResource, final String key, final String value) { String path = Joiner.on("/") .join(TaskConstants.REBALANCER_CONTEXT_ROOT, workflowJobResource, USER_CONTENT_NODE); manager.getHelixPropertyStore().update(path, new DataUpdater<ZNRecord>() { @Override public ZNRecord update(ZNRecord znRecord) { znRecord.setSimpleField(key, value); return znRecord; } }, AccessOption.PERSISTENT); }
Source:
<code>public FormValidation doCheckName( @QueryParameter final String value, @QueryParameter final String id) { if (Util.fixEmpty(value) == null) { return FormValidation.error("You must provide a name for the failure cause!"); <START> } <END> if (CauseManagement.NEW_CAUSE_NAME.equalsIgnoreCase(value)) { return FormValidation.error("Reserved name!"); } try { Jenkins.checkGoodName(value); } catch (Failure failure) { return FormValidation.error(failure, failure.getMessage()); } try { for (FailureCause other : PluginImpl.getInstance().getKnowledgeBase().getCauses()) { if ((id == null || !id.equals(other.getId())) && value.equals(other.getName())) { return FormValidation.error("There is another cause with that name."); } } } catch (Exception e) { logger.log(Level.SEVERE, "Failed to get causes list to evaluate name! ", e); } return FormValidation.ok(); }</code><technical_language>suggestion Jenkins.getInstance().checkPermission(PluginImpl.UPDATE_PERMISSION); if (Util.fixEmpty(value) == null) {</technical_language>

Target:
public FormValidation doCheckName( @QueryParameter final String value, @QueryParameter final String id) { Jenkins.getInstance().checkPermission(PluginImpl.UPDATE_PERMISSION); if (Util.fixEmpty(value) == null) { return FormValidation.error("You must provide a name for the failure cause!"); } if (CauseManagement.NEW_CAUSE_NAME.equalsIgnoreCase(value)) { return FormValidation.error("Reserved name!"); } try { Jenkins.checkGoodName(value); } catch (Failure failure) { return FormValidation.error(failure, failure.getMessage()); } try { for (FailureCause other : PluginImpl.getInstance().getKnowledgeBase().getCauses()) { if ((id == null || !id.equals(other.getId())) && value.equals(other.getName())) { return FormValidation.error("There is another cause with that name."); } } } catch (Exception e) { logger.log(Level.SEVERE, "Failed to get causes list to evaluate name! ", e); } return FormValidation.ok(); }
Source:
<code>public void getLastColumnTest() { <START> assertArrayEquals(matrix.getColumn(matrix.getColumnsCount() - 1), lastColumn); <END> }</code><technical_language>JUnit assertions typically request expected actual value, reverse parameter ordering of of calls assertArrayEquals - failure messages potentially confusing</technical_language>

Target:
public void getLastColumnTest() { assertArrayEquals(lastColumn, matrix.getColumn(matrix.getColumnsCount() - 1)); }
Source:
<code>private void emitRefundEvent(PayoutReconcileMessage payoutReconcileMessage, BalanceTransaction balanceTransaction) { var sourceTransfer = (Transfer) balanceTransaction.getSourceObject(); var metadata = StripeTransferMetadata.from(sourceTransfer.getMetadata()); var refundExternalId = metadata.getGovukPayTransactionExternalId(); <START> if (connectorConfiguration.getEmitPayoutEvents()) { <END> var refundEvent = new RefundIncludedInPayout(refundExternalId, payoutReconcileMessage.getGatewayPayoutId(), payoutReconcileMessage.getCreatedDate()); try { eventService.emitEvent(refundEvent, false); } catch (QueueException e) { throw new RuntimeException(format("Error sending event for refund [%s] included in payout [%s] to event queue: %s", refundExternalId, payoutReconcileMessage.getGatewayPayoutId(), e.getMessage()), e); } } LOGGER.info("Emitted event for refund included in payout [{}]", refundExternalId, payoutReconcileMessage.getGatewayPayoutId()); }</code><technical_language>this deserialise happily add nulls if metadata Map<String, String> formatted correctly (if govuk transaction ID in there). worth throwing exception in this method level if transaction ID (is null), accidentally associate invalid data</technical_language>

Target:
private void emitRefundEvent(PayoutReconcileMessage payoutReconcileMessage, BalanceTransaction balanceTransaction) { var sourceTransfer = (Transfer) balanceTransaction.getSourceObject(); String refundExternalId = resolveTransactionExternalId(payoutReconcileMessage, balanceTransaction, sourceTransfer); var refundEvent = new RefundIncludedInPayout(refundExternalId, payoutReconcileMessage.getGatewayPayoutId(), payoutReconcileMessage.getCreatedDate()); emitEvent(refundEvent, payoutReconcileMessage, refundExternalId); LOGGER.info("Emitted event for refund included in payout [{}]", refundExternalId, payoutReconcileMessage.getGatewayPayoutId()); }
Source:
<code>private void setAccount() throws OrmException, IOException, UnloggedFailure { user = genericUserFactory.create(id); rsrc = new AccountResource(user); try { for (String email : addEmails) { addEmail(email); } for (String email : deleteEmails) { deleteEmail(email); } if (preferredEmail != null <START> && !preferredEmail.isEmpty()) { <END> putPreferred(preferredEmail); } if (fullName != null) { PutName.Input in = new PutName.Input(); in.name = fullName; putName.apply(rsrc, in); } if (httpPassword != null || clearHttpPassword) { PutHttpPassword.Input in = new PutHttpPassword.Input(); in.httpPassword = httpPassword; putHttpPassword.apply(rsrc, in); } if (active) { putActive.apply(rsrc, null); } else if (inactive) { try { deleteActive.apply(rsrc, null); } catch (ResourceNotFoundException e) { } } addSshKeys = readSshKey(addSshKeys); if (!addSshKeys.isEmpty()) { addSshKeys(addSshKeys); } deleteSshKeys = readSshKey(deleteSshKeys); if (!deleteSshKeys.isEmpty()) { deleteSshKeys(deleteSshKeys); } } catch (RestApiException e) { throw die(e.getMessage()); } }</code><technical_language>Is this needed? pass empty option? line 186 is checking for emptiness. Strings.isNullOrEmpty(foo) out need it</technical_language>

Target:
private void setAccount() throws OrmException, IOException, UnloggedFailure { user = genericUserFactory.create(id); rsrc = new AccountResource(user); try { for (String email : addEmails) { addEmail(email); } for (String email : deleteEmails) { deleteEmail(email); } if (preferredEmail != null) { putPreferred(preferredEmail); } if (fullName != null) { PutName.Input in = new PutName.Input(); in.name = fullName; putName.apply(rsrc, in); } if (httpPassword != null || clearHttpPassword) { PutHttpPassword.Input in = new PutHttpPassword.Input(); in.httpPassword = httpPassword; putHttpPassword.apply(rsrc, in); } if (active) { putActive.apply(rsrc, null); } else if (inactive) { try { deleteActive.apply(rsrc, null); } catch (ResourceNotFoundException e) { } } addSshKeys = readSshKey(addSshKeys); if (!addSshKeys.isEmpty()) { addSshKeys(addSshKeys); } deleteSshKeys = readSshKey(deleteSshKeys); if (!deleteSshKeys.isEmpty()) { deleteSshKeys(deleteSshKeys); } } catch (RestApiException e) { throw die(e.getMessage()); } }
Source:
<code>public void run() { registerReceivers(); running = true; try { while (running) { clearOldLoadedFiles(); while (!loadQueue.isEmpty() && loadQueue.peek().getFileSize() < (maxBytesToLoad - bytesRequested)) { PlaylistEntry entry = loadQueue.poll(); if (entry.isLocalFile()) { loadLocal(entry); } else { loadRemote(entry); bytesRequested += entry.getFileSize(); remotelyLoaded.add(entry); } } try { <START> Thread.sleep(1000); <END> } catch (InterruptedException e) { } } } finally { unregisterReceivers(); if (this.stoppingThread != null) { synchronized(this.stoppingThread) { this.stoppingThread.notify(); } } } }</code><technical_language>Magic number. this means try load new songs second, try again</technical_language>

Target:
public void run() { registerReceivers(); running = true; try { while (running) { clearOldLoadedFiles(); while (!loadQueue.isEmpty() && loadQueue.peek().getFileSize() < (maxBytesToLoad - bytesRequested)) { PlaylistEntry entry = loadQueue.poll(); if (entry.isLocalFile()) { loadLocal(entry); } else { loadRemote(entry); bytesRequested += entry.getFileSize(); remotelyLoaded.add(entry); } } pauseForNextRun(); } } finally { unregisterReceivers(); if (this.stoppingThread != null) { synchronized(this.stoppingThread) { this.stoppingThread.notify(); } } } }
Source:
<code>public String render(final PutBulkResult result) { <START> if (result.getIgnoredFiles() == null || result.getIgnoredFiles().isEmpty()) { <END> return result.getResult(); } return String.format("%s\n%s", result.getResult(), ASCIITable.getInstance().getTable(getHeaders(), formatIgnoreFileList(result.getIgnoredFiles()))); }</code><technical_language>this of Guard methods</technical_language>

Target:
public String render(final PutBulkResult result) { if (Guard.isNullOrEmpty(result.getIgnoredFiles())) { return result.getResult(); } return String.format("%s\n%s", result.getResult(), ASCIITable.getInstance().getTable(getHeaders(), formatIgnoreFileList(result.getIgnoredFiles()))); }
Source:
<code>private long generateCidaFromFilepaths(String[] fileNames) { long pidls = new long [fileNames.length]; int[] pidlSizes = new int[fileNames.length]; int pidlSizeSum = 2; int n = 0; for (int i = 0; i < fileNames.length; i++) { long ppv = new long [1]; <START> int hr = OS.PathToPIDL(fileNames[i].toCharArray(), ppv); <END> if (hr != OS.S_OK) continue; pidls[n] = ppv[0]; pidlSizes[n] = OS.ILGetSize(pidls[n]); pidlSizeSum += pidlSizes[n]; n++; } CIDA cida = new CIDA(); cida.cidl = n; int cidaSize = CIDA.sizeof + 4 * cida.cidl; cida.aoffset = cidaSize; long newPtr = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, cidaSize + pidlSizeSum); if (newPtr != 0) { OS.MoveMemory(newPtr, cida, CIDA.sizeof); int[] pidlOffsets = new int[n]; if (n > 0) pidlOffsets[0] = cidaSize + 2; for (int i = 1; i < n; i++) { pidlOffsets[i] = pidlOffsets[i - 1] + pidlSizes[i - 1]; } OS.MoveMemory(newPtr + CIDA.sizeof, pidlOffsets, 4 * cida.cidl); for (int i = 0; i < n; i++) { OS.MoveMemory(newPtr + pidlOffsets[i], pidls[i], pidlSizes[i]); } } for (int i = 0; i < n; i++) { OS.CoTaskMemFree(pidls[i]); } return newPtr; }</code><technical_language>need null-terminate fileNames[i]</technical_language>

Target:
private long generateCidaFromFilepaths(String[] fileNames) { final int n = fileNames.length; long pidls = new long [n]; try { CIDA cida = new CIDA(); cida.cidl = n; int cidaSize = CIDA.sizeof + 4 * n; cida.aoffset = cidaSize; int[] pidlOffsets = new int[n]; int[] pidlSizes = new int[n]; int pidlSizeSum = 2; for (int i = 0; i < n; i++) { TCHAR szfileName = new TCHAR(0, fileNames[i], true); long ppv = new long [1]; int hr = COM.PathToPIDL(szfileName.chars, ppv); if (hr != OS.S_OK) { DND.error(DND.ERROR_INVALID_DATA); } pidls[i] = ppv[0]; pidlSizes[i] = OS.ILGetSize(pidls[i]); pidlSizeSum += pidlSizes[i]; if (i == 0) { pidlOffsets[0] = cidaSize + 2; } else { pidlOffsets[i] = pidlOffsets[i - 1] + pidlSizes[i - 1]; } } long newPtr = OS.GlobalAlloc(COM.GMEM_FIXED | COM.GMEM_ZEROINIT, cidaSize + pidlSizeSum); if (newPtr != 0) { OS.MoveMemory(newPtr, cida, CIDA.sizeof); OS.MoveMemory(newPtr + CIDA.sizeof, pidlOffsets, 4 * cida.cidl); for (int i = 0; i < n; i++) { OS.MoveMemory(newPtr + pidlOffsets[i], pidls[i], pidlSizes[i]); } } return newPtr; } finally { for (int i = 0; i < n; i++) { if (pidls[i] != 0) { OS.CoTaskMemFree(pidls[i]); } } } }
Source:
<code>public SwtConfirmBox( Element self, XulComponent parent, XulDomContainer domContainer, String tagName ) { super( tagName ); if ( parent instanceof SwtWindow ) { SwtWindow swtWindow = (SwtWindow) parent; <START> setModalParent( swtWindow.shell ); <END> } }</code><technical_language>prefer shell a getShell() method (instead of package-protected access), if @pentaho-nbaker is fine this I :)</technical_language>

Target:
public SwtConfirmBox( Element self, XulComponent parent, XulDomContainer domContainer, String tagName ) { super( tagName ); if ( parent instanceof SwtWindow ) { SwtWindow swtWindow = (SwtWindow) parent; setModalParent( swtWindow.getShell() ); } }
Source:
<code>public Vector2f scaleForRegion(Rect2i region, int actualWidth, int actualHeight) { <START> if(actualHeight < 500) <END> { System.out.println("Hell of a job"); float scale = Math.max((float) region.width() / actualWidth, (float) region.height() / actualHeight); return new Vector2f(actualWidth * scale, actualHeight * scale); } System.out.println(actualHeight); float scale = Math.max((float) region.width() / actualWidth, (float) region.height() / actualHeight); return new Vector2f(actualWidth * scale, (actualHeight * scale)-100); }</code><technical_language>This work of a hardcoded size. 500? arbitrary. treat image 700x700 600x3</technical_language>

Target:
public Vector2f scaleForRegion(Rect2i region, int actualWidth, int actualHeight) { return new Vector2f(region.width(), region.height()); }
Source:
<code>private void loadCheckpoint(Map<String, Object> checkpoint) { if (checkpoint == null || checkpoint.isEmpty()) { LOG.warn("No checkpoints supplied. Skipping checkpoint load"); return; } String err = String.format("Load checkpoint called with %s keys when expected %s. Checkpoint supplied %s", checkpoint.size(), _chunkingKeys.size(), checkpoint); <START> Validate.isTrue(checkpoint.size() == _chunkingKeys.size(), err); <END> _chunkingKeys.keySet().forEach(k -> { Validate.isTrue(checkpoint.containsKey(k), String.format("Load checkpoint called without key %s. Checkpoint map supplied : %s", k, checkpoint)); _chunkingKeys.put(k, checkpoint.get(k)); }); }</code><technical_language>put String.format() in Validate.isTrue() call, String concatenation execute unnecessarily</technical_language>

Target:
private void loadCheckpoint(Map<String, Object> checkpoint) { if (checkpoint == null || checkpoint.isEmpty()) { LOG.warn("No checkpoints supplied. Skipping checkpoint load"); return; } Validate.isTrue(checkpoint.size() == _chunkingKeys.size(), String.format("Load checkpoint called with %s keys when expected %s. Checkpoint supplied %s", checkpoint.size(), _chunkingKeys.size(), checkpoint)); _chunkingKeys.keySet().forEach(k -> { Validate.isTrue(checkpoint.containsKey(k), String.format("Load checkpoint called without key %s. Checkpoint map supplied : %s", k, checkpoint)); _chunkingKeys.put(k, checkpoint.get(k)); }); }
Source:
<code>public static void main(String[] args) { Map<String, Object> opts = new Docopt(USAGE) .withVersion(GitRepositoryState.getRepositoryState().describe) .parse(args); AnsiConsole.systemInstall(); printStartupMsg(opts); configureLogger(opts); log.debug("Started with arguments: {}", opts); if (opts.get("--network-interface") != null) { opts.put("--address", getAddressFromInterfaceName((String) opts.get("--network-interface"))); opts.put("--bind-to-all-interfaces", false); } else if (opts.get("--address") == null) { opts.put("--bind-to-all-interfaces", true); opts.put("--address", "localhost"); } else { opts.put("--bind-to-all-interfaces", false); } <START> log.info("Server arguments: {}", opts); <END> createServiceDirectory(opts); if (Integer.parseInt((String) opts.get("--metadata-retention")) < 1) { throw new IllegalArgumentException("Max number of metadata files to retain must be greater than 0."); } Thread shutdownThread = new Thread(CorfuServer::cleanShutdown); shutdownThread.setName("ShutdownThread"); Runtime.getRuntime().addShutdownHook(shutdownThread); while (!shutdownServer) { final ServerContext serverContext = new ServerContext(opts); try { activeServer = new CorfuServerNode(serverContext); activeServer.startAndListen(); } catch (Throwable th) { log.error("CorfuServer: Server exiting due to unrecoverable error: ", th); System.exit(EXIT_ERROR_CODE); } if (cleanupServer) { clearDataFiles(serverContext); cleanupServer = false; } if (!shutdownServer) { log.info("main: Server restarting."); } } log.info("main: Server exiting due to shutdown"); }</code><technical_language>Do want remove similar debug statement above</technical_language>

Target:
public static void main(String[] args) { Map<String, Object> opts = new Docopt(USAGE) .withVersion(GitRepositoryState.getRepositoryState().describe) .parse(args); AnsiConsole.systemInstall(); printStartupMsg(opts); configureLogger(opts); if (opts.get("--network-interface") != null) { opts.put("--address", getAddressFromInterfaceName((String) opts.get("--network-interface"))); opts.put("--bind-to-all-interfaces", false); } else if (opts.get("--address") == null) { opts.put("--bind-to-all-interfaces", true); opts.put("--address", "localhost"); } else { opts.put("--bind-to-all-interfaces", false); } createServiceDirectory(opts); if (Integer.parseInt((String) opts.get("--metadata-retention")) < 1) { throw new IllegalArgumentException("Max number of metadata files to retain must be greater than 0."); } Thread shutdownThread = new Thread(CorfuServer::cleanShutdown); shutdownThread.setName("ShutdownThread"); Runtime.getRuntime().addShutdownHook(shutdownThread); while (!shutdownServer) { final ServerContext serverContext = new ServerContext(opts); try { activeServer = new CorfuServerNode(serverContext); log.info("Server arguments: {}", opts); activeServer.startAndListen(); } catch (Throwable th) { log.error("CorfuServer: Server exiting due to unrecoverable error: ", th); System.exit(EXIT_ERROR_CODE); } if (cleanupServer) { clearDataFiles(serverContext); cleanupServer = false; } if (!shutdownServer) { log.info("main: Server restarting."); } } log.info("main: Server exiting due to shutdown"); }
Source:
<code>boolean isRequired() { BeanValidationContext config = BeanValidationConfiguration.get(); List<Class<? extends Annotation>> notNullAnnotations = config.getNotNullAnnotations(); Map<Annotation, ConstraintDescriptor<?>> constraints = findNotNullConstraints( notNullAnnotations); if (constraints.isEmpty()) { return false; } HashSet<Class<?>> validatorGroups = new HashSet<>(); <START> validatorGroups.addAll(Arrays.asList(getGroups())); <END> for (Annotation constraint : constraints.keySet()) { ConstraintDescriptor<?> constraintDescriptor = constraints.get(constraint); if (canApplyToDefaultGroup(constraintDescriptor) && validatorGroups.isEmpty()) { return true; } for (Class<?> constraintGroup : constraintDescriptor.getGroups()) { if (validatorGroups.contains(constraintGroup)) { return true; } } } return false; }</code><technical_language>I Set</technical_language>

Target:
boolean isRequired() { List<ConstraintDescriptor<?>> constraints = findNotNullConstraints(NOT_NULL_ANNOTATIONS); if (constraints.isEmpty()) { return false; } Set<Class<?>> validatorGroups = new HashSet<>(); validatorGroups.addAll(Arrays.asList(getGroups())); for (ConstraintDescriptor<?> constraint : constraints) { if (canApplyToDefaultGroup(constraint) && validatorGroups.isEmpty()) { return true; } for (Class<?> constraintGroup : constraint.getGroups()) { if (validatorGroups.contains(constraintGroup)) { return true; } } } return false; }
Source:
<code>public void setUp() throws Exception { when(environment.metrics()).thenReturn(metricRegistry); when(environment.lifecycle()).thenReturn(lifecycleEnvironment); config = new DataSourceFactory(); config.setUrl("jdbc:hsqldb:mem:DbTest-" + System.currentTimeMillis()); config.setUser("sa"); config.setDriverClass("org.hsqldb.jdbcDriver"); config.setValidationQuery("SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS"); <START> HashMap<String, String> props = new HashMap<>(); <END> props.put("hibernate.show_sql", "true"); props.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect"); config.setProperties(props); }</code><technical_language>builder methods of ImmutableMap save a keystroke here</technical_language>

Target:
public void setUp() throws Exception { when(environment.metrics()).thenReturn(metricRegistry); when(environment.lifecycle()).thenReturn(lifecycleEnvironment); config = new DataSourceFactory(); config.setUrl("jdbc:hsqldb:mem:DbTest-" + System.currentTimeMillis()); config.setUser("sa"); config.setDriverClass("org.hsqldb.jdbcDriver"); config.setValidationQuery("SELECT 1 FROM INFORMATION_SCHEMA.SYSTEM_USERS"); config.setProperties(ImmutableMap.<String, String>builder(). put("hibernate.show_sql", "true"). put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect"). build()); }
Source:
<code>protected BuddyConnectMessage(BuddyInfoParameters buddyInfoParameters, String message, UUID buddyId, Set<UserDevice> devices) { super(buddyInfoParameters, message); this.buddyId = buddyId; List<UserDevice> sortedDevices = devices.stream() <START> .sorted((d1, d2) -> d1.getDeviceAnonymizedId().compareTo(d2.getDeviceAnonymizedId())) <END> .collect(Collectors.toList()); this.deviceNames = buildDeviceNamesString(sortedDevices); this.deviceAnonymizedIds = buildDeviceAnonymizedIdsString(sortedDevices); this.deviceVpnConnectionStatuses = buildDeviceVpnConnectionStatusesString(sortedDevices); }</code><technical_language>sorting a bit superfluous here? convert a list</technical_language>

Target:
protected BuddyConnectMessage(BuddyInfoParameters buddyInfoParameters, String message, UUID buddyId, Set<UserDevice> devices) { super(buddyInfoParameters, message); this.buddyId = buddyId; List<UserDevice> orderedDevices = new ArrayList<>(devices); this.deviceNames = buildDeviceNamesString(orderedDevices); this.deviceAnonymizedIds = buildDeviceAnonymizedIdsString(orderedDevices); this.deviceVpnConnectionStatuses = buildDeviceVpnConnectionStatusesString(orderedDevices); }
Source:
<code>public boolean supports(DataHolder dataHolder) { <START> return dataHolder instanceof net.minecraft.entity.Entity; <END> }</code><technical_language>reason import Entity</technical_language>

Target:
public boolean supports(DataHolder dataHolder) { return dataHolder instanceof Entity; }
Source:
<code>private void write(String user, Path path) { byte[] fileContents = getNextFileContents(); Path dirName = path.getParent(); String fileName = path.getFileName().toString(); Map<Path, List<String>> dirsToFiles = index.getDirToFiles(user); List<String> existingFiles = dirsToFiles.get(dirName); <START> if (! existingFiles.contains(fileName)) { <END> existingFiles.add(fileName); } FileSystem testFileSystem = fileSystems.getTestFileSystem(user); FileSystem referenceFileSystem = fileSystems.getReferenceFileSystem(user); testFileSystem.write(path, fileContents); referenceFileSystem.write(path, fileContents); }</code><technical_language>this a bit nervous - existingFiles updated a set instead</technical_language>

Target:
private void write(String user, Path path) { byte[] fileContents = getNextFileContents(); Path dirName = path.getParent(); String fileName = path.getFileName().toString(); Map<Path, Set<String>> dirsToFiles = index.getDirToFiles(user); Set<String> existingFiles = dirsToFiles.get(dirName); existingFiles.add(fileName); FileSystem testFileSystem = fileSystems.getTestFileSystem(user); FileSystem referenceFileSystem = fileSystems.getReferenceFileSystem(user); testFileSystem.write(path, fileContents); referenceFileSystem.write(path, fileContents); }
Source:
<code>protected void putUpdateStoredBlock(StoredBlock storedBlock, boolean wasUndoable) throws SQLException { try { PreparedStatement s = conn.get().prepareStatement(getInsertHeadersSQL()); byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 4, hashBytes, 0, 28); s.setBytes(1, hashBytes); s.setBytes(2, storedBlock.getChainWork().toByteArray()); s.setInt(3, storedBlock.getHeight()); <START> s.setBytes(4, storedBlock.getHeader().getTransactions() == null ? <END> storedBlock.getHeader().unsafeBitcoinSerialize() : storedBlock.getHeader().cloneAsHeader().unsafeBitcoinSerialize()); s.setBoolean(5, wasUndoable); s.executeUpdate(); s.close(); } catch (SQLException e) { if (!(e.getSQLState().equals(getDuplicateKeyErrorCode())) || !wasUndoable) throw e; PreparedStatement s = conn.get().prepareStatement(getUpdateHeadersSQL()); s.setBoolean(1, true); byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 4, hashBytes, 0, 28); s.setBytes(2, hashBytes); s.executeUpdate(); s.close(); } }</code><technical_language>Ditto. This is a full store: getTransactions() null, I think? needs run cloneAsHeader()</technical_language>

Target:
protected void putUpdateStoredBlock(StoredBlock storedBlock, boolean wasUndoable) throws SQLException { try { PreparedStatement s = conn.get().prepareStatement(getInsertHeadersSQL()); byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 4, hashBytes, 0, 28); s.setBytes(1, hashBytes); s.setBytes(2, storedBlock.getChainWork().toByteArray()); s.setInt(3, storedBlock.getHeight()); s.setBytes(4, storedBlock.getHeader().cloneAsHeader().unsafeBitcoinSerialize()); s.setBoolean(5, wasUndoable); s.executeUpdate(); s.close(); } catch (SQLException e) { if (!(e.getSQLState().equals(getDuplicateKeyErrorCode())) || !wasUndoable) throw e; PreparedStatement s = conn.get().prepareStatement(getUpdateHeadersSQL()); s.setBoolean(1, true); byte[] hashBytes = new byte[28]; System.arraycopy(storedBlock.getHeader().getHash().getBytes(), 4, hashBytes, 0, 28); s.setBytes(2, hashBytes); s.executeUpdate(); s.close(); } }
Source:
<code>private void purge() throws HCatException { HCatClient hcatClient = null; if (Conduit.isHCatEnabled()) { hcatClient = getHCatClient(); if (hcatClient == null) { <START> return; <END> } } try { Iterator it = streamsToPurge.iterator(); Path purgePath = null; while (it.hasNext()) { purgePath = (Path) it.next(); if (pathPartitionDescMap.containsKey(purgePath)) { HCatAddPartitionDesc partDesc = pathPartitionDescMap.get(purgePath); if (partDesc != null) { LOG.info("Droping the partition : " + partDesc); hcatClient.dropPartitions(partDesc.getDatabaseName(), partDesc.getTableName(), partDesc.getPartitionSpec(), true); } } try { fs.delete(purgePath, true); LOG.info("Purging [" + purgePath + "]"); ConduitMetrics.updateSWGuage(getServiceType(), PURGEPATHS_COUNT, getName(), 1); } catch (Exception e) { LOG.warn("Cannot delete path " + purgePath, e); ConduitMetrics.updateSWGuage(getServiceType(), DELETE_FAILURES_COUNT, getName(), 1); } } } finally { submitBack(hcatClient); } }</code><technical_language>log exception</technical_language>

Target:
private void purge() throws HCatException, InterruptedException { HCatClient hcatClient = null; if (Conduit.isHCatEnabled()) { hcatClient = getHCatClient(); if (hcatClient == null) { LOG.warn("Did not get hcat client hence not purging the partitions and paths"); ConduitMetrics.updateSWGuage(getServiceType(), FAILED_TO_GET_HCAT_CLIENT_COUNT, getName(), 1); return; } } try { Iterator it = streamsToPurge.iterator(); Path purgePath = null; while (it.hasNext()) { purgePath = (Path) it.next(); if (pathPartitionDescMap.containsKey(purgePath)) { HCatAddPartitionDesc partDesc = pathPartitionDescMap.get(purgePath); if (partDesc != null) { LOG.info("Droping the partition : " + partDesc.getLocation() + " from " + partDesc.getTableName() + " table"); try { hcatClient.dropPartitions(partDesc.getDatabaseName(), partDesc.getTableName(), partDesc.getPartitionSpec(), false); ConduitMetrics.updateSWGuage(getServiceType(), HCAT_PURGED_PARTITION_COUNT, getName(), 1); } catch (HCatException hcatException) { if (hcatException.getCause() instanceof NoSuchObjectException) { LOG.info("partition " + partDesc.getLocation() + " does not" + " exists in " + partDesc.getTableName() + " table"); } else { ConduitMetrics.updateSWGuage(getServiceType(), HCAT_PURGE_PARTITION_FAILURES_COUNT, getName(), 1); ConduitMetrics.updateSWGuage(getServiceType(), HCAT_CONNECTION_FAILURES, getName(), 1); throw hcatException; } } } } try { LOG.info("Purging [" + purgePath + "]"); fs.delete(purgePath, true); ConduitMetrics.updateSWGuage(getServiceType(), PURGEPATHS_COUNT, getName(), 1); } catch (Exception e) { LOG.warn("Cannot delete path " + purgePath, e); ConduitMetrics.updateSWGuage(getServiceType(), DELETE_FAILURES_COUNT, getName(), 1); } } } finally { addToPool(hcatClient); } }
Source:
<code>public void createFieldEditors() { final Composite parent = getFieldEditorParent(); filePathTemp = new DirectoryFieldEditor(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER, Messages.getString("ComponentsPreferencePage.directoryFieldLabel"), parent); addField(filePathTemp); filePathTemp.getTextControl(parent).addModifyListener(new ModifyListener() { String oldPath = getPreferenceStore().getString(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER); @Override public void modifyText(ModifyEvent e) { String newPath = filePathTemp.getTextControl(parent).getText(); File file = new File(newPath); if (!file.exists() && !"".equals(newPath)) { filePathTemp.showErrorMessage(); setValid(false); } else { if (oldPath.equals(newPath)) { setValid(true); return; } if (!StringUtils.isEmpty(newPath)) { if (!checkUserComponentsFolder(file)) { filePathTemp.getTextControl(parent).setText(oldPath); } } setValid(true); } } }); if (PluginChecker.isPreviewPluginLoaded()) { createForDataViewer(parent); } createForMapper(parent); createFortRunJob(parent); if (PluginChecker.isJobLetPluginLoaded()) { createForJoblet(parent); } createForComponentAssist(parent); if (PluginChecker.isTIS()) { createForHelpType(parent); <START> } <END> parent.pack(); }</code><technical_language>Checked @nrousseau . online for TOS , difference is TOS contains plugin default in studio</technical_language>

Target:
public void createFieldEditors() { final Composite parent = getFieldEditorParent(); filePathTemp = new DirectoryFieldEditor(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER, Messages.getString("ComponentsPreferencePage.directoryFieldLabel"), parent); addField(filePathTemp); filePathTemp.getTextControl(parent).addModifyListener(new ModifyListener() { String oldPath = getPreferenceStore().getString(IComponentPreferenceConstant.USER_COMPONENTS_FOLDER); @Override public void modifyText(ModifyEvent e) { String newPath = filePathTemp.getTextControl(parent).getText(); File file = new File(newPath); if (!file.exists() && !"".equals(newPath)) { filePathTemp.showErrorMessage(); setValid(false); } else { if (oldPath.equals(newPath)) { setValid(true); return; } if (!StringUtils.isEmpty(newPath)) { if (!checkUserComponentsFolder(file)) { filePathTemp.getTextControl(parent).setText(oldPath); } } setValid(true); } } }); if (PluginChecker.isPreviewPluginLoaded()) { createForDataViewer(parent); } createForMapper(parent); createFortRunJob(parent); if (PluginChecker.isJobLetPluginLoaded()) { createForJoblet(parent); } createForComponentAssist(parent); if (ComponentsHelpUtil.isEnabledOnLineHelp()) { createForHelpType(parent); } parent.pack(); }