auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } Quota quota = getQuota(); if (quota == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } <START> if (getQuotaDAO().isQuotaInUse(quota) && !quota.getQuotaEnforcementType().equals(QuotaEnforcementTypeEnum.DISABLED)) { <END> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK); return false; } return true; }</code><technical_language>switch: const.equal(nullable) instead of nullable.equal(const)</technical_language>

Target:
protected boolean canDoAction() { if (getParameters() == null || (getParameters().getQuotaId() == null)) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } Quota quota = getQuota(); if (quota == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NOT_EXIST); return false; } if (getQuotaDAO().isQuotaInUse(quota) && !QuotaEnforcementTypeEnum.DISABLED.equals(quota.getQuotaEnforcementType())) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IN_USE_BY_VM_OR_DISK); return false; } return true; }
Source:
<code>protected void addAllExpectedMsgs() { addExpectedMsg(13, 54, Severity.WARNING, Messages.SWITCH_STATEMENT); addExpectedMsg(17, 12, Severity.WARNING, Messages.CLASS); <START> addExpectedMsg(24, 21, Severity.WARNING, Messages.CLASS); <END> addExpectedMsg(27, 12, Severity.WARNING, Messages.STRUCT); addExpectedMsg(30, 7, Severity.WARNING, Messages.STRUCT); addExpectedMsg(32, 20, Severity.WARNING, Messages.STRUCT); addExpectedMsg(51, 25, Severity.WARNING, Messages.PROTOCOL); addExpectedMsg(54, 24, Severity.WARNING, Messages.PROTOCOL); addExpectedMsg(57, 7, Severity.WARNING, Messages.PROTOCOL); addExpectedMsg(63, 30, Severity.WARNING, Messages.EXTENSION); addExpectedMsg(66, 16, Severity.WARNING, Messages.EXTENSION); addExpectedMsg(68, 30, Severity.WARNING, Messages.EXTENSION); addExpectedMsg(71, 20, Severity.WARNING, Messages.EXTENSION); addExpectedMsg(78, 14, Severity.WARNING, Messages.FUNCTION); addExpectedMsg(85, 16, Severity.WARNING, Messages.FUNCTION); }</code><technical_language>I impression allow cases this, e.g. class MyClass class MyClass { }. is opinion that</technical_language>

Target:
protected void addAllExpectedMsgs() { addExpectedBraceMsg(13, 54, Severity.WARNING, Messages.SWITCH_STATEMENT); addExpectedBraceMsg(17, 12, Severity.WARNING, Messages.CLASS); addExpectedEmptyConstructBodyMsg(24, 19, Severity.WARNING); addExpectedBraceMsg(27, 12, Severity.WARNING, Messages.STRUCT); addExpectedEmptyConstructBodyMsg(30, 5, Severity.WARNING); addExpectedEmptyConstructBodyMsg(32, 18, Severity.WARNING); addExpectedEmptyConstructBodyMsg(51, 23, Severity.WARNING); addExpectedEmptyConstructBodyMsg(54, 22, Severity.WARNING); addExpectedEmptyConstructBodyMsg(57, 5, Severity.WARNING); addExpectedEmptyConstructBodyMsg(63, 28, Severity.WARNING); addExpectedEmptyConstructBodyMsg(68, 28, Severity.WARNING); addExpectedEmptyConstructBodyMsg(71, 18, Severity.WARNING); addExpectedBraceMsg(85, 16, Severity.WARNING, Messages.FUNCTION); addExpectedEmptyConstructBodyMsg(89, 28, Severity.WARNING); addExpectedBraceMsg(91, 29, Severity.WARNING, Messages.CLASS); addExpectedBraceMsg(96, 4, Severity.WARNING, Messages.CLASS); addExpectedBraceMsg(100, 14, Severity.WARNING, Messages.CLASS); addExpectedBraceMsg(103, 6, Severity.WARNING, Messages.CLASS); }
Source:
<code>public Void visit(KApp kapp, Void _) { if (kapp.getLabel() instanceof Token) { Token token = (Token)kapp.getLabel(); <START> if (token.tokenSort().equals(Sort.of("#Id"))) { <END> result.write("#id \""); } result.write(token.value()); if (token.tokenSort().equals(Sort.of("#Id"))) { result.write("\""); } result.write(token.toString()); } else { this.visitNode(kapp.getLabel()); result.write("("); boolean stopnextline = false; if (kapp.getChild() instanceof KList) { KList listOfK = (KList)kapp.getChild(); if (listOfK.getContents().size() <= 1) { stopnextline = true; } } if (kapp.getChild() instanceof ListTerminator) { stopnextline = true; } if (nextline) { if (!stopnextline) { result.endLine(); result.indent(1); } } else { result.indentToCurrent(); } this.visitNode(kapp.getChild()); result.write(")"); if (!nextline || !stopnextline) { result.unindent(); } } return null; }</code><technical_language>#Id exist anymore. I think</technical_language>

Target:
public Void visit(KApp kapp, Void _) { if (kapp.getLabel() instanceof Token) { Token token = (Token)kapp.getLabel(); if (token.tokenSort().equals(Sort.BUILTIN_ID)) { result.write("#id \""); } result.write(token.value()); if (token.tokenSort().equals(Sort.BUILTIN_ID)) { result.write("\""); } result.write(token.toString()); } else { this.visitNode(kapp.getLabel()); result.write("("); boolean stopnextline = false; if (kapp.getChild() instanceof KList) { KList listOfK = (KList)kapp.getChild(); if (listOfK.getContents().size() <= 1) { stopnextline = true; } } if (kapp.getChild() instanceof ListTerminator) { stopnextline = true; } if (nextline) { if (!stopnextline) { result.endLine(); result.indent(1); } } else { result.indentToCurrent(); } this.visitNode(kapp.getChild()); result.write(")"); if (!nextline || !stopnextline) { result.unindent(); } } return null; }
Source:
<code>public JobId submit(File workflowFile, Map<String, String> variables) throws NotConnectedRestException, PermissionRestException, SubmissionClosedRestException, JobCreationRestException { try { <START> JobId jobId = scheduler.submit(createJobObject(workflowFile, variables)); <END> return jobId; } catch (NotConnectedException e) { throw new NotConnectedRestException(e); } catch (PermissionException e) { throw new PermissionRestException(e); } catch (SubmissionClosedException e) { throw new SubmissionClosedRestException(e); } catch (JobCreationException e) { throw new JobCreationRestException(e); } catch (Exception e) { logger.warn("Unexpected error when submitting job", e); throw new JobCreationRestException(e); } }</code><technical_language>![MINOR](<LINK_1> 'Severity: MINOR') Immediately return this expression instead of assigning temporary variable "jobId". [![rule](<LINK_0>](<LINK_2></technical_language>

Target:
public JobId submit(File workflowFile, Map<String, String> variables) throws NotConnectedRestException, PermissionRestException, SubmissionClosedRestException, JobCreationRestException { try { return scheduler.submit(createJobObject(workflowFile, variables)); } catch (NotConnectedException e) { throw new NotConnectedRestException(e); } catch (PermissionException e) { throw new PermissionRestException(e); } catch (SubmissionClosedException e) { throw new SubmissionClosedRestException(e); } catch (JobCreationException e) { throw new JobCreationRestException(e); } catch (Exception e) { logger.warn("Unexpected error when submitting job", e); throw new JobCreationRestException(e); } }
Source:
<code>public void deserialize(Block block, int index, GeometryState state) { <START> state.addMemoryUsage(-state.estimateGeometryMemorySize()); <END> state.setGeometry(GeometrySerde.deserialize(GEOMETRY.getSlice(block, index))); state.addMemoryUsage(state.estimateGeometryMemorySize()); }</code><technical_language>set memory usage setGeometry call? easy miss setting memory usage setting geometry</technical_language>

Target:
public void deserialize(Block block, int index, GeometryState state) { long previousMemorySize = state.getGeometry() != null ? state.getGeometry().estimateMemorySize() : 0; state.setGeometry(GeometrySerde.deserialize(GEOMETRY.getSlice(block, index)), previousMemorySize); }
Source:
<code>private boolean isTokenSep(final int idx) { if (idx < 0 || idx >= text.length) { return false; } return text[idx] == <START> tokenSep; <END> }</code><technical_language>this creates a hard dependency outer class future refactoring a bit harder if want extract this class file. tokenSep passed a member of this class</technical_language>

Target:
private boolean isTokenSep(final int idx) { return text[idx] == edItemConfig.tokenSep; }
Source:
<code>protected Map<String, String> createManifestHeaders(final String projectName) { final Map<String, String> headers = new HashMap<String, String>(); headers.put(ManifestUtils.MANIFEST_VERSION, "1.0"); headers.put(org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION, "2"); headers.put(org.osgi.framework.Constants.BUNDLE_NAME, projectName); headers.put(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME, toJavaIdentifier(projectName, false)); headers.put(org.osgi.framework.Constants.BUNDLE_VERSION, "1.0.0.qualifier"); <START> headers.put(org.osgi.framework.Constants.BUNDLE_VENDOR, "BonitaSoft S.A."); <END> headers.put(org.osgi.framework.Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "JavaSE-1.7"); headers.put(org.osgi.framework.Constants.REQUIRE_BUNDLE, new StringBuilder() .append("javax.persistence;bundle-version=\"2.0.3\"").append(",") .append(System.lineSeparator()) .append(" ") .append(engineBundleSymbolicName()).toString()); return headers; }</code><technical_language>eopportunity uodate BonitaSoft --> Bonitasoft</technical_language>

Target:
protected Map<String, String> createManifestHeaders(final String projectName) { final Map<String, String> headers = new HashMap<String, String>(); headers.put(ManifestUtils.MANIFEST_VERSION, "1.0"); headers.put(org.osgi.framework.Constants.BUNDLE_MANIFESTVERSION, "2"); headers.put(org.osgi.framework.Constants.BUNDLE_NAME, projectName); headers.put(org.osgi.framework.Constants.BUNDLE_SYMBOLICNAME, toJavaIdentifier(projectName, false)); headers.put(org.osgi.framework.Constants.BUNDLE_VERSION, "1.0.0.qualifier"); headers.put(org.osgi.framework.Constants.BUNDLE_VENDOR, "Bonitasoft S.A."); headers.put(org.osgi.framework.Constants.BUNDLE_REQUIREDEXECUTIONENVIRONMENT, "JavaSE-1.7"); headers.put(org.osgi.framework.Constants.REQUIRE_BUNDLE, new StringBuilder() .append("javax.persistence;bundle-version=\"2.0.3\"").append(",") .append(System.lineSeparator()) .append(" ") .append(engineBundleSymbolicName()).toString()); return headers; }
Source:
<code>private static ICompletionProposal[] proposals(String prefix, int offset) { List<ICompletionProposal> results = new ArrayList<>(); for (String s : ALL_OPTIONS) { if (prefix == null || s.startsWith(prefix)) { IContextInformation info = new ContextInformation(s, s); String text = prefix == null ? s : s.substring(prefix.length()); <START> results.add(new CompletionProposal(text + ": ", offset, 0, text.length() + 2, null, s, info, null)); <END> } } Collections.sort(results, new Comparator<ICompletionProposal>() { @Override public int compare(ICompletionProposal p1, ICompletionProposal p2) { return p1.getDisplayString() .compareTo(p2.getDisplayString()); } }); return results.toArray(new ICompletionProposal[0]); }</code><technical_language>desired switch lookup Syntax.HELP. add missing properties HELP, some helpful information? draw form existing docs</technical_language>

Target:
private static ICompletionProposal[] proposals(String prefix, int offset) { ArrayList<ICompletionProposal> results = new ArrayList<ICompletionProposal>(Syntax.HELP.size()); for (Syntax s : Syntax.HELP.values()) { if (prefix == null || s.getHeader() .startsWith(prefix)) { IContextInformation info = new ContextInformation(s.getHeader(), s.getHeader()); String text = prefix == null ? s.getHeader() : s.getHeader() .substring(prefix.length()); results.add(new CompletionProposal(text + ": ", offset, 0, text.length() + 2, null, s.getHeader(), info, s.getLead())); } } Collections.sort(results, new Comparator<ICompletionProposal>() { @Override public int compare(ICompletionProposal p1, ICompletionProposal p2) { return p1.getDisplayString() .compareTo(p2.getDisplayString()); } }); return results.toArray(new ICompletionProposal[0]); }
Source:
<code>public void onInteract(@Nonnull Player p, @Nonnull Block b) { ItemStack item = p.getInventory().getItemInMainHand(); <START> boolean itemIsAPlank = Tag.PLANKS.isTagged(item.getType()); boolean itemIsALog = Tag.LOGS.isTagged(item.getType()); ItemStack output = null; if (itemIsALog) { Optional<Material> planks = MaterialConverter.getPlanksFromLog(item.getType()); output = new ItemStack(planks.get(), 8); } else if (itemIsAPlank){ output = new ItemStack(Material.STICK, 4); } else { return; } <END> if (p.getGameMode() != GameMode.CREATIVE) { ItemUtils.consumeItem(item, true); } Inventory outputChest = findOutputChest(b, output); if (outputChest != null) { outputChest.addItem(output); } else { b.getWorld().dropItemNaturally(b.getLocation(), output); } b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, item.getType()); }</code><technical_language>I this put a seperate method returning a nullable ItemStack</technical_language>

Target:
public void onInteract(@Nonnull Player p, @Nonnull Block b) { ItemStack item = p.getInventory().getItemInMainHand(); ItemStack output = getItemsToOutput(item.getType()); if (output == null) { SlimefunPlugin.getLocalization().sendMessage(p, "machines.wrong-item", true); return; } if (p.getGameMode() != GameMode.CREATIVE) { ItemUtils.consumeItem(item, true); } outputItems(b, output); b.getWorld().playEffect(b.getLocation(), Effect.STEP_SOUND, item.getType()); }
Source:
<code>private void setClassInvocationFailure(Class<?> clazz, Object instance) { <START> synchronized(this){ <END> Set<Object> instances = m_classInvocationResults.get( clazz ); if (instances == null) { instances = Sets.newHashSet(); m_classInvocationResults.put(clazz, instances); } instances.add(instance); } }</code><technical_language>I know, synchronized(this) is a good practice, in case, want a synchronization m_classInvocationResults</technical_language>

Target:
private void setClassInvocationFailure(Class<?> clazz, Object instance) { synchronized(m_classInvocationResults){ Set<Object> instances = m_classInvocationResults.get( clazz ); if (instances == null) { instances = Sets.newHashSet(); m_classInvocationResults.put(clazz, instances); } instances.add(instance); } }
Source:
<code>private JavaSymbol.TypeJavaSymbol getEnclosingClass(String shortName, String packageName) { JavaSymbol.TypeJavaSymbol owner = null; String enclosingClassName = Convert.enclosingClassName(shortName); if (StringUtils.isNotEmpty(enclosingClassName)) { enclosingClassName = Convert.fullName(packageName, enclosingClassName); InputStream inputStream = inputStreamFor(enclosingClassName); while (inputStream == null && enclosingClassName.endsWith("$")) { <START> enclosingClassName = enclosingClassName.substring(0, enclosingClassName.length() - 1); <END> inputStream = inputStreamFor(enclosingClassName); } owner = getClassSymbol(enclosingClassName); } return owner; }</code><technical_language>inputStream is open closed</technical_language>

Target:
private JavaSymbol.TypeJavaSymbol getEnclosingClass(String shortName, String packageName) { JavaSymbol.TypeJavaSymbol owner = null; String enclosingClassName = Convert.enclosingClassName(shortName); if (StringUtils.isNotEmpty(enclosingClassName)) { enclosingClassName = Convert.fullName(packageName, enclosingClassName); InputStream inputStream = null; try { inputStream = inputStreamFor(enclosingClassName); while (inputStream == null && enclosingClassName.endsWith("$")) { enclosingClassName = enclosingClassName.substring(0, enclosingClassName.length() - 1); inputStream = inputStreamFor(enclosingClassName); } } finally { Closeables.closeQuietly(inputStream); } owner = getClassSymbol(enclosingClassName); } return owner; }
Source:
<code>public void onItemBind(ItemBinding itemBinding, int position, T item) { <START> itemBinding.clearExtra(); <END> if (itemExtraBindingMap != null && !itemExtraBindingMap.isEmpty()) { for (int i = 0; i < itemExtraBindingMap.size(); i++) { Class<? extends T> key = itemExtraBindingMap.keyAt(i); if (key.isInstance(item)) { SparseArray<Object> extraBindings = itemExtraBindingMap.valueAt(i); if (extraBindings != null) { for (int j = 0, size = extraBindings.size(); j < size; j++) { int variableId = extraBindings.keyAt(j); Object value = extraBindings.valueAt(j); if (value instanceof PropertyResolver) { value = ((PropertyResolver<T>) value).resolve(item); } itemBinding.bindExtra(variableId, value); } } break; } } } for (int i = 0; i < itemBindingMap.size(); i++) { Class<? extends T> key = itemBindingMap.keyAt(i); if (key.isInstance(item)) { int[] values = itemBindingMap.valueAt(i); itemBinding.set(values[0], values[1]); return; } } throw new IllegalArgumentException("Missing class for item " + item); }</code><technical_language>This clear extras set bindExta break on-off usages in README</technical_language>

Target:
public void onItemBind(ItemBinding itemBinding, int position, T item) { for (int i = 0; i < itemBindingClassList.size(); i++) { Class<? extends T> key = itemBindingClassList.get(i); if (key.isInstance(item)) { OnItemBind itemBind = itemBindingList.get(i); itemBind.onItemBind(itemBinding, position, item); return; } } throw new IllegalArgumentException("Missing class for item " + item); }
Source:
<code>private static SetAlarmNotificationsRequestData fetchAlarmNotifications( final Map<String, String> requestParameters) { <START> final List<AlarmNotification> lstAlarmNotifications = new ArrayList<>(); <END> if (nullCheckAlarmType(requestParameters, "")) { lstAlarmNotifications.add(addAlarmNotification(requestParameters, "")); } for (int i = 1; i < NUMBER_ALARM_TYPES; i++) { if (nullCheckAlarmType(requestParameters, "_" + Integer.toString(i))) { lstAlarmNotifications.add(addAlarmNotification(requestParameters, "_" + Integer.toString(i))); } } return addAlarmNotificationsToRequestData(lstAlarmNotifications); }</code><technical_language>While it, add i here? listAlarmNotifications (or alarmNotificationsList) is a name in opinion</technical_language>

Target:
private static SetAlarmNotificationsRequestData fetchAlarmNotifications( final Map<String, String> requestParameters) { final List<AlarmNotification> alarmNotificationsList = new ArrayList<>(); if (nullCheckAlarmType(requestParameters, "")) { alarmNotificationsList.add(getAlarmNotification(requestParameters, "")); } for (int i = 1; i < NUMBER_ALARM_TYPES; i++) { if (nullCheckAlarmType(requestParameters, "_" + Integer.toString(i))) { alarmNotificationsList.add(getAlarmNotification(requestParameters, "_" + Integer.toString(i))); } } return addAlarmNotificationsToRequestData(alarmNotificationsList); }
Source:
<code>public void trackEnrollClicked(@NonNull String courseId, boolean emailOptIn) { final AnswersEvent event = new AnswersEvent(Events.COURSE_ENROLL_CLICKED); event.putCustomAttribute(Keys.NAME, Values.USER_COURSE_ENROLL_CLICKED) .putCustomAttribute(Analytics.Keys.COURSE_ID, courseId) .putCustomAttribute(Keys.EMAIL_OPT_IN, emailOptIn ? 1 : 0) ; event.addCategoryToBiEvents(Values.CONVERSION, courseId); <START> trackAnswersEvent(event); <END> }</code><technical_language>implementation needed. need trackEnrollSuccess</technical_language>

Target:
public void trackEnrollClicked(@NonNull String courseId, boolean emailOptIn) { }
Source:
<code>private void readFullAccountAndUpdateCache(String pathToFullAccountMetadata) throws JSONException { lock.lock(); try { long startTimeMs = System.currentTimeMillis(); logger.trace("Start reading full account metadata set from path={}", pathToFullAccountMetadata); ZNRecord zNRecord = helixStore.get(pathToFullAccountMetadata, null, AccessOption.PERSISTENT); logger.trace("Fetched ZNRecord from path={}, took time={} ms", pathToFullAccountMetadata, System.currentTimeMillis() - startTimeMs); if (zNRecord == null) { logger.debug("The ZNRecord to read does not exist on path={}", pathToFullAccountMetadata); } else { Map<String, String> remoteAccountMap = zNRecord.getMapField(ACCOUNT_METADATA_MAP_KEY); if (remoteAccountMap == null) { logger.debug("ZNRecord={} to read on path={} does not have a simple map with key={}", zNRecord, pathToFullAccountMetadata, ACCOUNT_METADATA_MAP_KEY); } else { logger.trace("Start parsing remote account data."); AccountInfoMap newAccountInfoMap = new AccountInfoMap(remoteAccountMap); Map<Short, Account> oldIdToAccountMap = accountInfoMapRef.get().idToAccountMap; <START> List<Short> idForUpdatedAccounts = new ArrayList<>(); <END> for (Account newAccount : newAccountInfoMap.getAccounts()) { if (!newAccount.equals(oldIdToAccountMap.get(newAccount.getId()))) { idForUpdatedAccounts.add(newAccount.getId()); } } accountInfoMapRef.set(newAccountInfoMap); logger.info("Received updates for accounts. Account IDs={}", idForUpdatedAccounts.size(), idForUpdatedAccounts); } } } finally { lock.unlock(); } }</code><technical_language>minor: idsOfUpdatedAccounts</technical_language>

Target:
private void readFullAccountAndUpdateCache(String pathToFullAccountMetadata) throws JSONException { lock.lock(); try { long startTimeMs = System.currentTimeMillis(); logger.trace("Start reading full account metadata set from path={}", pathToFullAccountMetadata); ZNRecord zNRecord = helixStore.get(pathToFullAccountMetadata, null, AccessOption.PERSISTENT); logger.trace("Fetched ZNRecord from path={}, took time={} ms", pathToFullAccountMetadata, System.currentTimeMillis() - startTimeMs); if (zNRecord == null) { logger.debug("The ZNRecord to read does not exist on path={}", pathToFullAccountMetadata); } else { Map<String, String> remoteAccountMap = zNRecord.getMapField(ACCOUNT_METADATA_MAP_KEY); if (remoteAccountMap == null) { logger.debug("ZNRecord={} to read on path={} does not have a simple map with key={}", zNRecord, pathToFullAccountMetadata, ACCOUNT_METADATA_MAP_KEY); } else { logger.trace("Start parsing remote account data."); AccountInfoMap newAccountInfoMap = new AccountInfoMap(remoteAccountMap); Map<Short, Account> oldIdToAccountMap = accountInfoMapRef.get().idToAccountMap; List<Short> idsOfUpdatedAccounts = new ArrayList<>(); for (Account newAccount : newAccountInfoMap.getAccounts()) { if (!newAccount.equals(oldIdToAccountMap.get(newAccount.getId()))) { idsOfUpdatedAccounts.add(newAccount.getId()); } } accountInfoMapRef.set(newAccountInfoMap); logger.info("Received updates for accounts. Account IDs={}", idsOfUpdatedAccounts.size(), idsOfUpdatedAccounts); } } } finally { lock.unlock(); } }
Source:
<code>private void setRevisions(ChangeInfo change, String patchSet) { int i = patchSet.indexOf(".."); if (i > 0) { <START> this.revisionA <END> = getRevision(change, patchSet.substring(0, i)); if (patchSet.length() > i + 2) { this.revisionB = getRevision(change, patchSet.substring(i + 2)); } else { throw new IllegalArgumentException("Invalid patch set: " + patchSet); } } else { this.revisionB = getRevision(change, patchSet); this.revisionA = this.revisionB + "^1"; } }</code><technical_language>Remove this in this method</technical_language>

Target:
private void setRevisions(ChangeInfo change, String patchSet) { int i = patchSet.indexOf(".."); if (i > 0) { revisionA = getRevision(change, patchSet.substring(0, i)); if (patchSet.length() > i + 2) { revisionB = getRevision(change, patchSet.substring(i + 2)); } else { throw new IllegalArgumentException("Invalid patch set: " + patchSet); } } else { revisionB = getRevision(change, patchSet); revisionA = this.revisionB + "^1"; } }
Source:
<code>private void _nextTerminationEntry() throws Exception { <START> _terminationDialog[_terminationIndex++].call(); <END> }</code><technical_language>do prevent ArrayIndexOutOfBounds NullPointer</technical_language>

Target:
private void _nextTerminationEntry() throws Exception { try { _terminationDialog[_terminationIndex++].call(); } catch (ArrayIndexOutOfBoundsException e) { throw new RuntimeException("Protocol violation", e); } }
Source:
<code>public void shouldSendGooglePay3DSRequestWhenGooglePayDetailsWithoutIpAddressArePresent() throws Exception { try { worldpayApplePayAuthorisationHandler.authorise(getGooglePay3DSAuthorisationRequestWithoutIpAddress()); } catch (GatewayErrorException e) { <START> ArgumentCaptor<GatewayOrder> gatewayOrderArgumentCaptor = ArgumentCaptor.forClass(GatewayOrder.class); ArgumentCaptor<Map<String, String>> headers = ArgumentCaptor.forClass(Map.class); <END> verify(mockGatewayClient).postRequestFor(eq(WORLDPAY_URL), eq(gatewayAccountEntity), gatewayOrderArgumentCaptor.capture(), headers.capture()); assertXMLEqual(TestTemplateResourceLoader.load(WORLDPAY_VALID_AUTHORISE_WORLDPAY_GOOGLE_PAY_3DS_REQUEST_WITHOUT_IP_ADDRESS), gatewayOrderArgumentCaptor.getValue().getPayload()); assertThat(headers.getValue().size(), is(1)); assertThat(headers.getValue(), is(AuthUtil.getGatewayAccountCredentialsAsAuthHeader(gatewayAccountEntity))); } }</code><technical_language>move variables of method attributes of WorldpayWalletAuthorisationHandlerTest class @Captor annotation. This remove duplicate code test cases easier read. @Captor ArgumentCaptor<GatewayOrder> gatewayOrderArgumentCaptor; @Captor ArgumentCaptor<Map<String, String>> headers;</technical_language>

Target:
public void shouldSendGooglePay3DSRequestWhenGooglePayDetailsWithoutIpAddressArePresent() throws Exception { try { worldpayApplePayAuthorisationHandler.authorise(getGooglePay3DSAuthorisationRequestWithoutIpAddress()); } catch (GatewayErrorException e) { verify(mockGatewayClient).postRequestFor(eq(WORLDPAY_URL), eq(gatewayAccountEntity), gatewayOrderArgumentCaptor.capture(), headers.capture()); assertXMLEqual(TestTemplateResourceLoader.load(WORLDPAY_VALID_AUTHORISE_WORLDPAY_GOOGLE_PAY_3DS_REQUEST_WITHOUT_IP_ADDRESS), gatewayOrderArgumentCaptor.getValue().getPayload()); assertThat(headers.getValue().size(), is(1)); assertThat(headers.getValue(), is(AuthUtil.getGatewayAccountCredentialsAsAuthHeader(gatewayAccountEntity))); } }
Source:
<code>public InternalRecord( List<String> keys, Value[] values ) { this.keys = keys; this.values = values; int numFields = keys.size(); Map<String, Integer> fieldLookup = new HashMap<>( numFields ); for ( int i = 0; i < numFields; i++ ) { String name = keys.get(i); fieldLookup.put( name, i ); } <START> this.keyIndexLookup = fieldLookup; <END> }</code><technical_language>for field-counts dealing (10s), keys.indexOf() good enough</technical_language>

Target:
public InternalRecord( List<String> keys, Value[] values ) { this.keys = keys; this.values = values; }
Source:
<code><START> public List<TagName> getTagNamesInUse(long dsObjId) throws TskCoreException { <END> ArrayList<TagName> tagNames = new ArrayList<>(); String queryStr = "SELECT * FROM tag_names " + "WHERE tag_name_id IN " + "( SELECT content_tags.tag_name_id as tag_name_id " + "FROM content_tags as content_tags, tsk_files as tsk_files" + " WHERE content_tags.obj_id = tsk_files.obj_id" + " AND tsk_files.data_source_obj_id = " + dsObjId + " UNION " + "SELECT artifact_tags.tag_name_id as tag_name_id " + " FROM blackboard_artifact_tags as artifact_tags, blackboard_artifacts AS arts " + " WHERE artifact_tags.artifact_id = arts.artifact_id" + " AND arts.data_source_obj_id = " + dsObjId + " )"; try (CaseDbQuery query = caseDb.executeQuery(queryStr);) { ResultSet resultSet = query.getResultSet(); while (resultSet.next()) { tagNames.add(new TagName(resultSet.getLong("tag_name_id"), resultSet.getString("display_name"), resultSet.getString("description"), TagName.HTML_COLOR.getColorByName(resultSet.getString("color")), TskData.FileKnown.valueOf(resultSet.getByte("knownStatus")))); } return tagNames; } catch (SQLException | TskCoreException ex) { throw new TskCoreException("Failed to get tag names in use for data source objID : " + dsObjId, ex); } }</code><technical_language>wait put new methods query case database tags manager ready create a TagsManager class in SleuthKIt layer, noted in <LINK_0> For now, need bite bullet add methods SleuthkitCase do need constructors for TagName, etc., public</technical_language>

Target:
public List<TagName> getTagNamesInUse(long dsObjId) throws TskCoreException { return caseDb.getTagNamesInUse(dsObjId); }
Source:
<code>public Map<String, String> getProperties() { <START> return properties; <END> }</code><technical_language>data objects return null collections is met</technical_language>

Target:
public Map<String, String> getProperties() { return MoreObjects.firstNonNull(properties, new HashMap<String, String>()); }
Source:
<code>public void addContents(@NonNull Container result) { result.add( new Content("nodes/master/running-jobs.txt") { @Override public void writeTo(OutputStream os) throws IOException { try (PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(os, StandardCharsets.UTF_8)))) { Optional.ofNullable(Jenkins.getInstanceOrNull()) <START> .ifPresent(jenkins -> jenkins.getAllItems(Job.class) <END> .stream() .filter(Job::isBuilding) .forEach(job -> { ((Job<?, ?>) job) .getBuilds() .filter(Run::isBuilding) .forEach(run -> out.println(String.format(MESSAGE_FORMAT, job.getFullName(), run.getNumber()))); })); } finally { os.flush(); } } } ); }</code><technical_language>afraid call getAllItems big instances thousands of jobs In UI, display running jobs (thus exclude lightweight (pipeline jobs & co) listing computers / executors <LINK_1> <LINK_0></technical_language>

Target:
public void addContents(@NonNull Container result) { result.add( new Content("nodes/master/running-jobs.txt") { @Override public void writeTo(OutputStream os) throws IOException { try (OutputStreamWriter osw = new OutputStreamWriter(os, StandardCharsets.UTF_8); BufferedWriter bw = new BufferedWriter(osw); PrintWriter out = new PrintWriter(bw)) { Optional.ofNullable(Jenkins.getInstanceOrNull()) .ifPresent(jenkins -> jenkins.getAllItems(Job.class) .stream() .filter(Job::isBuilding) .forEach(job -> { ((Job<?, ?>) job) .getBuilds() .filter(Run::isBuilding) .forEach(run -> out.println(String.format(MESSAGE_FORMAT, job.getFullName(), run.getNumber()))); })); } finally { out.flush(); } } } ); }
Source:
<code>default @Nullable Object removeArgument(String name) { <START> return false; <END> }</code><technical_language>false? null</technical_language>

Target:
default @Nullable Object removeArgument(String name) { return null; }
Source:
<code>static List<FormPage> toRecognizedLayout(AnalyzeResult analyzeResult, boolean includeTextDetails) { List<ReadResult> readResults = analyzeResult.getReadResults(); List<PageResult> pageResults = analyzeResult.getPageResults(); List<FormPage> formPages = new ArrayList<>(); forEachWithIndex(readResults, ((index, readResultItem) -> { List<FormTable> perPageTableList = new ArrayList<>(); <START> if (!CoreUtils.isNullOrEmpty(pageResults)) { <END> PageResult pageResultItem = pageResults.get(index); perPageTableList = getPageTables(pageResultItem, readResults, pageResultItem.getPage()); } List<FormLine> perPageFormLineList = new ArrayList<>(); if (includeTextDetails && !CoreUtils.isNullOrEmpty(readResultItem.getLines())) { perPageFormLineList = getReadResultFormLines(readResultItem); } formPages.add(getFormPage(readResultItem, perPageTableList, perPageFormLineList)); })); return formPages; }</code><technical_language>this a variable of scope of for loop? need check this once</technical_language>

Target:
static List<FormPage> toRecognizedLayout(AnalyzeResult analyzeResult, boolean includeTextDetails) { List<ReadResult> readResults = analyzeResult.getReadResults(); List<PageResult> pageResults = analyzeResult.getPageResults(); List<FormPage> formPages = new ArrayList<>(); boolean pageResultsIsNullOrEmpty = CoreUtils.isNullOrEmpty(pageResults); forEachWithIndex(readResults, ((index, readResultItem) -> { List<FormTable> perPageTableList = new ArrayList<>(); if (!pageResultsIsNullOrEmpty) { PageResult pageResultItem = pageResults.get(index); perPageTableList = getPageTables(pageResultItem, readResults, pageResultItem.getPage()); } List<FormLine> perPageFormLineList = new ArrayList<>(); if (includeTextDetails && !CoreUtils.isNullOrEmpty(readResultItem.getLines())) { perPageFormLineList = getReadResultFormLines(readResultItem); } formPages.add(getFormPage(readResultItem, perPageTableList, perPageFormLineList)); })); return formPages; }
Source:
<code><START> private static final boolean isPrimitiveIntegral(TypeKind typeKind) { <END> switch (typeKind) { case INT: case SHORT: case BYTE: case CHAR: case LONG: return true; default: return false; } }</code><technical_language>final is unnecessary</technical_language>

Target:
private static boolean isPrimitiveIntegral(TypeKind typeKind) { switch (typeKind) { case INT: case SHORT: case BYTE: case CHAR: case LONG: return true; default: return false; } }
Source:
<code>protected void connectToLeader(MultipleAddresses addr, String hostname) throws IOException, InterruptedException { List<InetSocketAddress> addresses = addr.getAllAddresses(); ExecutorService executor = Executors.newFixedThreadPool(addresses.size()); CountDownLatch latch = new CountDownLatch(addresses.size()); AtomicReference<Socket> socket = new AtomicReference<>(null); addresses.stream().map(address -> new LeaderConnector(address, socket, latch)).forEach(executor::submit); latch.await(); <START> if(socket.get() == null) <END> throw new IOException("Failed connect to " + addr); else sock = socket.get(); self.authLearner.authenticate(sock, hostname); leaderIs = BinaryInputArchive.getArchive(new BufferedInputStream( sock.getInputStream())); bufferedOutput = new BufferedOutputStream(sock.getOutputStream()); leaderOs = BinaryOutputArchive.getArchive(bufferedOutput); }</code><technical_language>Code style: please brackets</technical_language>

Target:
protected void connectToLeader(MultipleAddresses addr, String hostname) throws IOException, InterruptedException { Set<InetSocketAddress> addresses = addr.getAllAddresses(); ExecutorService executor = Executors.newFixedThreadPool(addresses.size()); CountDownLatch latch = new CountDownLatch(addresses.size()); AtomicReference<Socket> socket = new AtomicReference<>(null); addresses.stream().map(address -> new LeaderConnector(address, socket, latch)).forEach(executor::submit); latch.await(); if (socket.get() == null) { throw new IOException("Failed connect to " + addr); } else { sock = socket.get(); } self.authLearner.authenticate(sock, hostname); leaderIs = BinaryInputArchive.getArchive(new BufferedInputStream( sock.getInputStream())); bufferedOutput = new BufferedOutputStream(sock.getOutputStream()); leaderOs = BinaryOutputArchive.getArchive(bufferedOutput); }
Source:
<code>private Collection<? extends CRL> getCRLs(List<InputStream> crlStreams) throws GeneralSecurityException { CertificateFactory cf = CertificateFactory.getInstance("X.509"); Collection<CRL> crls = new ArrayList<>(); try { for (InputStream stream : crlStreams) { crls.addAll(cf.generateCRLs(stream)); } return crls; } finally { try { for (InputStream stream : crlStreams) { <START> stream.close(); <END> } } catch (Exception ignore) } }</code><technical_language>Instead of try/catch for loop, stream.close()</technical_language>

Target:
private Collection<? extends CRL> getCRLs(List<InputStream> crlStreams) throws GeneralSecurityException { CertificateFactory cf = CertificateFactory.getInstance("X.509"); Collection<CRL> crls = new ArrayList<>(); try { for (InputStream stream : crlStreams) { crls.addAll(cf.generateCRLs(stream)); } return crls; } finally { for (InputStream stream : crlStreams) { try { stream.close(); } catch (Exception ignore) } } }
Source:
<code><START> boolean validateVdsGroup() { <END> if (getVdsGroup() == null) { return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } return true; }</code><technical_language>please set a modifier - protected suitable</technical_language>

Target:
protected boolean validateVdsGroup() { if (getVdsGroup() == null) { return failCanDoAction(VdcBllMessages.VDS_CLUSTER_IS_NOT_VALID); } return true; }
Source:
<code>public static boolean is64BitJVM() { <START> return ((System.getProperty("sun.arch.data.model").equals("64")) | <END> (System.getProperty("os.arch").equals("x86_64")) | (System.getProperty("os.arch").equals("amd64"))); }</code><technical_language>rewrite "64".equals(System.getProperty("sun.arch.data.model")) get exception if a is null. while bitwise operators do work booleans in Java...I'd prefer logical operators for clarity (I I valid)</technical_language>

Target:
public static boolean is64BitJVM() { return (("64".equals(System.getProperty("sun.arch.data.model"))) || ("x86_64".equals(System.getProperty("os.arch"))) || ("amd64".equals(System.getProperty("os.arch")))); }
Source:
<code>public static boolean containsConsole() { if (enabledWidgets != null) { boolean containsConsole = false; for (CoreScreenLayer layer : enabledWidgets) { if (layer instanceof ConsoleScreen) { <START> LoggerFactory.getLogger("").info("console open"); <END> containsConsole = true; } } return containsConsole; } return false; }</code><technical_language>This</technical_language>

Target:
public static boolean containsConsole() { if (enabledWidgets != null) { boolean containsConsole = false; for (CoreScreenLayer layer : enabledWidgets) { if (layer instanceof ConsoleScreen) { return true; } } } return false; }
Source:
<code>private String buildInOperator(int size) { if (size == 1) { return "(?)"; } StringBuilder builder = new StringBuilder("(") <START> .append(StringUtils.join(Collections.nCopies(size, "?"), ",")) <END> .append(")"); return builder.toString(); }</code><technical_language>TextUtils instead of StringUtils? some issues devices in past. StringUtil's methods heavily overloaded bigger manufacturer messed up..</technical_language>

Target:
private String buildInOperator(int size) { if (size == 1) { return "(?)"; } StringBuilder builder = new StringBuilder("(") .append(TextUtils.join(",", Collections.nCopies(size, "?"))) .append(")"); return builder.toString(); }
Source:
<code>private void navigateTo() { if (cache == null || cache.coords == null) { showToast(res.getString(R.string.err_location_unknown)); } cgeonavigate navigateActivity = new cgeonavigate(); Intent navigateIntent = new Intent(this, navigateActivity.getClass()); navigateIntent.putExtra("latitude", cache.coords.getLatitude()); navigateIntent.putExtra("longitude", cache.coords.getLongitude()); navigateIntent.putExtra("geocode", ""); <START> navigateIntent.putExtra("name", R.string.search_some_destination); <END> startActivity(navigateIntent); }</code><technical_language>Attention! R.string.search_some_destination is int, String</technical_language>

Target:
private void navigateTo() { if (cache == null || cache.coords == null) { showToast(res.getString(R.string.err_location_unknown)); } cgeonavigate navigateActivity = new cgeonavigate(); Intent navigateIntent = new Intent(this, navigateActivity.getClass()); navigateIntent.putExtra("latitude", cache.coords.getLatitude()); navigateIntent.putExtra("longitude", cache.coords.getLongitude()); navigateIntent.putExtra("geocode", ""); navigateIntent.putExtra("name", res.getString(R.string.search_some_destination)); startActivity(navigateIntent); }
Source:
<code>public void updated(Map<String, Object> properties) { logger.info("Updating {}...", properties.get(ConfigurationService.KURA_SERVICE_PID)); stopReconnectTask(); this.properties.clear(); this.properties.putAll(properties); <START> getThrottle(); <END> this.store.update((Integer) this.properties.get(STORE_HOUSEKEEPER_INTERVAL_PROP_NAME), (Integer) this.properties.get(STORE_PURGE_AGE_PROP_NAME), (Integer) this.properties.get(STORE_CAPACITY_PROP_NAME)); if (!this.dataTransportService.isConnected()) { startReconnectTask(); } }</code><technical_language>createThrottle indicating instanciation occur</technical_language>

Target:
public void updated(Map<String, Object> properties) { logger.info("Updating {}...", properties.get(ConfigurationService.KURA_SERVICE_PID)); stopReconnectTask(); this.properties.clear(); this.properties.putAll(properties); createThrottle(); this.store.update(dataServiceOptions.getStoreHousekeeperInterval(), dataServiceOptions.getStorePurgeAge(), dataServiceOptions.getStoreCapacity()); if (!this.dataTransportService.isConnected()) { startReconnectTask(); } }
Source:
<code>public LogReplicationEntry receive(LogReplicationEntry message) { rxMessageCounter++; rxMessageCount.setValue(rxMessageCounter); log.debug("Sink manager received while in {}", message.getMetadata().getMessageMetadataType(), rxState); if (message.getMetadata().getTopologyConfigId() != topologyConfigId) { log.warn("Sink manager with config id ignored msg id {}", topologyConfigId, message.getMetadata().getTopologyConfigId()); return null; } if (message.getMetadata().getMessageMetadataType().equals(MessageType.SNAPSHOT_START)) { processSnapshotStart(message); return null; } if (!receivedValidMessage(message)) { END ACK message and END message again, but the receiver has already transited to if (message.getMetadata().getMessageMetadataType() == SNAPSHOT_TRANSFER_END) { log.warn("Sink Manager in state and received message {}. Resending the ACK for SNAPSHOT_END.", rxState, message.getMetadata()); LogReplicationEntryMetadata metadata = snapshotSinkBufferManager.makeAckMessage(message); <START> return new LogReplicationEntry(metadata, new byte[0]); <END> } log.warn("Sink Manager in state and received message {}. Dropping Message.", rxState, message.getMetadata()); return null; } if (rxState.equals(RxState.LOG_ENTRY_SYNC)) { return logEntrySinkBufferManager.processMsgAndBuffer(message); } else { return snapshotSinkBufferManager.processMsgAndBuffer(message); } }</code><technical_language>rename makeAckMessage a more accurate name, ACK is built line 251. Maybe, getAckMetadata(message) method return LogReplicationEntry itself</technical_language>

Target:
public LogReplicationEntry receive(LogReplicationEntry message) { rxMessageCounter++; rxMessageCount.setValue(rxMessageCounter); log.debug("Sink manager received while in {}", message.getMetadata().getMessageMetadataType(), rxState); if (message.getMetadata().getTopologyConfigId() != topologyConfigId) { log.warn("Sink manager with config id ignored msg id {}", topologyConfigId, message.getMetadata().getTopologyConfigId()); return null; } if (message.getMetadata().getMessageMetadataType().equals(MessageType.SNAPSHOT_START)) { processSnapshotStart(message); return null; } if (!receivedValidMessage(message)) { END ACK message and END message again, but the receiver has already transited to if (message.getMetadata().getMessageMetadataType() == SNAPSHOT_TRANSFER_END) { log.warn("Sink Manager in state and received message {}. Resending the ACK for SNAPSHOT_END.", rxState, message.getMetadata()); LogReplicationEntryMetadata metadata = snapshotSinkBufferManager.getAckMetadata(message); return new LogReplicationEntry(metadata, new byte[0]); } log.warn("Sink Manager in state and received message {}. Dropping Message.", rxState, message.getMetadata()); return null; } if (rxState.equals(RxState.LOG_ENTRY_SYNC)) { return logEntrySinkBufferManager.processMsgAndBuffer(message); } else { return snapshotSinkBufferManager.processMsgAndBuffer(message); } }
Source:
<code>public void launchesTerminated(ILaunch[] launches) { for (ILaunch l : launches) { if (l.equals(launch)) { Display.getDefault().syncExec(new Runnable() { public void run() { try { String s = exePath.toOSString(); URI workingDirURI = getProject().getLocationURI(); RemoteProxyManager rpmgr = RemoteProxyManager.getInstance(); IRemoteFileProxy proxy = rpmgr.getFileProxy(getProject()); String workingDirPath = proxy.toPath(workingDirURI); String gmonExpected = workingDirPath + "/gmon.out"; IFileStore f = proxy.getResource(gmonExpected); if (!f.fetchInfo().exists()) { String title = GprofLaunchMessages.GprofCompilerOptions_msg; String message = GprofLaunchMessages.GprofCompileAgain_msg; Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell(); MessageDialog.openWarning(parent, title, message); } IFileStore exe = proxy.getResource(exePath.toString()); <START> if (exe.fetchInfo().getLastModified() > f.fetchInfo().getLastModified()) { <END> String title = GprofLaunchMessages.GprofGmonStale_msg; String message = GprofLaunchMessages.GprofGmonStaleExplanation_msg; Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell(); MessageDialog.openWarning(parent, title, message); } Display.getDefault().asyncExec(new LaunchTerminationWatcherRunnable(s, gmonExpected)); } catch (NullPointerException e) { } catch (CoreException e) { } } }); } } }</code><technical_language>This condition true if a gmon.out file exist, in case f.fetchInfo().getLastModified() returns 0. This results in warning dialog boxes opening consecutively in absence of a gmon.out file . Returning opening a warning dialog box fix this</technical_language>

Target:
public void launchesTerminated(ILaunch[] launches) { for (ILaunch l : launches) { if (l.equals(launch)) { Display.getDefault().syncExec(new Runnable() { public void run() { try { String s = exePath.toOSString(); URI workingDirURI = getProject().getLocationURI(); RemoteProxyManager rpmgr = RemoteProxyManager.getInstance(); IRemoteFileProxy proxy = rpmgr.getFileProxy(getProject()); String workingDirPath = proxy.toPath(workingDirURI); String gmonExpected = workingDirPath + "/gmon.out"; IFileStore f = proxy.getResource(gmonExpected); if (!f.fetchInfo().exists()) { String title = GprofLaunchMessages.GprofCompilerOptions_msg; String message = GprofLaunchMessages.GprofCompileAgain_msg; Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell(); MessageDialog.openWarning(parent, title, message); } else { IFileStore exe = proxy.getResource(exePath.toString()); if (exe.fetchInfo().getLastModified() > f.fetchInfo().getLastModified()) { String title = GprofLaunchMessages.GprofGmonStale_msg; String message = GprofLaunchMessages.GprofGmonStaleExplanation_msg; Shell parent = PlatformUI.getWorkbench().getDisplay().getActiveShell(); MessageDialog.openWarning(parent, title, message); } } Display.getDefault().asyncExec(new LaunchTerminationWatcherRunnable(s, gmonExpected)); } catch (NullPointerException e) { } catch (CoreException e) { } } }); } } }
Source:
<code>public void process(JCas jCas) throws AnalysisEngineProcessException { if (tempData == null) { try { <START> tempData = File.createTempFile("dkpro-stanford-pos-trainer", ".tsv"); <END> out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(tempData), StandardCharsets.UTF_8)); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } } Map<Sentence, Collection<Token>> index = indexCovered(jCas, Sentence.class, Token.class); for (Sentence sentence : select(jCas, Sentence.class)) { Collection<Token> tokens = index.get(sentence); for (Token token : tokens) { out.printf("%s\t%s%n", token.getText(), token.getPos().getPosValue()); } out.println(); } }</code><technical_language>"arktweet" instead of "stanford"</technical_language>

Target:
public void process(JCas jCas) throws AnalysisEngineProcessException { if (tempData == null) { try { tempData = File.createTempFile("dkpro-arktweet-pos-trainer", ".tsv"); out = new PrintWriter(new OutputStreamWriter(new FileOutputStream(tempData), StandardCharsets.UTF_8)); } catch (IOException e) { throw new AnalysisEngineProcessException(e); } } Map<Sentence, Collection<Token>> index = indexCovered(jCas, Sentence.class, Token.class); for (Sentence sentence : select(jCas, Sentence.class)) { Collection<Token> tokens = index.get(sentence); for (Token token : tokens) { out.printf("%s\t%s%n", token.getText(), token.getPos().getPosValue()); } out.println(); } }
Source:
<code>public void setUp() throws Exception { brickPosition = 1; <START> insertItemIntoUserListBrick = new InsertItemIntoUserListBrick(10, 1); <END> BrickTestUtils.createProjectAndGetStartScript("insertItemOfUserListBrickTest1") .addBrick(insertItemIntoUserListBrick); baseActivityTestRule.launchActivity(null); }</code><technical_language>please add variables for 10 1 give meaningful names</technical_language>

Target:
public void setUp() throws Exception { brickPosition = 1; value = 10; indexToInsert = 1; insertItemIntoUserListBrick = new InsertItemIntoUserListBrick(value, indexToInsert); BrickTestUtils.createProjectAndGetStartScript("insertItemOfUserListBrickTest1") .addBrick(insertItemIntoUserListBrick); baseActivityTestRule.launchActivity(null); }
Source:
<code>public boolean isCallerInRole(String role) { String caller = ctx.getCallerPrincipal().getName(); if (!USER.equals(caller)) { <START> log.severe("Caller name is not " + USER + ", but " + caller); <END> } return ctx.isCallerInRole(role); }</code><technical_language>this fail instead of logging</technical_language>

Target:
public boolean isCallerInRole(String role) throws Exception { String caller = ctx.getCallerPrincipal().getName(); if (!USER.equals(caller)) { throw new Exception("Caller name is not " + USER + ", but " + caller); } return ctx.isCallerInRole(role); }