auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public List<PoolQuantityDTO> dryBind( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @QueryParam("service_level") String serviceLevel) { Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); if (consumer.getOwner().isAutobindDisabled()) { throw new BadRequestException(i18n.tr("Owner has autobind disabled.")); } List<PoolQuantityDTO> dryRunPools = new ArrayList<PoolQuantityDTO>(); try { consumerBindUtil.validateServiceLevel(consumer.getOwner(), serviceLevel); dryRunPools = entitler.getDryRun(consumer, serviceLevel); if (dryRunPools == null) { <START> return new ArrayList<PoolQuantityDTO>(); <END> } } catch (ForbiddenException fe) { return dryRunPools; } catch (BadRequestException bre) { throw bre; } catch (RuntimeException re) { return dryRunPools; } return dryRunPools; }</code><technical_language>refactor this block a bit creating collection throw out and, in some cases, recreate it</technical_language>

Target:
public List<PoolQuantityDTO> dryBind( @PathParam("consumer_uuid") @Verify(Consumer.class) String consumerUuid, @QueryParam("service_level") String serviceLevel) { Consumer consumer = consumerCurator.verifyAndLookupConsumer(consumerUuid); if (consumer.getOwner().isAutobindDisabled()) { throw new BadRequestException(i18n.tr("Owner has autobind disabled.")); } List<PoolQuantity> dryRunPools = new ArrayList<PoolQuantity>(); try { consumerBindUtil.validateServiceLevel(consumer.getOwner(), serviceLevel); dryRunPools = entitler.getDryRun(consumer, serviceLevel); } catch (ForbiddenException fe) { return Collections.<PoolQuantityDTO>emptyList(); } catch (BadRequestException bre) { throw bre; } catch (RuntimeException re) { return Collections.<PoolQuantityDTO>emptyList(); } if (dryRunPools != null) { List<PoolQuantityDTO> dryRunPoolDtos = new ArrayList<PoolQuantityDTO>(); for (PoolQuantity pq : dryRunPools) { dryRunPoolDtos.add(this.translator.translate(pq, PoolQuantityDTO.class)); } return dryRunPoolDtos; } else { return Collections.<PoolQuantityDTO>emptyList(); } }
Source:
<code>DataNodeConfigSourceMetrics(MetricRegistry registry) { setInconsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "SetInconsistentCount")); getInconsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "GetInconsistentCount")); listenerInconsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerInconsistentCount")); listenerTrendingInconsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerTrendingInconsistentCount")); <START> listenerConsistentCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerConsistentCount")); <END> }</code><technical_language>I this metrics is helpful for testing in practice I feel need it. other inconsistent metrics give sufficient alerting. do think</technical_language>

Target:
DataNodeConfigSourceMetrics(MetricRegistry registry) { setSwallowedErrorCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "SetSwallowedErrorCount")); getSwallowedErrorCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "GetSwallowedErrorCount")); addListenerSwallowedErrorCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "AddListenerSwallowedErrorCount")); listenerInconsistencyCount = registry.counter(MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerInconsistencyCount")); listenerTransientInconsistencyCount = registry.counter( MetricRegistry.name(CompositeDataNodeConfigSource.class, "ListenerTransientInconsistencyCount")); }
Source:
<code>private static int getPayloadSize(org.apache.qpid.proton.message.Message msg) { <START> <END> if (msg == null || msg.getBody() == null) { return 0; } if (msg.getBody() instanceof Data) { final Data payloadSection = (Data) msg.getBody(); if (payloadSection == null) { return 0; } final Binary payloadBytes = payloadSection.getValue(); if (payloadBytes == null) { return 0; } return payloadBytes.getLength(); } if (msg.getBody() instanceof AmqpValue) { final AmqpValue amqpValue = (AmqpValue) msg.getBody(); if (amqpValue == null) { return 0; } return amqpValue.getValue().toString().length() * 2; } return 0; }</code><technical_language>this aligns track 1 serialization code for a service bus message. iirc, different</technical_language>

Target:
private static int getPayloadSize(org.apache.qpid.proton.message.Message msg) { if (msg == null || msg.getBody() == null) { return 0; } final Section bodySection = msg.getBody(); if (bodySection instanceof AmqpValue) { return sizeof(((AmqpValue) bodySection).getValue()); } else if (bodySection instanceof AmqpSequence) { return sizeof(((AmqpSequence) bodySection).getValue()); } else if (bodySection instanceof Data) { final Data payloadSection = (Data) bodySection; final Binary payloadBytes = payloadSection.getValue(); return sizeof(payloadBytes); } else { return 0; } }
Source:
<code>public void topicListeningTestCase() { try { jmsTopicTransportListener.start(topicListeningParameters); logger.info("JMS Transport Listener is starting to listen to the topic " + JMSTestConstants.TOPIC_NAME_1); jmsServer.publishMessagesToTopic(JMSTestConstants.TOPIC_NAME_1); Assert.assertTrue(topicTestMessageProcessor.getCount() > 10, "Expected message count is not received when " + "listening to topic " + JMSTestConstants.TOPIC_NAME_1); jmsTopicTransportListener.stop(); } catch (Exception e) { <START> Assert.fail("Error while listing to topic"); <END> } }</code><technical_language>listening</technical_language>

Target:
public void topicListeningTestCase() throws ServerConnectorException, InterruptedException, JMSException { jmsTopicTransportListener.start(topicListeningParameters); logger.info("JMS Transport Listener is starting to listen to the topic " + JMSTestConstants.TOPIC_NAME_1); jmsServer.publishMessagesToTopic(JMSTestConstants.TOPIC_NAME_1); Assert.assertTrue(topicTestMessageProcessor.getCount() > 10, "Expected message count is not received when " + "listening to topic " + JMSTestConstants.TOPIC_NAME_1); jmsTopicTransportListener.stop(); }
Source:
<code>protected void subscribeToInitializeEvent(final DtoUnmarshallerFactory unmarshallerFactory, final MessageBusProvider messageBusProvider, <START> final NotificationManager notificationManager, final EventBus eventBus) { <END> eventBus.addHandler(WsAgentStateEvent.TYPE, new WsAgentStateHandler() { @Override public void onWsAgentStarted(WsAgentStateEvent event) { MessageBus messageBus = messageBusProvider.getMachineMessageBus(); Unmarshallable<LanguageServerInitializeEvent> unmarshaller = unmarshallerFactory .newWSUnmarshaller(LanguageServerInitializeEvent.class); try { messageBus.subscribe("languageserver", new SubscriptionHandler<LanguageServerInitializeEvent>(unmarshaller) { @Override protected void onMessageReceived(LanguageServerInitializeEvent initializeEvent) { register(initializeEvent.getProjectPath(), initializeEvent.getSupportedLanguages(), initializeEvent.getServerCapabilities()); } @Override protected void onErrorReceived(Throwable exception) { notificationManager.notify(exception.getMessage(), StatusNotification.Status.FAIL, StatusNotification.DisplayMode.NOT_EMERGE_MODE); } }); } catch (WebSocketException exception) { Log.error(getClass(), exception); } } @Override public void onWsAgentStopped(WsAgentStateEvent event) { projectToInitResult.clear(); } }); }</code><technical_language>format</technical_language>

Target:
protected void subscribeToInitializeEvent(final DtoUnmarshallerFactory unmarshallerFactory, final MessageBusProvider messageBusProvider, final NotificationManager notificationManager, final EventBus eventBus) { eventBus.addHandler(WsAgentStateEvent.TYPE, new WsAgentStateHandler() { @Override public void onWsAgentStarted(WsAgentStateEvent event) { MessageBus messageBus = messageBusProvider.getMachineMessageBus(); Unmarshallable<LanguageServerInitializeEvent> unmarshaller = unmarshallerFactory.newWSUnmarshaller(LanguageServerInitializeEvent.class); try { messageBus.subscribe("languageserver", new SubscriptionHandler<LanguageServerInitializeEvent>(unmarshaller) { @Override protected void onMessageReceived(LanguageServerInitializeEvent initializeEvent) { register(initializeEvent.getProjectPath(), initializeEvent.getSupportedLanguages(), initializeEvent.getServerCapabilities()); } @Override protected void onErrorReceived(Throwable exception) { notificationManager.notify(exception.getMessage(), FAIL, StatusNotification.DisplayMode.NOT_EMERGE_MODE); } }); } catch (WebSocketException exception) { Log.error(getClass(), exception); } } @Override public void onWsAgentStopped(WsAgentStateEvent event) { projectToInitResult.clear(); } }); }
Source:
<code>protected DBFactory newDbFactory() { DBFactory factory = null; <START> ClassLoader tccl = Thread.currentThread().getContextClassLoader(); <END> for (String className : DB_FACTORY_CLASS_NAMES) { try { factory = (DBFactory) tccl.loadClass(className).newInstance(); break; } catch (Throwable e) { if (log.isDebugEnabled()) log.debugUnableToInstantiateDbFactory(className, e); } } return factory; }</code><technical_language>tccl first? I try getClass().getClassLoader() first. This code fail load leveldb in infinispan-server tccl in this context loader of infinispan subsystem leveldb modules directly. I getClass().getClassLoader() works this leveldb cache store module able leveldb impls</technical_language>

Target:
protected DBFactory newDbFactory() { ImplementationType type = ImplementationType.valueOf(config.getImplementationType()); switch (type) { case JNI: { return Util.<DBFactory>getInstance(JNI_DB_FACTORY_CLASS_NAME, config.getClassLoader()); } case JAVA: { return Util.<DBFactory>getInstance(JAVA_DB_FACTORY_CLASS_NAME, config.getClassLoader()); } default: { for (String className : DB_FACTORY_CLASS_NAMES) { try { return Util.<DBFactory>getInstance(className, config.getClassLoader()); } catch (Throwable e) { if (log.isDebugEnabled()) log.debugUnableToInstantiateDbFactory(className, e); } } } } return null; }
Source:
<code>public Vulnerability getVulnerabilityWithReleaseRelationsByExternalId(String externalId, User sw360User) { try { VulnerabilityService.Iface sw360VulnerabilityClient = getThriftVulnerabilityClient(); sw360VulnerabilityClient.getVulnerabilityWithReleaseRelationsByExternalId(externalId, sw360User); <START> return null; <END> } catch (TException e) { throw new RuntimeException(e); } }</code><technical_language>return null</technical_language>

Target:
public Vulnerability getVulnerabilityWithReleaseRelationsByExternalId(String externalId, User sw360User) { try { VulnerabilityService.Iface sw360VulnerabilityClient = getThriftVulnerabilityClient(); final VulnerabilityWithReleaseRelations vulWithRel = sw360VulnerabilityClient.getVulnerabilityWithReleaseRelationsByExternalId(externalId, sw360User); return vulWithRel.getVulnerability(); } catch (TException e) { throw new RuntimeException(e); } }
Source:
<code>public void execute() { for (Motor motor : motors) { try { motor.set(speed); } <START> catch (Exception e) { <END> updateStatus(motor.getName(), SystemStatus.FAIL, e); } } }</code><technical_language>cases in motor set, error</technical_language>

Target:
public void execute() { for (Motor motor : motors) { try { motor.set(speed); } catch (Exception e) { updateStatusFail(motor.getName(), e); } VICheck(motor); } }
Source:
<code><START> public static ArchStrategy getStrategy(String cpuName, Version clusterVersion) { <END> String archName = ArchStrategy.getArchNameFromCpuNameAndVersion(cpuName, clusterVersion); ArchStrategy archStrategy = getStrategy(archName); return archStrategy; }</code><technical_language>this clearer map is based enum</technical_language>

Target:
public static ArchStrategy getStrategy(String cpuName, Version clusterVersion) { ArchitectureType archType = ArchStrategy.getArchTypeFromCpuNameAndVersion(cpuName, clusterVersion); ArchStrategy archStrategy = getStrategy(archType); return archStrategy; }
Source:
<code>protected void parseTickerFromJsonObject(int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { ticker.vol = jsonObject.getDouble("baseVolume"); ticker.high = jsonObject.getDouble("highestBid"); ticker.low = jsonObject.getDouble("lowestAsk"); <START> ticker.last = jsonObject.getDouble("last"); <END> }</code><technical_language>sense add ask bid (as lowestAsk24 highestBid24 respectively)</technical_language>

Target:
protected void parseTickerFromJsonObject(int requestId, JSONObject jsonObject, Ticker ticker, CheckerInfo checkerInfo) throws Exception { ticker.ask = jsonObject.getDouble("lowestAsk24"); ticker.bid = jsonObject.getDouble("highestBid24"); ticker.vol = jsonObject.getDouble("baseVolume"); ticker.high = jsonObject.getDouble("highestBid"); ticker.low = jsonObject.getDouble("lowestAsk"); ticker.last = jsonObject.getDouble("last"); }
Source:
<code>protected void findGroups(String searchString, AsyncQuery query) { Frontend.getInstance() .runQuery(VdcQueryType.Search, <START> new DirectorySearchParameters("ADGROUP@" + ((ProfileEntry) getProfile().getSelectedItem()).getAuthz() + ": " + searchString, SearchType.DirectoryGroup, (String) getNamespace().getSelectedItem()), query); END> }</code><technical_language>If you"ll generics need this cast</technical_language>

Target:
protected void findGroups(String searchString, AsyncQuery query) { Frontend.getInstance() .runQuery(VdcQueryType.Search, new DirectorySearchParameters("ADGROUP@" + ((ProfileEntry) getProfile().getSelectedItem()).getAuthz() + ": " + searchString, SearchType.DirectoryGroup, getNamespace().getSelectedItem()), query); }
Source:
<code>public void applicationSetVolume(String volume) { final ApplicationSetVolume applicationsetvolume = new ApplicationSetVolume(client, httpUri); if (volume.equals("ON")) { volume = "100"; } if (volume.equals("OFF")) { volume = "0"; } if (volume.equals("DECREASE")) { volume = this.volume.subtract(new BigDecimal(10)).toString(); } if (volume.equals("INCREASE")) { volume = this.volume.add(new BigDecimal(10)).toString(); <START> } <END> this.volume = new BigDecimal(volume); applicationsetvolume.setVolume(this.volume.intValue()); applicationsetvolume.execute(); }</code><technical_language>please "else if" option valid a time. Please format code Eclipse coding standards</technical_language>

Target:
public void applicationSetVolume(String volume) { final ApplicationSetVolume applicationsetvolume = new ApplicationSetVolume(client, httpUri); if (volume.equals("ON")) { this.volume = new BigDecimal(100); } else if (volume.equals("OFF")) { this.volume = new BigDecimal(0); } else if (volume.equals("DECREASE")) { this.volume = this.volume.subtract(VOLUMESTEP); } else if (volume.equals("INCREASE")) { this.volume = this.volume.add(VOLUMESTEP); } else { try { this.volume = new BigDecimal(volume); } catch (NumberFormatException e) { logger.error("applicationSetVolume cannot parse volume parameter: " + volume); this.volume = BigDecimal.ZERO; } } applicationsetvolume.setVolume(this.volume.intValue()); applicationsetvolume.execute(); }
Source:
<code>protected boolean isEnabledFor(Object[] selectionArray) { Object parent = null; IProfile profile = getProfile(); if (selectionArray.length > 0) { for (Object <START> element2 : <END> selectionArray) { if (element2 instanceof InstalledIUElement) { InstalledIUElement element = (InstalledIUElement) element2; if (parent == null) { parent = element.getParent(element); } else if (parent != element.getParent(element)) { return false; } if (!isSelectable(element.getIU(), profile)) return false; } else { IInstallableUnit iu = ProvUI.getAdapter(element2, IInstallableUnit.class); if (iu == null || !isSelectable(iu)) return false; } } return true; } return false; }</code><technical_language>rename selection</technical_language>

Target:
protected boolean isEnabledFor(Object[] selectionArray) { Object parent = null; IProfile profile = getProfile(); if (selectionArray.length > 0) { for (Object selection : selectionArray) { if (selection instanceof InstalledIUElement) { InstalledIUElement element = (InstalledIUElement) selection; if (parent == null) { parent = element.getParent(element); } else if (parent != element.getParent(element)) { return false; } if (!isSelectable(element.getIU(), profile)) return false; } else { IInstallableUnit iu = ProvUI.getAdapter(selection, IInstallableUnit.class); if (iu == null || !isSelectable(iu)) return false; } } return true; } return false; }
Source:
<code><START> void setHeight(int height) { <END> cellSize = height; }</code><technical_language>public? put next other setter</technical_language>

Target:
public void setHeight(int height) { cellSize = height; }
Source:
<code>public void onTripRequestComplete(List<Itinerary> itineraries) { <START> Log.i(TAG, "Successfully routed. Itineraries are " + itineraries); <END> if (itineraries.size() > 0) { Fragment fragment = getSupportFragmentManager().findFragmentById(R.id.trip_plan_fragment_container); if (fragment != null && fragment instanceof TripResultsFragment) { Bundle bundle = fragment.getArguments(); bundle.putSerializable(OTPConstants.ITINERARIES, new ArrayList<>(itineraries)); ((TripResultsFragment) fragment).displayNewResults(); return; } TripResultsFragment resultsFragment = new TripResultsFragment(); Bundle bundle = builder.getBundle(); bundle.putSerializable(OTPConstants.ITINERARIES, new ArrayList<>(itineraries)); resultsFragment.setArguments(bundle); FragmentTransaction transaction = getSupportFragmentManager().beginTransaction(); transaction.replace(R.id.trip_plan_fragment_container, resultsFragment); transaction.addToBackStack(null); transaction.commit(); } else { Toast.makeText(this, getString(R.string.tripplanner_error_bogus_parameter), Toast.LENGTH_SHORT).show(); } }</code><technical_language>Log statements Log.d(), in a try/catch exception block, in case Log.e()</technical_language>

Target:
public void onTripRequestComplete(List<Itinerary> itineraries) { Intent intent = new Intent(this, TripPlanActivity.class) .setAction(Intent.ACTION_MAIN) .addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP) .putExtra(OTPConstants.ITINERARIES, (ArrayList<Itinerary>) itineraries) .putExtra(INTENT_SOURCE, true); startActivity(intent); }
Source:
<code><START> ScriptExecutingMessageSource(AbstractScriptExecutingMessageProcessor<?> scriptMessageProcessor) { <END> this.scriptMessageProcessor = scriptMessageProcessor; }</code><technical_language>Java Config style, this class public</technical_language>

Target:
public ScriptExecutingMessageSource(AbstractScriptExecutingMessageProcessor<?> scriptMessageProcessor) { this.scriptMessageProcessor = scriptMessageProcessor; }
Source:
<code>public void run() { AbstractApplicationContext ctx = new ClassPathXmlApplicationContext( "testIp-in-multicast-context.xml", UdpMulticastEndToEndTests.class); while (okToRun) { try { readyToReceive.countDown(); sentFirst.await(); } catch (InterruptedException e) { e.printStackTrace(); } QueueChannel channel = ctx.getBean("udpOutChannel", QueueChannel.class); finalMessage = (Message<byte[]>) channel.receive(); firstReceived.countDown(); try { doneProcessing.await(); } catch (InterruptedException e) { e.printStackTrace(); } } ctx.stop(); ctx.close(); <START> ctx.destroy(); <END> }</code><technical_language>destroy invokes close. So, redundant</technical_language>

Target:
public void run() { AbstractApplicationContext ctx = new ClassPathXmlApplicationContext( "testIp-in-multicast-context.xml", UdpMulticastEndToEndTests.class); while (okToRun) { try { readyToReceive.countDown(); sentFirst.await(); } catch (InterruptedException e) { e.printStackTrace(); } QueueChannel channel = ctx.getBean("udpOutChannel", QueueChannel.class); finalMessage = (Message<byte[]>) channel.receive(); firstReceived.countDown(); try { doneProcessing.await(); } catch (InterruptedException e) { e.printStackTrace(); } } ctx.stop(); ctx.close(); }
Source:
<code>public void invalidate(Object obj, PageMode mode) { IHTMLPage htmlPage = (IHTMLPage) obj; String folderPath = mode.name() + File.separator; String velocityRootPath = VelocityUtil.getVelocityRootPath(); String languageStr = htmlPage.isContent() ? "_" + ((Contentlet) htmlPage).getLanguageId() : ""; String filePath = folderPath + htmlPage.getIdentifier() + languageStr + "." + VelocityType.HTMLPAGE.fileExtension; velocityRootPath += java.io.File.separator; java.io.File f = new java.io.File(velocityRootPath + filePath); <START> f.delete(); <END> DotResourceCache vc = CacheLocator.getVeloctyResourceCache(); vc.remove(ResourceManager.RESOURCE_TEMPLATE + filePath); }</code><technical_language>![MAJOR](<LINK_0> 'Severity: MAJOR') "java.nio.Files#delete" for messages error conditions. [![rule](<LINK_3>](<LINK_4> ![MINOR](<LINK_1> 'Severity: MINOR') Do "boolean" returned "delete". [![rule](<LINK_3>](<LINK_2></technical_language>

Target:
public void invalidate(Object obj, PageMode mode) { HTMLPageAsset htmlPage =null; if(obj instanceof IHTMLPage) { htmlPage = (HTMLPageAsset) obj; }else if(obj instanceof Contentlet) { htmlPage = APILocator.getHTMLPageAssetAPI().fromContentlet((Contentlet) obj); } if(htmlPage==null) { return; } String folderPath = mode.name() + File.separator; String velocityRootPath = VelocityUtil.getVelocityRootPath(); String languageStr = htmlPage.getLanguageId() +""; String filePath = folderPath + htmlPage.getIdentifier() + languageStr + "." + VelocityType.HTMLPAGE.fileExtension; velocityRootPath += java.io.File.separator; java.io.File f = new java.io.File(velocityRootPath + filePath); f.delete(); DotResourceCache vc = CacheLocator.getVeloctyResourceCache(); vc.remove(ResourceManager.RESOURCE_TEMPLATE + filePath); }
Source:
<code>public void unparseServiceConfigurationWithInstance() { TestCacheLoaderWriter testCacheLoaderWriter = new TestCacheLoaderWriter(); CacheConfiguration<?, ?> cacheConfig = newCacheConfigurationBuilder(Object.class, Object.class, heap(10)).add(new DefaultCacheLoaderWriterConfiguration(testCacheLoaderWriter)).build(); assertThatExceptionOfType(XmlConfigurationException.class).isThrownBy(() -> new DefaultCacheLoaderWriterConfigurationParser().unparseServiceConfiguration(cacheConfig, new CacheType())) <START> .withMessage("%s", "XML translation for instance based intialization for " + <END> "DefaultCacheLoaderWriterConfiguration is not supported"); }</code><technical_language>awful correct typo ("intialization" -> "initialization") in this exception message</technical_language>

Target:
public void unparseServiceConfigurationWithInstance() { TestCacheLoaderWriter testCacheLoaderWriter = new TestCacheLoaderWriter(); CacheConfiguration<?, ?> cacheConfig = newCacheConfigurationBuilder(Object.class, Object.class, heap(10)).add(new DefaultCacheLoaderWriterConfiguration(testCacheLoaderWriter)).build(); assertThatExceptionOfType(XmlConfigurationException.class).isThrownBy(() -> new DefaultCacheLoaderWriterConfigurationParser().unparseServiceConfiguration(cacheConfig, new CacheType())) .withMessage("%s", "XML translation for instance based initialization for " + "DefaultCacheLoaderWriterConfiguration is not supported"); }
Source:
<code>public EnumWindingOrderTypes getWindingOrder() { <START> return getParameter(PARAM_UNIFY_WINDING_ORDER).as(EnumWindingOrderTypes.class); <END> }</code><technical_language>This ideal place provide a default value, in case parameter is set. This classes extending writer able adapt. default anything, for GML writers a unification CCW</technical_language>

Target:
public EnumWindingOrderTypes getWindingOrder() { EnumWindingOrderTypes value = getParameter(PARAM_UNIFY_WINDING_ORDER) .as(EnumWindingOrderTypes.class); if (value == null) return getDefaultWindingOrder(); else return value; }
Source:
<code>public WebElement getCancelAddInstructorLink() { <START> return browser.driver.findElement(By.id("addInstrCancelLink")); <END> }</code><technical_language>names consistent. suggested, cancelAddInstructorLink is preferred addIntrCancelLink</technical_language>

Target:
public WebElement getCancelAddInstructorLink() { return browser.driver.findElement(By.id("cancelAddInstructorLink")); }
Source:
<code>private void newSnapshot() { if (getWindow() != null) { return; } final UIConstants constants = ConstantsManager.getInstance().getConstants(); GlusterVolumeEntity volumeEntity = getEntity(); boolean scheduleTabVisible = false; if (!(volumeEntity.getSnapshotScheduled())) { scheduleTabVisible = true; } GlusterVolumeSnapshotModel snapshotModel = new GlusterVolumeSnapshotModel(Arrays.asList(GlusterVolumeSnapshotScheduleRecurrence.values()), true, scheduleTabVisible); snapshotModel.setHelpTag(HelpTag.new_volume_snapshot); snapshotModel.setHashName("new_volume_snapshot"); snapshotModel.setTitle(ConstantsManager.getInstance().getConstants().createScheduleVolumeSnapshotTitle()); setWindow(snapshotModel); snapshotModel.getClusterName().setEntity(volumeEntity.getVdsGroupName()); snapshotModel.getVolumeName().setEntity(volumeEntity.getName()); <START> UICommand okCommand = new UICommand("onCreateSnapshot", this); END> okCommand.setTitle(constants.ok()); okCommand.setIsDefault(true); snapshotModel.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("Cancel", this); cancelCommand.setTitle(constants.cancel()); cancelCommand.setIsCancel(true); snapshotModel.getCommands().add(cancelCommand); }</code><technical_language>UICommand.createOkUiCommand</technical_language>

Target:
private void newSnapshot() { if (getWindow() != null) { return; } final UIConstants constants = ConstantsManager.getInstance().getConstants(); GlusterVolumeEntity volumeEntity = getEntity(); boolean scheduleTabVisible = false; if (!(volumeEntity.getSnapshotScheduled())) { scheduleTabVisible = true; } GlusterVolumeSnapshotModel snapshotModel = new GlusterVolumeSnapshotModel(Arrays.asList(GlusterVolumeSnapshotScheduleRecurrence.values()), true, scheduleTabVisible); snapshotModel.setHelpTag(HelpTag.new_volume_snapshot); snapshotModel.setHashName("new_volume_snapshot"); snapshotModel.setTitle(ConstantsManager.getInstance().getConstants().createScheduleVolumeSnapshotTitle()); setWindow(snapshotModel); snapshotModel.getClusterName().setEntity(volumeEntity.getVdsGroupName()); snapshotModel.getVolumeName().setEntity(volumeEntity.getName()); UICommand okCommand = UICommand.createDefaultOkUiCommand("onCreateSnapshot", this); snapshotModel.getCommands().add(okCommand); UICommand cancelCommand = UICommand.createCancelUiCommand("cancel", this); snapshotModel.getCommands().add(cancelCommand); }
Source:
<code>public static void addMonthsToDate(SSDate date, int months) { if (months != 0) { int month = date.getMonth(); int year = date.getYear(); int resultMonthCount = year * 12 + month + months; int resultYear = resultMonthCount / 12; int resultMonth = resultMonthCount - resultYear * 12; if (resultMonth == 1 && date.getDate() > 28) { if (((resultYear % 4 == 0) && (resultYear % 100 != 0)) || (resultYear % 400 == 0)) { date.setDate(29); } else { date.setDate(28); } } else if ( date.getDate() == 31 && <START> (resultMonth <= 6 && resultMonth % 2 != 0) || (resultMonth > 6 && resultMonth % 2 == 0) <END> ) { date.setDate(30); } date.setMonth(resultMonth); date.setYear(resultYear); } }</code><technical_language>easier follow if changed this line to: (resultMonth == 3 || resultMonth == 5 || resultMonth == 8 || resultMonth == 10) thing. is number of days in a month changes</technical_language>

Target:
public static void addMonthsToDate(SSDate date, int months) { if (months != 0) { int month = date.getMonth(); int year = date.getYear(); int resultMonthCount = year * 12 + month + months; int resultYear = resultMonthCount / 12; int resultMonth = resultMonthCount - resultYear * 12; if (resultMonth == 1 && date.getDate() > 28) { if (((resultYear % 4 == 0) && (resultYear % 100 != 0)) || (resultYear % 400 == 0)) { date.setDate(29); } else { date.setDate(28); } } else if ( date.getDate() == 31 && (resultMonth == 3 || resultMonth == 5 || resultMonth == 8 || resultMonth == 10) ) { date.setDate(30); } date.setMonth(resultMonth); date.setYear(resultYear); } }
Source:
<code>public void init() { final Image splashImage = new Image(getClass().getResourceAsStream("views/common/splash.png")); final double splashImageAspectRatio = splashImage.getWidth() / splashImage.getHeight(); splashWidth = Screen.getPrimary().getBounds().getWidth() / 3; splashHeight = splashWidth * (1 / splashImageAspectRatio); final ImageView splash = new ImageView(splashImage); splash.setFitWidth(splashWidth); splash.setFitHeight(splashHeight); loadProgress = new ProgressBar(); loadProgress.setPrefWidth(splashWidth); progressText = new Label(tr("Loading ...")); progressText.setFont(new Font(12)); <START> splashLayout = new VBox(); <END> splashLayout.getChildren().addAll(splash, loadProgress, progressText); progressText.setAlignment(Pos.CENTER); splashLayout.setEffect(new DropShadow()); }</code><technical_language>This next line unified new VBox(nodes) constructor</technical_language>

Target:
public void init() { final Image splashImage = new Image(getClass().getResourceAsStream("views/common/splash.png")); final double splashImageAspectRatio = splashImage.getWidth() / splashImage.getHeight(); splashWidth = Screen.getPrimary().getBounds().getWidth() / 3; splashHeight = splashWidth * (1 / splashImageAspectRatio); BackgroundSize backgroundSize = new BackgroundSize(splashWidth, splashHeight, false, false, true, true); BackgroundImage backgroundImage = new BackgroundImage(splashImage, BackgroundRepeat.NO_REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, backgroundSize); Region spacer = new Region(); VBox.setVgrow(spacer, Priority.ALWAYS); ProgressIndicator loadProgress = new ProgressIndicator(); progressText = new Label(tr("Loading...")); progressText.setFont(new Font(12)); progressText.setPadding(new Insets(20, 5, 10, 5)); progressText.setBackground(Background.EMPTY); progressText.setAlignment(Pos.CENTER); splashLayout = new VBox(spacer, loadProgress, progressText); splashLayout.setPrefSize(splashWidth, splashHeight); splashLayout.setAlignment(Pos.CENTER); splashLayout.setBackground(new Background(backgroundImage)); splashLayout.setEffect(new DropShadow()); }
Source:
<code><START> public void copyWALFiles(WalPosition startPosition, WalPosition endPosition, long oldWalKey) <END> { try { for (long i = startPosition.fileId; i < endPosition.fileId; i++) { DataInputStream in = bfs.getInputStream(oldWalKey, WAL_FILE_PREFIX + i); DataOutputStream out = bfs.getOutputStream(walKey, WAL_FILE_PREFIX + walFileId); IOUtils.copyLarge(in, out); in.close(); out.close(); walFileId++; } copyWalPart(startPosition, endPosition, oldWalKey); if (maxWalFileSize > 0 && walSize > maxWalFileSize) { writer.close(); writer = null; walFileId++; walSize = 0; } } catch (Exception e) { DTThrowable.wrapIfChecked(e); } }</code><technical_language>need public</technical_language>

Target:
public void copyWALFiles(WalPosition startPosition, WalPosition endPosition, long oldWalKey) { try { for (long i = startPosition.fileId; i < endPosition.fileId; i++) { if (bfs.exists(oldWalKey, WAL_FILE_PREFIX + i)) { DataInputStream in = bfs.getInputStream(oldWalKey, WAL_FILE_PREFIX + i); DataOutputStream out = bfs.getOutputStream(walKey, WAL_FILE_PREFIX + walFileId); IOUtils.copyLarge(in, out); in.close(); out.close(); walFileId++; } } copyWalPart(startPosition, endPosition, oldWalKey); if (maxWalFileSize > 0 && walSize > maxWalFileSize) { writer.close(); writer = null; walFileId++; walSize = 0; } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code>public static String longToString(Long transactorId) { <START> return Long.toString(transactorId, 36); <END> }</code><technical_language>java.lang.Character.MAX_RADIX</technical_language>

Target:
public static String longToString(Long transactorId) { return Long.toString(transactorId, Character.MAX_RADIX); }
Source:
<code>public OperatorImplGraph(OperatorSpecGraph specGraph, Context context, Clock clock) { this.clock = clock; StreamConfig streamConfig = new StreamConfig(context.getJobContext().getConfig()); <START> TaskContextImpl taskContext = (TaskContextImpl) context.getTaskContext(); <END> this.jobContextMetadata = new JobContextMetadata(context); Map<SystemStream, Integer> producerTaskCounts = hasIntermediateStreams(specGraph) ? getProducerTaskCountForIntermediateStreams( getStreamToConsumerTasks(jobContextMetadata.getJobModel()), getIntermediateToInputStreamsMap(specGraph, streamConfig)) : Collections.EMPTY_MAP; producerTaskCounts.forEach((stream, count) -> { LOG.info("{} has producer tasks.", stream, count); }); jobContextMetadata.registerObject(EndOfStreamStates.class.getName(), new EndOfStreamStates(taskContext.getTaskModel().getSystemStreamPartitions(), producerTaskCounts)); jobContextMetadata.registerObject(WatermarkStates.class.getName(), new WatermarkStates(taskContext.getTaskModel().getSystemStreamPartitions(), producerTaskCounts, context.getContainerContext().getContainerMetricsRegistry())); specGraph.getInputOperators().forEach((streamId, inputOpSpec) -> { SystemStream systemStream = streamConfig.streamIdToSystemStream(streamId); InputOperatorImpl inputOperatorImpl = (InputOperatorImpl) createAndRegisterOperatorImpl(null, inputOpSpec, systemStream, context); this.inputOperators.put(systemStream, inputOperatorImpl); }); }</code><technical_language>I this variable is unused now</technical_language>

Target:
public OperatorImplGraph(OperatorSpecGraph specGraph, Context context, Clock clock) { this.clock = clock; StreamConfig streamConfig = new StreamConfig(context.getJobContext().getConfig()); this.internalTaskContext = new InternalTaskContext(context); Map<SystemStream, Integer> producerTaskCounts = hasIntermediateStreams(specGraph) ? getProducerTaskCountForIntermediateStreams( getStreamToConsumerTasks(internalTaskContext.getJobModel()), getIntermediateToInputStreamsMap(specGraph, streamConfig)) : Collections.EMPTY_MAP; producerTaskCounts.forEach((stream, count) -> { LOG.info("{} has producer tasks.", stream, count); }); internalTaskContext.registerObject(EndOfStreamStates.class.getName(), new EndOfStreamStates( internalTaskContext.getContext().getTaskContext().getTaskModel().getSystemStreamPartitions(), producerTaskCounts)); internalTaskContext.registerObject(WatermarkStates.class.getName(), new WatermarkStates( internalTaskContext.getContext().getTaskContext().getTaskModel().getSystemStreamPartitions(), producerTaskCounts, context.getContainerContext().getContainerMetricsRegistry())); specGraph.getInputOperators().forEach((streamId, inputOpSpec) -> { SystemStream systemStream = streamConfig.streamIdToSystemStream(streamId); InputOperatorImpl inputOperatorImpl = (InputOperatorImpl) createAndRegisterOperatorImpl(null, inputOpSpec, systemStream, context); this.inputOperators.put(systemStream, inputOperatorImpl); }); }
Source:
<code>public SerialMessage getValueMessage() { <START> logger.debug("NODE {}: Creating new message for command SWITCH_ALL_GET", (Object)this.getNode().getNodeId()); <END> SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessage.SerialMessageClass.SendData, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.ApplicationCommandHandler, SerialMessage.SerialMessagePriority.Get); byte[] newPayload = { (byte)this.getNode().getNodeId(), 2, (byte) this.getCommandClass().getKey(), (byte) SWITCH_ALL_GET }; result.setMessagePayload(newPayload); return result; }</code><technical_language>This if(getSupported) check</technical_language>

Target:
public SerialMessage getValueMessage() { if (!this.isGetSupported) { logger.debug("NODE {}: Node doesn't support get requests", (Object) this.getNode().getNodeId()); return null; } logger.debug( "NODE {}: Creating new message for command SWITCH_ALL_GET", (Object) this.getNode().getNodeId()); SerialMessage result = new SerialMessage(this.getNode().getNodeId(), SerialMessage.SerialMessageClass.SendData, SerialMessage.SerialMessageType.Request, SerialMessage.SerialMessageClass.ApplicationCommandHandler, SerialMessage.SerialMessagePriority.Get); byte[] newPayload = { (byte) this.getNode().getNodeId(), 2, (byte) this.getCommandClass().getKey(), (byte) SWITCH_ALL_GET }; result.setMessagePayload(newPayload); return result; }
Source:
<code>public boolean onOptionsItemSelected( final MenuItem item ) { final MainActivity main = MainActivity.getMainActivity(); NavigationView navigationView = (NavigationView) getActivity().findViewById(R.id.left_drawer); switch ( item.getItemId() ) { case MENU_USER_STATS: MenuItem userStatsMenuItem = navigationView.getMenu().findItem(R.id.nav_user_stats); navigationView.getMenu().setGroupVisible(R.id.stats_group, true); userStatsMenuItem.setCheckable(true); userStatsMenuItem.setChecked(true); <START> if (main != null) main.selectFragment(R.id.nav_user_stats); <END> return true; case MENU_SITE_STATS: MenuItem siteStatsMenuItem = navigationView.getMenu().findItem(R.id.nav_site_stats); navigationView.getMenu().setGroupVisible(R.id.stats_group, true); siteStatsMenuItem.setCheckable(true); siteStatsMenuItem.setChecked(true); if (main != null) main.selectFragment(R.id.nav_site_stats); return true; case MENU_RANK_SWAP: monthRanking.set(!monthRanking.get()); item.setTitle(getRankSwapString()); downloadRanks(false); return true; case MENU_USER_CENTRIC_SWAP: userCentric.set(!userCentric.get()); item.setTitle(getUserCentricSwapString()); downloadRanks(false); return true; } return false; }</code><technical_language>steps copied over, is generalize a single call</technical_language>

Target:
public boolean onOptionsItemSelected( final MenuItem item ) { final MainActivity main = MainActivity.getMainActivity(); NavigationView navigationView = (NavigationView) getActivity().findViewById(R.id.left_drawer); switch ( item.getItemId() ) { case MENU_USER_STATS: MenuUtil.selectStatsSubmenuItem(navigationView, main, R.id.nav_user_stats); return true; case MENU_SITE_STATS: MenuUtil.selectStatsSubmenuItem(navigationView, main, R.id.nav_site_stats); return true; case MENU_RANK_SWAP: monthRanking.set(!monthRanking.get()); item.setTitle(getRankSwapString()); downloadRanks(false); return true; case MENU_USER_CENTRIC_SWAP: userCentric.set(!userCentric.get()); item.setTitle(getUserCentricSwapString()); downloadRanks(false); return true; } return false; }
Source:
<code>private Tree getLastReassignment(int line, Symbol referenceSymbol) { Tree result = null; <START> for (Tree reassignement : reassignmentBySymbol.get(referenceSymbol)) { <END> int reassignementLine = FirstSyntaxTokenFinder.firstSyntaxToken(reassignement).line(); if (line > reassignementLine) { result = reassignement; } } return result; }</code><technical_language>@m-g-sonar reassignement -> reassignment</technical_language>

Target:
private Tree getLastReassignment(int line, Symbol referenceSymbol) { Tree result = null; for (Tree reassignment : reassignmentBySymbol.get(referenceSymbol)) { int reassignmentLine = FirstSyntaxTokenFinder.firstSyntaxToken(reassignment).line(); if (line > reassignmentLine) { result = reassignment; } } return result; }
Source:
<code>protected void delete(Context context, UUID id) throws AuthorizeException { Community community = null; try { community = cs.find(context, id); if (community == null) { throw new ResourceNotFoundException( CommunityRest.CATEGORY + "." + CommunityRest.NAME + " with id: " + id + " not found"); } } catch (SQLException e) { <START> throw new RuntimeException(e.getMessage(), e); <END> } try { cs.delete(context, community); } catch (SQLException | IOException e) { throw new RuntimeException(e.getMessage(), e); } }</code><technical_language>Change like: throw new RuntimeException("Unable find Community id=" + id, e);</technical_language>

Target:
protected void delete(Context context, UUID id) throws AuthorizeException { Community community = null; try { community = cs.find(context, id); if (community == null) { throw new ResourceNotFoundException( CommunityRest.CATEGORY + "." + CommunityRest.NAME + " with id: " + id + " not found"); } } catch (SQLException e) { throw new RuntimeException("Unable to find Community with id = " + id, e); } try { cs.delete(context, community); } catch (SQLException e) { throw new RuntimeException("Unable to delete Community with id = " + id, e); } catch (IOException e) { throw new RuntimeException("Unable to delete community because the logo couldn't be deleted", e); } }
Source:
<code>protected void onHandleIntent(Intent intent) { Bundle extras = intent.getExtras(); GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this); String messageType = gcm.getMessageType(intent); Log.e(LIGER.TAG, "LigerGcmIntentService onHandleIntent"); if (!extras.isEmpty()) { if (GoogleCloudMessaging. MESSAGE_TYPE_SEND_ERROR.equals(messageType)) { sendNotification("Send error: " + extras.toString(), intent); } else if (GoogleCloudMessaging. MESSAGE_TYPE_DELETED.equals(messageType)) { sendNotification("Deleted messages on server: " + extras.toString(), intent); } else if (GoogleCloudMessaging. MESSAGE_TYPE_MESSAGE.equals(messageType)) { for (int i = 0; i < 5; i++) { Log.e(LIGER.TAG, "Working... " + (i + 1) + "/5 @ " + SystemClock.elapsedRealtime()); try { Thread.sleep(5000); } catch (InterruptedException e) { } } Log.e(LIGER.TAG, "Completed work @ " + SystemClock.elapsedRealtime()); sendNotification("Received: " + extras.toString(), intent); Log.e(LIGER.TAG, "Received: " + extras.toString()); }else if ("send_event".equals(messageType)) { for (int i = 0; i < 5; i++) { <START> Log.e(LIGER.TAG, "Working... " + (i + 1) <END> + "/5 @ " + SystemClock.elapsedRealtime()); try { Thread.sleep(5000); } catch (InterruptedException e) { } } Log.e(LIGER.TAG, "Completed work @ " + SystemClock.elapsedRealtime()); sendNotification("Received: " + extras.toString(), intent); Log.e(LIGER.TAG, "Received: " + extras.toString()); } } LigerGcmBroadcastReceiver.completeWakefulIntent(intent); }</code><technical_language>Is this needed part of test code</technical_language>

Target:
protected void onHandleIntent(Intent intent) { Bundle extras = intent.getExtras(); GoogleCloudMessaging gcm = GoogleCloudMessaging.getInstance(this); String messageType = gcm.getMessageType(intent); if (LIGER.LOGGING) { Log.d(LIGER.TAG, "LigerGcmIntentService onHandleIntent"); } if (!extras.isEmpty()) { if (GoogleCloudMessaging. MESSAGE_TYPE_SEND_ERROR.equals(messageType)) { sendNotification("Send error: " + extras.toString(), intent); } else if (GoogleCloudMessaging. MESSAGE_TYPE_DELETED.equals(messageType)) { sendNotification("Deleted messages on server: " + extras.toString(), intent); } else if (GoogleCloudMessaging. MESSAGE_TYPE_MESSAGE.equals(messageType)) { for (int i = 0; i < 5; i++) { Log.d(LIGER.TAG, "Working... " + (i + 1) + "/5 @ " + SystemClock.elapsedRealtime()); try { Thread.sleep(5000); } catch (InterruptedException e) { } } Log.d(LIGER.TAG, "Completed work @ " + SystemClock.elapsedRealtime()); sendNotification("Received: " + extras.toString(), intent); Log.d(LIGER.TAG, "Received: " + extras.toString()); } } LigerGcmBroadcastReceiver.completeWakefulIntent(intent); }
Source:
<code>public void setUp() throws IOException { config = new LocalDataSegmentPusherConfig(); config.storageDirectory = temporaryFolder.newFolder(); <START> localDataSegmentPusher = new LocalDataSegmentPusher(config, new JodaMapper()); <END> dataSegmentFiles = temporaryFolder.newFolder(); Files.asByteSink(new File(dataSegmentFiles, "version.bin")).write(Ints.toByteArray(0x9)); }</code><technical_language>this change</technical_language>

Target:
public void setUp() throws IOException { config = new LocalDataSegmentPusherConfig(); config.storageDirectory = temporaryFolder.newFolder(); localDataSegmentPusher = new LocalDataSegmentPusher(config, new DefaultObjectMapper()); dataSegmentFiles = temporaryFolder.newFolder(); Files.asByteSink(new File(dataSegmentFiles, "version.bin")).write(Ints.toByteArray(0x9)); }
Source:
<code>public static boolean isAutoTools(IProject project) { try { if (project.hasNature(AutotoolsNewProjectNature.AUTOTOOLS_NATURE_ID)) { return true; } else { return false; } } catch (CoreException e) { MessageDialog.openError(null, "Getting Project type error", <START> "project not found or is closed."); END> return false; } }</code><technical_language>Externalize strings</technical_language>

Target:
public static boolean isAutoTools(IProject project) { try { if (project.hasNature(AutotoolsNewProjectNature.AUTOTOOLS_NATURE_ID)) { return true; } else { return false; } } catch (CoreException e) { MessageDialogSyncedRunnable.openErrorSyncedRunnable(ProfilingMessages.errorTitle, ProfilingMessages.errorGetProjectType); return false; } }
Source:
<code>public static MaskedWalletRequest createMaskedWalletRequest(String merchantName, Checkout checkout, BuyClient buyClient, boolean phoneNumberRequired) { if (checkout == null) { throw new NullPointerException("checkout cannot be null"); } if (buyClient == null) { throw new NullPointerException("buyClient cannot be null"); } if (TextUtils.isEmpty(merchantName)) { throw new IllegalArgumentException("merchantName cannot be empty"); } PaymentMethodTokenizationParameters parameters = PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PaymentMethodTokenizationType.NETWORK_TOKEN) <START> .addParameter("publicKey", buyClient.getAndroidPayPublicKey()) <END> .build(); Cart walletCart = AndroidPayHelper.createWalletCart(checkout); return MaskedWalletRequest.newBuilder() .setMerchantName(merchantName) .setPhoneNumberRequired(phoneNumberRequired) .setShippingAddressRequired(checkout.isRequiresShipping()) .setCurrencyCode(checkout.getCurrency()) .setEstimatedTotalPrice(checkout.getTotalPrice()) .setPaymentMethodTokenizationParameters(parameters) .setCart(walletCart) .setPhoneNumberRequired(phoneNumberRequired) .build(); }</code><technical_language>if Android Pay is disabled, in this case pay public key is null, add verification if pay is disabled for this function</technical_language>

Target:
public static MaskedWalletRequest createMaskedWalletRequest(String merchantName, Checkout checkout, BuyClient buyClient, boolean phoneNumberRequired) { if (checkout == null) { throw new NullPointerException("checkout cannot be null"); } if (buyClient == null) { throw new NullPointerException("buyClient cannot be null"); } if (TextUtils.isEmpty(merchantName)) { throw new IllegalArgumentException("merchantName cannot be empty"); } if (!buyClient.androidPayIsEnabled()) { throw new IllegalArgumentException("buyClient must have Android Pay enabled"); } PaymentMethodTokenizationParameters parameters = PaymentMethodTokenizationParameters.newBuilder() .setPaymentMethodTokenizationType(PaymentMethodTokenizationType.NETWORK_TOKEN) .addParameter("publicKey", buyClient.getAndroidPayPublicKey()) .build(); Cart walletCart = createWalletCart(checkout); return MaskedWalletRequest.newBuilder() .setMerchantName(merchantName) .setPhoneNumberRequired(phoneNumberRequired) .setShippingAddressRequired(checkout.isRequiresShipping()) .setCurrencyCode(checkout.getCurrency()) .setEstimatedTotalPrice(checkout.getTotalPrice()) .setPaymentMethodTokenizationParameters(parameters) .setCart(walletCart) .setPhoneNumberRequired(phoneNumberRequired) .build(); }
Source:
<code>private void discoverFields(Map<String, Object> map, Map<String, Object> document) { for(String field : document.keySet()) { if(!map.containsKey(field)) { Object val = document.get(field); <START> if(!(val instanceof Map) && !(val instanceof List)) { <END> map.put(field, val); } } } }</code><technical_language>want include Lists of basic types (like Strings numbers) valid root level things</technical_language>

Target:
private void discoverFields(Map<String, Object> map, Map<String, Object> document) { for (String field : document.keySet()) { if (!map.containsKey(field)) { Object val = document.get(field); if (val == null) { continue; } if (val instanceof Map) { continue; } if (val instanceof List) { if (!isFlatList((List) val)) { continue; } } val = valueConversionFunction(val); map.put(field, val); } } }
Source:
<code>public void addEntities() { while (getEntities().size() < 5) { <START> EnemyFish eFish = factory.randomizedFish(new BoundingBox(null, 60, 60)); <END> add(eFish); } }</code><technical_language>a getFactory() method, here. <interface</technical_language>

Target:
public void addEntities() { while (getEntities().size() < 5) { EnemyFish eFish = getFactory().randomizedFish(new BoundingBox(null, 60, 60)); add(eFish); } }