auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public InitialAuthConfig(ConfigurationProperties configurationProperties) { Map<String, String> authProperties = configurationProperties.getProperties(CONFIGURATION_PREFIX_PATTERN); Set<String> registryPrefixes = authProperties.entrySet() .stream() .map(property -> getRegistryPrefix(property.getKey())) .collect(Collectors.toSet()); <START> Map<String, AuthConfig> configMap = new HashMap<>(); <END> for (String regPrefix: registryPrefixes) { String url = getPropertyValue(authProperties, regPrefix + URL); String userName = getPropertyValue(authProperties, regPrefix + USER_NAME); String password = getPropertyValue(authProperties, regPrefix + PASSWORD); configMap.put(url, newDto(AuthConfig.class).withUsername(userName).withPassword(password)); } authConfigs = newDto(AuthConfigs.class).withConfigs(configMap); }</code><technical_language>size provided iterate registryPrefixes length</technical_language>

Target:
public InitialAuthConfig(ConfigurationProperties configurationProperties) { Map<String, String> authProperties = configurationProperties.getProperties(CONFIGURATION_PREFIX_PATTERN); Set<String> registryPrefixes = authProperties.entrySet() .stream() .map(property -> getRegistryPrefix(property.getKey())) .collect(Collectors.toSet()); Map<String, AuthConfig> configMap = newHashMapWithExpectedSize(registryPrefixes.size()); for (String regPrefix : registryPrefixes) { String url = getPropertyValue(authProperties, regPrefix + URL); String userName = getPropertyValue(authProperties, regPrefix + USER_NAME); String password = getPropertyValue(authProperties, regPrefix + PASSWORD); configMap.put(url, newDto(AuthConfig.class).withUsername(userName).withPassword(password)); } authConfigs = newDto(AuthConfigs.class).withConfigs(configMap); }
Source:
<code>public void testStopCq() throws Exception { gfsh.executeAndAssertThat("create region --name=region --type=PARTITION") .statusIsSuccess(); qs.newCq("Select * from /region r where r.ID = 1", cqa).execute(); server1.invoke(() -> populateRegion(0, 100)); locator.invoke(() -> { Cache cache = getCache(); ManagementService service = ManagementService.getManagementService(cache); DistributedSystemMXBean dsmbean = service.getDistributedSystemMXBean(); <START> await().untilAsserted(() -> assertThat(dsmbean.getActiveCQCount()).isEqualTo(2)); <END> }); qs.stopCqs(); locator.invoke(() -> { Cache cache = getCache(); ManagementService service = ManagementService.getManagementService(cache); DistributedSystemMXBean dsmbean = service.getDistributedSystemMXBean(); await().untilAsserted(() -> assertThat(dsmbean.getActiveCQCount()).isEqualTo(0)); }); checkActiveCqCount(server1, 0); checkActiveCqCount(server2, 0); }</code><technical_language>Please provide a timeout. I tested timeout(30, TimeUnit.SECONDS). This way, this test terminate in a "reasonable" time</technical_language>

Target:
public void testStopCq() throws Exception { gfsh.executeAndAssertThat("create region --name=region --type=PARTITION") .statusIsSuccess(); queryService.newCq("Select * from /region r where r.ID = 1", cqAttributes).execute(); server1.invoke(() -> populateRegion(0, 100)); locator.invoke(() -> { Cache cache = getCache(); ManagementService service = ManagementService.getManagementService(cache); DistributedSystemMXBean dsmbean = service.getDistributedSystemMXBean(); await().atMost(30, TimeUnit.SECONDS) .untilAsserted(() -> assertThat(dsmbean.getActiveCQCount()).isEqualTo(2)); }); queryService.stopCqs(); locator.invoke(() -> { Cache cache = getCache(); ManagementService service = ManagementService.getManagementService(cache); DistributedSystemMXBean dsmbean = service.getDistributedSystemMXBean(); await().atMost(30, TimeUnit.SECONDS) .untilAsserted(() -> assertThat(dsmbean.getActiveCQCount()).isEqualTo(0)); }); checkActiveCqCount(server1, 0); checkActiveCqCount(server2, 0); }
Source:
<code>public void testGetEventSuccess() throws Exception { <START> Client client = getLiveClient(); <END> Request<Event> request = new Event.GetRequestBuilder(EVENT_ID).build(); Event event = client.sendRequest(request, Event.class); System.out.printf("Event retrieved: %s", event.getId()); assertNotNull(event); assertEquals(EVENT_ID, event.getId()); assertTrue(event.getData() instanceof Charge); }</code><technical_language>move client global variable</technical_language>

Target:
public void testGetEventSuccess() throws Exception { Request<Event> request = new Event.GetRequestBuilder(EVENT_ID).build(); Event event = client.sendRequest(request, Event.class); System.out.printf("Event retrieved: %s", event.getId()); assertNotNull(event); assertEquals(EVENT_ID, event.getId()); assertTrue(event.getData() instanceof Charge); }
Source:
<code>public List<UUID> getTaggedTables() { TableRegistry tableRegistry = runtime.getTableRegistry(); List<UUID> tables = tableRegistry .listTables() .stream() .filter(tableName -> tableRegistry .getRegistryTable() .get(tableName) .getMetadata() .getTableOptions() .getRequiresBackupSupport()) .map(tableName -> CorfuRuntime .getStreamID(TableRegistry.getFullyQualifiedTableName(tableName))) .collect(Collectors.toList()); <START> log.info("{} tables need to be backed up: {}", tables.size(), tables); <END> return tables; }</code><technical_language>do want print names of tables? this print list reference, right</technical_language>

Target:
private List<UUID> getTaggedTables() { TableRegistry tableRegistry = runtime.getTableRegistry(); List<UUID> tables = tableRegistry .listTables() .stream() .filter(tableName -> tableRegistry .getRegistryTable() .get(tableName) .getMetadata() .getTableOptions() .getRequiresBackupSupport()) .map(tableName -> CorfuRuntime .getStreamID(TableRegistry.getFullyQualifiedTableName(tableName))) .collect(Collectors.toList()); log.info("{} tables need to be backed up: {}", tables.size(), tables); return tables; }
Source:
<code>void bindItem(int position) { pos = position; PageTitle item = languageEntries.get(position); String languageCode = item.getWikiSite().languageCode(); String localizedLanguageName = app.language().getAppLanguageLocalizedName(languageCode); localizedLanguageNameTextView.setText(localizedLanguageName == null ? languageCode : StringUtils.capitalize(localizedLanguageName)); articleTitleTextView.setText(item.getDisplayText()); if (langLinksProgress.getVisibility() != View.VISIBLE && !languageCode.equals(app.language().getSystemLanguageCode())) { String canonicalName = getCanonicalName(languageCode); <START> if (canonicalName != null) { <END> nonLocalizedLanguageNameTextView.setText(TextUtils.isEmpty(canonicalName) ? app.language().getAppLanguageCanonicalName(languageCode) : canonicalName); } } itemView.setOnClickListener(this); }</code><technical_language>Is this required while testing for empty</technical_language>

Target:
void bindItem(int position) { pos = position; PageTitle item = languageEntries.get(position); String languageCode = item.getWikiSite().languageCode(); String localizedLanguageName = app.language().getAppLanguageLocalizedName(languageCode); localizedLanguageNameTextView.setText(localizedLanguageName == null ? languageCode : StringUtils.capitalize(localizedLanguageName)); articleTitleTextView.setText(item.getDisplayText()); if (langLinksProgress.getVisibility() != View.VISIBLE) { String canonicalName = getCanonicalName(languageCode); if (TextUtils.isEmpty(canonicalName) || languageCode.equals(app.language().getSystemLanguageCode())) { nonLocalizedLanguageNameTextView.setVisibility(View.GONE); } else { nonLocalizedLanguageNameTextView.setText(canonicalName); nonLocalizedLanguageNameTextView.setVisibility(View.VISIBLE); } } itemView.setOnClickListener(this); }
Source:
<code>public static void clearLogOffline(final String geocode) { if (StringUtils.isBlank(geocode)) { return; } init(); final String[] geocodeWhereArgs = {geocode}; database.delete(dbTableLogsOffline, "geocode = ?", geocodeWhereArgs); <START> database.execSQL(String.format("UPDATE %s SET visiteddate = 0 where geocode = ?", dbTableCaches), geocodeWhereArgs); <END> }</code><technical_language>in uppercase (several instances) is a SQL keyword</technical_language>

Target:
public static void clearLogOffline(final String geocode) { if (StringUtils.isBlank(geocode)) { return; } init(); final String[] geocodeWhereArgs = {geocode}; database.delete(dbTableLogsOffline, "geocode = ?", geocodeWhereArgs); database.execSQL(String.format("UPDATE %s SET visiteddate = 0 WHERE geocode = ?", dbTableCaches), geocodeWhereArgs); }
Source:
<code>public ByteBuf readChunk( ByteBufAllocator allocator ) throws IOException { boolean endOfInput = isEndOfInput(); if ( endOfInput ) { return null; } ByteBuf buffer = allocator.buffer( chunkSize ); try { buffer.writeBoolean( endOfInput ); if ( progress() == 0 ) { buffer.writeByte( contentType ); buffer.writeInt( byteBufAwareMarshal.length() ); } if ( !byteBufAwareMarshal.encode( buffer ) ) { lastByteWasWritten = true; } if ( isEndOfInput() != endOfInput ) { buffer.setBoolean( 0, isEndOfInput() ); } progress += buffer.readableBytes(); return buffer; } <START> catch ( IOException e ) <END> { buffer.release(); throw e; } }</code><technical_language>Catch Throwable here? want lean right</technical_language>

Target:
public ByteBuf readChunk( ByteBufAllocator allocator ) throws IOException { if ( isEndOfInput() ) { return null; } boolean lastChunk = true; ByteBuf buffer = allocator.buffer( chunkSize ); try { buffer.writeBoolean( lastChunk ); if ( progress() == 0 ) { buffer.writeByte( contentType ); buffer.writeInt( byteBufAwareMarshal.length() ); } if ( !byteBufAwareMarshal.encode( buffer ) ) { this.endOfInput = true; } if ( isEndOfInput() != lastChunk ) { buffer.setBoolean( 0, isEndOfInput() ); } progress += buffer.readableBytes(); return buffer; } catch ( Throwable e ) { buffer.release(); throw e; } }
Source:
<code><START> private final AlignmentContext getDerivedAlignmentContext( <END> final Set<ReferenceContext> sliceReferenceContexts, final int singleRefAlignmentStart, final int singleRefAlignmentEnd) { ReferenceContext referenceContext; switch (sliceReferenceContexts.size()) { case 0: referenceContext = ReferenceContext.UNMAPPED_UNPLACED_CONTEXT; break; case 1: referenceContext = sliceReferenceContexts.iterator().next(); break; default: referenceContext = ReferenceContext.MULTIPLE_REFERENCE_CONTEXT; } if (referenceContext.isMappedSingleRef()) { AlignmentContext.validateAlignmentContext( true, referenceContext, singleRefAlignmentStart, singleRefAlignmentEnd - singleRefAlignmentStart + 1); return new AlignmentContext( referenceContext, singleRefAlignmentStart, singleRefAlignmentEnd - singleRefAlignmentStart + 1); } else if (referenceContext.isUnmappedUnplaced()) { return AlignmentContext.UNMAPPED_UNPLACED_CONTEXT; } else { return AlignmentContext.MULTIPLE_REFERENCE_CONTEXT; } }</code><technical_language>suggestion private static final AlignmentContext getDerivedAlignmentContext(</technical_language>

Target:
private static final AlignmentContext getDerivedAlignmentContext( final Set<ReferenceContext> sliceReferenceContexts, final int singleRefAlignmentStart, final int singleRefAlignmentEnd) { ReferenceContext referenceContext; switch (sliceReferenceContexts.size()) { case 0: referenceContext = ReferenceContext.UNMAPPED_UNPLACED_CONTEXT; break; case 1: referenceContext = sliceReferenceContexts.iterator().next(); break; default: referenceContext = ReferenceContext.MULTIPLE_REFERENCE_CONTEXT; } if (referenceContext.isMappedSingleRef()) { AlignmentContext.validateAlignmentContext( true, referenceContext, singleRefAlignmentStart, singleRefAlignmentEnd - singleRefAlignmentStart + 1); return new AlignmentContext( referenceContext, singleRefAlignmentStart, singleRefAlignmentEnd - singleRefAlignmentStart + 1); } else if (referenceContext.isUnmappedUnplaced()) { return AlignmentContext.UNMAPPED_UNPLACED_CONTEXT; } else { return AlignmentContext.MULTIPLE_REFERENCE_CONTEXT; } }
Source:
<code>public List<SlimAssertion> call(final Map<String, String> scenarioArguments, SlimTable parentTable, int row) throws TestExecutionException { Table newTable = getTable().asTemplate(new Table.CellContentSubstitution() { @Override public String substitute(String content) throws SyntaxError { for (Map.Entry<String, String> scenarioArgument : scenarioArguments.entrySet()) { String arg = scenarioArgument.getKey(); if (getInputs().contains(arg)) { String argument = scenarioArguments.get(arg); <START> content = StringUtils.replace(content, "@" + arg, replaceSymbols(argument)); <END> content = StringUtils.replace(content, "@{" + arg + "}", replaceSymbols(argument)); } else { throw new SyntaxError(String.format("The argument %s is not an input to the scenario.", arg)); } } return content; } }); ScenarioTestContext testContext = new ScenarioTestContext(parentTable.getTestContext()); ScriptTable t = createChild(testContext, parentTable, newTable); parentTable.addChildTable(t, row); List<SlimAssertion> assertions = t.getAssertions(); assertions.add(makeAssertion(Instruction.NOOP_INSTRUCTION, new ScenarioExpectation(t, row))); return assertions; }</code><technical_language>I nicer a single call replaceSymbols, content alteration</technical_language>

Target:
public List<SlimAssertion> call(final Map<String, String> scenarioArguments, SlimTable parentTable, int row) throws TestExecutionException { Table newTable = getTable().asTemplate(content -> { for (Map.Entry<String, String> scenarioArgument : scenarioArguments.entrySet()) { String arg = scenarioArgument.getKey(); if (getInputs().contains(arg)) { String argument = scenarioArguments.get(arg); content = StringUtils.replace(content, "@" + arg, argument); content = StringUtils.replace(content, "@{" + arg + "}", argument); } else { throw new SyntaxError(String.format("The argument %s is not an input to the scenario.", arg)); } } return content; }); ScenarioTestContext testContext = new ScenarioTestContext(parentTable.getTestContext()); ScriptTable t = createChild(testContext, parentTable, newTable); parentTable.addChildTable(t, row); List<SlimAssertion> assertions = t.getAssertions(); assertions.add(makeAssertion(Instruction.NOOP_INSTRUCTION, new ScenarioExpectation(t, row))); return assertions; }
Source:
<code>public List<Concept> getPossibleValues() { try { return Context.getConceptService().getConceptsByName(""); } catch (Exception e) { <START> logger.error("Error", e); <END> } return Collections.emptyList(); }</code><technical_language>Change this log</technical_language>

Target:
public List<Concept> getPossibleValues() { try { return Context.getConceptService().getConceptsByName(""); } catch (Exception e) { log.error("Error", e); } return Collections.emptyList(); }
Source:
<code>public synchronized void disableProxy() { if (socks5Proxy == null) { SmackConfiguration.setLocalSocks5ProxyEnabled(false); return; } <START> Socks5Proxy.getSocks5Proxy().stop(); <END> SmackConfiguration.setLocalSocks5ProxyEnabled(false); socks5Proxy = null; if (socks5ProxyPort < 0) return; log.info("stopped Socks5 proxy on port: " + socks5ProxyPort); boolean wasInterrupted = false; while (true) { try { addressRetrieval.acquire(2); break; } catch (InterruptedException e) { wasInterrupted = true; } } try { if (device == null) return; if (!upnpService.isMapped(device, socks5ProxyPort, IUPnPService.TCP)) return; if (!upnpService.deletePortMapping(device, socks5ProxyPort, IUPnPService.TCP)) { log.warn( "failed to delete port mapping on device: " + device.getFriendlyName() + " [" + socks5ProxyPort + "|" + IUPnPService.TCP + "]"); } log.info( "removed port mapping on device: " + device.getFriendlyName() + " [" + socks5ProxyPort + "|" + IUPnPService.TCP + "]"); } finally { addressRetrieval.release(2); device = null; if (wasInterrupted) Thread.currentThread().interrupt(); } }</code><technical_language>lead a NPE if called "enableProxy" method. I is worth check for null</technical_language>

Target:
public synchronized void disableProxy() { if (socks5Proxy == null) { SmackConfiguration.setLocalSocks5ProxyEnabled(false); return; } socks5Proxy.stop(); SmackConfiguration.setLocalSocks5ProxyEnabled(false); socks5Proxy = null; log.info("stopped Socks5 proxy on port: " + socks5ProxyPort); if (socks5ProxyPort > 0 && device != null) { assert upnpService != null; unmapPort(upnpService, device, socks5ProxyPort); } socks5ProxyPort = 0; device = null; }
Source:
<code>public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 3) { throw new IAE("function '%s' needs 3 arguments", name()); } final String arg = args.get(0).eval(bindings).asString(); final String pattern = args.get(1).eval(bindings).asString(); final String replacement = args.get(2).eval(bindings).asString(); <START> return ExprEval.of( <END> Strings.nullToEmpty(arg).replace(Strings.nullToEmpty(pattern), Strings.nullToEmpty(replacement)) ); }</code><technical_language>In spirit of other functions return null if arg is null</technical_language>

Target:
public ExprEval apply(List<Expr> args, Expr.ObjectBinding bindings) { if (args.size() != 3) { throw new IAE("Function[%s] needs 3 arguments", name()); } final String arg = args.get(0).eval(bindings).asString(); final String pattern = args.get(1).eval(bindings).asString(); final String replacement = args.get(2).eval(bindings).asString(); return ExprEval.of( Strings.nullToEmpty(arg).replace(Strings.nullToEmpty(pattern), Strings.nullToEmpty(replacement)) ); }
Source:
<code>public void testEventFailed() { EventApi eventApi = EasyMock.createMock(EventApi.class); DigitalOceanApi api = EasyMock.createMock(DigitalOceanApi.class); expect(eventApi.get(anyInt())).andReturn(event(Status.ERROR)); expect(api.getEventApi()).andReturn(eventApi); replay(eventApi); replay(api); EventDonePredicate predicate = new EventDonePredicate(api); try { predicate.apply(1); fail("Method should have thrown an IllegalStateException"); } catch (IllegalStateException ex) { assertEquals(ex.getMessage(), "Resource is in invalid status: ERROR"); verify(eventApi); <START> verify(api); <END> } }</code><technical_language>above. move verify calls out of catch</technical_language>

Target:
public void testEventFailed() { EventApi eventApi = EasyMock.createMock(EventApi.class); DigitalOceanApi api = EasyMock.createMock(DigitalOceanApi.class); expect(eventApi.get(anyInt())).andReturn(event(Status.ERROR)); expect(api.getEventApi()).andReturn(eventApi); replay(eventApi, api); EventDonePredicate predicate = new EventDonePredicate(api); try { predicate.apply(1); fail("Method should have thrown an IllegalStateException"); } catch (IllegalStateException ex) { assertEquals(ex.getMessage(), "Resource is in invalid status: ERROR"); } }
Source:
<code>public void testLunDiskValid() { VDS vds = mockVds(); LunDisk disk = createISCSILunDisk(); command.getParameters().setDiskInfo(disk); command.getParameters().setVdsId(vds.getId()); command.setVds(vds); <START> Guid storageId = Guid.newGuid(); command.getParameters().setStorageDomainId(storageId); <END> mockStorageDomain(storageId); mockVm(); mockMaxPciSlots(); mockInterfaceList(); List<LUNs> luns = Collections.singletonList(disk.getLun()); doReturn(luns).when(command).executeGetDeviceList(any(), any(), any()); ValidateTestUtils.runAndAssertValidateSuccess(command); }</code><technical_language>insert mockStorageDomain()</technical_language>

Target:
public void testLunDiskValid() { VDS vds = mockVds(); LunDisk disk = createISCSILunDisk(); command.getParameters().setDiskInfo(disk); command.getParameters().setVdsId(vds.getId()); command.setVds(vds); Guid storageId = Guid.newGuid(); mockStorageDomain(storageId); mockVm(); mockMaxPciSlots(); mockInterfaceList(); List<LUNs> luns = Collections.singletonList(disk.getLun()); doReturn(luns).when(command).executeGetDeviceList(any(), any(), any()); ValidateTestUtils.runAndAssertValidateSuccess(command); }
Source:
<code>protected void waitUntilContainerStarted() { logger().info("Waiting for database connection to become available at using query '{}'", getJdbcUrl(), getTestQueryString()); await().ignoreExceptionsMatching(e -> ! (e instanceof NoDriverFoundException)) .timeout(startupTimeoutSeconds, SECONDS) <START> .until(() -> { <END> if (!isRunning()) { return false; } try (Connection connection = createConnection("")) { boolean success = connection.createStatement().execute(JdbcDatabaseContainer.this.getTestQueryString()); if (success) { logger().info("Obtained a connection to container ({})", JdbcDatabaseContainer.this.getJdbcUrl()); return true; } else { return false; } } }); }</code><technical_language>this lambda a private method canConnect() something, WDYT</technical_language>

Target:
protected void waitUntilContainerStarted() { logger().info("Waiting for database connection to become available at using query '{}'", getJdbcUrl(), getTestQueryString()); long start = System.currentTimeMillis(); try { while (System.currentTimeMillis() < start + (1000 * startupTimeoutSeconds)) { try { if (!isRunning()) { Thread.sleep(100L); continue; } try (Connection connection = createConnection("")) { boolean testQuerySucceeded = connection.createStatement().execute(this.getTestQueryString()); if (testQuerySucceeded) { break; } } } catch (NoDriverFoundException e) { throw e; } catch (Exception e) { logger().debug("Failure when trying test query", e); Thread.sleep(100L); } } } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new ContainerLaunchException("Container startup wait was interrupted", e); } logger().info("Container is started (JDBC URL: {})", JdbcDatabaseContainer.this.getJdbcUrl()); }
Source:
<code>private StringBuilder addPDFViewer(StringBuilder parsedContent, Map<String, Boolean> savedLinks) { for (Map.Entry<String, Boolean> linkPath : savedLinks.entrySet()) { if (linkPath.getKey().toLowerCase().contains(".pdf")) { String pat = "(href=)+(\"|')?(/group/" + siteId + "/)(" + linkPath.getKey() + ")(\"|')?([ a-z0-9=\"'-]*)(>)"; Pattern target = Pattern.compile(pat, Pattern.CASE_INSENSITIVE); Matcher matcher = target.matcher(parsedContent); <START> if (matcher.find()) { <END> parsedContent.insert(matcher.end(4), "?canvas_download=1&amp;canvas_qs_wrap=1"); parsedContent.insert(matcher.start(), " class=\"instructure_file_link instructure_scribd_file\" "); } } } return parsedContent; }</code><technical_language>this in a loop if multiple links file get updated</technical_language>

Target:
StringBuilder addPDFViewer(StringBuilder parsedContent, Map<String, Boolean> savedLinks) { for (Map.Entry<String, Boolean> linkPath : savedLinks.entrySet()) { if (linkPath.getKey().toLowerCase().contains(".pdf")) { String pat = "(href=)+(\"|')?(/group/" + siteId + "/)(" + linkPath.getKey() + ")(\"|')?([_ a-z0-9=\"'-]*)(>)"; Pattern target = Pattern.compile(pat, Pattern.CASE_INSENSITIVE); Matcher matcher = target.matcher(parsedContent); String urlAddition = "?canvas_download=1&amp;canvas_qs_wrap=1"; String cssAddition = "class=\"instructure_file_link instructure_scribd_file\" "; while (matcher.find()) { parsedContent.insert(matcher.end(4), urlAddition); parsedContent.insert(matcher.start(), cssAddition); matcher.region(matcher.end() + urlAddition.length() + cssAddition.length(), parsedContent.length()); } } } return parsedContent; }
Source:
<code>protected void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); if (savedInstance == null || !savedInstance.getBoolean(ExtraConstants.HAS_EXISTING_INSTANCE)) { if (!hasNetworkConnection()) { Log.d(TAG, "No network connection"); finish(ErrorCodes.NO_NETWORK, IdpResponse.getErrorCodeIntent(ErrorCodes.NO_NETWORK)); return; } <START> GoogleApiAvailability apiAvailability = GoogleApiAvailability.getInstance(); <END> Dialog errorDialog = apiAvailability.getErrorDialog( this, apiAvailability.isGooglePlayServicesAvailable(this), RC_PLAY_SERVICES, new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { finish(ResultCodes.CANCELED, IdpResponse.getErrorCodeIntent(ErrorCodes.UNKNOWN_ERROR)); } }); if (errorDialog == null) { SignInDelegate.delegate(KickoffActivity.this, mActivityHelper.getFlowParams()); } else { errorDialog.show(); mIsWaitingForPlayServices = true; } } }</code><technical_language>rid of PlayServicesHelper centralize Play services availability logic somewhere. if class is a host for a singleton of GoogleApiAvailability a win for future testing. Play services a lot of trouble in testing (although simplified a lot of here)</technical_language>

Target:
protected void onCreate(Bundle savedInstance) { super.onCreate(savedInstance); if (savedInstance == null || savedInstance.getBoolean(IS_WAITING_FOR_PLAY_SERVICES)) { if (isOffline()) { Log.d(TAG, "No network connection"); finish(ErrorCodes.NO_NETWORK, IdpResponse.getErrorCodeIntent(ErrorCodes.NO_NETWORK)); return; } boolean isPlayServicesAvailable = PlayServicesHelper.makePlayServicesAvailable( this, RC_PLAY_SERVICES, new DialogInterface.OnCancelListener() { @Override public void onCancel(DialogInterface dialog) { finish(ResultCodes.CANCELED, IdpResponse.getErrorCodeIntent( ErrorCodes.UNKNOWN_ERROR)); } }); if (isPlayServicesAvailable) { SignInDelegate.delegate(KickoffActivity.this, mActivityHelper.getFlowParams()); } else { mIsWaitingForPlayServices = true; } } }
Source:
<code>public SequencerServerCache(int cacheSize, long maxConflictNewSequencer) { this.cacheSize = cacheSize; cacheConflictKeys = new HashMap<> (); <START> cacheEntries = new PriorityQueue<> (cacheSize, Comparator.comparingLong((ConflictTxStream a) -> a.txVersion)); <END> cacheEntriesBytes = 0; maxConflictWildcard = maxConflictNewSequencer; this.maxConflictNewSequencer = maxConflictNewSequencer; }</code><technical_language>remove casting ConflictTxStream is redundant</technical_language>

Target:
public SequencerServerCache(int cacheSize, long maxConflictNewSequencer) { this.cacheSize = cacheSize; conflictKeys = new HashMap(); cacheEntries = new PriorityQueue(cacheSize, Comparator.comparingLong (a -> ((ConflictTxStream)a).txVersion)); maxConflictWildcard = maxConflictNewSequencer; this.maxConflictNewSequencer = maxConflictNewSequencer; }
Source:
<code>public HelixNotifier(HelixPropertyStoreConfig storeConfig, HelixPropertyStoreFactory<ZNRecord> storeFactory) { if (storeFactory == null) { throw new IllegalArgumentException("storeFactory cannot be null."); } List<String> subscribedPaths = new ArrayList<>(); <START> subscribedPaths.add(storeConfig.rootPath + TOPIC_PATH); <END> helixStore = storeFactory.getHelixPropertyStore(storeConfig, subscribedPaths); logger.info("HelixNotifier started, topicPath={}", storeConfig.rootPath + TOPIC_PATH); }</code><technical_language>if Collections.singletonList(storeConfig.rootPath) works instead of creating ArrayList</technical_language>

Target:
public HelixNotifier(HelixPropertyStoreConfig storeConfig, HelixPropertyStoreFactory<ZNRecord> storeFactory) { if (storeFactory == null) { throw new IllegalArgumentException("storeFactory cannot be null."); } List<String> subscribedPaths = Collections.singletonList(storeConfig.rootPath + TOPIC_PATH); helixStore = storeFactory.getHelixPropertyStore(storeConfig, subscribedPaths); logger.info("HelixNotifier started, topicPath={}", storeConfig.rootPath + TOPIC_PATH); }
Source:
<code>public void setSpliterator() { Spliterator<String> spliterator = IterableView.of(ImmutableSortedSet.of("a", "b")).spliterator(); assertThat(spliterator.estimateSize()).isEqualTo(2); int characteristics = spliterator.characteristics(); <START> assertThat(characteristics).isNotEqualTo(0); <END> assertThat(characteristics & Spliterator.CONCURRENT).isEqualTo(0); assertThat(characteristics & Spliterator.DISTINCT).isEqualTo(Spliterator.DISTINCT); assertThat(characteristics & Spliterator.IMMUTABLE).isEqualTo(Spliterator.IMMUTABLE); assertThat(characteristics & Spliterator.NONNULL).isEqualTo(Spliterator.NONNULL); assertThat(characteristics & Spliterator.SIZED).isEqualTo(Spliterator.SIZED); assertThat(characteristics & Spliterator.SORTED).isEqualTo(Spliterator.SORTED); assertThat(characteristics & Spliterator.SUBSIZED).isEqualTo(Spliterator.SUBSIZED); }</code><technical_language>tempted remove isNotZero style asserts; redundant constraints</technical_language>

Target:
public void setSpliterator() { Spliterator<String> spliterator = IterableView.of(ImmutableSortedSet.of("a", "b")).spliterator(); assertThat(spliterator.estimateSize()).isEqualTo(2); assertThat(spliterator.characteristics()).isNotZero(); assertThat(spliterator.hasCharacteristics(Spliterator.DISTINCT)).isTrue(); assertThat(spliterator.hasCharacteristics(Spliterator.SIZED)).isTrue(); assertThat(spliterator.hasCharacteristics(Spliterator.SUBSIZED)).isTrue(); assertThat(StreamSupport.stream(spliterator, false)).containsExactly("a", "b"); }
Source:
<code>private KalturaLiveEntry onClientConnect(WMSProperties properties, HashMap<String, String> requestParams) throws KalturaApiException, ClientConnectException, Exception { if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_ENTRY_ID)){ throw new ClientConnectException("Missing argument: entryId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_TOKEN)){ throw new ClientConnectException("Missing argument: token"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_PARTNER_ID)){ throw new ClientConnectException("Missing argument: partnerId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_SERVER_INDEX)){ throw new ClientConnectException("Missing argument: server index"); } int partnerId = Integer.parseInt(requestParams.get(Constants.REQUEST_PROPERTY_PARTNER_ID)); String entryId = requestParams.get(Constants.REQUEST_PROPERTY_ENTRY_ID); String token = requestParams.get(Constants.REQUEST_PROPERTY_TOKEN); KalturaEntryServerNodeType serverIndex = KalturaEntryServerNodeType.get(requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX)); KalturaLiveEntry liveEntry = KalturaAPI.getKalturaAPI().authenticate(entryId, partnerId, token, serverIndex); Utils.addEntry(entryId, liveEntry); synchronized(properties) { properties.setProperty(Constants.CLIENT_PROPERTY_SERVER_INDEX, requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX)); <START> properties.setProperty(Constants.CLIENT_PROPERTY_KALTURA_LIVE_ENTRY, liveEntry); <END> } logger.info("Entry added [" + entryId + "]"); return liveEntry; }</code><technical_language>add property for liveEntry</technical_language>

Target:
private KalturaLiveEntry onClientConnect(WMSProperties properties, HashMap<String, String> requestParams) throws KalturaApiException, ClientConnectException, Exception { if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_ENTRY_ID)){ throw new ClientConnectException("Missing argument: entryId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_TOKEN)){ throw new ClientConnectException("Missing argument: token"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_PARTNER_ID)){ throw new ClientConnectException("Missing argument: partnerId"); } if (!requestParams.containsKey(Constants.REQUEST_PROPERTY_SERVER_INDEX)){ throw new ClientConnectException("Missing argument: server index"); } int partnerId = Integer.parseInt(requestParams.get(Constants.REQUEST_PROPERTY_PARTNER_ID)); String entryId = requestParams.get(Constants.REQUEST_PROPERTY_ENTRY_ID); String token = requestParams.get(Constants.REQUEST_PROPERTY_TOKEN); KalturaEntryServerNodeType serverIndex = KalturaEntryServerNodeType.get(requestParams.get(Constants.REQUEST_PROPERTY_SERVER_INDEX)); KalturaLiveEntry liveEntry = KalturaAPI.getKalturaAPI().authenticate(entryId, partnerId, token, serverIndex); KalturaEntryIdKey key = KalturaEntryDataPersistence.setProperty(entryId, Constants.CLIENT_PROPERTY_KALTURA_LIVE_ENTRY, liveEntry); synchronized (properties) { properties.setProperty(Constants.KALTURA_ENTRY_DATA_PERSISTENCY_KEY, key); } logger.info("Entry added [" + entryId + "]"); return liveEntry; }
Source:
<code>public void addToOrderBook(Order order) { <START> if (BuyOrder.class.isInstance(order)){ if (this.buyOrders.containsKey(order.getStockSymbol())){ ArrayList<Order> list =buyOrders.get(order.getStockSymbol()); list.add(order); } else{ ArrayList<Order> list = new ArrayList<Order>(); list.add(order); this.buyOrders.put(order.getStockSymbol(), list); } } else{ if (this.sellOrders.containsKey(order.getStockSymbol())){ ArrayList<Order> list =sellOrders.get(order.getStockSymbol()); list.add(order); } else{ ArrayList<Order> list = new ArrayList<Order>(); list.add(order); this.sellOrders.put(order.getStockSymbol(), list); } } <END> }</code><technical_language>Long method, parts of this extracted</technical_language>

Target:
public void addToOrderBook(Order order) { if (BuyOrder.class.isInstance(order)){ addBuyOrder(order); } else{ addSellOrder(order); } }
Source:
<code>protected Option[] configurePaxExam() { return options( logLevel(LogLevelOption.LogLevel.WARN), useOwnExamBundlesStartLevel(100), systemTimeout(GENERIC_TIMEOUT_MILLISECONDS), when(Boolean.getBoolean("keepRuntimeFolder")).useOptions(keepRuntimeFolder()), cleanCaches(true), <START> KarafDistributionOption.debugConfiguration()); <END> }</code><technical_language>This is a duplicate of <LINK_0> . hardcodes debug port 5005 dynamic. If executed debugger pax exam, advantage of hold flag parameter wait for debugger attach starting test</technical_language>

Target:
protected Option[] configurePaxExam() { return options( logLevel(LogLevelOption.LogLevel.WARN), useOwnExamBundlesStartLevel(100), systemTimeout(GENERIC_TIMEOUT_MILLISECONDS), when(Boolean.getBoolean("keepRuntimeFolder")).useOptions(keepRuntimeFolder()), cleanCaches(true)); }
Source:
<code>public <T> T lookup(Class<T> serviceClass) { Collection<Object> registered = services.get(serviceClass); if (registered == null || registered.isEmpty()) { ServiceLoader<T> loader = ServiceLoader.load(serviceClass); List<T> services = new ArrayList<>(); for (Iterator<T> iterator = loader.iterator(); iterator .hasNext();) { services.add(iterator.next()); } if (services.size() > 1) { throw new IllegalStateException(SEVERAL_IMPLS + serviceClass + SPI + services + ONE_IMPL_REQUIRED); } else if (services.size() == 1) { return services.get(0); } return null; } else if (registered.size() > 1) { throw new IllegalStateException(SEVERAL_IMPLS + serviceClass <START> + SPI + registered + ONE_IMPL_REQUIRED); <END> } else { return serviceClass.cast(registered.iterator().next()); } }</code><technical_language>of error messages state lookupAll instead</technical_language>

Target:
public <T> T lookup(Class<T> serviceClass) { Collection<Object> registered = serviceMap.get(serviceClass); if (registered == null || registered.isEmpty()) { ServiceLoader<T> loader = ServiceLoader.load(serviceClass); List<T> services = new ArrayList<>(); for (Iterator<T> iterator = loader.iterator(); iterator .hasNext();) { services.add(iterator.next()); } if (services.size() > 1) { throw new IllegalStateException(SEVERAL_IMPLS + serviceClass + SPI + services + ONE_IMPL_REQUIRED); } else if (services.size() == 1) { return services.get(0); } return null; } else if (registered.size() > 1) { throw new IllegalStateException(SEVERAL_IMPLS + serviceClass + SPI + registered + ONE_IMPL_REQUIRED); } else { return serviceClass.cast(registered.iterator().next()); } }
Source:
<code>protected static Stream<Arguments> messagingEntityWithSessions() { return Stream.of( Arguments.of(MessagingEntityType.QUEUE, false), <START> Arguments.of(MessagingEntityType.SUBSCRIPTION, false) END> Arguments.of(MessagingEntityType.QUEUE, true), Arguments.of(MessagingEntityType.SUBSCRIPTION, true) ); }</code><technical_language>left over</technical_language>

Target:
protected static Stream<Arguments> messagingEntityWithSessions() { return Stream.of( Arguments.of(MessagingEntityType.QUEUE, false), Arguments.of(MessagingEntityType.SUBSCRIPTION, false), Arguments.of(MessagingEntityType.QUEUE, true), Arguments.of(MessagingEntityType.SUBSCRIPTION, true) ); }
Source:
<code><START> public void parseAndCreateHCatClients() throws Exception { <END> if (isHCatEnabled) { try { String hcatCientsRaio = System.getProperty(HCAT_CLIENTS_RATIO, "1/5"); String ratioStr = hcatCientsRaio.split("/")[1]; int numServices = services.size(); int ratio = Integer.parseInt(ratioStr); if (numServices > 0 && ratio > 0) { numOfHCatClients = (numServices / ratio); if (numOfHCatClients <= 0) { numOfHCatClients = 1; } } else { LOG.info("no services or ratio is invalid"); } } catch(Exception e) { LOG.error("Exception occured while calcluating the number" + " of hcatClients ", e); numOfHCatClients = 10; } createHCatClients(); } }</code><technical_language>is this method used</technical_language>

Target:
public void parseAndCreateHCatClients() throws Exception { if (isHCatEnabled) { try { String hcatCientsRaio = System.getProperty(HCAT_CLIENTS_RATIO, "1/5"); String ratioSplits = hcatCientsRaio.split("/"); int numServices = services.size(); boolean isValidRatio = isValidRatio(ratioSplits); if (numServices > 0 && isValidRatio) { numOfHCatClients = (int) Math.ceil( (numServices * Integer.parseInt(ratioSplits[0])) / Integer.parseInt(ratioSplits[1])); if (numOfHCatClients <= 0) { numOfHCatClients = 1; } } else { LOG.info("no services or ratio is invalid." + " Starts with " + numOfHCatClients + " hcatclients"); } } catch(Exception e) { LOG.error("Exception occured while calcluating the number" + " of hcatClients ", e); numOfHCatClients = 10; } createHCatClients(); } }
Source:
<code>public static boolean isFramework270OrHigher (String version) { <START> return StringUtils.isNotEmpty(version); <END> }</code><technical_language>is enough judge empty. judge > 2.7.0</technical_language>

Target:
public static boolean isFramework270OrHigher (String version) { if (StringUtils.isEmpty(version)) { return false; } if (getIntVersion(version) >= 2070000) { return true; } return false; }
Source:
<code>TransactionInput(NetworkParameters params, Transaction parentTransaction, TransactionOutput output) { super(params); long outputIndex = output.getIndex(); try { outpoint = new TransactionOutPoint(params, outputIndex, output.getParentTransaction()); <START> } catch (NullPointerException e) { <END> outpoint = new TransactionOutPoint(params, output); } scriptBytes = EMPTY_ARRAY; sequence = NO_SEQUENCE; setParent(parentTransaction); this.value = output.getValue(); length = 41; }</code><technical_language>a bad idea catch NPE's other exception generated a common class of bugs. this output.getParentTransaction() return null? In case if statement</technical_language>

Target:
TransactionInput(NetworkParameters params, Transaction parentTransaction, TransactionOutput output) { super(params); long outputIndex = output.getIndex(); if(output.getParentTransaction() != null ) { outpoint = new TransactionOutPoint(params, outputIndex, output.getParentTransaction()); } else { outpoint = new TransactionOutPoint(params, output); } scriptBytes = EMPTY_ARRAY; sequence = NO_SEQUENCE; setParent(parentTransaction); this.value = output.getValue(); length = 41; }
Source:
<code>private List<JSONObject> removeStreetDuplicates(List<JSONObject> results, String lang) { List<JSONObject> filteredItems = Lists.newArrayListWithCapacity(results.size()); final HashSet<String> keys = Sets.newHashSet(); for(JSONObject result : results) { final JSONObject properties = result.getJSONObject(Tags.KEY_PROPERTIES); if(properties.has(Tags.KEY_OSM_KEY) && "highway".equals(properties.getString(Tags.KEY_OSM_KEY))) { if(properties.has(OSMTags.KEY_POSTCODE) && properties.has(OSMTags.KEY_NAME)) { String postcode = properties.getString(OSMTags.KEY_POSTCODE); String name = properties.getString(OSMTags.KEY_NAME); String key = postcode + ":" + name; if(keys.contains(key)) { continue; <START> } else if (lang.equals("nl")) { <END> String letterlessPostcode = Utils.stripNonDigits(postcode); int postcodeNumbers; try { postcodeNumbers = Integer.parseInt(letterlessPostcode); } catch (NumberFormatException e) { continue; } boolean foundMatch = false; for (String keyString : keys) { String letterlessKey = Utils.stripNonDigits(keyString); int keyPostcode; try { keyPostcode = Integer.parseInt(letterlessKey); } catch (NumberFormatException e) { continue; } String keyName = keyString.split(":")[1]; if (postcodeNumbers == keyPostcode && keyName.equals(name)) { foundMatch = true; break; } } if (foundMatch) { continue; } } keys.add(key); } } filteredItems.add(result); } return filteredItems; }</code><technical_language>a save a lot of lines of code a language-specific key generation? say: if lang == "nl": key = onlyDigitsPostCode + ':' + 'name' else: key = postcode + ":" + name;</technical_language>

Target:
private List<JSONObject> removeStreetDuplicates(List<JSONObject> results, String lang) { List<JSONObject> filteredItems = Lists.newArrayListWithCapacity(results.size()); final HashSet<String> keys = Sets.newHashSet(); for(JSONObject result : results) { final JSONObject properties = result.getJSONObject(Tags.KEY_PROPERTIES); if(properties.has(Tags.KEY_OSM_KEY) && "highway".equals(properties.getString(Tags.KEY_OSM_KEY))) { if(properties.has(OSMTags.KEY_POSTCODE) && properties.has(OSMTags.KEY_NAME)) { String postcode = properties.getString(OSMTags.KEY_POSTCODE); String onlyDigitsPostcode = Utils.stripNonDigits(postcode); String name = properties.getString(OSMTags.KEY_NAME); String key; if(lang.equals("nl")) { key = onlyDigitsPostcode + ":" + name; } else { key = postcode + ":" + name; } if(keys.contains(key)) { continue; } keys.add(key); } } filteredItems.add(result); } return filteredItems; }
Source:
<code>public Stream<DiscoveryResult> stream() { <START> return this.discoveryResultStorage.getValues().stream().filter(discoveryResult -> discoveryResult == null); <END> }</code><technical_language>if filter end in streaming nulls, you? idea filter discoveryResult != null</technical_language>

Target:
public Stream<DiscoveryResult> stream() { return this.discoveryResultStorage.getValues().stream().filter(Objects::nonNull); }
Source:
<code>public DictionaryPage readDictionaryPage(ColumnDescriptor descriptor) { if (rowGroup != null) { return rowGroup.readDictionaryPage(descriptor); } String dotPath = String.join(".", descriptor.getPath()); ColumnChunkMetaData column = columns.get(dotPath); if (column == null) { throw new ParquetDecodingException( "Failed to load dictionary, unknown column: " + dotPath); } <START> return cache.computeIfAbsent(dotPath, key -> { <END> try { final DictionaryPage dict = hasDictionaryPage(column) ? reader.readDictionary(column) : null; return (dict != null) ? Optional.of(reusableCopy(dict)) : Optional.empty(); } catch (IOException e) { throw new ParquetDecodingException("Failed to read dictionary", e); } }).orElse(null); }</code><technical_language>Is this method threadsafe? removing locking mechanism</technical_language>

Target:
public DictionaryPage readDictionaryPage(ColumnDescriptor descriptor) { if (rowGroup != null) { return rowGroup.readDictionaryPage(descriptor); } String dotPath = Strings.join(descriptor.getPath(), "."); ColumnChunkMetaData column = columns.get(dotPath); if (column == null) { throw new ParquetDecodingException( "Failed to load dictionary, unknown column: " + dotPath); } return dictionaryPageCache.computeIfAbsent(dotPath, key -> { try { final DictionaryPage dict = hasDictionaryPage(column) ? reader.readDictionary(column) : null; return (dict != null) ? Optional.of(reusableCopy(dict)) : Optional.empty(); } catch (IOException e) { throw new ParquetDecodingException("Failed to read dictionary", e); } }).orElse(null); }
Source:
<code>public Object execute(JobExecutionContext context) throws JobExecutionException { JobArguments args = context.getJobArguments(); String principalName = context.getPrincipalName(); String ownerKey = args.getAsString(OWNER_KEY); Owner owner = this.ownerCurator.lockAndLoadByKey(ownerKey); if (owner == null) { log.debug("Owner no longer exists: {}", ownerKey); return String.format("Nothing to do; owner no longer exists: %s", ownerKey); } String displayName = owner.getDisplayName(); ExporterMetadata metadata = this.exportCurator .getByTypeAndOwner(ExporterMetadata.TYPE_PER_USER, owner); if (metadata == null) { log.debug("No imports exist for owner {}", displayName); return String.format("Nothing to do; imports no longer exist for owner: %s", displayName); } log.info("Deleting all pools originating from manifests for owner/org: {}", displayName); List<Pool> pools = this.poolManager.listPoolsByOwner(owner).list(); for (Pool pool : pools) { if (this.poolManager.isManaged(pool)) { this.poolManager.deletePool(pool); } } UpstreamConsumer uc = owner.getUpstreamConsumer(); owner.setUpstreamConsumer(null); <START> this.ownerCurator.merge(owner); <END> this.ownerCurator.flush(); this.exportCurator.delete(metadata); this.recordManifestDeletion(owner, principalName, uc); this.ownerCurator.evict(owner); return String.format("Imported pools removed for owner: %s", displayName); }</code><technical_language>set owner merged owner later</technical_language>

Target:
public Object execute(JobExecutionContext context) throws JobExecutionException { JobArguments args = context.getJobArguments(); String principalName = context.getPrincipalName(); String ownerKey = args.getAsString(OWNER_KEY); Owner owner = this.ownerCurator.lockAndLoadByKey(ownerKey); if (owner == null) { log.debug("Owner no longer exists: {}", ownerKey); return String.format("Nothing to do; owner no longer exists: %s", ownerKey); } String displayName = owner.getDisplayName(); ExporterMetadata metadata = this.exportCurator .getByTypeAndOwner(ExporterMetadata.TYPE_PER_USER, owner); if (metadata == null) { log.debug("No imports exist for owner {}", displayName); return String.format("Nothing to do; imports no longer exist for owner: %s", displayName); } log.info("Deleting all pools originating from manifests for owner/org: {}", displayName); List<Pool> pools = this.poolManager.listPoolsByOwner(owner).list(); for (Pool pool : pools) { if (this.poolManager.isManaged(pool)) { this.poolManager.deletePool(pool); } } UpstreamConsumer uc = owner.getUpstreamConsumer(); owner.setUpstreamConsumer(null); owner = this.ownerCurator.merge(owner); this.ownerCurator.flush(); this.exportCurator.delete(metadata); this.recordManifestDeletion(owner, principalName, uc); return String.format("Imported pools removed for owner: %s", displayName); }
Source:
<code>private RequestPayment(Builder builder) { <START> <END> super(builder); if (builder.moneySources == null) { throw new NullPointerException("moneySources is null"); } this.moneySources = Collections.unmodifiableList(builder.moneySources); this.cscRequired = builder.cscRequired != null && builder.cscRequired; this.balance = builder.balance; this.recipientAccountStatus = builder.recipientAccountStatus; this.recipientAccountType = builder.recipientAccountType; this.protectionCode = builder.protectionCode; this.accountUnblockUri = builder.accountUnblockUri; this.extActionUri = builder.extActionUri; }</code><technical_language>Please remove this empty line</technical_language>

Target:
private RequestPayment(Builder builder) { super(builder); checkNotNull(builder.moneySources, "moneySource"); switch (status) { case SUCCESS: checkNotNull(builder.balance, "balance"); break; case REFUSED: if (error == Error.ACCOUNT_BLOCKED) { checkNotNull(builder.accountUnblockUri, "accountUnblockUri"); } if (error == Error.EXT_ACTION_REQUIRED) { checkNotNull(builder.extActionUri, "extActionUri"); } break; } this.moneySources = Collections.unmodifiableList(builder.moneySources); this.cscRequired = builder.cscRequired; this.balance = builder.balance; this.recipientAccountStatus = builder.recipientAccountStatus; this.recipientAccountType = builder.recipientAccountType; this.protectionCode = builder.protectionCode; this.accountUnblockUri = builder.accountUnblockUri; this.extActionUri = builder.extActionUri; }