auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] password, int maxMemoryLimitInKb) throws IOException { final byte propsByte = coder.properties[0]; final int dictSize = getDictionarySize(coder); if (dictSize > LZMAInputStream.DICT_SIZE_MAX) { throw new IOException("Dictionary larger than 4GiB maximum size used in " + archiveName); <START> } else if ((dictSize / 1024) > maxMemoryLimitInKb) { <END> throw new MemoryLimitException(dictSize / 1024, maxMemoryLimitInKb); } return new LZMAInputStream(in, uncompressedLength, propsByte, dictSize); }</code><technical_language>I call LZMAInputStream.getMemoryUsage evaluate dictionary size only. bad constructor support memoryLimit parameter other constructors allow</technical_language>

Target:
InputStream decode(final String archiveName, final InputStream in, final long uncompressedLength, final Coder coder, final byte[] password, int maxMemoryLimitInKb) throws IOException { final byte propsByte = coder.properties[0]; final int dictSize = getDictionarySize(coder); if (dictSize > LZMAInputStream.DICT_SIZE_MAX) { throw new IOException("Dictionary larger than 4GiB maximum size used in " + archiveName); } final int memoryUsageInKb = LZMAInputStream.getMemoryUsage(dictSize, propsByte); if (memoryUsageInKb > maxMemoryLimitInKb) { throw new MemoryLimitException(memoryUsageInKb, maxMemoryLimitInKb); } return new LZMAInputStream(in, uncompressedLength, propsByte, dictSize); }
Source:
<code>protected Void call() throws Exception { Objects.requireNonNull(version, "Version hasn't been set."); updateTitle(i18n.get("game.mapGeneration.downloadGenerator.title", version)); <START> URL url = new URL(String.format(clientProperties.getMapGenerator().getMapGeneratorReleaseUrl(), version, version)); <END> URLConnection urlConnection = url.openConnection(); int contentLength = urlConnection.getContentLength(); BufferedInputStream inputStream = new BufferedInputStream(urlConnection.getInputStream()); File targetFile = mapGeneratorService.getGeneratorExecutablePath().resolve(String.format(MapGeneratorService.getGENERATOR_EXECUTABLE_FILENAME(), version)).toFile(); BufferedOutputStream outputStream = new BufferedOutputStream(new FileOutputStream(targetFile)); byte buffer[] = new byte[4096]; int totalBytesRead = 0; int bytesRead; while ((bytesRead = inputStream.read(buffer, 0, buffer.length)) != 0 && bytesRead != -1) { outputStream.write(buffer, 0, bytesRead); totalBytesRead += bytesRead; updateProgress(totalBytesRead, contentLength); } outputStream.close(); Files.setPosixFilePermissions(targetFile.toPath(), Sets.immutableEnumSet(PosixFilePermission.OWNER_READ, PosixFilePermission.OWNER_EXECUTE)); return null; }</code><technical_language>String argument argument</technical_language>

Target:
protected Void call() throws Exception { Objects.requireNonNull(version, "Version hasn't been set."); updateTitle(i18n.get("game.mapGeneration.downloadGenerator.title", version)); URL url = new URL(String.format(clientProperties.getMapGenerator().getMapGeneratorReleaseUrl(), version)); URLConnection urlConnection = url.openConnection(); File targetFile = mapGeneratorService.getGeneratorExecutablePath().resolve(String.format(MapGeneratorService.getGENERATOR_EXECUTABLE_FILENAME(), version)).toFile(); Path tempFile = Files.createTempFile(targetFile.toPath().getParent(), "generator", null); ResourceLocks.acquireDownloadLock(); try (InputStream inputStream = url.openStream(); OutputStream outputStream = Files.newOutputStream(tempFile)) { ByteCopier.from(inputStream) .to(outputStream) .totalBytes(urlConnection.getContentLength()) .listener(this::updateProgress) .copy(); Files.move(tempFile, targetFile.toPath(), StandardCopyOption.REPLACE_EXISTING); } finally { ResourceLocks.freeDownloadLock(); try { Files.deleteIfExists(tempFile); } catch (IOException e) { logger.warn("Could not delete temporary file: " + tempFile.toAbsolutePath(), e); } } platformService.setUnixExecutableAndWritableBits(targetFile.toPath()); return null; }
Source:
<code>public void channelCreated( Channel channel ) { <START> throw new IllegalStateException( "A fatal error happened in this driver as this method should never be called. " + <END> "Contact the driver developer." ); }</code><technical_language>throw new UnsupportedOperationException()? Current message reminds of ThisShouldNotHappenError :)</technical_language>

Target:
public void channelCreated( Channel channel ) { throw new IllegalStateException( "Untraceable channel created." ); }
Source:
<code>public boolean doSynchronousPing() { MerlinLog.d("Pinging : " + hostAddress); try { <START> int responseCode = responseCodeFetcher.from(hostAddress); <END> MerlinLog.d("Got response : " + responseCode); } catch (RequestException e) { if (e.causedByIO()) { return false; } throw e; } return true; }</code><technical_language>Is this for logging</technical_language>

Target:
public boolean doSynchronousPing() { MerlinLog.d("Pinging : " + hostAddress); try { responseCodeFetcher.from(hostAddress); } catch (RequestException e) { if (e.causedByIO()) { return false; } throw e; } return true; }
Source:
<code>public void writeToParcel(Parcel dest, int flags) { <START> dest.writeValue(date); <END> }</code><technical_language>write data parcel, is analogous serialization, need deserialize result get NarrowFilterByDate instance in [creator createfromparcel](<LINK_0></technical_language>

Target:
public void writeToParcel(Parcel dest, int flags) { dest.writeLong(date.getTime()); }
Source:
<code>private void checkForOnlyFinalFields(DetailAST objBlockToken) { <START> for (DetailAST ast = objBlockToken.getFirstChild(); ast != null; ast = ast.getNextSibling()) { <END> if (TokenTypes.VARIABLE_DEF == ast.getType()) { final DetailAST modifiersToken = ast.findFirstToken(TokenTypes.MODIFIERS); if (!modifiersToken.branchContains(TokenTypes.FINAL) && !Utils.hasIllegalCombination(modifiersToken)) { log(modifiersToken, String.format(ERROR_MSG, ast.findFirstToken(TokenTypes.IDENT).getText(), objBlockToken.getPreviousSibling().getText())); } } } }</code><technical_language>This simplified TokenUtil.findFirstTokenByPredicate. Similar other instances</technical_language>

Target:
private void checkForOnlyFinalFields(DetailAST objBlockToken) { Optional<DetailAST> nonFinalFieldFound = TokenUtil.findFirstTokenByPredicate(objBlockToken, node -> TokenTypes.VARIABLE_DEF == node.getType() && !node.branchContains(TokenTypes.FINAL) && !Utils.hasIllegalCombination(node.findFirstToken(TokenTypes.MODIFIERS))); if (nonFinalFieldFound.isPresent()) { DetailAST field = nonFinalFieldFound.get().findFirstToken(TokenTypes.IDENT); log(field, String.format(ERROR_MSG, field.getText())); } }
Source:
<code>Object[][] testOAData() { return new Object[][]{ <START> new Object[]{new File("testdata/picard/sam/aligned_withoutOA.sam"), new File("testdata/picard/sam/aligned_withOA.sam")}, <END> }; }</code><technical_language>Also, a test aligned original OA test default overwrite nice here. unmapped reads OA tag current code overwrite (and I guess should)</technical_language>

Target:
Object[][] testOAData() { return new Object[][]{ new Object[]{OA_TEST_DIR.resolve("aligned_withoutOA.sam").toFile(), OA_TEST_DIR.resolve("aligned_withOA.sam").toFile()}, }; }
Source:
<code>public void testRowScannerStream() { List<ColumnScanner> rows = new ArrayList<>(); Set<ColumnValue> cv1 = new HashSet<>(); Set<ColumnValue> cv2 = new HashSet<>(); Bytes row1 = Bytes.of("555555555"); cv1.add(new ColumnValue(new Column("firstname"), Bytes.of("Chris"))); cv1.add(new ColumnValue(new Column("lastname"), Bytes.of("McTague"))); cv1.add(new ColumnValue(new Column("age"), Bytes.of("21"))); rows.add(new ColumnScannerImpl(row1, cv1)); Bytes row2 = Bytes.of("55234234"); cv2.add(new ColumnValue(new Column("firstname"), Bytes.of("Hulk"))); cv2.add(new ColumnValue(new Column("lastname"), Bytes.of("Hogan"))); cv2.add(new ColumnValue(new Column("age"), Bytes.of("60"))); rows.add(new ColumnScannerImpl(row2, cv2)); RowScannerImpl rsi = new RowScannerImpl(rows); Set<Person> people = rsi.stream().map(cs -> toPerson(cs)).collect(Collectors.toSet()); Set<Person> expected = new HashSet<>(); expected.add(new Person("Chris", "McTague", 21, 555555555)); expected.add(new Person("Hulk", "Hogan", 60, 55234234)); Assert.assertEquals(expected.hashCode(), people.hashCode()); <START> Assert.assertEquals(expected.size(), people.size()); <END> }</code><technical_language>adding a equals method Person type , replace checks : Assert.assertEquals(expected, people);</technical_language>

Target:
public void testRowScannerStream() { List<ColumnScanner> rows = new ArrayList<>(); Set<ColumnValue> cv1 = new HashSet<>(); Set<ColumnValue> cv2 = new HashSet<>(); Bytes row1 = Bytes.of("555555555"); cv1.add(new ColumnValue(new Column("firstname"), Bytes.of("Chris"))); cv1.add(new ColumnValue(new Column("lastname"), Bytes.of("McTague"))); cv1.add(new ColumnValue(new Column("age"), Bytes.of("21"))); rows.add(new ColumnScannerImpl(row1, cv1)); Bytes row2 = Bytes.of("55234234"); cv2.add(new ColumnValue(new Column("firstname"), Bytes.of("Hulk"))); cv2.add(new ColumnValue(new Column("lastname"), Bytes.of("Hogan"))); cv2.add(new ColumnValue(new Column("age"), Bytes.of("60"))); rows.add(new ColumnScannerImpl(row2, cv2)); RowScannerImpl rsi = new RowScannerImpl(rows); Set<Person> people = rsi.stream().map(cs -> toPerson(cs)).collect(Collectors.toSet()); Set<Person> expected = new HashSet<>(); expected.add(new Person("Chris", "McTague", 21, 555555555)); expected.add(new Person("Hulk", "Hogan", 60, 55234234)); Assert.assertEquals(expected, people); }
Source:
<code>public List<TaskExecution> getLatestTaskExecutionsByTaskNames(String... taskNames) { <START> throw new UnsupportedOperationException("Not implemented."); <END> }</code><technical_language>This implemented for consistency</technical_language>

Target:
public List<TaskExecution> getLatestTaskExecutionsByTaskNames(String... taskNames) { Assert.notEmpty(taskNames, "At least 1 task name must be provided."); final List<String> taskNamesAsList = new ArrayList<>(); for (String taskName : taskNames) { if (StringUtils.hasText(taskName)) { taskNamesAsList.add(taskName); } } Assert.isTrue(taskNamesAsList.size() == taskNames.length, String.format("Task names must not contain any empty elements but %s of %s were empty or null.", taskNames.length - taskNamesAsList.size(), taskNames.length)); final Map<String, TaskExecution> tempTaskExecutions = new HashMap<>(); for (Map.Entry<Long, TaskExecution> taskExecutionMapEntry : this.taskExecutions.entrySet()) { if (!taskNamesAsList.contains(taskExecutionMapEntry.getValue().getTaskName())) { continue; } final TaskExecution tempTaskExecution = tempTaskExecutions.get(taskExecutionMapEntry.getValue().getTaskName()); if (tempTaskExecution == null || tempTaskExecution.getStartTime().before(taskExecutionMapEntry.getValue().getStartTime()) || ( tempTaskExecution.getStartTime().equals(taskExecutionMapEntry.getValue().getStartTime()) && tempTaskExecution.getExecutionId() < taskExecutionMapEntry.getValue().getExecutionId() ) ) { tempTaskExecutions.put(taskExecutionMapEntry.getValue().getTaskName(), taskExecutionMapEntry.getValue()); } } final List<TaskExecution> latestTaskExecutions = new ArrayList<>(tempTaskExecutions.values()); Collections.sort(latestTaskExecutions, new TaskExecutionComparator()); return latestTaskExecutions; }
Source:
<code>protected boolean canDoAction() { boolean returnValue = true; if (isVmStatusProperForHotPlugNic(getVm().getstatus())) { setVdsId(getVm().getrun_on_vds().getValue()); returnValue = isHotPlugSupported() && isOSSupportingHotPlug(); } else { <START> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_VM_STATUS_ILLEGAL); <END> returnValue = false; } if (returnValue) { vmDevice = getVmDeviceDao().get(new VmDeviceId(getParameters().getNicId(), getParameters().getVmId())); if (vmDevice == null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.VM_INTERFACE_NOT_EXIST); } } return returnValue; }</code><technical_language>new message type added. replace HOT_PLUG_NIC_VM_STATUS_ILLEGAL</technical_language>

Target:
protected boolean canDoAction() { boolean returnValue = true; if (isVmStatusProperForAttachDetach(getVm().getstatus())) { setVdsId(getVm().getrun_on_vds().getValue()); if (vmStatusDemandsHotPlugNic(getVm().getstatus())) { returnValue = isHotPlugSupported() && isOSSupportingHotPlug(); } } else { addCanDoActionMessage(VdcBllMessages.HOT_PLUG_NIC_VM_STATUS_ILLEGAL); returnValue = false; } if (returnValue) { vmDevice = getVmDeviceDao().get(new VmDeviceId(getParameters().getNicId(), getParameters().getVmId())); if (vmDevice == null) { returnValue = false; addCanDoActionMessage(VdcBllMessages.VM_INTERFACE_NOT_EXIST); } } return returnValue; }
Source:
<code>public String toString() { <START> return prependIfDeerInstance("Title-matching Generator"); <END> }</code><technical_language>pass in name variable this</technical_language>

Target:
public String toString() { return name; }
Source:
<code>private void assertIsLegalIndex(final int index) { int totalCount = itemCount(); <START> Assert.isTrue(index < totalCount && index > 0, java.text.MessageFormat.format( <END> "The index ({0}) is more than the number of items ({1}) in the list.", index, totalCount)); }</code><technical_language>This illegal select index 0... >= 0</technical_language>

Target:
private void assertIsLegalIndex(final int index) { int totalCount = itemCount(); Assert.isTrue(index < totalCount && index >= 0, java.text.MessageFormat.format( "The index ({0}) is more than the number of items ({1}) in the list.", index, totalCount)); }
Source:
<code>private DruidServer serverAddedOrUpdated(DruidServer server) { DruidServerHolder curr; DruidServerHolder newHolder; synchronized (servers) { curr = servers.get(server.getName()); newHolder = curr == null ? new DruidServerHolder(server) : curr.updatedHolder(server); servers.put(server.getName(), newHolder); } if (curr == null) { try { Future<?> future = newHolder.updateSegmentsListAsync(); <START> future.get(config.getServerTimeout(), TimeUnit.MILLISECONDS); <END> } catch (Throwable th) { log.error(th, "Failed to fetch segment list from %s , will be retried", server.getName()); } } return newHolder.druidServer; }</code><technical_language>this block fetch</technical_language>

Target:
private DruidServer serverAddedOrUpdated(DruidServer server) { DruidServerHolder curr; DruidServerHolder newHolder; synchronized (servers) { curr = servers.get(server.getName()); newHolder = curr == null ? new DruidServerHolder(server) : curr.updatedHolder(server); servers.put(server.getName(), newHolder); } newHolder.updateSegmentsListAsync(); return newHolder.druidServer; }
Source:
<code>public static Money of(CurrencyAmount currencyAmount) { Currency currency = currencyAmount.getCurrency(); <START> BigDecimal roundedAmount = new BigDecimal(currencyAmount.getAmount()) <END> .setScale(currency.getMinorUnitDigits(), BigDecimal.ROUND_HALF_EVEN); return new Money(currency, roundedAmount); }</code><technical_language>BigDecimal.valueOf(...) instead of new BigDecimal(...)</technical_language>

Target:
public static Money of(CurrencyAmount currencyAmount) { Currency currency = currencyAmount.getCurrency(); BigDecimal roundedAmount = BigDecimal.valueOf(currencyAmount.getAmount()) .setScale(currency.getMinorUnitDigits(), BigDecimal.ROUND_HALF_UP); return new Money(currency, roundedAmount); }
Source:
<code>public Factory<PaxosLearnerNetworkClient> learner() { return client -> { List<PaxosLearner> remoteLearners = TimelockPaxosLearnerAdapter .wrap(useCase(), remoteClients()) .apply(client); PaxosLearner localLearner = components().learner(client); <START> LocalAndRemotes<PaxosLearner> allLearners = LocalAndRemotes.of(localLearner, remoteLearners); <END> return new SingleLeaderLearnerNetworkClient( allLearners.local(), allLearners.remotes(), quorumSize(), allLearners.withSharedExecutor(sharedExecutor())); }; }</code><technical_language>above, need enhanceRemotes</technical_language>

Target:
public Factory<PaxosLearnerNetworkClient> learner() { return client -> { List<PaxosLearner> remoteLearners = TimelockPaxosLearnerAdapter .wrap(useCase(), remoteClients()) .apply(client); PaxosLearner localLearner = components().learner(client); LocalAndRemotes<PaxosLearner> allLearners = LocalAndRemotes.of(localLearner, remoteLearners) .enhanceRemotes(remote -> metrics().instrument(PaxosLearner.class, remote, client)); SingleLeaderLearnerNetworkClient uninstrumentedLearner = new SingleLeaderLearnerNetworkClient( allLearners.local(), allLearners.remotes(), quorumSize(), allLearners.withSharedExecutor(sharedExecutor())); return metrics().instrument(PaxosLearnerNetworkClient.class, uninstrumentedLearner); }; }
Source:
<code>private List<File> scanJarsInPluginsDirectory() { if (pluginsDir == null || !pluginsDir.exists()) { return Collections.emptyList(); } File[] matches = pluginsDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { <START> return (pathname.getName().endsWith(".jar") || pathname.getName() <END> .endsWith(".jar.disabled")) && pathname.isFile(); } }); if (matches == null) { log.error("Cannot list " + pluginsDir.getAbsolutePath()); return Collections.emptyList(); } return Arrays.asList(matches); }</code><technical_language>this line wrapped ugly. try another form putting name a local variable: String n = pathname.getName(); return (n.endsWith(".jar") || n.endsWith(".jar.disabled")) && pathname.isFile();</technical_language>

Target:
private List<File> scanJarsInPluginsDirectory() { if (pluginsDir == null || !pluginsDir.exists()) { return Collections.emptyList(); } File[] matches = pluginsDir.listFiles(new FileFilter() { @Override public boolean accept(File pathname) { String n = pathname.getName(); return (n.endsWith(".jar") || n.endsWith(".jar.disabled")) && pathname.isFile(); } }); if (matches == null) { log.error("Cannot list " + pluginsDir.getAbsolutePath()); return Collections.emptyList(); } return Arrays.asList(matches); }
Source:
<code>public MqttBrokerConnection(Protocol protocol, String host, @Nullable Integer port, boolean secure, @Nullable String clientId) { <START> this(host, port, secure, clientId); <END> this.protocol = protocol; }</code><technical_language>* protocol field final remove initialization declaration line. * Move implementation other constructor this one. * Add this(Protocol.TCP, host, port, secure, clientId); other constructor</technical_language>

Target:
public MqttBrokerConnection(Protocol protocol, String host, @Nullable Integer port, boolean secure, @Nullable String clientId) { this.protocol = protocol; this.host = host; this.secure = secure; String newClientID = clientId; if (newClientID == null) { newClientID = MqttClient.generateClientId(); } else if (newClientID.length() > 65535) { throw new IllegalArgumentException("Client ID cannot be longer than 65535 characters"); } if (port != null && (port <= 0 || port > 65535)) { throw new IllegalArgumentException("Port is not within a valid range"); } this.port = port != null ? port : (secure ? 8883 : 1883); this.clientId = newClientID; setReconnectStrategy(new PeriodicReconnectStrategy()); }
Source:
<code>public Collection<TransferLeg> map(Map<Stop, Transfer> input, double walkSpeed) { List<TransferLeg> result = new ArrayList<>(); for (Map.Entry<Stop, Transfer> entry : input.entrySet()) { Stop stop = entry.getKey(); Transfer transfer = entry.getValue(); int duration = (int)Math.floor(transfer.getDistanceMeters() / walkSpeed); int stopIndex = transitLayer.getIndexByStop(stop); Transfer newTransfer = new Transfer(stopIndex, transfer.getDistanceMeters(), transfer.getCoordinates()); <START> result.add(new TransferWithDuration(newTransfer, duration)); <END> } return result; }</code><technical_language>[constructor](<LINK_0> for TransferWithDuration expects transfer, walkSpeed parameters. suggestion result.add(new TransferWithDuration(newTransfer, walkSpeed));</technical_language>

Target:
public Collection<TransferLeg> map(Map<Stop, Transfer> input, double walkSpeed) { List<TransferLeg> result = new ArrayList<>(); for (Map.Entry<Stop, Transfer> entry : input.entrySet()) { Stop stop = entry.getKey(); Transfer transfer = entry.getValue(); int stopIndex = transitLayer.getIndexByStop(stop); Transfer newTransfer = new Transfer(stopIndex, transfer.getDistanceMeters(), transfer.getCoordinates()); result.add(new TransferWithDuration(newTransfer, walkSpeed)); } return result; }
Source:
<code>private void configureSingleUserMode() { bind(TokenValidator.class).to(org.eclipse.che.api.local.DummyTokenValidator.class); bind(MachineTokenProvider.class).to(MachineTokenProvider.EmptyMachineTokenProvider.class); bind(org.eclipse.che.api.workspace.server.stack.StackLoader.class); bind(DataSource.class).toProvider(org.eclipse.che.core.db.h2.H2DataSourceProvider.class); install(new org.eclipse.che.api.user.server.jpa.UserJpaModule()); install(new org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule()); bind(org.eclipse.che.api.user.server.CheUserCreator.class); bindConstant().annotatedWith(Names.named("che.agents.auth_enabled")).to(false); bindConstant() .annotatedWith(Names.named("db.jndi.datasource.name")) .to("java:/comp/env/jdbc/che-h2"); bindConstant() <START> .annotatedWith(Names.named("machine.terminal_agent.run_command")) <END> .to( "$HOME/che/terminal/che-websocket-terminal " + "-addr :4411 " + "-cmd ${SHELL_INTERPRETER} " + "-enable-activity-tracking"); bindConstant() .annotatedWith(Names.named("machine.exec_agent.run_command")) .to( "$HOME/che/exec-agent/che-exec-agent " + "-addr :4412 " + "-cmd ${SHELL_INTERPRETER} " + "-logs-dir $HOME/che/exec-agent/logs"); }</code><technical_language>check is anywhere</technical_language>

Target:
private void configureSingleUserMode() { bind(TokenValidator.class).to(org.eclipse.che.api.local.DummyTokenValidator.class); bind(MachineTokenProvider.class).to(MachineTokenProvider.EmptyMachineTokenProvider.class); bind(org.eclipse.che.api.workspace.server.stack.StackLoader.class); bind(DataSource.class).toProvider(org.eclipse.che.core.db.h2.H2DataSourceProvider.class); install(new org.eclipse.che.api.user.server.jpa.UserJpaModule()); install(new org.eclipse.che.api.workspace.server.jpa.WorkspaceJpaModule()); bind(org.eclipse.che.api.user.server.CheUserCreator.class); bindConstant().annotatedWith(Names.named("che.agents.auth_enabled")).to(false); bindConstant() .annotatedWith(Names.named("db.jndi.datasource.name")) .to("java:/comp/env/jdbc/che-h2"); }
Source:
<code>private List<JobForecastId> findForecastsToDelete(SearchResponse searchResponse) { List<JobForecastId> forecastsToDelete = new ArrayList<>(); SearchHits hits = searchResponse.getHits(); if (hits.getTotalHits() > MAX_FORECASTS) { LOGGER.info("More than forecasts were found. This run will only delete of them", MAX_FORECASTS, MAX_FORECASTS); } for (SearchHit hit : hits.getHits()) { <START> String expiryTime = stringFieldValueOrNull(hit, ForecastRequestStats.EXPIRY_TIME.getPreferredName()); <END> if (expiryTime == null) { LOGGER.warn("Forecast request stats document has a null field", hit.getId(), ForecastRequestStats.EXPIRY_TIME.getPreferredName()); continue; } long expiryMs = TimeUtils.parseToEpochMs(expiryTime); if (expiryMs < cutoffEpochMs) { JobForecastId idPair = new JobForecastId( stringFieldValueOrNull(hit, Job.ID.getPreferredName()), stringFieldValueOrNull(hit, Forecast.FORECAST_ID.getPreferredName())); if (idPair.hasNullValue() == false) { forecastsToDelete.add(idPair); } } } return forecastsToDelete; }</code><technical_language>tricky part is condition checks is **not** a long. Thus, logic is prior 6.0, expect a long. If not, something's wrong. Otherwise, fall return of method. Pretty confusing, I know</technical_language>

Target:
private List<JobForecastId> findForecastsToDelete(SearchResponse searchResponse) { List<JobForecastId> forecastsToDelete = new ArrayList<>(); SearchHits hits = searchResponse.getHits(); if (hits.getTotalHits() > MAX_FORECASTS) { LOGGER.info("More than forecasts were found. This run will only delete of them", MAX_FORECASTS, MAX_FORECASTS); } for (SearchHit hit : hits.getHits()) { DocumentField docField = hit.field(ForecastRequestStats.EXPIRY_TIME.getPreferredName()); if (docField == null) { LOGGER.warn("Forecast request stats document has a null field", hit.getId(), ForecastRequestStats.EXPIRY_TIME.getPreferredName()); continue; } Long expiryMs = parseDateField(docField.getValue()); if (expiryMs == null) { LOGGER.warn("Forecast request stats document date field cannot be parsed", hit.getId(), ForecastRequestStats.EXPIRY_TIME.getPreferredName()); continue; } if (expiryMs < cutoffEpochMs) { JobForecastId idPair = new JobForecastId( stringFieldValueOrNull(hit, Job.ID.getPreferredName()), stringFieldValueOrNull(hit, Forecast.FORECAST_ID.getPreferredName())); if (idPair.hasNullValue() == false) { forecastsToDelete.add(idPair); } } } return forecastsToDelete; }
Source:
<code>public void addVmsToRun(List<Guid> vmIds) { final DateTime now = DateTime.getNow(); LinkedList<Pair<Guid, DateTime>> vmsToAdd = new LinkedList<>(); for (Guid vmId: vmIds) { <START> vmsToAdd.add(new Pair<>(vmId, now)); <END> } autoStartVmsToRun.addAll(vmsToAdd); }</code><technical_language>add list addAll other? add target</technical_language>

Target:
public void addVmsToRun(List<Guid> vmIds) { LinkedList<AutoStartVmToRestart> vmsToAdd = new LinkedList<>(); for (Guid vmId: vmIds) { vmsToAdd.add(new AutoStartVmToRestart(vmId)); } autoStartVmsToRestart.addAll(vmsToAdd); }
Source:
<code><START> public DataPropertyTemplateModel call() throws Exception { <END> DataPropertyTemplateModel dptm = new DataPropertyTemplateModel(dp, subject, vreq, editing, populatedDataPropertyList); return dptm; }</code><technical_language>Exception is thrown. able remove throws clause</technical_language>

Target:
public DataPropertyTemplateModel call() { return new DataPropertyTemplateModel(dp, subject, vreq, editing, populatedDataPropertyList); }
Source:
<code>public void setInput(Object input) { String content= null; if (input instanceof String) { content= (String) input; } else if (input instanceof JavaSourceInformationInput) { content= ((JavaSourceInformationInput) input).getHoverInfo(); } setInformation(content); if (fShell != null && !fShell.isDisposed()) { Display display= fShell.getDisplay(); if (!display.isDisposed()) { display.asyncExec(new Runnable() { @Override public void run() { Object element= null; if (input instanceof JavaSourceInformationInput) { element= ((JavaSourceInformationInput) input).getJavaElement(); } else if (input instanceof String && ((String) <START> input).contains(SimpleJavaSourceViewerConfiguration.MODULE)) <END> { element= input; } updateViewerConfiguration(element); } }); } } }</code><technical_language>Yes, 'contains' a problem a normal Java file string "String moduleName;". a JavaElement in case considering effort required reset configs, I leave this template syntax coloring. So, patch set 2 fine here</technical_language>

Target:
public void setInput(Object input) { String content= null; if (input instanceof String) { content= (String) input; } else if (input instanceof JavaSourceInformationInput) { content= ((JavaSourceInformationInput) input).getHoverInfo(); } setInformation(content); if (fShell != null && !fShell.isDisposed()) { Display display= fShell.getDisplay(); if (!display.isDisposed()) { display.asyncExec(new Runnable() { @Override public void run() { IJavaElement javaElement= null; if (input instanceof JavaSourceInformationInput) { javaElement= ((JavaSourceInformationInput) input).getJavaElement(); } updateViewerConfiguration(javaElement); } }); } } }
Source:
<code>public static boolean matches(Resource resource, List<String> queries) { if (resource == null) return false; if (queries == null || queries.size() == 0) return true; ResourceAttributes attributes = resource.getAttributes(); String path = resource.getPath() + resource.getName(); for (String s : queries) { int delim = s.indexOf("="); if (delim != -1) { String attrName = s.substring(0, delim); String expected = s.substring(delim + 1); if (attrName.equals(LinkFormat.LINK)) { if (expected.endsWith("*")) { if (!path.startsWith(expected.substring(0, expected.length() - 1))) return false; } else { if (!path.equals(expected)) return false; } } else if (attributes.containsAttribute(attrName)) { boolean matched = false; for (String actual : attributes.getAttributeValues(attrName)) { int prefixLength = expected.indexOf('*'); if (prefixLength >= 0 && prefixLength < actual.length()) { String shortened = expected.substring(0, prefixLength); actual = actual.substring(0, prefixLength); if (actual.equals(shortened)) { <START> matched = true; <END> } } else if (actual.equals(expected)) { matched = true; } } if (!matched) { return false; } } else if (!attributes.containsAttribute(attrName)) { return false; } } else { if (attributes.getAttributeValues(s).size() == 0) { return false; } } } return true; }</code><technical_language>a break optimize loop</technical_language>

Target:
public static boolean matches(Resource resource, List<String> queries) { if (resource == null) return false; if (queries == null || queries.size() == 0) return true; ResourceAttributes attributes = resource.getAttributes(); String path = resource.getPath() + resource.getName(); for (String s : queries) { int delim = s.indexOf("="); if (delim != -1) { String attrName = s.substring(0, delim); String expected = s.substring(delim + 1); if (attrName.equals(LinkFormat.LINK)) { if (expected.endsWith("*")) { if (!path.startsWith(expected.substring(0, expected.length() - 1))) return false; } else { if (!path.equals(expected)) return false; } } else if (attributes.containsAttribute(attrName)) { boolean matched = false; for (String actual : attributes.getAttributeValues(attrName)) { int prefixLength = expected.indexOf('*'); if (prefixLength >= 0 && prefixLength < actual.length()) { String shortened = expected.substring(0, prefixLength); actual = actual.substring(0, prefixLength); if (actual.equals(shortened)) { matched = true; break; } } else if (actual.equals(expected)) { matched = true; break; } } if (!matched) { return false; } } else if (!attributes.containsAttribute(attrName)) { return false; } } else { if (attributes.getAttributeValues(s).size() == 0) { return false; } } } return true; }
Source:
<code>public void visitConditionalExpression(ConditionalExpressionTree conditionalExpression) { <START> checkNull(conditionalExpression.trueExpression()); <END> checkNull(conditionalExpression.falseExpression()); super.visitConditionalExpression(conditionalExpression); }</code><technical_language>This is a bit strong. perform verification of true false expressions if type of expression is Optional. current state, code trigger issue, do optional is perfectly valid: public Optional<String> bar(booleab b) { Object myObject = b ? null : new Object(); return Optional.empty(); } following, work: if (conditionalExpression.symbolType().is(OPTIONAL)) { checkNull(conditionalExpression.trueExpression()); checkNull(conditionalExpression.falseExpression()); }</technical_language>

Target:
public void visitConditionalExpression(ConditionalExpressionTree conditionalExpression) { if (conditionalExpression.symbolType().is(OPTIONAL)) { checkNull(conditionalExpression.trueExpression()); checkNull(conditionalExpression.falseExpression()); } super.visitConditionalExpression(conditionalExpression); }
Source:
<code><START> public long getId() { <END> return fId; }</code><technical_language>remain int</technical_language>

Target:
public int getId() { return fId; }
Source:
<code><START> public void typeBirthdate(String month, String day, String year) { <END> waitForElementByElement(signupBirthdate); scrollAndClick((signupBirthdate)); waitForElementByElement(signupBirthMonth); scrollAndClick((signupBirthMonth)); signupBirthMonth.sendKeys(month); waitForElementByElement(signupBirthDay); signupBirthDay.click(); signupBirthDay.sendKeys(day); waitForElementByElement(signupBirthYear); signupBirthYear.click(); signupBirthYear.sendKeys(year); }</code><technical_language>get rid of this "void"s more chaining, public MobileSignupPageObject typePassword(String password) { waitForElementByElement(signupPassword); signupPassword.sendKeys(password); return this; }</technical_language>

Target:
public MobileSignupPageObject typeBirthdate(String month, String day, String year) { waitForElementByElement(signupBirthdate); scrollAndClick((signupBirthdate)); waitForElementByElement(signupBirthMonth); scrollAndClick((signupBirthMonth)); signupBirthMonth.sendKeys(month); waitForElementByElement(signupBirthDay); signupBirthDay.click(); signupBirthDay.sendKeys(day); waitForElementByElement(signupBirthYear); signupBirthYear.click(); signupBirthYear.sendKeys(year); return this; }
Source:
<code>private void wrapValue(final AssetRecord assetRecord, final String userValue, final String userType) { requireNonNull(assetRecord, message.assetRecordNonNull()); requireNonNull(userValue, message.valueNonNull()); requireNonNull(userType, message.typeNonNull()); final DataType dataType = DataType.getDataType(userType); TypedValue<?> value = null; try { if (INTEGER == dataType) { value = TypedValues.newIntegerValue(Integer.parseInt(userValue)); } if (BOOLEAN == dataType) { value = TypedValues.newBooleanValue(Boolean.parseBoolean(userValue)); } if (FLOAT == dataType) { <START> value = TypedValues.newFloatValue(Byte.parseByte(userValue)); <END> } if (DOUBLE == dataType) { value = TypedValues.newDoubleValue(Double.parseDouble(userValue)); } if (LONG == dataType) { value = TypedValues.newLongValue(Long.parseLong(userValue)); } if (STRING == dataType) { value = TypedValues.newStringValue(userValue); } } catch (final NumberFormatException nfe) { throw nfe; } assetRecord.setValue(value); }</code><technical_language>Float.parseFloat</technical_language>

Target:
private void wrapValue(final AssetRecord assetRecord, final String userValue, final String userType) { requireNonNull(assetRecord, message.assetRecordNonNull()); requireNonNull(userValue, message.valueNonNull()); requireNonNull(userType, message.typeNonNull()); final DataType dataType = DataType.getDataType(userType); TypedValue<?> value = null; try { if (INTEGER == dataType) { value = TypedValues.newIntegerValue(Integer.parseInt(userValue)); } if (BOOLEAN == dataType) { value = TypedValues.newBooleanValue(Boolean.parseBoolean(userValue)); } if (FLOAT == dataType) { value = TypedValues.newFloatValue(Float.parseFloat(userValue)); } if (DOUBLE == dataType) { value = TypedValues.newDoubleValue(Double.parseDouble(userValue)); } if (LONG == dataType) { value = TypedValues.newLongValue(Long.parseLong(userValue)); } if (STRING == dataType) { value = TypedValues.newStringValue(userValue); } } catch (final NumberFormatException nfe) { throw nfe; } assetRecord.setValue(value); }
Source:
<code>public ApacheDirective getDirective() { <START> ApacheDirectiveTree tree = resourceContext.getParentResourceComponent().parseFullConfiguration(); <END> String resourceKey = resourceContext.getResourceKey(); int snmpIdx = getWwwServiceIndex(); if (snmpIdx < 1) { throw new IllegalStateException("Could not determine the index of the virtual host [" + resourceKey + "] in the runtime configuration. This is very strange."); } if (snmpIdx == 1) { return tree.getRootNode(); } final List<ApacheDirective> allVhosts = tree.search("/<VirtualHost"); int idx = allVhosts.size() - snmpIdx + 1; return allVhosts.get(idx); }</code><technical_language>call parseRuntimeConfiguration(true) instead of parsing full config. reason is getWWWServiceIndex() runtime config, too, determine SNMP index. of conditional directives IfModule, IfDefine IfVersion, number of vhosts discovered methods differ get a wrong vhost directive IndexOutOfBoundsException</technical_language>

Target:
public ApacheDirective getDirective() { ApacheDirectiveTree tree = resourceContext.getParentResourceComponent().parseRuntimeConfiguration(true, true); String resourceKey = resourceContext.getResourceKey(); int snmpIdx = getWwwServiceIndex(); if (snmpIdx < 1) { throw new IllegalStateException("Could not determine the index of the virtual host [" + resourceKey + "] in the runtime configuration. This is very strange."); } if (snmpIdx == 1) { return tree.getRootNode(); } final List<ApacheDirective> allVhosts = tree.search("/<VirtualHost"); int idx = allVhosts.size() - snmpIdx + 1; return allVhosts.get(idx); }
Source:
<code>public ProjectileSource getShooter() { <START> if (projectileSource != null) { <END> return this.projectileSource; } if (this.owner instanceof ProjectileSource) { return (ProjectileSource) this.owner; } return ProjectileSource.UNKNOWN; }</code><technical_language>this</technical_language>

Target:
public ProjectileSource getShooter() { if (this.projectileSource != null) { return this.projectileSource; } if (this.owner instanceof ProjectileSource) { return (ProjectileSource) this.owner; } return ProjectileSource.UNKNOWN; }
Source:
<code>Object invoke(InvocationContext ctx) throws Exception { if (isRequestContextActive()) { return ctx.proceed(); } else { Object dummyPayload = new Object(); try { requestContext.activate(); <START> beanManager.fireEvent(dummyPayload, InitializedLiteral.REQUEST); <END> return ctx.proceed(); } finally { requestContext.invalidate(); beanManager.fireEvent(dummyPayload, BeforeDestroyed.Literal.REQUEST); requestContext.deactivate(); beanManager.fireEvent(dummyPayload, DestroyedLiteral.REQUEST); } } }</code><technical_language>of org.jboss.weld.event.FastEvent..</technical_language>

Target:
Object invoke(InvocationContext ctx) throws Exception { if (isRequestContextActive()) { return ctx.proceed(); } else { Object dummyPayload = new Object(); try { requestContext.activate(); fastEventInit.fire(dummyPayload); return ctx.proceed(); } finally { requestContext.invalidate(); fastEventBeforeDestroyed.fire(dummyPayload); requestContext.deactivate(); fastEventDestroyed.fire(dummyPayload); } } }
Source:
<code>public void setup() { <START> TestVectorsLatency data = new TestVectorsLatency(6); <END> TreeMapStore<TestInterval> latencyDataStore = new TreeMapStore<>(); for (TestInterval interval : data.getDataList()) { assertNotNull(interval); latencyDataStore.addElement(interval); } fData = latencyDataStore; fIntersecting = latencyDataStore; }</code><technical_language>tests in specific input data used. I TestVectorsLatency is useful. locally writing tests, final version of TestIntersectingElements (and eventual others) setup input data directly</technical_language>

Target:
public void setup() { List<TestInterval> data = new ArrayList<>(); data.add(new TestInterval(5, 10)); data.add(new TestInterval(16, 18)); data.add(new TestInterval(30, 34)); TreeMapStore<TestInterval> treeMapStore = new TreeMapStore<>(); for (TestInterval interval : data) { assertNotNull(interval); treeMapStore.addElement(interval); } fData = treeMapStore; fIntersecting = treeMapStore; }
Source:
<code>public <T> T unwrap(Class<T> iface) throws SQLException { if (!iface.isInstance(this)) { <START> throw new SQLExceptionInfo.Builder(SQLExceptionCodeEnum.CLASS_NOT_UNWRAPPABLE) <END> .setMessage(this.getClass().getName() + " not unwrappable from " + iface.getName()) .build().buildException(); } return (T)this; }</code><technical_language>MySQL error code this: 533 throw SQLError.createSQLException("Unable unwrap " 534 + iface.toString(), SQLError.SQL_STATE_ILLEGAL_ARGUMENT, this.exceptionInterceptor);</technical_language>

Target:
public <T> T unwrap(Class<T> iface) throws SQLException { if (!iface.isInstance(this)) { throw new SQLExceptionInfo.Builder(SQLExceptionCode.CLASS_NOT_UNWRAPPABLE) .setMessage(this.getClass().getName() + " not unwrappable from " + iface.getName()) .build().buildException(); } return (T)this; }
Source:
<code>public void execute(CloudStackClient cloudStackClient, Pool pool, DelegateExecution execution) { if (execution.getVariable(ProcessVariables.NETWORK_ID) != null) { LOG.warn("Network process variable ({}) will be overwritten!", ProcessVariables.NETWORK_ID); } Network network; final String existingNetwork = pool.getNetwork().getOption(NetworkOptions.EXISTING_NETWORK_ID); if (existingNetwork != null) { network = checkNotNull(cloudStackClient.getNetworkClient().getNetwork(existingNetwork), "Network with id " + existingNetwork + " does not exist"); } else { final String networkName = Networks.formatNameFromBusinessKey(execution.getProcessBusinessKey()); final String zoneId = pool.getProvider().getOption(ProviderOptions.ZONE_ID); <START> final String networkOffering = pool.getProvider().getOption(ProviderOptions.NETWORK_OFFERING); <END> try { network = Networks.getByName(cloudStackClient, networkName); LOG.info("Network with name exists.", networkName); } catch (NoSuchElementException e) { LOG.info(String.format("Creating network %s in zone %s with offering %s", networkName, zoneId, networkOffering)); network = cloudStackClient.getNetworkClient().createNetworkInZone(zoneId, networkOffering, networkName, networkName, CreateNetworkOptions.NONE); } } LOG.info("Storing network id in process variable {}", network.getId(), ProcessVariables.NETWORK_ID); execution.setVariable(ProcessVariables.NETWORK_ID, network.getId()); }</code><technical_language>NETWORK_OFFERING NETWORK_OFFERING_ID</technical_language>

Target:
public void execute(CloudStackClient cloudStackClient, Pool pool, DelegateExecution execution) { if (execution.getVariable(ProcessVariables.NETWORK_ID) != null) { LOG.warn("Network process variable ({}) will be overwritten!", ProcessVariables.NETWORK_ID); } Network network; final String existingNetwork = pool.getNetwork().getOption(NetworkOptions.EXISTING_NETWORK_ID); if (existingNetwork != null) { network = checkNotNull(cloudStackClient.getNetworkClient().getNetwork(existingNetwork), "Network with id " + existingNetwork + " does not exist"); } else { final String networkName = Networks.formatNameFromBusinessKey(execution.getProcessBusinessKey()); final String zoneId = pool.getProvider().getOption(ProviderOptions.ZONE_ID); final String networkOfferingId = pool.getProvider().getOption(ProviderOptions.NETWORK_OFFERING_ID); try { network = Networks.getByName(cloudStackClient, networkName); LOG.info("Network with name exists.", networkName); } catch (NoSuchElementException e) { LOG.info(String.format("Creating network %s in zone %s with offering %s", networkName, zoneId, networkOfferingId)); network = cloudStackClient.getNetworkClient().createNetworkInZone(zoneId, networkOfferingId, networkName, networkName, CreateNetworkOptions.NONE); } } LOG.info("Storing network id in process variable {}", network.getId(), ProcessVariables.NETWORK_ID); execution.setVariable(ProcessVariables.NETWORK_ID, network.getId()); }
Source:
<code>private void giveItem(CommandSender sender, Player p, SlimefunItem sfItem, String[] args) { if (sfItem instanceof MultiBlockMachine) { SlimefunPlugin.getLocalization().sendMessage(sender, "guide.cheat.no-multiblocks"); } else { int amount = parseAmount(args); if (amount > 0) { SlimefunPlugin.getLocalization().sendMessage(p, "messages.given-item", true, msg -> msg.replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); HashMap<Integer,ItemStack> excess = p.getInventory().addItem(new CustomItem(sfItem.getItem(), amount)); if (SlimefunPlugin.getCfg().getBoolean("options.drop-excess-sf-give-items") && !excess.isEmpty()) { for (ItemStack is : excess.values()) { <START> p.getWorld().dropItemNaturally(p.getLocation(), is); <END> } } SlimefunPlugin.getLocalization().sendMessage(sender, "messages.give-item", true, msg -> msg.replace(PLACEHOLDER_PLAYER, args[1]).replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); } else { SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-valid-amount", true, msg -> msg.replace(PLACEHOLDER_AMOUNT, args[3])); } } }</code><technical_language>I Naturally here, give item offset jump in a random direction</technical_language>

Target:
private void giveItem(CommandSender sender, Player p, SlimefunItem sfItem, String[] args) { if (sfItem instanceof MultiBlockMachine) { SlimefunPlugin.getLocalization().sendMessage(sender, "guide.cheat.no-multiblocks"); } else { int amount = parseAmount(args); if (amount > 0) { SlimefunPlugin.getLocalization().sendMessage(p, "messages.given-item", true, msg -> msg.replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); Map<Integer,ItemStack> excess = p.getInventory().addItem(new CustomItem(sfItem.getItem(), amount)); if (SlimefunPlugin.getCfg().getBoolean("options.drop-excess-sf-give-items") && !excess.isEmpty()) { for (ItemStack is : excess.values()) { p.getWorld().dropItem(p.getLocation(), is); } } SlimefunPlugin.getLocalization().sendMessage(sender, "messages.give-item", true, msg -> msg.replace(PLACEHOLDER_PLAYER, args[1]).replace(PLACEHOLDER_ITEM, sfItem.getItemName()).replace(PLACEHOLDER_AMOUNT, String.valueOf(amount))); } else { SlimefunPlugin.getLocalization().sendMessage(sender, "messages.not-valid-amount", true, msg -> msg.replace(PLACEHOLDER_AMOUNT, args[3])); } } }
Source:
<code><START> private static Optional<ExecutableElement> findBuildMethod( <END> TypeElement autoValueClass, TypeElement builderElement) { List<ExecutableElement> methods = ElementFilter.methodsIn(builderElement.getEnclosedElements()) .stream() .filter(e -> !MoreElements.hasModifiers(STATIC, PRIVATE).apply(e)) .filter(e -> e.getParameters().isEmpty()) .filter(e -> MoreTypes.equivalence().equivalent(e.getReturnType(), autoValueClass.asType())) .collect(Collectors.toList()); if (methods.isEmpty()) { return Optional.empty(); } List<ExecutableElement> annotatedMethods = methods.stream() .filter(e -> MoreElements.isAnnotationPresent(e, GsonBuild.class)) .collect(Collectors.toList()); if (annotatedMethods.size() > 1) { return Optional.empty(); } else if (annotatedMethods.size() == 1) { return Optional.of(Iterables.getOnlyElement(annotatedMethods)); } return methods.stream() .filter(e -> e.getSimpleName().contentEquals("build")) .findFirst(); }</code><technical_language>This follow method AutoValue identify build methods in a builder. is, a non-private, non-static method args returns annotated type. method need named build (create is another common option). If is more (both create build createWithDefaults createByIncrementingCount, etc) annotation decide one</technical_language>

Target:
private static ExecutableElement findBuildMethod( TypeElement autoValueClass, TypeElement builderElement) { Set<ExecutableElement> methods = ElementFilter.methodsIn(builderElement.getEnclosedElements()) .stream() .filter(MoreElements.hasModifiers(STATIC, PRIVATE).negate()) .filter(e -> e.getParameters().isEmpty()) .filter(e -> MoreTypes.equivalence().equivalent(e.getReturnType(), autoValueClass.asType())) .collect(Collectors.toSet()); if (methods.size() == 1) { return Iterables.getOnlyElement(methods); } else { Set<ExecutableElement> annotatedMethods = methods.stream() .filter(e -> MoreElements.isAnnotationPresent(e, AutoValueGsonBuild.class)) .collect(Collectors.toSet()); if (annotatedMethods.size() == 1) { return Iterables.getOnlyElement(annotatedMethods); } } return null; }
Source:
<code>public void selectCompositeAutocompleteProposal(String item) { seleniumWebDriverHelper.waitAndClick( <START> By.xpath(format(AUTOCOMPLETE_CONTAINER + "/li/span[text()='%s']", item))); <END> }</code><technical_language>reuse this method need public void selectAutocompleteProposal(String item) { seleniumWebDriverHelper.waitAndClick( By.xpath(format(AUTOCOMPLETE_CONTAINER + "/li/span[text()='%s']", item))); } <LINK_0></technical_language>

Target:
public void selectCompositeAutocompleteProposal(String item) { seleniumWebDriverHelper.waitAndClick( By.xpath(format(AUTOCOMPLETE_CONTAINER + "/li/span[.='%s']", item))); }
Source:
<code>private static void validateAgreement(String agreement, List<String> validationErrors) { if (!isValid(agreement, AGREEMENT_ID_MAX_LENGTH)){ <START> validationErrors.add("agreement"); <END> } }</code><technical_language>I changed this line I "agreement_id"</technical_language>

Target:
private static void validateAgreement(String agreement, List<String> validationErrors) { if (!isValid(agreement, AGREEMENT_ID_MAX_LENGTH)){ validationErrors.add("agreement_id"); } }