auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void stopContainer(String container, long timeout, TimeUnit timeunit) throws IOException { final List<Pair<String, ?>> headers = new ArrayList<>(2); <START> headers.add(Pair.of("Content-Type", "text/plain")); <END> headers.add(Pair.of("Content-Length", 0)); try (DockerConnection connection = openConnection(dockerDaemonUri).method("POST") .path("/containers/" + container + "/stop") .query("t", timeunit.toSeconds(timeout)) .headers(headers)) { final DockerResponse response = connection.request(); final int status = response.getStatus(); if (!(204 == status || 304 == status)) { throw new DockerException(getDockerExceptionMessage(response), status); } } }</code><technical_language>constant "text/plain"</technical_language>

Target:
public void stopContainer(String container, long timeout, TimeUnit timeunit) throws IOException { final List<Pair<String, ?>> headers = new ArrayList<>(2); headers.add(Pair.of("Content-Type", MediaType.TEXT_PLAIN)); headers.add(Pair.of("Content-Length", 0)); try (DockerConnection connection = openConnection(dockerDaemonUri).method("POST") .path("/containers/" + container + "/stop") .query("t", timeunit.toSeconds(timeout)) .headers(headers)) { final DockerResponse response = connection.request(); final int status = response.getStatus(); if (!(NO_CONTENT.getStatusCode() == status || NOT_MODIFIED.getStatusCode() == status)) { throw new DockerException(getDockerExceptionMessage(response), status); } } }
Source:
<code>public void onCheckoutClicked() { String name = selectedBranch.getDisplayName(); if (name == null) { return; } final CheckoutRequest checkoutRequest = dtoFactory.createDto(CheckoutRequest.class); if (selectedBranch.isRemote()) { checkoutRequest.setTrackBranch(selectedBranch.getDisplayName()); } else { checkoutRequest.setName(selectedBranch.getDisplayName()); } final String path = project.getRootProject().getPath(); service.checkout(workspaceId, project.getRootProject(), checkoutRequest, new AsyncRequestCallback<String>() { @Override protected void onSuccess(String result) { getBranches(); projectExplorer.reloadChildren(); updateOpenedFiles(); <START> projectService.getProject (appContext.getWorkspace().getId(), path, <END> new AsyncRequestCallback<ProjectConfigDto>( dtoUnmarshallerFactory.newUnmarshaller(ProjectConfigDto.class)) { @Override protected void onSuccess(ProjectConfigDto result) { eventBus.fireEvent(new ProjectUpdatedEvent(path, result)); } @Override protected void onFailure(Throwable exception) { notificationManager .notify(exception.getLocalizedMessage(), FAIL, true, project.getProjectConfig()); } }); } @Override protected void onFailure(Throwable exception) { printGitMessage(exception.getMessage()); } }); }</code><technical_language>Please reformat it. workspaceId variable <LINK_0></technical_language>

Target:
public void onCheckoutClicked() { String name = selectedBranch.getDisplayName(); if (name == null) { return; } final CheckoutRequest checkoutRequest = dtoFactory.createDto(CheckoutRequest.class); if (selectedBranch.isRemote()) { checkoutRequest.setTrackBranch(selectedBranch.getDisplayName()); } else { checkoutRequest.setName(selectedBranch.getDisplayName()); } final String path = project.getRootProject().getPath(); service.checkout(workspaceId, project.getRootProject(), checkoutRequest, new AsyncRequestCallback<String>() { @Override protected void onSuccess(String result) { getBranches(); projectExplorer.reloadChildren(); updateOpenedFiles(); projectService.getProject (workspaceId, path, new AsyncRequestCallback<ProjectConfigDto>( dtoUnmarshallerFactory.newUnmarshaller(ProjectConfigDto.class)) { @Override protected void onSuccess(ProjectConfigDto result) { eventBus.fireEvent(new ProjectUpdatedEvent(path, result)); } @Override protected void onFailure(Throwable exception) { notificationManager .notify(exception.getLocalizedMessage(), FAIL, true, project.getProjectConfig()); } }); } @Override protected void onFailure(Throwable exception) { printGitMessage(exception.getMessage()); } }); }
Source:
<code><START> void validateStringToSearch() throws IllegalArgumentException { <END> if (stringToSearch == null) { throw new IllegalArgumentException("String to search must be non-null."); } else if (!stringToSearch.chars().allMatch(Character::isDigit)) { throw new IllegalArgumentException("String to search may only contain digits."); } }</code><technical_language>I private methods stay private. Do agree? :slightly_smiling_face:</technical_language>

Target:
private void validateStringToSearch() throws IllegalArgumentException { if (stringToSearch == null) { throw new IllegalArgumentException("String to search must be non-null."); } else if (!stringToSearch.chars().allMatch(Character::isDigit)) { throw new IllegalArgumentException("String to search may only contain digits."); } }
Source:
<code>public DataTransactionResult removeFrom(ValueContainer<?> container) { if (container instanceof EntityPlayer) { final DataTransactionBuilder builder = DataTransactionBuilder.builder(); builder.replace(getApiValueFromContainer(container).get().asImmutable()); builder.replace(container.getValue(Keys.CAN_FLY).get().asImmutable()); <START> ((EntityPlayer) container).capabilities.allowFlying = false; <END> ((EntityPlayer) (container)).sendPlayerAbilities(); return builder.result(DataTransactionResult.Type.SUCCESS).build(); } return DataTransactionBuilder.failNoData(); }</code><technical_language>setting false, removing supported</technical_language>

Target:
public DataTransactionResult removeFrom(ValueContainer<?> container) { return DataTransactionBuilder.failNoData(); }
Source:
<code>public void testSetBrightness() { <START> mDevicePolicyManager.setSystemSetting(ADMIN_RECEIVER_COMPONENT, Settings.System.SCREEN_BRIGHTNESS_MODE, "0"); <END> testSetBrightnessWithValue(TEST_BRIGHTNESS_1); testSetBrightnessWithValue(TEST_BRIGHTNESS_2); }</code><technical_language>restore original setting test</technical_language>

Target:
public void testSetBrightness() { final int mode = Settings.System.getInt(mContext.getContentResolver(), Settings.System.SCREEN_BRIGHTNESS_MODE, SCREEN_BRIGHTNESS_MODE_AUTOMATIC); if(mode==1) { mDevicePolicyManager.setSystemSetting(ADMIN_RECEIVER_COMPONENT, Settings.System.SCREEN_BRIGHTNESS_MODE, "0"); testSetBrightnessWithValue(TEST_BRIGHTNESS_1); testSetBrightnessWithValue(TEST_BRIGHTNESS_2); mDevicePolicyManager.setSystemSetting(ADMIN_RECEIVER_COMPONENT, Settings.System.SCREEN_BRIGHTNESS_MODE, "1"); } else { testSetBrightnessWithValue(TEST_BRIGHTNESS_1); testSetBrightnessWithValue(TEST_BRIGHTNESS_2); } }
Source:
<code>private static StoragePool createNewStoragePool() { <START> StoragePool pool = createBasicPool(); <END> pool.setcompatibility_version(VERSION_1_1); return pool; }</code><technical_language>need to: pool.setIsLocal(false);</technical_language>

Target:
private static StoragePool createNewStoragePool() { StoragePool pool = createBasicPool(); pool.setIsLocal(false); pool.setcompatibility_version(VERSION_1_1); return pool; }
Source:
<code>private void toggleCheckboxAndWriteBackDefaultValue(Address address, String attributeName) throws Exception { <START> final ModelNodeResult value = operations.readAttribute(address, attributeName); <END> value.assertSuccess(); final boolean booleanValue = value.booleanValue(); try { new ConfigChecker.Builder(client, address) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.CHECKBOX, attributeName, !booleanValue) .verifyFormSaved() .verifyAttribute(attributeName, !booleanValue); new ConfigChecker.Builder(client, address) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.CHECKBOX, attributeName, booleanValue) .verifyFormSaved() .verifyAttribute(attributeName, booleanValue); } finally { operations.writeAttribute(address, attributeName, value.value()); } }</code><technical_language>I suggest rename -> originalReadAttributeResult code more clear avoid statements value.value()</technical_language>

Target:
private void toggleCheckboxAndWriteBackDefaultValue(Address address, String attributeName) throws Exception { final ModelNodeResult originalValueResult = operations.readAttribute(address, attributeName); originalValueResult.assertSuccess(); final boolean originalBooleanValue = originalValueResult.booleanValue(); try { new ConfigChecker.Builder(client, address) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.CHECKBOX, attributeName, !originalBooleanValue) .verifyFormSaved() .verifyAttribute(attributeName, !originalBooleanValue); new ConfigChecker.Builder(client, address) .configFragment(page.getConfigFragment()) .editAndSave(ConfigChecker.InputType.CHECKBOX, attributeName, originalBooleanValue) .verifyFormSaved() .verifyAttribute(attributeName, originalBooleanValue); } finally { operations.writeAttribute(address, attributeName, originalValueResult.value()); } }
Source:
<code>static Arbitrary<LocalDateTime> localDateTime(LocalDateTime median, ChronoUnit unit) { <START> return size -> random -> Gen.choose(median.minus(size, unit), median.plus(size, unit)).apply(random); <END> }</code><technical_language>move logic Gen Arbitrary this: java Objects.requireNonNull(median, "median is null"); Objects.requireNonNull(unit, "unit is null"); return size -> { final LocalDateTime start = median.minus(size, unit); final LocalDateTime end = median.plus(size, unit); final long duration = Duration.between(start, end).toMillis(); final Gen<Long> = Gen.choose(0, duration); return random -> start.plus(from.apply(random), ChronoUnit.MILLIS); } _(Note: name parameters in error messages)_ Some Gen.localDateTime tests obsolete need moved ArbitraryTest..</technical_language>

Target:
static Arbitrary<LocalDateTime> localDateTime(LocalDateTime median, ChronoUnit unit) { Objects.requireNonNull(median, "median is null"); Objects.requireNonNull(unit, "unit is null"); return size -> { if(size == 0) { return Gen.of(median); } final LocalDateTime start = median.minus(size, unit); final LocalDateTime end = median.plus(size, unit); final long duration = Duration.between(start, end).toMillis(); final Gen<Long> from = Gen.choose(0, duration); return random -> start.plus(from.apply(random), ChronoUnit.MILLIS); }; }
Source:
<code>public void deleteFromSubject(String tenant, String subject) { <START> LOGGER.debug("Deleting all the content from tenant [" + tenant + "]" <END> + " and subject [" + subject + "]"); String hql = "DELETE FROM Policy " + "WHERE subject = :subject_id"; Query query = this.currentSession().createQuery(hql); query.setParameter("subject_id", subject); int result = query.executeUpdate(); }</code><technical_language><LINK_0></technical_language>

Target:
public void deleteFromSubject(String tenant, String subject) { LOGGER.debug("Deleting all the content from tenant [{}]" + " and subject [{}]", tenant, subject); String hql = "DELETE FROM Policy " + "WHERE subject = :subject_id"; Query query = this.currentSession().createQuery(hql); query.setParameter("subject_id", subject); int result = query.executeUpdate(); }
Source:
<code>public void PlayingVideoTests_001_ooyala() { VideoComponentObject video; String providerName = "ooyala"; String articleName = "VideoOoyala"; ArticlePageObject article = base.openArticleByName(wikiURL, articleName); article.verifyVideo(); Integer videoWidth = article.getVideoWidth(); <START> if ( videoWidth > 400 ) { <END> video = article.clickThumbnailVideoInline(); article.verifyVideoAutoplay(providerName); } else { LightboxComponentObject lightbox = article.clickThumbnailVideo(); lightbox.verifyLightboxVideo(); lightbox.verifyVideoAutoplay(providerName); video = lightbox.getVideoPlayer(); videoWidth = videoWidthLightbox; } video.verifyVideoEmbedWidth(videoWidth); video.verifyVideoOoyalaAgeGate(); video.verifyVideoObjectVisible(); video.verifyVideoOoyalaEmbed(); }</code><technical_language>want avoid magic number consider 400 set some meaningful constant</technical_language>

Target:
public void PlayingVideoTests_001_ooyala() { String providerName = "ooyala"; String articleName = "VideoOoyala"; ArticlePageObject article = base.openArticleByName(wikiURL, articleName); article.verifyVideo(); VideoComponentObject video = article.clickThumbnailVideo(providerName); video.verifyVideoEmbedWidth(); video.verifyVideoOoyalaAgeGate(); video.verifyVideoObjectVisible(); video.verifyVideoOoyalaEmbed(); }
Source:
<code>private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { <START> if (a.hashes.get(ai) != b.hashes.get(bi)) { <END> return false; } int as = a.lines.get(ai); int bs = b.lines.get(bi); final int ae = a.lines.get(ai + 1); final int be = b.lines.get(bi + 1); while (as < ae && bs < be) { while (as < ae - 1 && RawCharUtil.isWhitespace(a.content[as])) { as++; } while (bs < be - 1 && RawCharUtil.isWhitespace(b.content[bs])) { bs++; } if (a.content[as] != b.content[bs]) { return false; } as++; bs++; } while (as < ae) { if (!RawCharUtil.isWhitespace(a.content[as++])) { return false; } } while (bs < be) { if (!RawCharUtil.isWhitespace(b.content[bs++])) { return false; } } return true; }</code><technical_language>Style-nit: In JGit put curly braces single line statements</technical_language>

Target:
private static boolean equals(final RawText a, final int ai, final RawText b, final int bi) { if (a.hashes.get(ai) != b.hashes.get(bi)) return false; int as = a.lines.get(ai); int bs = b.lines.get(bi); int ae = a.lines.get(ai + 1); int be = b.lines.get(bi + 1); as = trimLeadingWhitespace(a.content, as, ae); bs = trimLeadingWhitespace(b.content, bs, be); ae = trimTrailingWhitespace(a.content, as, ae); be = trimTrailingWhitespace(b.content, bs, be); while (as < ae && bs < be) { byte ac = a.content[as]; byte bc = b.content[bs]; while (as < ae - 1 && isWhitespace(ac)) { as++; ac = a.content[as]; } while (bs < be - 1 && isWhitespace(bc)) { bs++; bc = b.content[bs]; } if (ac != bc) return false; as++; bs++; } return true; }
Source:
<code>public Color getForeground(Object element, int columnIndex) { String legendItemText = (String) element; <START> if (legendItemText.equals("Population > 1,000,000") | legendItemText.equals("Population > 50,000")) { <END> return Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); } return null; }</code><technical_language>I guess ||</technical_language>

Target:
public Color getForeground(Object element, int columnIndex) { String legendItemText = (String) element; if (legendItemText.equals("Population > 1,000,000") || legendItemText.equals("Population > 50,000")) { return Display.getCurrent().getSystemColor(SWT.COLOR_WHITE); } return null; }
Source:
<code>protected abstract boolean doRemoveInternal(final K key) throws StoreAccessException; <START> <END> @Override public void clear() { clearObserver.begin(); statusTransitioner.checkAvailable(); try { store.clear(); clearObserver.end(ClearOutcome.SUCCESS); } catch (StoreAccessException e) { clearObserver.end(ClearOutcome.FAILURE); resilienceStrategy.clearFailure(e); } }</code><technical_language>this need communicate memoized function called in loader-writer specific subclass double write</technical_language>

Target:
protected abstract boolean doRemoveInternal(final K key) throws StoreAccessException; @Override public void clear() { clearObserver.begin(); try { statusTransitioner.checkAvailable(); try { store.clear(); clearObserver.end(ClearOutcome.SUCCESS); } catch (StoreAccessException e) { resilienceStrategy.clearFailure(e); clearObserver.end(ClearOutcome.FAILURE); } } catch (Throwable e) { clearObserver.end(ClearOutcome.FAILURE); throw e; } }
Source:
<code>static boolean deleteRealm(final RealmConfiguration configuration) { <START> final String management = ".management"; <END> final AtomicBoolean realmDeleted = new AtomicBoolean(true); RealmCache.invokeWithGlobalRefCount(configuration, new RealmCache.Callback() { @Override public void onResult(int count) { if (count != 0) { throw new IllegalStateException("It's not allowed to delete the file associated with an open Realm. " + "Remember to close() all the instances of the Realm before deleting its file: " + configuration.getPath()); } String canonicalPath = configuration.getPath(); File realmFolder = configuration.getRealmFolder(); String realmFileName = configuration.getRealmFileName(); List<File> filesToDelete = Arrays.asList(new File(canonicalPath), new File(realmFolder, realmFileName + ".lock"), new File(realmFolder, realmFileName + ".log_a"), new File(realmFolder, realmFileName + ".log_b"), new File(realmFolder, realmFileName + ".log")); for (File fileToDelete : filesToDelete) { if (fileToDelete.exists()) { boolean deleteResult = fileToDelete.delete(); if (!deleteResult) { realmDeleted.set(false); RealmLog.w("Could not delete the file " + fileToDelete); } } } File managementFolder = new File(realmFolder, realmFileName + management); if (managementFolder.exists()) { filesToDelete = Arrays.asList( new File(managementFolder, realmFileName + ".lock"), new File(managementFolder, realmFileName + ".log_a"), new File(managementFolder, realmFileName + ".log_b"), new File(managementFolder, realmFileName + ".log")); for (File fileToDelete : filesToDelete) { if (fileToDelete.exists()) { boolean deleteResult = fileToDelete.delete(); if (!deleteResult) { realmDeleted.set(false); RealmLog.w("Could not delete the file " + fileToDelete); } } } boolean deleteResult = managementFolder.delete(); if (!deleteResult) { realmDeleted.set(false); RealmLog.w("Could not delete the folder " + managementFolder); } } } }); return realmDeleted.get(); }</code><technical_language>related datetime, core upgrade in general</technical_language>

Target:
static boolean deleteRealm(final RealmConfiguration configuration) { final String management = ".management"; final AtomicBoolean realmDeleted = new AtomicBoolean(true); RealmCache.invokeWithGlobalRefCount(configuration, new RealmCache.Callback() { @Override public void onResult(int count) { if (count != 0) { throw new IllegalStateException("It's not allowed to delete the file associated with an open Realm. " + "Remember to close() all the instances of the Realm before deleting its file: " + configuration.getPath()); } String canonicalPath = configuration.getPath(); File realmFolder = configuration.getRealmFolder(); String realmFileName = configuration.getRealmFileName(); File managementFolder = new File(realmFolder, realmFileName + management); realmDeleted.set(deletes(realmFolder.getPath()+ "/" + realmFileName + management, managementFolder, realmFileName)); realmDeleted.set(realmDeleted.get() && deletes(canonicalPath, realmFolder, realmFileName)); } }); return realmDeleted.get(); }
Source:
<code>public String[] getLocations() throws IOException, InterruptedException { if (locations == null) { Map<String, Integer> hosts = new HashMap<String, Integer>(); for (InputSplit s : splits) { String[] hints = s.getLocations(); if (hints != null) { for (String host : hints) { Integer value = hosts.get(host); if (value == null) { value = 0; } value++; hosts.put(host, value); } } } if (hosts.size() < 5) { locations = hosts.keySet().toArray(new String[hosts.size()]); } else { Queue<Pair<String, Integer>> queue = new PriorityQueue<Pair<String, Integer>>(hosts.size(), new Comparator<Pair<String, Integer>>() { public int compare(Pair<String, Integer> o1, Pair<String, Integer> o2) { return -o1.getSecond().compareTo(o2.getSecond()); } }); for (Map.Entry<String, Integer> entry : hosts.entrySet()) { queue.add(new Pair<String, Integer>(entry.getKey(), entry.getValue())); } locations = new String[] { queue.remove().getFirst(), queue.remove().getFirst(), queue.remove().getFirst(), queue.remove().getFirst(), queue.remove().getFirst() }; } } <START> return locations == null ? new String[] : locations.length > 5 ? Arrays.copyOf(locations, 5) : locations; <END> }</code><technical_language>this redundant code returns array larger 5</technical_language>

Target:
public String[] getLocations() throws IOException, InterruptedException { if (locations == null) { Map<String, Integer> hosts = new HashMap<String, Integer>(); for (InputSplit s : splits) { String[] hints = s.getLocations(); if (hints != null) { for (String host : hints) { Integer value = hosts.get(host); if (value == null) { value = 0; } value++; hosts.put(host, value); } } } if (hosts.size() < 5) { locations = hosts.keySet().toArray(new String[hosts.size()]); } else { Queue<Pair<String, Integer>> queue = new PriorityQueue<Pair<String, Integer>>(hosts.size(), new Comparator<Pair<String, Integer>>() { public int compare(Pair<String, Integer> o1, Pair<String, Integer> o2) { return -o1.getSecond().compareTo(o2.getSecond()); } }); for (Map.Entry<String, Integer> entry : hosts.entrySet()) { queue.add(new Pair<String, Integer>(entry.getKey(), entry.getValue())); } locations = new String[] { queue.remove().getFirst(), queue.remove().getFirst(), queue.remove().getFirst(), queue.remove().getFirst(), queue.remove().getFirst() }; } } return locations; }
Source:
<code>public Transaction newTransaction() throws TransactionException { if (!connected) { throw new TransactionException("Not connected - cannot create transaction."); } Transaction transaction = new Transaction(metaStoreClient, lockOptions); long txnId = transaction.getTransactionId(); for (AcidTable table : tables) { try { table.setWriteId(metaStoreClient.allocateTableWriteId(txnId, table.getDatabaseName(), table.getTableName())); } catch (TException ex) { try { metaStoreClient.rollbackTxn(txnId); } catch (TException e) { <START> LOG.warn("Operation failed and rollback transaction failed due to {}", txnId, e.getMessage()); <END> } throw new TransactionException("Unable to allocate table write ID", ex); } } LOG.debug("Created transaction {}", transaction); return transaction; }</code><technical_language>Msg include operation failed db.table name if</technical_language>

Target:
public Transaction newTransaction() throws TransactionException { if (!connected) { throw new TransactionException("Not connected - cannot create transaction."); } Transaction transaction = new Transaction(metaStoreClient, lockOptions); long txnId = transaction.getTransactionId(); for (AcidTable table : tables) { try { table.setWriteId(metaStoreClient.allocateTableWriteId(txnId, table.getDatabaseName(), table.getTableName())); } catch (TException ex) { try { metaStoreClient.rollbackTxn(txnId); } catch (TException e) { LOG.warn("Allocation of write id failed for table and rollback transaction failed due to {}", AcidUtils.getFullTableName(table.getDatabaseName(), table.getTableName()), txnId, e.getMessage()); } throw new TransactionException("Unable to allocate table write ID for table " + AcidUtils.getFullTableName(table.getDatabaseName(), table.getTableName()) + " under txn " + txnId, ex); } } LOG.debug("Created transaction {}", transaction); return transaction; }
Source:
<code>private void release() { if (refcount.decrementAndGet() == 0) { <START> ownerThread.set(null); <END> } }</code><technical_language>"NO_CURRENT_THREAD" replace "null"? "NO_CURRENT_THREAD" is more readable</technical_language>

Target:
private void release() { if (refcount.decrementAndGet() == 0) { ownerThread.set(NO_CURRENT_THREAD); } }
Source:
<code>public void run() { try { <START> String message = String.format("Starting repair command #%d (%s), repairing keyspace %s with %s", cmd, parentSession, keyspace, <END> options); logger.info(message); Tracing.traceRepair(message); fireProgressEvent(new ProgressEvent(ProgressEventType.START, 0, 100, message)); Pair<Context, String> setup = setup(); if (setup.right != null) { skip(setup.right); return; } Context ctx = setup.left; assert ctx != null : "Context is required but was not found"; this.context = ctx; start(ctx); } catch (Exception | Error e) { notifyError(e); fail(e.getMessage()); } }</code><technical_language>final</technical_language>

Target:
public void run() { try { runMayThrow(); } catch (SkipRepairException e) { skip(e.getMessage()); } catch (Exception | Error e) { notifyError(e); fail(e.getMessage()); } }
Source:
<code>public QueryResult countStudiesPerSpecies(QueryOptions queryOptions) { long start = System.currentTimeMillis(); Specification filterSpecification = getSpeciesAndTypeFilters(queryOptions); List<Tuple> countGroupBy = dgvaStudyBrowserRepository.groupCount(DgvaStudyBrowserRepository.COMMON_NAME, filterSpecification, false); Map<String, Long> result = new HashMap<>(); for (Tuple tuple : countGroupBy) { String[] species = tuple.get(0) != null ? ((String) tuple.get(0)).split(",") : new String[]{ "Others" }; long count = (long) tuple.get(1); for (String s : species) { if (result.containsKey(s)) { <START> count += result.get(s); <END> } result.put(s, count); } } long end = System.currentTimeMillis(); return new QueryResult(null, ((Long) (end - start)).intValue(), result.size(), result.size(), null, null, new LinkedList(result.entrySet())); }</code><technical_language>+=</technical_language>

Target:
public QueryResult countStudiesPerSpecies(QueryOptions queryOptions) { long start = System.currentTimeMillis(); Specification filterSpecification = getSpeciesAndTypeFilters(queryOptions); List<Tuple> countGroupBy = dgvaStudyBrowserRepository.groupCount(DgvaStudyBrowserRepository.COMMON_NAME, filterSpecification, false); Map<String, Long> result = new HashMap<>(); for (Tuple tuple : countGroupBy) { String[] species = tuple.get(0) != null ? ((String) tuple.get(0)).split(",") : new String[]{ "Others" }; for (String s : species) { long count = (long) tuple.get(1); if (result.containsKey(s)) { count += result.get(s); } result.put(s, count); } } long end = System.currentTimeMillis(); return new QueryResult(null, ((Long) (end - start)).intValue(), result.size(), result.size(), null, null, new LinkedList(result.entrySet())); }
Source:
<code>public void runPinger() { if (pingInProgress.get()) { return; } else { pingInProgress.set(true); } Server[] allServers = null; boolean[] results = null; Lock allLock = null; Lock upLock = null; try { allLock = allServerLock.readLock(); allLock.lock(); allServers = allServerList.toArray(new Server[allServerList.size()]); allLock.unlock(); int numCandidates = allServers.length; results = pingerStrategy.pingServers(ping, allServers); final List<Server> newUpList = new ArrayList<Server>(); final List<Server> changedServers = new ArrayList<Server>(); for (int i = 0; i < numCandidates; i++) { boolean isAlive = results[i]; Server svr = allServers[i]; boolean oldIsAlive = svr.isAlive(); svr.setAlive(isAlive); if (oldIsAlive != isAlive) { changedServers.add(svr); logger.debug("LoadBalancer [{}]: Server status changed to {}", name, svr.getId(), (isAlive ? "ALIVE" : "DEAD")); } if (isAlive) { newUpList.add(svr); } } upLock = upServerLock.writeLock(); upLock.lock(); upServerList = newUpList; upLock.unlock(); notifyServerStatusChangeListener(changedServers); <START> } catch (Exception e) { <END> logger.error("LoadBalancer : Error running the Pinger", name, e); } finally { pingInProgress.set(false); } }</code><technical_language>nit: This is a bit of belt suspenders try-catch block in PingerTask class. Consider marking this method throwing Exception removing catch block</technical_language>

Target:
public void runPinger() throws Exception { if (!pingInProgress.compareAndSet(false, true)) { return; } Server[] allServers = null; boolean[] results = null; Lock allLock = null; Lock upLock = null; try { allLock = allServerLock.readLock(); allLock.lock(); allServers = allServerList.toArray(new Server[allServerList.size()]); allLock.unlock(); int numCandidates = allServers.length; results = pingerStrategy.pingServers(ping, allServers); final List<Server> newUpList = new ArrayList<Server>(); final List<Server> changedServers = new ArrayList<Server>(); for (int i = 0; i < numCandidates; i++) { boolean isAlive = results[i]; Server svr = allServers[i]; boolean oldIsAlive = svr.isAlive(); svr.setAlive(isAlive); if (oldIsAlive != isAlive) { changedServers.add(svr); logger.debug("LoadBalancer [{}]: Server status changed to {}", name, svr.getId(), (isAlive ? "ALIVE" : "DEAD")); } if (isAlive) { newUpList.add(svr); } } upLock = upServerLock.writeLock(); upLock.lock(); upServerList = newUpList; upLock.unlock(); notifyServerStatusChangeListener(changedServers); } finally { pingInProgress.set(false); } }
Source:
<code><START> private static Stream<IdentifierTree> findClassInDefaultPackage(ExpressionTree expression) { <END> if (expression.is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) expression; if ("class".equals(memberSelect.identifier().name()) && memberSelect.expression().is(Tree.Kind.IDENTIFIER)) { IdentifierTree identifier = (IdentifierTree) memberSelect.expression(); if (isTypeInDefaultPackage(identifier.symbol())) { return Stream.of(identifier); } } } return Stream.empty(); }</code><technical_language>Method returns a stream of element empty stream of optional stream</technical_language>

Target:
private static Optional<IdentifierTree> findClassInDefaultPackage(ExpressionTree expression) { if (expression.is(Tree.Kind.MEMBER_SELECT)) { MemberSelectExpressionTree memberSelect = (MemberSelectExpressionTree) expression; if ("class".equals(memberSelect.identifier().name()) && memberSelect.expression().is(Tree.Kind.IDENTIFIER)) { IdentifierTree identifier = (IdentifierTree) memberSelect.expression(); if (isTypeInDefaultPackage(identifier.symbol())) { return Optional.of(identifier); } } } return Optional.empty(); }
Source:
<code>public Boolean FNCallback(FeatureNode srcNode) { FeatureNode attr = srcNode.get("DISJUNCT"); <START> <END> if (attr == null) return false; if (!attr.isValued()) return false; String value = attr.getValue(); if (value.length() == 0) return false; String[] connectors = value.split(" "); str += "(LgWordCset \n"; str += " (WordInstanceNode \"" + srcNode.get("uuid").getValue() + "\")\n"; str += " (LgAnd \n"; for (String conn : connectors) { String name; String direction; Boolean multi; if (conn.charAt(0) == '@') { name = conn.substring(1, conn.length() - 1); direction = conn.substring(conn.length() - 1); multi = true; } else { name = conn.substring(0, conn.length() - 1); direction = conn.substring(conn.length() - 1); multi = false; } str += " (LgConnector \n"; str += " (LgConnectorNode \"" + name + "\")\n"; str += " (LgConnDirNode \"" + direction + "\")\n"; if (multi) str += " (LgConnMultiNode \"@\")\n"; str += " )\n"; } str += " )\n"; str += ")\n"; return false; }</code><technical_language>join ifs or</technical_language>

Target:
public Boolean FNCallback(FeatureNode srcNode) { FeatureNode attr = srcNode.get("DISJUNCT"); if (attr == null || !attr.isValued()) return false; String value = attr.getValue(); if (value.length() == 0) return false; String[] connectors = value.split(" "); str += "(LgWordCset \n"; str += " (WordInstanceNode \"" + srcNode.get("uuid").getValue() + "\")\n"; str += " (LgAnd \n"; for (String conn : connectors) { String name; String direction; Boolean multi; if (conn.charAt(0) == '@') { name = conn.substring(1, conn.length() - 1); direction = conn.substring(conn.length() - 1); multi = true; } else { name = conn.substring(0, conn.length() - 1); direction = conn.substring(conn.length() - 1); multi = false; } str += " (LgConnector \n"; str += " (LgConnectorNode \"" + name + "\")\n"; str += " (LgConnDirNode \"" + direction + "\")\n"; if (multi) str += " (LgConnMultiNode \"@\")\n"; str += " )\n"; } str += " )\n"; str += ")\n"; return false; }
Source:
<code>public XmlTextAnnotation createTextAnnotation(String xmlText, String corpusId, String docId) { <START> Pair<StringTransformation, List<XmlDocumentProcessor.SpanInfo>> cleanResults = <END> xmlProcessor.processXml(xmlText); TextAnnotation ta = taBuilder.createTextAnnotation(corpusId, docId, cleanResults.getFirst().getTransformedText()); return new XmlTextAnnotation(cleanResults.getFirst(), ta, cleanResults.getSecond()); }</code><technical_language>remove logging</technical_language>

Target:
public XmlTextAnnotation createTextAnnotation(String xmlText, String corpusId, String docId) { logger.debug("processing text from document {}", docId); Pair<StringTransformation, List<XmlDocumentProcessor.SpanInfo>> cleanResults = xmlProcessor.processXml(xmlText); TextAnnotation ta = taBuilder.createTextAnnotation(corpusId, docId, cleanResults.getFirst().getTransformedText()); return new XmlTextAnnotation(cleanResults.getFirst(), ta, cleanResults.getSecond()); }
Source:
<code>public ChapterFragmentPagerAdapter(Context ctx, FragmentManager fm, @NonNull Chapter selectedChapter) { super(fm); mContext = ctx; <START> this.mSelectedChapter = selectedChapter; <END> }</code><technical_language>m prefix in a field name, this</technical_language>

Target:
public ChapterFragmentPagerAdapter(Context ctx, FragmentManager fm, @NonNull Chapter selectedChapter) { super(fm); mContext = ctx; mSelectedChapter = selectedChapter; }
Source:
<code>public Solution_ read(File inputSolutionFile) { <START> try(InputStream inputSolutionStream = Files.newInputStream(inputSolutionFile.toPath())) { <END> return read(inputSolutionStream); } catch (IOException e) { throw new IllegalArgumentException("Failed reading inputSolutionFile (" + inputSolutionFile + ").", e); } }</code><technical_language>code style: space (</technical_language>

Target:
public Solution_ read(File inputSolutionFile) { try (InputStream inputSolutionStream = Files.newInputStream(inputSolutionFile.toPath())) { return read(inputSolutionStream); } catch (Exception e) { throw new IllegalArgumentException("Failed reading inputSolutionFile (" + inputSolutionFile + ").", e); } }
Source:
<code>protected void checkProducerMethod(EnhancedAnnotatedMethod<T, ? super X> method) { if (method.getEnhancedParameters(Observes.class).size() > 0) { throw BeanLogger.LOG.inconsistentAnnotationsOnMethod(PRODUCER_ANNOTATION, "@Observes", this.method); } else if (method.getEnhancedParameters(Disposes.class).size() > 0) { throw BeanLogger.LOG.inconsistentAnnotationsOnMethod(PRODUCER_ANNOTATION, "@Disposes", this.method); } else if (getDeclaringBean() instanceof SessionBean<?>) { boolean methodDeclaredOnTypes = false; for (Type type : getDeclaringBean().getTypes()) { Class<?> clazz = Reflections.getRawType(type); methodDeclaredOnTypes = doPrivileged(clazz, method.getName(), method.getParameterTypesAsArray()); if (methodDeclaredOnTypes) { break; } } <START> if (!methodDeclaredOnTypes && Modifier.isStatic(method.slim().getJavaMember().getModifiers())) { <END> methodDeclaredOnTypes = doPrivileged(getDeclaringBean().getBeanClass(), method.getName(), method.getParameterTypesAsArray()); } if (!methodDeclaredOnTypes) { throw BeanLogger.LOG.methodNotBusinessMethod(this, getDeclaringBean()); } } }</code><technical_language>If method is static perform this check all, spec covers non-static session bean classes. Therefore, Modifier.isStatic() moved outer if condition</technical_language>

Target:
protected void checkProducerMethod(EnhancedAnnotatedMethod<T, ? super X> method) { if (method.getEnhancedParameters(Observes.class).size() > 0) { throw BeanLogger.LOG.inconsistentAnnotationsOnMethod(PRODUCER_ANNOTATION, "@Observes", this.method); } else if (method.getEnhancedParameters(Disposes.class).size() > 0) { throw BeanLogger.LOG.inconsistentAnnotationsOnMethod(PRODUCER_ANNOTATION, "@Disposes", this.method); } else if (getDeclaringBean() instanceof SessionBean<?> && !Modifier.isStatic(method.slim().getJavaMember().getModifiers())) { boolean methodDeclaredOnTypes = false; for (Type type : getDeclaringBean().getTypes()) { Class<?> clazz = Reflections.getRawType(type); try { AccessController.doPrivileged(new GetMethodAction(clazz, method.getName(), method.getParameterTypesAsArray())); methodDeclaredOnTypes = true; break; } catch (PrivilegedActionException ignored) { } } if (!methodDeclaredOnTypes) { throw BeanLogger.LOG.methodNotBusinessMethod(this, getDeclaringBean()); } } }
Source:
<code>public void test() { connect(); click(jq("@button")); waitResponse(); JQuery grid = jq("@grid"); int width = grid.width(); click(grid); JQuery body = grid.find(".z-grid-body"); body.scrollTop(body.scrollHeight()); waitResponse(); <START> Assert.assertTrue(width < grid.width()); <END> }</code><technical_language>assertThat lessThan</technical_language>

Target:
public void test() { connect(); click(jq("@button")); waitResponse(); JQuery grid = jq("@grid"); int width = grid.width(); click(grid); JQuery body = grid.find(".z-grid-body"); body.scrollTop(body.scrollHeight()); waitResponse(); Assert.assertThat(grid.width(), greaterThan(width)); }
Source:
<code>public InsightCard(final Long accountId, final String title, final String message, final Category category, final TimePeriod timePeriod, final DateTime timestamp) { this.accountId = Optional.fromNullable(accountId); this.title = title; this.message = message; this.category = category; this.timePeriod = timePeriod; this.timestamp = timestamp; <START> this.genericInsightCards = Collections.emptyList(); <END> }</code><technical_language>call other constructor: java public InsightCard(final Long accountId, final String title, final String message, final Category category, final TimePeriod timePeriod, final DateTime timestamp) { this(accountId, title, message, category, timePeriod, timestamp, Collections.emptyList()) } repeat fromNullable call other assignments</technical_language>

Target:
public InsightCard(final Long accountId, final String title, final String message, final Category category, final TimePeriod timePeriod, final DateTime timestamp) { this.accountId = Optional.fromNullable(accountId); this.title = title; this.message = message; this.category = category; this.timePeriod = timePeriod; this.timestamp = timestamp; }
Source:
<code>public void setRootNode(String rootNode) { this.rootNode = <START> rootNode; <END> }</code><technical_language>remove "this"</technical_language>

Target:
public void setRootNode(String rootNode) { fRootNode = rootNode; }
Source:
<code>public String getSelectedRepositoryId() { Optional<PickerRepository> selectedRepository = matchingRepositories.stream() .filter(repo -> repo.isSelected()) .findFirst(); assert selectedRepository.isPresent(); return selectedRepository.get().getRepositoryId(); <START> } <END></code><technical_language>this state guarantees is a selected repository time</technical_language>

Target:
public String getSelectedRepositoryId() { Optional<PickerRepository> selectedRepository = suggestedRepositories.stream() .filter(repo -> repo.isSelected()) .findFirst(); assert selectedRepository.isPresent(); return selectedRepository.get().getRepositoryId(); }
Source:
<code>public void flagAsEvicted() { if (_expireAfterDate == null) { <START> _expireAfterDate = System.currentTimeMillis() + (_evictionDelayInSeconds * 1000); <END> } }</code><technical_language>kind of ugly, in code typically do TimeUnit.SECONDS.toMillis(_evictionDelayInSeconds) sorts of conversions</technical_language>

Target:
public void flagAsEvicted() { if (_expireAfterDate == Long.MAX_VALUE) { _expireAfterDate = System.currentTimeMillis() + _evictionDelayInMilliSeconds; } }
Source:
<code>public void close() { ExecutorService maybeNull = maybeNull(); if (maybeNull != null) { maybeNull.shutdownNow(); try { <START> maybeNull.awaitTermination(5, TimeUnit.SECONDS); <END> } catch (InterruptedException e) { } } }</code><technical_language>I wait 1 default now.. is arbitrary</technical_language>

Target:
public void close() { ExecutorService maybeNull = maybeNull(); if (maybeNull != null) { maybeNull.shutdownNow(); try { maybeNull.awaitTermination(1, TimeUnit.SECONDS); } catch (InterruptedException e) { } } }
Source:
<code><START> private URL buildUrlWithParams() throws MalformedURLException { <END> Uri.Builder b = Uri.parse(url).buildUpon(); for (Map.Entry<String, String> param : params.entrySet()) { b.appendQueryParameter(param.getKey(), param.getValue()); } return new URL(b.build().toString()); }</code><technical_language>usage of this method immediately calls toString() returned result, return type String instead</technical_language>

Target:
private String buildUrlWithParams() throws MalformedURLException { Uri.Builder b = Uri.parse(url).buildUpon(); for (Map.Entry<String, String> param : params.entrySet()) { b.appendQueryParameter(param.getKey(), param.getValue()); } return b.build().toString(); }
Source:
<code>public CSVTupleDataLoader(ClientImpl client, String procName, BulkLoaderErrorHandler errHandler, ExecutorService callbackExecutor, BulkLoaderSuccessCallback successCallback) throws IOException, ProcCallException { m_client = client; m_insertProcedure = procName; m_errHandler = errHandler; m_callbackExecutor = callbackExecutor; m_successCallback = successCallback; <START> m_reinsertExecutor = CoreUtils.getSingleThreadExecutor(procName); <END> m_autoReconnect = client.isAutoReconnectEnabled(); List<VoltType> typeList = Lists.newArrayList(); VoltTable procInfo = client.callProcedure("@SystemCatalog", "PROCEDURECOLUMNS").getResults()[0]; while (procInfo.advanceRow()) { if (m_insertProcedure.equalsIgnoreCase(procInfo.getString("PROCEDURE_NAME"))) { String typeStr = (String) procInfo.get("TYPE_NAME", VoltType.STRING); typeList.add(VoltType.typeFromString(typeStr)); } } if (typeList.isEmpty()) { throw new RuntimeException("No matching insert procedure available"); } m_columnTypes = typeList.toArray(new VoltType[0]); int sleptTimes = 0; while (!client.isHashinatorInitialized() && sleptTimes < 120) { try { Thread.sleep(500); sleptTimes++; } catch (InterruptedException ex) } }</code><technical_language>create this executor if auto connect is on</technical_language>

Target:
public CSVTupleDataLoader(ClientImpl client, String procName, BulkLoaderErrorHandler errHandler, ExecutorService callbackExecutor, BulkLoaderSuccessCallback successCallback) throws IOException, ProcCallException { m_client = client; m_insertProcedure = procName; m_errHandler = errHandler; m_callbackExecutor = callbackExecutor; m_successCallback = successCallback; m_autoReconnect = client.isAutoReconnectEnabled(); if (m_autoReconnect) { m_reinsertExecutor = CoreUtils.getSingleThreadExecutor(procName); } else { m_reinsertExecutor = null; } List<VoltType> typeList = Lists.newArrayList(); VoltTable procInfo = client.callProcedure("@SystemCatalog", "PROCEDURECOLUMNS").getResults()[0]; while (procInfo.advanceRow()) { if (m_insertProcedure.equalsIgnoreCase(procInfo.getString("PROCEDURE_NAME"))) { String typeStr = (String) procInfo.get("TYPE_NAME", VoltType.STRING); typeList.add(VoltType.typeFromString(typeStr)); } } if (typeList.isEmpty()) { throw new RuntimeException("No matching insert procedure available"); } m_columnTypes = typeList.toArray(new VoltType[0]); int sleptTimes = 0; while (!client.isHashinatorInitialized() && sleptTimes < 120) { try { Thread.sleep(500); sleptTimes++; } catch (InterruptedException ex) } }
Source:
<code><START> BitMappedTrie(Object[] array, int offset, int length, int depthShift) { <END> this.array = array; this.offset = offset; this.length = length; this.depthShift = depthShift; assert length() <= treeSize(branchingFactor(), depthShift); }</code><technical_language>assert s.th. similar Vector? E.g. java assert (EMPTY == null) || (array.length > 0)</technical_language>

Target:
BitMappedTrie(Object[] array, int offset, int length, int depthShift) { this.array = array; this.offset = offset; this.length = length; this.depthShift = depthShift; assert length <= treeSize(branchingFactor(), depthShift); assert (EMPTY == null) || ((length > 0) && (array.length > 0)); }
Source:
<code>public boolean performNextOperation(int completedChildCount) { log.info("Command '{}' id '{}' executing step '{}'", getActionType(), getCommandId(), getParameters().getNextCommandStep()); switch (getParameters().getNextCommandStep()) { case UPDATE_OVF_STORE: getParameters().setCommandStep(DeactivateStorageDomainWithOvfUpdateStep.UPDATE_OVF_STORE); runInternalAction(ActionType.UpdateOvfStoreForStorageDomain, createUpdateOvfStoreParams(), cloneContext().withoutCompensationContext()); getParameters().setNextCommandStep( DeactivateStorageDomainWithOvfUpdateStep.DEACTIVATE_STORAGE_DOMAIN ); break; case DEACTIVATE_STORAGE_DOMAIN: getParameters().setCommandStep(DeactivateStorageDomainWithOvfUpdateStep.DEACTIVATE_STORAGE_DOMAIN); executeDeactivateCommand(); getParameters().setNextCommandStep(DeactivateStorageDomainWithOvfUpdateStep.COMPLETE); break; case COMPLETE: getParameters().setCommandStep(DeactivateStorageDomainWithOvfUpdateStep.COMPLETE); <START> setCommandStatus(CommandStatus.SUCCEEDED); <END> return false; } return true; }</code><technical_language>is this needed</technical_language>

Target:
public boolean performNextOperation(int completedChildCount) { log.info("Command '{}' id '{}' executing step '{}'", getActionType(), getCommandId(), getParameters().getNextCommandStep()); switch (getParameters().getNextCommandStep()) { case UPDATE_OVF_STORE: getParameters().setCommandStep(DeactivateStorageDomainWithOvfUpdateStep.UPDATE_OVF_STORE); runInternalAction(ActionType.UpdateOvfStoreForStorageDomain, createUpdateOvfStoreParams(), cloneContext().withoutCompensationContext()); getParameters().setNextCommandStep( DeactivateStorageDomainWithOvfUpdateStep.DEACTIVATE_STORAGE_DOMAIN ); break; case DEACTIVATE_STORAGE_DOMAIN: getParameters().setCommandStep(DeactivateStorageDomainWithOvfUpdateStep.DEACTIVATE_STORAGE_DOMAIN); executeDeactivateCommand(); getParameters().setNextCommandStep(DeactivateStorageDomainWithOvfUpdateStep.COMPLETE); break; case COMPLETE: getParameters().setCommandStep(DeactivateStorageDomainWithOvfUpdateStep.COMPLETE); setCommandStatus(CommandStatus.SUCCEEDED); return false; } persistCommandIfNeeded(); return true; }
Source:
<code>public void closedHigh(boolean closedHigh) { <START> this.closedHigh = closedHigh == false; <END> }</code><technical_language>This wrong. method parameter closedHigh is false assigning true this.closedHigh. Is correct _</technical_language>

Target:
public void closedHigh(boolean closedHigh) { this.closedHigh = closedHigh; }
Source:
<code>public boolean hasMatch() { <START> return rawHasMatch(fEmptyArray); <END> }</code><technical_language>emptyArray() instead of potentially uninitialized field fEmptyArray</technical_language>

Target:
public boolean hasMatch() { return rawHasMatch(emptyArray()); }
Source:
<code>public void nextIsInvoke() { m.visitInsn(Opcodes.NOP); m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "owner", "name", "()V", false); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKESTATIC, "owner", "name", "()V"); assertNull(matcher.cursor); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "another_owner", "name", "()V"); assertNull(matcher.cursor); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "owner", "another_name", "()V"); assertNull(matcher.cursor); matcher.cursor = m.instructions.getFirst(); <START> matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "owner", "another_name", <END> "()I"); assertNull(matcher.cursor); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "owner", "name", "()V"); assertSame(m.instructions.getLast(), matcher.cursor); matcher.cursor = null; matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "owner", "name", "()V"); }</code><technical_language>read "name" here, testing descriptor miss a branch</technical_language>

Target:
public void nextIsInvoke() { m.visitInsn(Opcodes.NOP); m.visitMethodInsn(Opcodes.INVOKEVIRTUAL, "owner", "name", "()V", false); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKESTATIC, "owner", "name", "()V"); assertNull(matcher.cursor); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "another_owner", "name", "()V"); assertNull(matcher.cursor); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "owner", "another_name", "()V"); assertNull(matcher.cursor); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "owner", "name", "(Lanother_descriptor;)V"); assertNull(matcher.cursor); matcher.cursor = m.instructions.getFirst(); matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "owner", "name", "()V"); assertSame(m.instructions.getLast(), matcher.cursor); matcher.cursor = null; matcher.nextIsInvoke(Opcodes.INVOKEVIRTUAL, "owner", "name", "()V"); }