auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void run() { long start = System.nanoTime(); try { Path sourceFile = determineCurrentSourceFile(); if ( sourceFile == null ) { log.unableToDetermineCurrentInSourceDirectory(); return; } Path currentDestinationFile = destination.resolve( Integer.valueOf( current ).toString() ); try { if ( FileHelper.areInSync( sourceFile, currentDestinationFile ) ) { log.trace( "Source and destination directory are in sync. No copying required." ); return; } } catch (IOException ioe) { log.unableToCompareSourceWithDestinationDirectory( sourceFile.toString(), currentDestinationFile.toString() ); } int oldIndex = current; int index = oldIndex == 1 ? 2 : 1; <START> Path destinationFile = destination.resolve( Integer.valueOf( index ).toString() ); <END> try { log.tracef( "Copying %s into %s", sourceFile, destinationFile ); FileHelper.synchronize( sourceFile, destinationFile, true, copyChunkSize ); current = index; log.tracef( "Copy for %s took %d ms", indexName, TimeUnit.NANOSECONDS.toMillis( System.nanoTime() - start ) ); } catch (IOException e) { log.unableToSynchronizeSource( indexName, e ); return; } if ( !new File( indexName, "current" + oldIndex ).delete() ) { log.unableToRemovePreviousMarket( indexName ); } try { new File( indexName, "current" + index ).createNewFile(); } catch (IOException e) { log.unableToCreateCurrentMarker( indexName, e ); } } finally { inProgress.set( false ); } }</code><technical_language>forgot some occurrences of File (new File( indexName, "current" + oldIndex ).delete() for instance)</technical_language>

Target:
public void run() { long start = System.nanoTime(); try { Path sourceFile = determineCurrentSourceFile(); if ( sourceFile == null ) { log.unableToDetermineCurrentInSourceDirectory(); return; } Path currentDestinationFile = destination.resolve( Integer.valueOf( current ).toString() ); try { if ( FileHelper.areInSync( sourceFile, currentDestinationFile ) ) { log.trace( "Source and destination directory are in sync. No copying required." ); return; } } catch (IOException ioe) { log.unableToCompareSourceWithDestinationDirectory( sourceFile.toString(), currentDestinationFile.toString() ); } int oldIndex = current; int index = oldIndex == 1 ? 2 : 1; Path destinationFile = destination.resolve( Integer.valueOf( index ).toString() ); try { log.tracef( "Copying %s into %s", sourceFile, destinationFile ); FileHelper.synchronize( sourceFile, destinationFile, true ); current = index; log.tracef( "Copy for %s took %d ms", indexDir, TimeUnit.NANOSECONDS.toMillis( System.nanoTime() - start ) ); } catch (IOException e) { log.unableToSynchronizeSource( indexDir.toString(), e ); return; } try { Files.delete( indexDir.resolve( "current" + oldIndex ) ); } catch (IOException e) { log.unableToRemovePreviousMarker( indexDir.toString(), e ); } try { Files.createFile( indexDir.resolve( "current" + index ) ); } catch (IOException e) { log.unableToCreateCurrentMarker( indexDir.toString(), e ); } } finally { inProgress.set( false ); } }
Source:
<code>public void saveSystem(final IFile targetFile) { long <START> time1 = <END> System.currentTimeMillis(); if (null != getWriter()) { try { createNamedElementEntry(system, LibraryElementTags.SYSTEM); addIdentification(system); addVersionInfo(system); addApplications(); SystemConfiguration systemConfiguration = system.getSystemConfiguration(); if (null != systemConfiguration) { addDevices(systemConfiguration.getDevices()); addMapping(); addSegment(systemConfiguration.getSegments()); addLink(systemConfiguration.getLinks()); } addEndElement(); } catch (XMLStreamException e) { Activator.getDefault().logError(e.getMessage(), e); } writeToFile(targetFile); } long time2 = System.currentTimeMillis(); System.out.println("Overall Saving time for System (" + system.getName() + ": " + (time2 - time1) + " ms"); }</code><technical_language>startTime</technical_language>

Target:
public void saveSystem(final IFile targetFile) { long startTime = System.currentTimeMillis(); if (null != getWriter()) { try { createNamedElementEntry(system, LibraryElementTags.SYSTEM); addIdentification(system); addVersionInfo(system); addApplications(); SystemConfiguration systemConfiguration = system.getSystemConfiguration(); if (null != systemConfiguration) { addDevices(systemConfiguration.getDevices()); addMapping(); addSegment(systemConfiguration.getSegments()); addLink(systemConfiguration.getLinks()); } addEndElement(); } catch (XMLStreamException e) { Activator.getDefault().logError(e.getMessage(), e); } writeToFile(targetFile); } long endTime = System.currentTimeMillis(); System.out.println("Overall Saving time for System (" + system.getName() + ": " + (endTime - startTime) + " ms"); }
Source:
<code>public void testCreateReusableSubprocessTaskExecutionSet_case() { <START> final String SLA_DUE_DATE = "12/25/1983"; <END> String uuid = UUID.randomUUID().toString(); CallActivity callActivity = bpmn2.createCallActivity(); callActivity.setId(uuid); CustomElement.isCase.of(callActivity).set(Boolean.TRUE); CustomElement.slaDueDate.of(callActivity).set(SLA_DUE_DATE); CallActivityPropertyReader propertyReader = new CallActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); BaseReusableSubprocessTaskExecutionSet result = tested.createReusableSubprocessTaskExecutionSet(callActivity, propertyReader); assertTrue(CaseReusableSubprocessTaskExecutionSet.class.isInstance(result)); assertTrue(result.getIsCase().getValue()); assertTrue(result.getSlaDueDate().getValue().contains(SLA_DUE_DATE)); }</code><technical_language>Common variables for more test methods moved class a constant</technical_language>

Target:
public void testCreateReusableSubprocessTaskExecutionSet_case() { CallActivity callActivity = bpmn2.createCallActivity(); CustomElement.isCase.of(callActivity).set(Boolean.TRUE); CustomElement.slaDueDate.of(callActivity).set(SLA_DUE_DATE); CallActivityPropertyReader propertyReader = new CallActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); BaseReusableSubprocessTaskExecutionSet result = tested.createReusableSubprocessTaskExecutionSet(callActivity, propertyReader); assertTrue(CaseReusableSubprocessTaskExecutionSet.class.isInstance(result)); assertTrue(result.getIsCase().getValue()); assertTrue(result.getSlaDueDate().getValue().contains(SLA_DUE_DATE)); }
Source:
<code>public Activator() { <START> System.out.println("Starting 1"); <END> }</code><technical_language>want include this line</technical_language>

Target:
public Activator() { }
Source:
<code>public IWallet createWallet(String walletLogin) { <START> System.out.println("wallet login:" + walletLogin); <END> if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); System.out.println("walletType:" + walletType); if ("aeternity".equalsIgnoreCase(walletType)) { String mnemonic = st.hasMoreTokens() ? st.nextToken() : null; return new AeternityWallet(mnemonic); } } return null; }</code><technical_language>Please remove System.out calls in code</technical_language>

Target:
public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("aeternity".equalsIgnoreCase(walletType)) { String mnemonicsOrPrivKey = st.hasMoreTokens() ? st.nextToken() : null; return new AeternityWallet(mnemonicsOrPrivKey); } } return null; }
Source:
<code>protected String checkAddDropWhitelist(final CatalogType suspect, final ChangeType changeType) { if (ChangeType.ADDITION == changeType && suspect instanceof Table) { assert ((Boolean)suspect.getField("isDRed")); return "Missing DR table " + suspect.getTypeName() + " on replica cluster"; } if (ChangeType.DELETION == changeType && suspect instanceof Table && isXDCR()) { assert ((Boolean)suspect.getField("isDRed")); <START> return "Missing DR table " + suspect.getTypeName() + " on master cluster"; <END> } if (suspect instanceof Column || isUniqueIndex(suspect) || isUniqueIndexColumn(suspect)) { return "Missing " + suspect + " from " + suspect.getParent() + " on " + (ChangeType.ADDITION == changeType ? "replica" : "master"); } return null; }</code><technical_language>do "master cluster"</technical_language>

Target:
protected String checkAddDropWhitelist(final CatalogType suspect, final ChangeType changeType) { if (ChangeType.ADDITION == changeType && suspect instanceof Table) { assert ((Boolean)suspect.getField("isDRed")); return "Missing DR table " + suspect.getTypeName() + " on local cluster"; } if (ChangeType.DELETION == changeType && suspect instanceof Table && m_isXDCR) { assert ((Boolean)suspect.getField("isDRed")); return "Missing DR table " + suspect.getTypeName() + " on remote cluster " + m_remoteClusterId; } if (suspect instanceof Column || isUniqueIndex(suspect) || isUniqueIndexColumn(suspect)) { return "Missing " + suspect + " from " + suspect.getParent() + " on " + (ChangeType.ADDITION == changeType ? "local cluster" : "remote cluster " + m_remoteClusterId); } return null; }
Source:
<code>public void testOctagonQuery() { OGCGeometryWrapper octagonA = new OGCGeometryWrapper(POLYGON_A); OGCGeometryWrapper octagonB = new OGCGeometryWrapper(POLYGON_B); OGCGeometryWrapper pointX = new OGCGeometryWrapper(POINT_X); OGCGeometryWrapper pointY = new OGCGeometryWrapper(POINT_Y); OGCGeometryWrapper pointZ = new OGCGeometryWrapper(POINT_Z); OGCGeometryWrapper pointW = new OGCGeometryWrapper(POINT_W); Flatbush rtree = new Flatbush<OGCGeometryWrapper>(new OGCGeometryWrapper[] { <START> pointX, pointY, pointZ, pointW <END> }); List<OGCGeometryWrapper> resultsA = rtree.findIntersections(octagonA.getExtent()); resultsA.sort(Comparator.naturalOrder()); assertEquals(resultsA, Arrays.asList(pointX, pointY)); List<OGCGeometryWrapper> resultsB = rtree.findIntersections(octagonB.getExtent()); resultsB.sort(Comparator.naturalOrder()); assertEquals(resultsB, Arrays.asList(pointY, pointZ)); }</code><technical_language>move this previous line: Flatbush<OGCGeometryWrapper> rtree = new Flatbush<>(new OGCGeometryWrapper[] {pointX, pointY, pointZ, pointW});</technical_language>

Target:
public void testOctagonQuery() { OGCGeometryWrapper octagonA = new OGCGeometryWrapper(POLYGON_A); OGCGeometryWrapper octagonB = new OGCGeometryWrapper(POLYGON_B); OGCGeometryWrapper pointX = new OGCGeometryWrapper(POINT_X); OGCGeometryWrapper pointY = new OGCGeometryWrapper(POINT_Y); OGCGeometryWrapper pointZ = new OGCGeometryWrapper(POINT_Z); OGCGeometryWrapper pointW = new OGCGeometryWrapper(POINT_W); Flatbush<OGCGeometryWrapper> rtree = new Flatbush<>(new OGCGeometryWrapper[] {pointX, pointY, pointZ, pointW}); List<OGCGeometryWrapper> resultsA = findIntersections(rtree, octagonA.getExtent()); assertEqualsSorted(resultsA, ImmutableList.of(pointX, pointY), Comparator.naturalOrder()); List<OGCGeometryWrapper> resultsB = findIntersections(rtree, octagonB.getExtent()); assertEqualsSorted(resultsB, ImmutableList.of(pointY, pointZ), Comparator.naturalOrder()); }
Source:
<code>public Disk mapRow(ResultSet rs, int rowNum) throws SQLException { DiskImage disk = new DiskImage(); disk.setDiskAlias(rs.getString("disk_alias")); disk.setSize(rs.getLong("size")); <START> disk.setId(new Guid((UUID) rs.getObject("disk_id"))); <END> return disk; }</code><technical_language>getGuid(rs, "disk_id")</technical_language>

Target:
public Disk mapRow(ResultSet rs, int rowNum) throws SQLException { DiskImage disk = new DiskImage(); disk.setDiskAlias(rs.getString("disk_alias")); disk.setSize(rs.getLong("size")); disk.setId(getGuid(rs, "disk_id")); return disk; }
Source:
<code>void expandOrCollapseSubTypes() { final HTMLElement arrow = view.getArrow(); <START> if (isCollapsed(arrow)) { <END> CssHelper.asDownArrow(arrow); expandSubDataTypes(getDataType()); } else { CssHelper.asRightArrow(arrow); collapseSubDataTypes(getDataType()); } }</code><technical_language>if(view.isCollapsed()) { view.expand(); } else { view.collapse(); } in view public void expand() { CssHelper.asDownArrow(getArrow()); presenter.expandSubDataTypes(); } in presenter: public void expandSubDataTypes() { expandSubDataTypes(getDataType()); }</technical_language>

Target:
void expandOrCollapseSubTypes() { if (view.isCollapsed()) { view.expand(); } else { view.collapse(); } }
Source:
<code>public static String get(Property property) { <START> if (config.containsKey(property.getKey())) { <END> return config.get(property.getKey()); } return null; }</code><technical_language>do containsKey check? If in map, get() return null</technical_language>

Target:
public static String get(Property property) { return config.get(property.getKey()); }
Source:
<code>protected Image getImage(Object element, int columnIndex) { switch(columnIndex) { case PACKAGE_ELEMENT_COLUMN_INDEX: return umlLabelProvider.getImage(element); case PROFILE_APPLICATION_NAME_COLUMN_INDEX: <START> if(element instanceof Profile) { <END> return umlLabelProvider.getImage(element); } default: return null; } }</code><technical_language>this, too. of want navigate profile application's appliedProfile get name image umlLabelProvider</technical_language>

Target:
protected Image getImage(Object element, int columnIndex) { switch(columnIndex) { case PACKAGE_ELEMENT_COLUMN_INDEX: return umlLabelProvider.getImage(element); case PROFILE_APPLICATION_NAME_COLUMN_INDEX: if(element instanceof ProfileApplication) { return umlLabelProvider.getImage(element); } default: return null; } }
Source:
<code>ExecutionPlan getExecutionPlan(String runId) { Map<String, String> allowedUserConfig = new HashMap<>(userConfig); Map<String, String> generatedConfig = new HashMap<>(); if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { if (userConfig.containsKey(TaskConfig.INPUT_STREAMS())) { <START> LOG.warn("SamzaApplications should not specify task.inputs in configuration. " + <END> "Ignoring configured value of " + userConfig.get(TaskConfig.INPUT_STREAMS())); allowedUserConfig.remove(TaskConfig.INPUT_STREAMS()); } generatedConfig.putAll(getGeneratedConfig(runId)); } Config mergedConfig = JobNodeConfigurationGenerator.mergeConfig(allowedUserConfig, generatedConfig); StreamManager streamManager = buildAndStartStreamManager(mergedConfig); try { ExecutionPlanner planner = new ExecutionPlanner(mergedConfig, streamManager); return planner.plan(appDesc); } finally { streamManager.stop(); } }</code><technical_language>add "use input descriptors" instead</technical_language>

Target:
ExecutionPlan getExecutionPlan(String runId) { Map<String, String> allowedUserConfig = new HashMap<>(userConfig); Map<String, String> generatedConfig = new HashMap<>(); if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { if (userConfig.containsKey(TaskConfig.INPUT_STREAMS())) { LOG.warn("SamzaApplications should not specify task.inputs in configuration. " + "Specify them using InputDescriptors instead. Ignoring configured task.inputs value of " + userConfig.get(TaskConfig.INPUT_STREAMS())); allowedUserConfig.remove(TaskConfig.INPUT_STREAMS()); } generatedConfig.putAll(getGeneratedConfig(runId)); } Config mergedConfig = JobNodeConfigurationGenerator.mergeConfig(allowedUserConfig, generatedConfig); StreamManager streamManager = buildAndStartStreamManager(mergedConfig); try { ExecutionPlanner planner = new ExecutionPlanner(mergedConfig, streamManager); return planner.plan(appDesc); } finally { streamManager.stop(); } }
Source:
<code>public boolean applicable(Context context) { TypeMirror autoValueClass = context.autoValueClass().asType(); if (!needsCreator(context)) { <START> context.processingEnvironment().getMessager().printMessage(Diagnostic.Kind.ERROR, <END> "Manual implementation of a static Parcelable.Creator<T> CREATOR field found when processing " + autoValueClass.toString() + ". Remove this so auto-value-parcel can automatically generate the " + "implementation for you."); return false; } if (!needsWriteToParcel(context)) { context.processingEnvironment().getMessager().printMessage(Diagnostic.Kind.ERROR, "Manual implementation of Parcelable#writeToParcel(Parcel,int) found when processing " + autoValueClass.toString() + ". Remove this so auto-value-parcel can automatically generate the " + "implementation for you."); return false; } TypeMirror parcelable = context.processingEnvironment().getElementUtils() .getTypeElement("android.os.Parcelable").asType(); return TypeSimplifier.isClassOfType(context.processingEnvironment().getTypeUtils(), parcelable, autoValueClass); }</code><technical_language>Pass variable element static field arg this method error is it</technical_language>

Target:
public boolean applicable(Context context) { TypeMirror autoValueClass = context.autoValueClass().asType(); VariableElement creator = findCreator(context); if (creator != null) { context.processingEnvironment().getMessager().printMessage(Diagnostic.Kind.ERROR, "Manual implementation of a static Parcelable.Creator<T> CREATOR field found when processing " + autoValueClass.toString() + ". Remove this so auto-value-parcel can automatically generate the " + "implementation for you.", creator); } ExecutableElement writeToParcel = findWriteToParcel(context); if (writeToParcel != null) { context.processingEnvironment().getMessager().printMessage(Diagnostic.Kind.ERROR, "Manual implementation of Parcelable#writeToParcel(Parcel,int) found when processing " + autoValueClass.toString() + ". Remove this so auto-value-parcel can automatically generate the " + "implementation for you.", writeToParcel); } TypeMirror parcelable = context.processingEnvironment().getElementUtils() .getTypeElement("android.os.Parcelable").asType(); return TypeSimplifier.isClassOfType(context.processingEnvironment().getTypeUtils(), parcelable, autoValueClass); }
Source:
<code>public void findAll() throws Exception { <START> Object operatorID1 = repository.create(new NewOperator("name1", OperatorState.ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1")); <END> Object operatorID2 = repository.create(new NewOperator("name2", OperatorState.INACTIVE, "description2", "domainName2", "friendlyName2", "emergencyNumber2")); List<Operator> got = repository.findAll(); List<Operator> want = Lists.newArrayList( new Operator(new ID(operatorID1), "name1", OperatorState.ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1"), new Operator(new ID(operatorID2), "name2", OperatorState.INACTIVE, "description2", "domainName2", "friendlyName2", "emergencyNumber2") ); assertThat(got, deepEquals(want)); }</code><technical_language>renamed operatorID1? I other ids..</technical_language>

Target:
public void findAll() throws Exception { Object id1 = repository.create(new NewOperator("name1", OperatorState.ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1")); Object id2 = repository.create(new NewOperator("name2", OperatorState.INACTIVE, "description2", "domainName2", "friendlyName2", "emergencyNumber2")); List<Operator> got = repository.findAll(); List<Operator> want = Lists.newArrayList( new Operator(new ID(id1), "name1", OperatorState.ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1"), new Operator(new ID(id2), "name2", OperatorState.INACTIVE, "description2", "domainName2", "friendlyName2", "emergencyNumber2") ); assertThat(got, deepEquals(want)); }
Source:
<code>public void testRebindAfterItemDeprecated() { String yaml = "name: rebind-yaml-catalog-item-test\n" + "brooklyn.catalog:\n" + " version: " + TEST_VERSION + "\n" + "services:\n" + "- type: io.camp.mock:AppServer"; BasicBrooklynCatalog catalog = (BasicBrooklynCatalog) origManagementContext.getCatalog(); CatalogItem<?, ?> catalogItem = catalog.addItem(yaml); assertNotNull(catalogItem, "catalogItem"); <START> catalogItem.setDeprecated(true); <END> rebindAndAssertCatalogsAreEqual(); CatalogItem<?, ?> catalogItemAfterRebind = catalog.getCatalogItem("rebind-yaml-catalog-item-test", TEST_VERSION); assertTrue(catalogItemAfterRebind.isDeprecated(), "Expected item to be deprecated"); }</code><technical_language>this need call catalog.persist(catalogItem), calling setDeprecated? works add + setDeprecated happen in rapid succession, persister writes changes in go. If put a sleep for 2 seconds in betting fail</technical_language>

Target:
public void testRebindAfterItemDeprecated() { String yaml = "name: rebind-yaml-catalog-item-test\n" + "brooklyn.catalog:\n" + " version: " + TEST_VERSION + "\n" + "services:\n" + "- type: io.camp.mock:AppServer"; BasicBrooklynCatalog catalog = (BasicBrooklynCatalog) origManagementContext.getCatalog(); CatalogItem<?, ?> catalogItem = catalog.addItem(yaml); assertNotNull(catalogItem, "catalogItem"); catalogItem.setDeprecated(true); catalog.persist(catalogItem); rebindAndAssertCatalogsAreEqual(); CatalogItem<?, ?> catalogItemAfterRebind = newManagementContext.getCatalog().getCatalogItem("rebind-yaml-catalog-item-test", TEST_VERSION); assertTrue(catalogItemAfterRebind.isDeprecated(), "Expected item to be deprecated"); }
Source:
<code>public void test_backupOperationAppliesDefaultExpiryPolicy() { SimpleExpiryListener listener = new SimpleExpiryListener(); HazelcastExpiryPolicy defaultExpiryPolicy = new HazelcastExpiryPolicy(FIVE_SECONDS, FIVE_SECONDS, FIVE_SECONDS); CacheConfig cacheConfig = createCacheConfig(defaultExpiryPolicy, listener); ICache cache = createCache(cacheConfig); for (int i = 0; i < 100; i++) { cache.put(i, i); } <START> sleepAtLeastMillis(500); END> for (int i = 1; i < CLUSTER_SIZE; i++) { BackupAccessor backupAccessor = TestBackupUtils.newCacheAccessor(instances, cache.getName(), i); for (int j = 0; j < 100; j++) { TestBackupUtils.assertExpirationTimeExists(j, backupAccessor); } } getNode(instances[1]).shutdown(true); getNode(instances[2]).shutdown(true); sleepAtLeastMillis(4500); int unExpiredCount = 0; for (int i = 0; i < 100; i++) { if (cache.get(i) != null) { unExpiredCount++; break; } } assertEquals(0, unExpiredCount); assertEqualsEventually(100, listener.expirationCount); }</code><technical_language>assert this for block assertTrueEventually get rid of sleep above</technical_language>

Target:
public void test_backupOperationAppliesDefaultExpiryPolicy() { SimpleExpiryListener listener = new SimpleExpiryListener(); HazelcastExpiryPolicy defaultExpiryPolicy = new HazelcastExpiryPolicy(FIVE_SECONDS, FIVE_SECONDS, FIVE_SECONDS); CacheConfig cacheConfig = createCacheConfig(defaultExpiryPolicy, listener); ICache cache = createCache(cacheConfig); for (int i = 0; i < 100; i++) { cache.put(i, i); } for (int i = 1; i < CLUSTER_SIZE; i++) { BackupAccessor backupAccessor = TestBackupUtils.newCacheAccessor(instances, cache.getName(), i); for (int j = 0; j < 100; j++) { TestBackupUtils.assertExpirationTimeExistsEventually(j, backupAccessor); } } getNode(instances[1]).shutdown(true); getNode(instances[2]).shutdown(true); sleepAtLeastSeconds(5); int unExpiredCount = 0; for (int i = 0; i < 100; i++) { if (cache.get(i) != null) { unExpiredCount++; break; } } assertEquals(0, unExpiredCount); assertEqualsEventually(100, listener.expirationCount); }
Source:
<code>private static void saveLocks(File locksData) throws IOException { try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(locksData))) { out.writeInt(DATA_VERSION); out.writeInt(locks.size()); for (String <START> string : <END> locks) out.writeUTF(string); } }</code><technical_language>rename lock</technical_language>

Target:
private static void saveLocks(File locksData) throws IOException { try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(locksData))) { out.writeInt(DATA_VERSION); out.writeInt(locks.size()); for (String lock : locks) out.writeUTF(lock); } }
Source:
<code>public Credentials getCredentials() throws IOException { <START> if (StringUtils.isNotEmpty(this.jsonPath)) { <END> try { return ServiceAccountCredentials.fromStream(new FileInputStream(jsonPath)); } catch (IOException e) { log.error("Could not import Google Pubsub json credentials: {}", e.getMessage()); } } else { try { return GoogleCredentials.getApplicationDefault(); } catch (IOException e) { log.error("Could not import default application credentials: {}", e.getMessage()); } } throw new IllegalStateException("Unable to authenticate to Google Pubsub."); }</code><technical_language>Nit: this is in subsequent references in this function</technical_language>

Target:
public Credentials getCredentials() throws IOException { if (StringUtils.isNotEmpty(this.jsonPath)) { try { return ServiceAccountCredentials.fromStream(new FileInputStream(this.jsonPath)); } catch (IOException e) { log.error("Could not import Google Pubsub json credentials: {}", e.getMessage()); } } else { try { return GoogleCredentials.getApplicationDefault(); } catch (IOException e) { log.error("Could not import default application credentials: {}", e.getMessage()); } } throw new IllegalStateException("Unable to authenticate to Google Pubsub."); }
Source:
<code>public String getEndpoint() <START> { <END> String stringToken = jmxConnect.getStorageServiceProxy().getTokens().get(0); Map<String, String> tokenToEndpoint = jmxConnect.getStorageServiceProxy().getTokenToEndpointMap(); for (Map.Entry<String, String> pair : tokenToEndpoint.entrySet()) { if (pair.getKey().equals(stringToken)) { return pair.getValue(); } } throw new RuntimeException("Could not find myself in the endpoint list, something is very wrong! Is the Cassandra node fully started?"); }</code><technical_language>inconsistent curly brace placement. Lets move end-of-line others</technical_language>

Target:
public String getEndpoint() { String stringToken = jmxConnect.getStorageServiceProxy().getTokens().get(0); Map<String, String> tokenToEndpoint = jmxConnect.getStorageServiceProxy().getTokenToEndpointMap(); for (Map.Entry<String, String> pair : tokenToEndpoint.entrySet()) { if (pair.getKey().equals(stringToken)) { return pair.getValue(); } } throw new InconsistentNodeException("Could not find myself in the endpoint list, something is very wrong! Is the Cassandra node fully started?"); }
Source:
<code>public Response purgeCache(String serviceId) { LOG.info("purgeCache() called with serviceId={}", serviceId); Optional<BaragonService> maybeService; if (internalStateCache.containsKey(serviceId)){ maybeService = Optional.of(internalStateCache.get(serviceId).getService()); } else { maybeService = stateDatastore.getService(serviceId); } if (!maybeService.isPresent()){ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(String.format("Could not find service with serviceId=%s", serviceId)).build(); } <START> String serviceBasePathWithoutLeadingSlash = getServiceBasePathWithoutLeadingSlash( <END> maybeService.get().getServiceBasePath() ); String purgeCacheUri = String.format( baragonAgentConfiguration.getPurgeCacheUriFormat(), serviceBasePathWithoutLeadingSlash ); LOG.info("purgeCache() uri={}", purgeCacheUri); final HttpRequest.Builder builder = HttpRequest.newBuilder() .setUrl(purgeCacheUri) .setMethod(Method.GET); HttpResponse response = this.httpClient.execute(builder.build()); LOG.info("purgeCache() response from loadbalancer={}", response.getAsString()); return Response.status(response.getStatusCode()).entity(response.getAsString()).build(); }</code><technical_language>Do want purge cache path service id both? - deploy want purge cache, is generally for a service routes for - For some of services, routes regexes, ends tricky deal - cache in nginx cache individual route tag service? i.e. module adding handle 'purge tagged serviceId'</technical_language>

Target:
public Response purgeCache(String serviceId) { LOG.info("purgeCache() called with serviceId={}", serviceId); Optional<BaragonService> maybeService; if (internalStateCache.containsKey(serviceId)){ maybeService = Optional.of(internalStateCache.get(serviceId).getService()); } else { maybeService = stateDatastore.getService(serviceId); } if (!maybeService.isPresent()){ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(String.format("Could not find service with serviceId=%s", serviceId)).build(); } String purgeCacheUri = String.format( baragonAgentConfiguration.getPurgeCacheUriFormat(), Hashing.sha256() .hashString(maybeService.get().getServiceId(), StandardCharsets.UTF_8) .toString() ); LOG.info("purgeCache() uri={}", purgeCacheUri); final HttpRequest.Builder builder = HttpRequest.newBuilder() .setUrl(purgeCacheUri) .setMethod(Method.POST); try { HttpResponse response = this.httpClient.execute(builder.build()); LOG.info("purgeCache() response from loadbalancer={}", response.getAsString()); return Response.status(response.getStatusCode()).entity(response.getAsString()).build(); } catch (Exception e){ LOG.error("purgeCache() exception, but will not fail", e); return Response.serverError().entity(e.getMessage()).build(); } }
Source:
<code>private ICompletionProposal[] computeProposals(int offset) { try { if (fContentAssistSubjectControl != null) return fContentAssistant.computeCompletionProposals(fContentAssistSubjectControl, offset); return fContentAssistant.computeCompletionProposals(fViewer, offset); <START> } catch (RuntimeException e) { <END> hide(); throw e; } catch (Error e) { hide(); throw e; } }</code><technical_language>catch clauses RuntimeException Error replaced Throwable</technical_language>

Target:
private ICompletionProposal[] computeProposals(int offset) { ICompletionProposal[] proposals = null; boolean succeeded = false; try { if (fContentAssistSubjectControl != null) { proposals = fContentAssistant.computeCompletionProposals(fContentAssistSubjectControl, offset); } else { proposals = fContentAssistant.computeCompletionProposals(fViewer, offset); } succeeded = true; } finally { if (!succeeded) { hide(); } } return proposals; }
Source:
<code>private void setAboutThisCourse(String overview) { <START> addDivider(); <END> courseAbout.setVisibility(View.VISIBLE); URLInterceptorWebViewClient client = new URLInterceptorWebViewClient( getActivity(), courseAboutWebView); client.setAllLinksAsExternal(true); StringBuffer buff = new StringBuffer(); buff.append("<head>"); buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); try { String cssFileContent = FileUtil.loadTextFileFromAssets(getActivity(), "css/render-html-in-webview.css"); buff.append("<style>"); buff.append(cssFileContent); buff.append("</style>"); } catch (IOException e) { logger.error(e); } buff.append("</head>"); buff.append("<body>"); buff.append("<div class=\"header\">"); buff.append(overview); buff.append("</div>"); buff.append("</body>"); courseAboutWebView.clearCache(true); courseAboutWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); }</code><technical_language>nit: this divider's existence depends visibility of courseAbout, define in XML child of courseAbout LinearLayout. (I prefer XML layouts code reasonable)</technical_language>

Target:
private void setAboutThisCourse(String overview) { courseAbout.setVisibility(View.VISIBLE); URLInterceptorWebViewClient client = new URLInterceptorWebViewClient( getActivity(), courseAboutWebView); client.setAllLinksAsExternal(true); StringBuffer buff = new StringBuffer(); buff.append("<head>"); buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); try { String cssFileContent = FileUtil.loadTextFileFromAssets(getActivity(), "css/render-html-in-webview.css"); buff.append("<style>"); buff.append(cssFileContent); buff.append("</style>"); } catch (IOException e) { logger.error(e); } buff.append("</head>"); buff.append("<body>"); buff.append("<div class=\"header\">"); buff.append(overview); buff.append("</div>"); buff.append("</body>"); courseAboutWebView.clearCache(true); courseAboutWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); }
Source:
<code>public static StringComparator makeComparator(String type) { <START> if (type.equals(StringComparators.LEXICOGRAPHIC)) { <END> return lexicographic(); } else if (type.equals(StringComparators.ALPHANUMERIC)) { return alphanumeric(); } else { throw new IAE("Unknown string comparator[%s]", type); } }</code><technical_language>nice if polymorphic deserialization, i thinkthat is a bigger change</technical_language>

Target:
public static StringComparator makeComparator(String type) { if (type.equals(StringComparators.LEXICOGRAPHIC_NAME)) { return LEXICOGRAPHIC; } else if (type.equals(StringComparators.ALPHANUMERIC_NAME)) { return ALPHANUMERIC; } else { throw new IAE("Unknown string comparator[%s]", type); } }
Source:
<code>public void setUp() throws IOException { existingTempFile = File.createTempFile("FiletypeTest.", ".tmp"); existingTempFile.deleteOnExit(); systemTempDir = System.getProperty("java.io.tmpdir"); final File tmpDir = new File(systemTempDir); <START> inMemmoryfileSystem = Jimfs.newFileSystem(Configuration.unix());; <END> if (!tmpDir.isDirectory()) tmpDir.mkdir(); if (!tmpDir.isDirectory()) throw new RuntimeException("java.io.tmpdir (" + systemTempDir + ") is not a directory"); systemUser = System.getProperty("user.name"); }</code><technical_language>memory...single 'm'</technical_language>

Target:
public void setUp() throws IOException { existingTempFile = File.createTempFile("FiletypeTest.", ".tmp"); existingTempFile.deleteOnExit(); systemTempDir = System.getProperty("java.io.tmpdir"); final File tmpDir = new File(systemTempDir); inMemoryfileSystem = Jimfs.newFileSystem(Configuration.unix());; if (!tmpDir.isDirectory()) tmpDir.mkdir(); if (!tmpDir.isDirectory()) throw new RuntimeException("java.io.tmpdir (" + systemTempDir + ") is not a directory"); systemUser = System.getProperty("user.name"); }
Source:
<code>public Response deleteParagraph(@PathParam("noteId") String noteId, @PathParam("paragraphId") String paragraphId) throws IOException { LOG.info("delete paragraph {}", noteId, paragraphId); Note note = notebook.getNote(noteId); checkIfNoteIsNotNull(note); <START> checkIfUserIsOwner(noteId, <END> "Insufficient privileges you cannot remove paragraph from this note"); Paragraph p = note.getParagraph(paragraphId); checkIfParagraphIsNotNull(p); AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal()); note.removeParagraph(SecurityUtils.getPrincipal(), paragraphId); note.persist(subject); notebookServer.broadcastNote(note); return new JsonResponse(Status.OK, "").build(); }</code><technical_language>writer permission insert paragraph note, sense allow remove paragraph? For example if added new paragraph mistake, able remove</technical_language>

Target:
public Response deleteParagraph(@PathParam("noteId") String noteId, @PathParam("paragraphId") String paragraphId) throws IOException { LOG.info("delete paragraph {}", noteId, paragraphId); Note note = notebook.getNote(noteId); checkIfNoteIsNotNull(note); checkIfUserCanRead(noteId, "Insufficient privileges you cannot remove paragraph from this note"); Paragraph p = note.getParagraph(paragraphId); checkIfParagraphIsNotNull(p); AuthenticationInfo subject = new AuthenticationInfo(SecurityUtils.getPrincipal()); note.removeParagraph(SecurityUtils.getPrincipal(), paragraphId); note.persist(subject); notebookServer.broadcastNote(note); return new JsonResponse(Status.OK, "").build(); }
Source:
<code>public Object getValue() { <START> if (value == null) { <END> return null; } else { return value; } }</code><technical_language>This simplified just: >return value;</technical_language>

Target:
public Object getValue() { return value; }
Source:
<code>private static List<Interval> breakIntervalAtBandMultiples(final Interval interval, final int bandMultiple) { final List<Interval> brokenUpIntervals = new ArrayList<Interval>(); int startPos = interval.getStart(); int startIndex = startPos / bandMultiple; final int endIndex = interval.getEnd() / bandMultiple; while (startIndex <= endIndex) { int endPos = (startIndex + 1) * bandMultiple -1; <START> if (endPos >= interval.getEnd()) { <END> endPos = interval.getEnd(); } brokenUpIntervals.add(new Interval(interval.getContig(), startPos, endPos, interval.isNegativeStrand(), interval.getName() + "." + startIndex)); startIndex++; startPos = startIndex * bandMultiple; } return brokenUpIntervals; }</code><technical_language>replaced strict ></technical_language>

Target:
private static List<Interval> breakIntervalAtBandMultiples(final Interval interval, final int bandMultiple) { final List<Interval> brokenUpIntervals = new ArrayList<Interval>(); int startPos = interval.getStart(); int startIndex = startPos / bandMultiple; final int endIndex = interval.getEnd() / bandMultiple; while (startIndex <= endIndex) { int endPos = (startIndex + 1) * bandMultiple -1; if (endPos > interval.getEnd()) { endPos = interval.getEnd(); } brokenUpIntervals.add(new Interval(interval.getContig(), startPos, endPos, interval.isNegativeStrand(), interval.getName() + "." + startIndex)); startIndex++; startPos = startIndex * bandMultiple; } return brokenUpIntervals; }
Source:
<code>public boolean isEnabled() { ISearchResultPage page = getCurrentPage(); <START> return page != null && !BLACKLISTED_IDS.contains(page.getID()); <END> }</code><technical_language>want enable get a viewer page. Right this enables for plugin search, viewer plugin search ends viewer due a bug I getViewer() method. This is a real concern if move a whitelist</technical_language>

Target:
public boolean isEnabled() { ISearchResultPage page = getCurrentPage(); return page != null && WHITELISTED_IDS.contains(page.getID()); }
Source:
<code><START> public void awaitActiveContexts() throws InterruptedException { <END> activeContextLatch.await(); activeContexts.addAll(pendingTaskSubmissions.values()); for (int i = 0; i < activeContexts.size(); i++) { planEvaluatorIdsToContexts.put(planEvaluatorIds.get(i), activeContexts.get(i)); } }</code><technical_language>this method explicitly throw Exception. Is special reasons</technical_language>

Target:
public void awaitActiveContexts() { try { activeContextLatch.await(); } catch (final InterruptedException e) { throw new RuntimeException(e); } activeContexts.addAll(pendingTaskSubmissions.values()); for (int i = 0; i < activeContexts.size(); i++) { planEvaluatorIdsToContexts.put(planEvaluatorIds.get(i), activeContexts.get(i)); } }
Source:
<code>public TemplateEngineFreemarkerAuthenticityTokenDirective(Context context) { <START> this.authenticityToken = context.getSession().getAuthenticityToken(); <END> }</code><technical_language>please do this in execute method. adding __AT session - if is needed..</technical_language>

Target:
public TemplateEngineFreemarkerAuthenticityTokenDirective(Context context) { this.context = context; }
Source:
<code>private void setShadowBackgroundColor(Graphics graphics) { Color color = null; <START> if (shadowColor != null && !"-1".equals(shadowColor)) { <END> RGBColor rgbColor = CSS2ColorHelper.getRGBColor(shadowColor); if (rgbColor != null) { int red = Integer.parseInt(rgbColor.getRed().toString()); int green = Integer.parseInt(rgbColor.getGreen().toString()); int blue = Integer.parseInt(rgbColor.getBlue().toString()); color = new Color(Display.getCurrent(), new RGB(red, green, blue)); } else { color = ColorRegistry.getInstance().getColor(Integer.valueOf(shadowColor)); } graphics.setBackgroundColor(color); } else { graphics.setBackgroundColor(getForegroundColor()); } }</code><technical_language>I suspect invalid values exceptions here. If color is ("gred?"), a natural integer, manipulate null colors (In case), get exceptions</technical_language>

Target:
private void setShadowBackgroundColor(Graphics graphics) { Color color = null; if (shadowColor != null && !"-1".equals(shadowColor)) { RGBColor rgbColor = CSS2ColorHelper.getRGBColor(shadowColor); if (rgbColor != null) { int red = Integer.parseInt(rgbColor.getRed().toString()); int green = Integer.parseInt(rgbColor.getGreen().toString()); int blue = Integer.parseInt(rgbColor.getBlue().toString()); color = new Color(Display.getCurrent(), new RGB(red, green, blue)); } if (color == null) { try { color = ColorRegistry.getInstance().getColor(Integer.valueOf(shadowColor)); } catch (NumberFormatException e) { } } } if (color != null) { graphics.setBackgroundColor(color); } else { graphics.setBackgroundColor(getForegroundColor()); } }
Source:
<code>public ReadRowsRequest get() { if (cachedRequest == null) { Scan scan = new Scan(); if (start.get() != null && !start.get().isEmpty()) { <START> scan.setStartRow(stop.get().getBytes()); <END> } if (stop.get() != null && !stop.get().isEmpty()) { scan.setStopRow(stop.get().getBytes()); } if (maxVersion.get() != null) { scan.setMaxVersions(maxVersion.get()); } if (filter.get() != null && !filter.get().isEmpty()) { try { scan.setFilter(new ParseFilter().parseFilterString(filter.get())); } catch (CharacterCodingException e) { e.printStackTrace(); throw new RuntimeException(e); } } ReadHooks readHooks = new DefaultReadHooks(); ReadRowsRequest.Builder builder = Adapters.SCAN_ADAPTER.adapt(scan, readHooks); cachedRequest = readHooks.applyPreSendHook(builder.build()); } return cachedRequest; }</code><technical_language>I meant start.get()</technical_language>

Target:
public ReadRowsRequest get() { if (cachedRequest == null) { Scan scan = new Scan(); if (start.get() != null && !start.get().isEmpty()) { scan.setStartRow(start.get().getBytes()); } if (stop.get() != null && !stop.get().isEmpty()) { scan.setStopRow(stop.get().getBytes()); } if (maxVersion.get() != null) { scan.setMaxVersions(maxVersion.get()); } if (filter.get() != null && !filter.get().isEmpty()) { try { scan.setFilter(new ParseFilter().parseFilterString(filter.get())); } catch (CharacterCodingException e) { throw new RuntimeException(e); } } ReadHooks readHooks = new DefaultReadHooks(); ReadRowsRequest.Builder builder = Adapters.SCAN_ADAPTER.adapt(scan, readHooks); cachedRequest = readHooks.applyPreSendHook(builder.build()); } return cachedRequest; }
Source:
<code>public void testMultiplePutsOnSameKey() throws Exception { TestResourceTracker.backgroundTestStarted(this); createStore(); final int number = 100; <START> final int loops = 10000; <END> for (int i = 0; i < loops; i++) { String key = "testMultiplePutsOnSameKey-k"; String value = "testMultiplePutsOnSameKey-v-"; doTestSameKeyPut(number, key, value); doTestSameKeyRemove(key); } }</code><technical_language>need a smaller number of outer loop iterations here, test timed out I ran trace logging enabled. I extend DummyInMemoryStore sleep(1) write, a smaller number of iterations (perhaps 5/100). is now, I test fit in AsyncStoreStressTest</technical_language>

Target:
public void testMultiplePutsOnSameKey() throws Exception { TestResourceTracker.backgroundTestStarted(this); createStore(); final int number = 1000; String key = "testMultiplePutsOnSameKey-k"; String value = "testMultiplePutsOnSameKey-v-"; doTestSameKeyPut(number, key, value); doTestSameKeyRemove(key); }
Source:
<code>protected void createTable(final DbEntity entity) throws DatabaseEngineException { final String defaultCreateTableStatement = getCreateTableStatement(entity); final String createTableCompressLOBS = getCompressLobsStatements(entity); final String createTableStatement = defaultCreateTableStatement + createTableCompressLOBS; <START> for (final String createTable : ImmutableList.of(createTableStatement, defaultCreateTableStatement)) { <END> try ( Statement statement = conn.createStatement() ) { statement.executeUpdate(createTable); break; } catch (final SQLException ex) { if (ex.getMessage().startsWith(NAME_ALREADY_EXISTS)) { logger.debug(dev, "'{}' is already defined", entity.getName()); handleOperation(new OperationFault(entity.getName(), OperationFault.Type.TABLE_ALREADY_EXISTS), ex); break; } else if (ex.getMessage().startsWith(SECUREFILE_NOT_ASSM)) { logger.warn("Secure file LOBS cannot be used in non-ASSM tablespace. Creating table " + "without compressed lobs"); } else { throw new DatabaseEngineException("Something went wrong handling statement", ex); } } } }</code><technical_language>I this, I find a works find out if LOB compression work :(</technical_language>

Target:
protected void createTable(final DbEntity entity) throws DatabaseEngineException { final String defaultCreateTableStatement = getCreateTableStatement(entity); final String createTableCompressLOBS = getCompressLobsStatements(entity); final String createTableStatement = defaultCreateTableStatement + createTableCompressLOBS; for (final String createTable : ImmutableList.of(createTableStatement, defaultCreateTableStatement)) { try (final Statement statement = conn.createStatement()) { statement.executeUpdate(createTable); return; } catch (final SQLException ex) { if (ex.getMessage().startsWith(NAME_ALREADY_EXISTS)) { logger.debug(dev, "'{}' is already defined", entity.getName()); handleOperation(new OperationFault(entity.getName(), OperationFault.Type.TABLE_ALREADY_EXISTS), ex); return; } else if (ex.getMessage().startsWith(SECUREFILE_NOT_ASSM)) { logger.warn("Secure file LOBS cannot be used in non-ASSM tablespace. Creating table " + "without compressed lobs"); } else if (ex.getMessage().startsWith(SECUREFILE_LOB_NOT_ENABLED)) { logger.warn("Unsupported LOB type for SECUREFILE LOB operation. Creating table " + "without compressed lobs"); } else if (ex.getMessage().startsWith(COMPRESSION_NOT_ENABLED)) { logger.warn("Feature not enabled: Advanced Compression. Creating table " + "without compressed lobs"); } else { throw new DatabaseEngineException("Something went wrong handling statement", ex); } } } }
Source:
<code>@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); <START> setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); <END> }</code><technical_language>Good note. I USER_PORTRAIT works upside</technical_language>

Target:
@TargetApi(18) @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setRequestedOrientation(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2 ? ActivityInfo.SCREEN_ORIENTATION_USER_PORTRAIT : ActivityInfo.SCREEN_ORIENTATION_PORTRAIT); }
Source:
<code>public KualiDecimal getTotalAmountBilledToDate() { KualiDecimal total = KualiDecimal.ZERO; for (InvoiceAccountDetail accountDetail : accountDetails) { <START> total = total.add(accountDetail.getAdjustedCumExpenditures()); <END> } return total; }</code><technical_language>accountDetail.getAdjustedCumExpenditures() method renamed getTotalAmountBilledToDate()</technical_language>

Target:
public KualiDecimal getTotalAmountBilledToDate() { KualiDecimal total = KualiDecimal.ZERO; for (InvoiceAccountDetail accountDetail : accountDetails) { total = total.add(accountDetail.getTotalAmountBilledToDate()); } return total; }
Source:
<code>private static List<SourceMethod> filterCandidatesByType(Method method, List<SourceMethod> callbackMethods, Map<SourceMethod, List<Parameter>> parameterAssignmentsForSourceMethod, MappingBuilderContext ctx) { List<SourceMethod> candidates = new ArrayList<SourceMethod>(); List<Parameter> availableParams = getAvailableParameters( method, ctx ); for ( SourceMethod callback : callbackMethods ) { List<Parameter> parameterAssignments = ParameterAssignmentUtil.getParameterAssignments( availableParams, callback.getParameters() ); if ( parameterAssignments != null && callback.matches( extractSourceTypes( parameterAssignments ), method.getResultType() ) && ( callback.getReturnType().isVoid() || callback.getReturnType().isTypeVar() <START> || callback.getReturnType().isAssignableTo( method.getResultType() ) ) ) { <END> parameterAssignmentsForSourceMethod.put( callback, parameterAssignments ); candidates.add( callback ); } } return candidates; }</code><technical_language>I extract checks some method instead of in if</technical_language>

Target:
private static List<SourceMethod> filterCandidatesByType(Method method, List<SourceMethod> callbackMethods, Map<SourceMethod, List<Parameter>> parameterAssignmentsForSourceMethod, MappingBuilderContext ctx) { List<SourceMethod> candidates = new ArrayList<SourceMethod>(); List<Parameter> availableParams = getAvailableParameters( method, ctx ); for ( SourceMethod callback : callbackMethods ) { List<Parameter> parameterAssignments = ParameterAssignmentUtil.getParameterAssignments( availableParams, callback.getParameters() ); if ( isValidCandidate( callback, method, parameterAssignments ) ) { parameterAssignmentsForSourceMethod.put( callback, parameterAssignments ); candidates.add( callback ); } } return candidates; }