auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void performDurablePublishRestartServerTestCase() throws Exception { AndesJMSConsumerClientConfiguration consumerConfig = new AndesJMSConsumerClientConfiguration(ExchangeType.TOPIC, "durableServerRestartTopic"); consumerConfig.setDurable(true, "restartServerSub"); AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration(ExchangeType.TOPIC, "durableServerRestartTopic"); publisherConfig.setPrintsPerMessageCount(SEND_COUNT / 10L); publisherConfig.setNumberOfMessagesToSend(SEND_COUNT); AndesClient initialConsumerClient = new AndesClient(consumerConfig, true); initialConsumerClient.startClient(); AndesClientUtils.sleepForInterval(5000L); initialConsumerClient.stopClient(); AndesClientUtils.sleepForInterval(5000L); AndesClient publisherClient = new AndesClient(publisherConfig, true); publisherClient.startClient(); AndesClientUtils.sleepForInterval(5000L); super.restartServer(); AndesClientUtils.sleepForInterval(20L * 1000L); AndesClient secondaryConsumerClient = new AndesClient(consumerConfig, true); secondaryConsumerClient.startClient(); AndesClientUtils .waitForMessagesAndShutdown(secondaryConsumerClient, AndesClientConstants.DEFAULT_RUN_TIME); Assert.assertEquals(publisherClient .getSentMessageCount(), SEND_COUNT, "Message sending failed."); Assert.assertEquals(secondaryConsumerClient .getReceivedMessageCount(), EXPECTED_COUNT, "Message receiving failed for client 1."); }

Target:
public void performDurablePublishRestartServerTestCase() throws Exception { AndesJMSConsumerClientConfiguration consumerConfig = new AndesJMSConsumerClientConfiguration(ExchangeType.TOPIC, "durableServerRestartTopic"); consumerConfig.setDurable(true, "restartServerSub"); AndesJMSPublisherClientConfiguration publisherConfig = new AndesJMSPublisherClientConfiguration(ExchangeType.TOPIC, "durableServerRestartTopic"); publisherConfig.setPrintsPerMessageCount(SEND_COUNT / 10L); publisherConfig.setNumberOfMessagesToSend(SEND_COUNT); AndesClient initialConsumerClient = new AndesClient(consumerConfig, true); initialConsumerClient.startClient(); AndesClientUtils.sleepForInterval(5000L); initialConsumerClient.stopClient(); AndesClientUtils.sleepForInterval(5000L); AndesClient publisherClient = new AndesClient(publisherConfig, true); publisherClient.startClient(); AndesClientUtils.sleepForInterval(5000L); super.restartServer(); AndesClient secondaryConsumerClient = new AndesClient(consumerConfig, true); secondaryConsumerClient.startClient(); AndesClientUtils .waitForMessagesAndShutdown(secondaryConsumerClient, AndesClientConstants.DEFAULT_RUN_TIME); Assert.assertEquals(publisherClient .getSentMessageCount(), SEND_COUNT, "Message sending failed."); Assert.assertEquals(secondaryConsumerClient .getReceivedMessageCount(), EXPECTED_COUNT, "Message receiving failed for client 1."); }
Source:
public Object[][] webAppEntities() { Object[][] dataProviderResult; Reflections reflections = new Reflections("org.apache.brooklyn.entity.webapp"); Set<Class<? extends JavaWebAppSoftwareProcess>> reflectionsSubTypesOfJavaWebAppSoftwareProcess = reflections.getSubTypesOf(org.apache.brooklyn.entity.webapp.JavaWebAppSoftwareProcess.class); List<Object[]> webAppEntities = getEntitiesFromClasses(reflectionsSubTypesOfJavaWebAppSoftwareProcess); dataProviderResult = new Object[webAppEntities.size()][]; webAppEntities.toArray(dataProviderResult); return dataProviderResult; }

Target:
public Object[][] webAppEntities() { Object[][] dataProviderResult = new Object[][] { {EntitySpec.create(JBoss6Server.class)}, {EntitySpec.create(JBoss7Server.class)}, {EntitySpec.create(Jetty6Server.class)}, {EntitySpec.create(TomcatServer.class)}, {EntitySpec.create(Tomcat8Server.class)} }; return dataProviderResult; }
Source:
protected void reestablishConnectionIfNeeded() { if (getVds().getProtocol() == VdsProtocol.XML && FeatureSupported.jsonProtocol(getVds().getVdsGroupCompatibilityVersion()) && getVds().getHostOs() != null) { getVds().setProtocol(VdsProtocol.STOMP); getVdsStaticDao().save(getVds().getStaticData()); initializeVds(); } }

Target:
protected void reestablishConnectionIfNeeded() { if (getVds().getProtocol() == VdsProtocol.XML && FeatureSupported.jsonProtocol(getVds().getVdsGroupCompatibilityVersion()) && getVds().getHostOs() != null) { getVds().setProtocol(VdsProtocol.STOMP); getVdsStaticDao().save(getVds().getStaticData()); resourceManager.reestablishConnection(getVdsId()); } }
Source:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RemoveImageCommand<RemoveImageParameters> cmd = CommandCoordinatorUtil.retrieveCommand(cmdId); if (asyncRetVal == null) { DiskImage diskImage = cmd.getDiskImage(); Guid storagePoolId = diskImage.getStoragePoolId() != null ? diskImage.getStoragePoolId() : Guid.Empty; Guid storageDomainId = (cmd.getParameters().getStorageDomainId() == null || Guid.Empty.equals(cmd.getParameters().getStorageDomainId())) && cmd.getDiskImage() != null ? diskImage.getStorageIds().get(0) : cmd.getParameters().getStorageDomainId(); asyncRetVal = ResourceManager.getInstance().runAsyncVdsCommand(VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(storagePoolId, storageDomainId, diskImage.getId(), diskImage.getImageId())); } if (asyncRetVal != null && asyncRetVal.isRequestCompleted()) { Object retVal = asyncRetVal.getReturnValue(); if (retVal == null) { cmd.setCommandStatus(asyncRetVal.getSucceeded() ? CommandStatus.FAILED : CommandStatus.SUCCEEDED); } else { asyncRetVal = null; } } }

Target:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RemoveImageCommand<RemoveImageParameters> cmd = CommandCoordinatorUtil.retrieveCommand(cmdId); if (asyncRetVal == null) { DiskImage diskImage = cmd.getDiskImage(); Guid storagePoolId = diskImage.getStoragePoolId() != null ? diskImage.getStoragePoolId() : Guid.Empty; Guid storageDomainId = Guid.isNullOrEmpty(cmd.getParameters().getStorageDomainId()) && cmd.getDiskImage() != null ? diskImage.getStorageIds().get(0) : cmd.getParameters().getStorageDomainId(); asyncRetVal = ResourceManager.getInstance().runAsyncVdsCommand(VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(storagePoolId, storageDomainId, diskImage.getId(), diskImage.getImageId())); } if (asyncRetVal != null && asyncRetVal.isRequestCompleted()) { if (!asyncRetVal.getSucceeded()) { cmd.setCommandStatus(CommandStatus.SUCCEEDED); } else { asyncRetVal = null; } } }
Source:
public MimeTypeEmail getMimeTypeEmail() throws MessagingException { MimeTypeEmailBuilder builder = new MimeTypeEmailBuilder(); String subject = String.format(CONSENT_EMAIL_SUBJECT, getStudy().getName()); builder.withSubject(subject); final String sendFromEmail = getFormattedSenderEmail(); builder.withSender(sendFromEmail); if (getStudy().getConsentNotificationEmail() != null) { Set<String> emailAddresses = BridgeUtils.commaListToOrderedSet(getStudy().getConsentNotificationEmail()); builder.withRecipients(emailAddresses); } String content = String.format("<p>User %s withdrew from the study on %s. </p>", getUserLabel(), FORMATTER.print(withdrewOn)); content += "<p>Reason:</p>"; if (StringUtils.isBlank(withdrawal.getReason())) { content += "<p><i>No reason given.</i></p>"; } else { content += "<p>" + nullSafeCleanHtml(withdrawal.getReason()) + "</p>"; } final MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setText(content, StandardCharsets.UTF_8.name(), SUB_TYPE_HTML); builder.withMessageParts(bodyPart); return builder.build(); }

Target:
public MimeTypeEmail getMimeTypeEmail() throws MessagingException { MimeTypeEmailBuilder builder = new MimeTypeEmailBuilder(); String subject = String.format(CONSENT_EMAIL_SUBJECT, getStudy().getName()); builder.withSubject(subject); final String sendFromEmail = getFormattedSenderEmail(); builder.withSender(sendFromEmail); builder.withRecipients(recipients); String content = String.format("<p>User %s withdrew from the study on %s. </p>", getUserLabel(), FORMATTER.print(withdrewOn)); content += "<p>Reason:</p>"; if (StringUtils.isBlank(withdrawal.getReason())) { content += "<p><i>No reason given.</i></p>"; } else { content += "<p>" + nullSafeCleanHtml(withdrawal.getReason()) + "</p>"; } final MimeBodyPart bodyPart = new MimeBodyPart(); bodyPart.setText(content, StandardCharsets.UTF_8.name(), SUB_TYPE_HTML); builder.withMessageParts(bodyPart); return builder.build(); }
Source:
public void shouldRestoreNotifications() { NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, getBaseNotifBundle(), null); NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; Intent intent = Shadows.shadowOf(blankActivity).getNextStartedService(); assertEquals(RestoreJobService.class.getName(), intent.getComponent().getClassName()); advanceSystemTimeBy(time, 604_801); NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; assertNull(Shadows.shadowOf(blankActivity).getNextStartedService()); }

Target:
public void shouldRestoreNotifications() { NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; NotificationBundleProcessor_ProcessFromFCMIntentService(blankActivity, getBaseNotifBundle(), null); NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; Intent intent = Shadows.shadowOf(blankActivity).getNextStartedService(); assertEquals(RestoreJobService.class.getName(), intent.getComponent().getClassName()); time.advanceSystemTimeBy(604_801); NotificationRestorer.restore(blankActivity); NotificationRestorer.restored = false; assertNull(Shadows.shadowOf(blankActivity).getNextStartedService()); }
Source:
default <R> Task<R> flatMap(final String desc, final Function1<? super T, Task<R>> func) { ArgumentUtil.requireNotNull(func, "function"); final Task<Task<R>> nested = map("map: " + desc, func); nested.getShallowTraceBuilder().setSystemHidden(true); nested.getShallowTraceBuilder().setTaskType("nestedTask"); return flatten(desc, nested); }

Target:
default <R> Task<R> flatMap(final String desc, final Function1<? super T, Task<R>> func) { ArgumentUtil.requireNotNull(func, "function"); final Task<Task<R>> nested = map("map: " + desc, func); nested.getShallowTraceBuilder().setSystemHidden(true); return flatten(desc, nested); }
Source:
public boolean waitInvisibility(WebElement webElement) { return waitInvisibility(webElement, DEFAULT_TIMEOUT); }

Target:
public void waitInvisibility(WebElement webElement) { waitInvisibility(webElement, DEFAULT_TIMEOUT); }
Source:
public void onCreate() { super.onCreate(); AwfulPreferences mPref = AwfulPreferences.getInstance(this); appStatePrefs = this.getSharedPreferences(APP_STATE_PREFERENCES, MODE_PRIVATE); NetworkUtils.init(this); AndroidThreeTen.init(this); AnnouncementsManager.init(); fontManager = new FontManager(mPref.preferredFont, getAssets()); mPref.registerCallback(fontManager); long hoursSinceInstall = getHoursSinceInstall(); crashlyticsEnabled = !BuildConfig.DEBUG || hoursSinceInstall > 4; if (crashlyticsEnabled) { Fabric.with(this, new Crashlytics()); if (mPref.sendUsernameInReport) Crashlytics.setUserName(mPref.username); } Timber.plant(crashlyticsEnabled ? new CrashlyticsReportingTree() : new Timber.DebugTree()); Timber.i("App installed %d hours ago", hoursSinceInstall); if (Constants.DEBUG) { Timber.d("*\n*\n*Debug active\n*\n*"); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects() .penaltyLog() .penaltyDeath() .build()); } SyncManager.sync(this); }

Target:
public void onCreate() { super.onCreate(); AwfulPreferences mPref = AwfulPreferences.getInstance(this); appStatePrefs = this.getSharedPreferences(APP_STATE_PREFERENCES, MODE_PRIVATE); NetworkUtils.init(this); AndroidThreeTen.init(this); AnnouncementsManager.init(); FontManager.createInstance(mPref, getAssets()); long hoursSinceInstall = getHoursSinceInstall(); crashlyticsEnabled = !BuildConfig.DEBUG || hoursSinceInstall > 4; if (crashlyticsEnabled) { Fabric.with(this, new Crashlytics()); if (mPref.sendUsernameInReport) Crashlytics.setUserName(mPref.username); } Timber.plant(crashlyticsEnabled ? new CrashlyticsReportingTree() : new Timber.DebugTree()); Timber.i("App installed %d hours ago", hoursSinceInstall); if (Constants.DEBUG) { Timber.d("*\n*\n*Debug active\n*\n*"); StrictMode.setVmPolicy(new StrictMode.VmPolicy.Builder() .detectLeakedSqlLiteObjects() .penaltyLog() .penaltyDeath() .build()); } SyncManager.sync(this); }
Source:
public EntityType(Type type, Set<Supertype> superTypes, Function<EntityType, String> variableNameFunction) { super(type); this.modifiedSimpleName = variableNameFunction.apply(this); this.superTypes = superTypes; this.variableNameFunction = variableNameFunction; }

Target:
private EntityType(Type type, Set<Supertype> superTypes, Function<EntityType, String> variableNameFunction) { super(type); this.superTypes = superTypes; this.modifiedSimpleName = variableNameFunction.apply(this); }
Source:
private void setDialogTextView(final String newString) { computeTextView.post(new Runnable() { @Override public void run() { computeTextView.setText(newString); ViewGroup.LayoutParams params = computeTextView.getLayoutParams(); int heightPixels = computeTextView.getLineCount() * computeTextView.getLineHeight(); params.width = ViewGroup.LayoutParams.FILL_PARENT; params.height = heightPixels + (int) (heightPixels * 0.5); computeTextView.setLayoutParams(params); } }); }

Target:
private void setDialogTextView(final String newString) { computeTextView.post(new Runnable() { @Override public void run() { computeTextView.setText(newString); ViewGroup.LayoutParams params = computeTextView.getLayoutParams(); int height = computeTextView.getLineCount() * computeTextView.getLineHeight(); int heightMargin = (int) (height * 0.5); params.width = ViewGroup.LayoutParams.FILL_PARENT; params.height = height + heightMargin; computeTextView.setLayoutParams(params); } }); }
Source:
public Run<?,?> getBuild(Job<?,?> job, EnvVars env, BuildFilter filter, Run<?,?> parent) { String jobName = job instanceof MatrixConfiguration ? job.getParent().getFullName() : job.getFullName(); for (Cause cause : parent instanceof MatrixRun ? ((MatrixRun)parent).getParentBuild().getCauses() : parent.getCauses()) { if (cause instanceof UpstreamCause && jobName.equals(((UpstreamCause)cause).getUpstreamProject())) { Run<?,?> run = job.getBuildByNumber(((UpstreamCause)cause).getUpstreamBuild()); return (run != null && filter.isSelectable(run, env)) ? run : null; } else if (cause instanceof UpstreamCause) { String parentJobName = ((UpstreamCause)cause).getUpstreamProject(); Job <?,?> parentJob = Jenkins.getInstance().getItemByFullName(parentJobName, Job.class); Run<?,?> run = getBuild( job, env, filter, parentJob.getBuildByNumber(((UpstreamCause)cause).getUpstreamBuild())); if (run != null && filter.isSelectable(run, env)) { return run; } } } if (isFallbackToLastSuccessful()) { return super.getBuild(job, env, filter, parent); } return null; }

Target:
public Run<?,?> getBuild(Job<?,?> job, EnvVars env, BuildFilter filter, Run<?,?> parent) { String jobName = job instanceof MatrixConfiguration ? job.getParent().getFullName() : job.getFullName(); for (Cause cause : parent instanceof MatrixRun ? ((MatrixRun)parent).getParentBuild().getCauses() : parent.getCauses()) { if (cause instanceof UpstreamCause) { UpstreamCause upstream = (UpstreamCause) cause; if (jobName.equals(upstream.getUpstreamProject())) { Run<?,?> run = job.getBuildByNumber(upstream.getUpstreamBuild()); return (run != null && filter.isSelectable(run, env)) ? run : null; } else { String parentJobName = upstream.getUpstreamProject(); Job <?,?> parentJob = Jenkins.getInstance().getItemByFullName(parentJobName, Job.class); Run<?,?> run = getBuild( job, env, filter, parentJob.getBuildByNumber(upstream.getUpstreamBuild())); if (run != null && filter.isSelectable(run, env)) { return run; } } } } if (isFallbackToLastSuccessful()) { return super.getBuild(job, env, filter, parent); } return null; }
Source:
public void switchAndQuoteMessageWall(String reply) { driver.switchTo().defaultContent(); driver.switchTo().frame(quoteMessageWallFrame); driver.findElement(By.cssSelector("body#bodyContent")).clear(); driver.findElement(By.cssSelector("body#bodyContent")).sendKeys(reply); PageObjectLogging.log("switchAndQuoteMessageWall", "quote typed", true); }

Target:
public void switchAndQuoteMessageWall(String reply) { driver.switchTo().frame(quoteMessageWallFrame); driver.findElement(By.cssSelector("body#bodyContent")).clear(); driver.findElement(By.cssSelector("body#bodyContent")).sendKeys(reply); PageObjectLogging.log("switchAndQuoteMessageWall", "quote typed", true); }
Source:
public void selectionRangeUpdated(TmfSelectionRangeUpdatedSignal signal) { if ((signal.getSource() != this) && (TmfTraceManager.getInstance().getActiveTrace() != null)) { long start = signal.getBeginTime().getValue(); long end = signal.getEndTime().getValue(); Iterable<ISegment> selection; if (start == end) { selection = fTopData.getData().getIntersectingElements(start); } else { selection = fTopData.getData().getIntersectingElements(start, end); } TreeMapStore<ISegment> data = new TreeMapStore<>(); for (ISegment segment : selection) { if (segment != null) { data.addElement(segment); } } updateModel(new LatencyDataStore(data)); } }

Target:
public void selectionRangeUpdated(TmfSelectionRangeUpdatedSignal signal) { if ((signal.getSource() != this) && (TmfTraceManager.getInstance().getActiveTrace() != null)) { TreeMapStore<ISegment> data = getIntersectingData(new TmfTimeRange(signal.getBeginTime(), signal.getEndTime())); if (data == null) { updateModel(null); return; } updateModel(new LatencyDataStore(data)); } }
Source:
public static KeyStore loadKeyStore(final String storeType, final String password, final String storeLoc) throws CertificateManagerException { InputStream is = null; KeyStore secretStore = null; try { secretStore = KeyStore.getInstance(storeType); if (!PKCS11_TYPE.equalsIgnoreCase(storeType)) { is = new FileInputStream(storeLoc); } secretStore.load(is, password.toCharArray()); } catch (final IOException | NoSuchAlgorithmException | CertificateException | KeyStoreException ex) { LOG.error(KEYSTORE_ERROR_MSG, ex.getLocalizedMessage(), ex); throw new CertificateManagerException(ex.getMessage(), ex); } finally { try { if (is != null) { is.close(); } } catch (final IOException ex) { LOG.error("Unable to close keyStoreStream- KeyStoreCallbackHandler {}", ex.getLocalizedMessage(), ex); } } return secretStore; }

Target:
public static KeyStore loadKeyStore(final String storeType, final String password, final String storeLoc) throws CertificateManagerException { InputStream is = null; KeyStore secretStore = null; try { secretStore = KeyStore.getInstance(storeType); if (!PKCS11_TYPE.equalsIgnoreCase(storeType)) { is = new FileInputStream(storeLoc); } secretStore.load(is, password.toCharArray()); } catch (final IOException | NoSuchAlgorithmException | CertificateException | KeyStoreException ex) { LOG.error(KEYSTORE_ERROR_MSG, ex.getLocalizedMessage(), ex); throw new CertificateManagerException(ex.getMessage(), ex); } finally { closeStream(is); } return secretStore; }
Source:
public static JsonParser createFor(JsonValue jsonValue, Supplier<JsonParserFactory> parserFactoryProvider) { if (jsonValue instanceof JsonObject) { return parserFactoryProvider.get().createParser((JsonObject) jsonValue); } else if (jsonValue instanceof JsonArray) { return parserFactoryProvider.get().createParser((JsonArray) jsonValue); } else if (jsonValue instanceof JsonString) { return new JsonStringParserAdapter((JsonString) jsonValue); } else if (jsonValue instanceof JsonNumber) { return new JsonNumberParserAdapter((JsonNumber) jsonValue); } else if (EnumSet.of(ValueType.FALSE, ValueType.TRUE).contains(jsonValue.getValueType())) { return new JsonValueParserAdapter<>(jsonValue); } throw new IllegalArgumentException("Cannot create JsonParser for " + jsonValue.getValueType()); }

Target:
public static JsonParser createFor(JsonValue jsonValue, Supplier<JsonParserFactory> parserFactoryProvider) { switch (jsonValue.getValueType()) { case OBJECT: return parserFactoryProvider.get().createParser(jsonValue.asJsonObject()); case ARRAY: return parserFactoryProvider.get().createParser(jsonValue.asJsonArray()); case STRING: return new JsonStringParserAdapter((JsonString) jsonValue); case NUMBER: return new JsonNumberParserAdapter((JsonNumber) jsonValue); default: return new JsonValueParserAdapter<>(jsonValue); } }
Source:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((name == null) ? 0 : name.hashCode()); result = prime * result + Arrays.hashCode(outcomes); result = prime * result + Arrays.hashCode(params); return result; }

Target:
public int hashCode() { return Objects.hash(name, Arrays.hashCode(outcomes), Arrays.hashCode(params)); }
Source:
public void setup() throws Exception { temporaryFolder.create(); String keysetHome = temporaryFolder.newFolder("keysets").getAbsolutePath(); String associatedDataHome = temporaryFolder.newFolder("etc").getAbsolutePath(); System.setProperty(SecurityConstants.KEYSET_DIR, keysetHome); System.setProperty( SecurityConstants.ASSOCIATED_DATA_PATH, associatedDataHome.concat("/associatedData.properties")); }

Target:
public void setup() throws Exception { String keysetHome = temporaryFolder.newFolder("keysets").getAbsolutePath(); String associatedDataHome = temporaryFolder.newFolder("etc").getAbsolutePath(); System.setProperty(SecurityConstants.KEYSET_DIR, keysetHome); System.setProperty( SecurityConstants.ASSOCIATED_DATA_PATH, associatedDataHome.concat("/associatedData.properties")); }
Source:
@NonNull public PageTitle pageTitle() { PageTitle title = new PageTitle(article.normalizedTitle(), site); if (article.thumbnail() != null) { title.setThumbUrl(article.thumbnail().toString()); } if (!TextUtils.isEmpty(article.description())) { title.setDescription(article.description()); } return title; }

Target:
@NonNull public PageTitle pageTitle() { PageTitle title = new PageTitle(article.title(), site); if (article.thumbnail() != null) { title.setThumbUrl(article.thumbnail().toString()); } if (!TextUtils.isEmpty(article.description())) { title.setDescription(article.description()); } return title; }
Source:
public void the_user_is_on_the_Candidate_creation_page() throws Throwable { getDriver().get(CANDIDATE_CREATION_URL); }

Target:
public void the_user_is_on_the_Candidate_creation_page() { waitForPageLoadAfter(event -> getDriver().get(CANDIDATE_CREATION_URL)); }
Source:
public Mono<Response<FileUploadInfo>> clearRange(long length) { FileRange range = new FileRange(0, length - 1); return azureFileStorageClient.files().uploadRangeWithRestResponseAsync(shareName, filePath, range.toString(), FileRangeWriteType.UPDATE, 0, null, null, null, Context.NONE) .map(this::uploadResponse); }

Target:
public Mono<FileUploadInfo> clearRange(long length) { return clearRangeWithResponse(length, 0).flatMap(FluxUtil::toMono); }
Source:
private void setupBinding() { setupChanges(false); if (mInfo.getInvokerMethod() != null) { mCommand = new ICommand() { @Override public boolean canExecute(Object parameter) { try { return mInfo.check(getSubject(), parameter); } catch (Exception ex) { getLogger().error("Error while checking command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } return true; } @Override public void execute(Object parameter) { try { mInfo.invoke(getSubject(), parameter); } catch (Exception ex) { getLogger().error("Error while raising command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } } @Override public boolean canExecute(View view, Object parameter) { try { return mInfo.check(getSubject(), view, parameter); } catch (Exception ex) { getLogger().error("Error while checking command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } return true; } @Override public void execute(View view, Object parameter) { try { mInfo.invoke(getSubject(), view, parameter); } catch (Exception ex) { getLogger().error("Error while raising command " + mInfo.getCommandName() + ": " + ex.getMessage()); retryExecute(view, parameter); } } private void retryExecute(View parameter, Object parameter2) { try { mInfo.invoke(getSubject(), parameter2); } catch (Exception e) { if (mDebugMode) { throw new RuntimeException(e); } else { execute(parameter); } } } }; } }

Target:
private void setupBinding() { setupChanges(false); if (mInfo.getInvokerMethod() != null) { mCommand = new ICommand() { @Override public boolean canExecute(Object parameter) { try { return mInfo.check(getSubject(), parameter); } catch (Exception ex) { getLogger().error("Error while checking command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } return true; } @Override public void execute(Object parameter) { try { mInfo.invoke(getSubject(), parameter); } catch (Exception ex) { getLogger().error("Error while raising command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } } @Override public boolean canExecute(View view, Object parameter) { try { return mInfo.check(getSubject(), view, parameter); } catch (Exception ex) { getLogger().error("Error while checking command " + mInfo.getCommandName() + ": " + ex.getMessage()); if (mDebugMode) { throw new RuntimeException(ex); } } return true; } @Override public void execute(View view, Object parameter) { try { mInfo.invoke(getSubject(), view, parameter); } catch (Exception ex) { getLogger().error("Error while raising command " + mInfo.getCommandName() + ": " + ex.getMessage()); retryExecute(view, parameter); } } private void retryExecute(View parameter, Object parameter2) { try { mInfo.invoke(getSubject(), parameter2); } catch (Exception e) { execute(parameter); } } }; } }
Source:
private void handleRemovedDevices(Guid vmId, HashSet<Guid> processedDevices) { List<VmDevice> devices = DbFacade.getInstance().getVmDeviceDAO().getVmDeviceByVmId(vmId); for (VmDevice device : devices) { if (!processedDevices.contains(device.getDeviceId())) { if (device.getIsManaged()) { if (device.getIsPlugged()) { log.errorFormat("Managed non plugable device was removed unexpetedly from libvirt: {0}", device.toString()); } else { device.setAddress(""); DbFacade.getInstance().getVmDeviceDAO().update(device); log.debugFormat("Unmanaged pluggable device was unplugged : {0}", device.toString()); } } else { DbFacade.getInstance().getVmDeviceDAO().remove(device.getId()); log.debugFormat("unmanaged device was removed : {0}", device.toString()); } } } }

Target:
private void handleRemovedDevices(Guid vmId, HashSet<Guid> processedDevices) { List<VmDevice> devices = DbFacade.getInstance().getVmDeviceDAO().getVmDeviceByVmId(vmId); for (VmDevice device : devices) { if (!processedDevices.contains(device.getDeviceId())) { if (device.getIsManaged()) { if (device.getIsPlugged()) { log.errorFormat("VM {0} managed non plugable device was removed unexpetedly from libvirt: {1}", vmId, device.toString()); } else { device.setAddress(""); addVmDeviceToList(device); log.debugFormat("VM {0} unmanaged pluggable device was unplugged : {1}", vmId, device.toString()); } } else { DbFacade.getInstance().getVmDeviceDAO().remove(device.getId()); log.debugFormat("VM {0} unmanaged device was removed : {1}", vmId, device.toString()); } } } }
Source:
public PypiWheelArtifactCoordinates(String distribution, String version, String build, String languageImplementationVersion, String abi, String platform) { if (distribution == "" || version == "" || languageImplementationVersion == "" || abi == "" || platform == "") { throw new IllegalArgumentException("distribution, version, language_implementation_version_tag, abi_tag, and platform_tag must be specified"); } if (build != "" && !Character.isDigit(build.charAt(0))) { throw new IllegalArgumentException("illegal build tag"); } setId(distribution); setVersion(version); setBuild(build); setLanguageImplementationVersion(languageImplementationVersion); setAbi(abi); setPlatform(platform); }

Target:
public PypiWheelArtifactCoordinates(String distribution, String version, String build, String languageImplementationVersion, String abi, String platform) { if (StringUtils.isBlank(distribution) || StringUtils.isBlank(version) || StringUtils.isBlank(languageImplementationVersion) || StringUtils.isBlank(abi) || StringUtils.isBlank(platform)) { throw new IllegalArgumentException("The distribution, version, language_implementation_version_tag, abi_tag, and platform_tag are mandatory fields."); } if (!StringUtils.isBlank(build) && !Character.isDigit(build.charAt(0))) { throw new IllegalArgumentException("Illegal build tag!"); } setId(distribution); setVersion(version); setBuild(build); setLanguageImplementationVersion(languageImplementationVersion); setAbi(abi); setPlatform(platform); }
Source:
public UserProperty newInstance(StaplerRequest req, JSONObject formData) throws FormException { String userId = formData.optString("userId"); boolean disableNotifications = formData.optBoolean("disableNotifications"); return new SlackUserProperty(userId, disableNotifications); }

Target:
public UserProperty newInstance(StaplerRequest req, JSONObject formData) { return req.bindJSON(SlackUserProperty.class, formData); }
Source:
private void init(List<ServiceReference<Object>> initServices){ if(initServices == null) { this.services = emptyList(); return; } this.services = Arrays.asList( initServices.stream() .map(TemplateServiceReference::new) .sorted() .toArray(TemplateServiceReference[]::new) ); }

Target:
private void init(List<ServiceReference<Object>> initServices){ if(initServices == null) { this.services = emptyList(); return; } this.services = initServices.stream() .map(TemplateServiceReference::new) .sorted() .collect(Collectors.toList()); }
Source:
private static void writeToFile(CompilationUnit compUnit, File file) throws IOException { try (BufferedWriter bw = Files.newBufferedWriter(file.toPath(), UTF_8)) { bw.write(compUnit.toString()); } catch (IOException e) { throw e; } }

Target:
private static void writeToFile(CompilationUnit compUnit, File file) throws IOException { try (BufferedWriter bw = Files.newBufferedWriter(file.toPath(), UTF_8)) { bw.write(compUnit.toString()); } }
Source:
public String getIdentifier() { MixinDefinition outer = getOuterMixinDefinition(); if (outer != null) { return outer.getIdentifier() + "." + this.name.getString(); } else if (this.isModule && this.sourceSection != null) { return this.sourceSection.getSource().getPath() + ":" + this.name.getString(); } return this.name.getString(); }

Target:
public SSymbol getIdentifier() { MixinDefinition outer = getOuterMixinDefinition(); if (identifier == null) { CompilerDirectives.transferToInterpreterAndInvalidate(); if (outer != null) { identifier = Symbols.symbolFor(outer.getIdentifier() + "." + this.name.getString()); } else if (this.isModule && this.sourceSection != null) { Path absolute = Paths.get(this.sourceSection.getSource().getURI()); Path relative = Paths.get(VmSettings.BASE_DIRECTORY).toAbsolutePath().relativize(absolute); identifier = Symbols.symbolFor(relative.toString() + ":" + this.name.getString()); } else { identifier = this.name; } } return identifier; }
Source:
public void testMassiveMerge() { ArrayList<Double> values = new ArrayList<>(); ArrayList<Double> weights = new ArrayList<>(); FixedDoubleBreakdownHistogram left = new FixedDoubleBreakdownHistogram(100, 0.0, 1.0); IntStream.range(0, 100).forEach(i -> { double value = Math.random(); double weight = Math.random(); values.add(value); weights.add(weight); left.add(value, weight, 1); }); FixedDoubleBreakdownHistogram right = new FixedDoubleBreakdownHistogram(100, 0.0, 1.0); ArrayList<Double> rightValues = new ArrayList<>(); ArrayList<Double> rightWeights = new ArrayList<>(); IntStream.range(0, 100).forEach(i -> { double value = Math.random(); double weight = Math.random(); values.add(value); weights.add(weight); rightValues.add(value); rightWeights.add(weight); right.add(value, weight, 1); }); left.mergeWith(right.clone()); Streams.stream(left.iterator()).forEach(b -> { long count = IntStream.range(0, values.size()) .filter(i -> b.getLeft() < values.get(i) && values.get(i) <= b.getRight() && b.getWeight() == weights.get(i)) .count(); assertEquals(b.getCount(), count); }); Streams.stream(right.iterator()).forEach(b -> { long count = IntStream.range(0, rightValues.size()) .filter(i -> b.getLeft() < rightValues.get(i) && rightValues.get(i) <= b.getRight() && b.getWeight() == rightWeights.get(i)) .count(); assertEquals(b.getCount(), count); }); }

Target:
public void testMassiveMerge() { ArrayList<Double> values = new ArrayList<>(); ArrayList<Double> weights = new ArrayList<>(); FixedDoubleBreakdownHistogram left = new FixedDoubleBreakdownHistogram(100, 0.0, 1.0); for (int i = 0; i < 100; ++i) { double value = Math.random(); double weight = Math.random(); values.add(value); weights.add(weight); left.add(value, weight, 1); } FixedDoubleBreakdownHistogram right = new FixedDoubleBreakdownHistogram(100, 0.0, 1.0); ArrayList<Double> rightValues = new ArrayList<>(); ArrayList<Double> rightWeights = new ArrayList<>(); for (int i = 0; i < 100; ++i) { double value = Math.random(); double weight = Math.random(); values.add(value); weights.add(weight); rightValues.add(value); rightWeights.add(weight); right.add(value, weight, 1); } left.mergeWith(right.clone()); Streams.stream(left.iterator()).forEach(b -> { long count = IntStream.range(0, values.size()) .filter(i -> b.getLeft() < values.get(i) && values.get(i) <= b.getRight() && b.getWeight() == weights.get(i)) .count(); assertEquals(b.getCount(), count); }); Streams.stream(right.iterator()).forEach(b -> { long count = IntStream.range(0, rightValues.size()) .filter(i -> b.getLeft() < rightValues.get(i) && rightValues.get(i) <= b.getRight() && b.getWeight() == rightWeights.get(i)) .count(); assertEquals(b.getCount(), count); }); }
Source:
private static long getEstimatedMemorySizeInBytes(MultiPath multiPath) { int pointCount = multiPath.getPointCount(); int pathCount = multiPath.getPointCount(); return ENVELOPE_INSTANCE_SIZE + sizeOfDoubleArray(2 * pointCount) + sizeOfIntArray(pathCount) + sizeOfByteArray(pathCount); }

Target:
private static long getEstimatedMemorySizeInBytes(MultiPath multiPath) { int pointCount = multiPath.getPointCount(); int pathCount = multiPath.getPathCount(); return ENVELOPE_INSTANCE_SIZE + sizeOfDoubleArray(2 * pointCount) + sizeOfIntArray(pathCount) + sizeOfByteArray(pathCount); }
Source:
public List<Folder> getAllFolders() { Jenkins jenkins = Jenkins.getInstance(); jenkins.checkPermission(Jenkins.ADMINISTER); List<Folder> folders; try (ACLContext ignored = ACL.as(ACL.SYSTEM)) { folders = jenkins.getAllItems(Folder.class); } return folders; }

Target:
public List<AbstractFolder> getAllFolders() { Jenkins jenkins = Jenkins.getInstance(); jenkins.checkPermission(Jenkins.ADMINISTER); List<AbstractFolder> folders; try (ACLContext ignored = ACL.as(ACL.SYSTEM)) { folders = jenkins.getAllItems(AbstractFolder.class); } return folders; }
Source:
protected void mergeBufferIntoQueue() { for (final Entry<DifferentialTimestamp, Map<Tuple, Integer>> outerEntry : this.buffer.entrySet()) { final DifferentialTimestamp selector = outerEntry.getKey(); final Map<Tuple, Integer> tupleMap = this.queue.get(selector); if (tupleMap == null) { this.queue.put(selector, outerEntry.getValue()); } else { for (final Entry<Tuple, Integer> innerEntry : outerEntry.getValue().entrySet()) { final Tuple tuple = innerEntry.getKey(); final Integer queueCount = tupleMap.get(tuple); final Integer bufferCount = innerEntry.getValue(); if (queueCount == null) { tupleMap.put(tuple, bufferCount); } else { final int sum = bufferCount + queueCount; if (sum != 0) { tupleMap.put(tuple, sum); } } } } } }

Target:
protected void mergeBufferIntoQueue() { for (final Entry<DifferentialTimestamp, IDeltaBag<Tuple>> outerEntry : this.buffer.entrySet()) { final DifferentialTimestamp selector = outerEntry.getKey(); final IDeltaBag<Tuple> tupleMap = this.queue.get(selector); if (tupleMap == null) { this.queue.put(selector, outerEntry.getValue()); } else { for (final Tuple tuple : outerEntry.getValue().distinctValues()) { final int queueCount = tupleMap.getCount(tuple); final int bufferCount = outerEntry.getValue().getCount(tuple); if (queueCount == 0) { tupleMap.addSigned(tuple, bufferCount); } else { final int sum = bufferCount + queueCount; if (sum != 0) { tupleMap.addSigned(tuple, sum); } else { tupleMap.clearAllOf(tuple); } } } } } }
Source:
private float[][] calculateRubricStats(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); int[][] responseFrequency = calculateResponseFrequency(responses, fqd); float[][] percentageFrequencyOrAverage = calculatePercentageFrequencyAndAverage(responseFrequency, fqd); return percentageFrequencyOrAverage; }

Target:
private float[][] calculateRubricStats(List<FeedbackResponseAttributes> responses, FeedbackQuestionAttributes question) { FeedbackRubricQuestionDetails fqd = (FeedbackRubricQuestionDetails) question.getQuestionDetails(); int[][] responseFrequency = calculateResponseFrequency(responses, fqd); return getPercentageFrequencyAndAverage(responseFrequency, fqd); }
Source:
private SafeHtmlBuilder formatHashtags(JsArrayString hashtags) { SafeHtmlBuilder html = new SafeHtmlBuilder(); Iterator<String> itr = Natives.asList(hashtags).iterator(); while (itr.hasNext()) { String hashtagName = itr.next(); html.openAnchor() .setAttribute("href", "/#/q/hashtag:" + hashtagName) .setAttribute("role", "listitem") .setAttribute(DATA_ID, hashtagName) .setStyleName(style.hashtagName()) .append(hashtagName) .openElement("button") .setAttribute("title", "Remove hashtag") .setAttribute("onclick", REMOVE + "(event)") .append( new ImageResourceRenderer().render(Resources.I.remove_reviewer())) .closeElement("button"); html.closeSpan(); if (itr.hasNext()) { html.append(' '); } } return html; }

Target:
private SafeHtmlBuilder formatHashtags(JsArrayString hashtags) { SafeHtmlBuilder html = new SafeHtmlBuilder(); Iterator<String> itr = Natives.asList(hashtags).iterator(); while (itr.hasNext()) { String hashtagName = itr.next(); html.openAnchor() .setAttribute("href", "#" + PageLinks.toChangeQuery("hashtag:" + hashtagName)) .setAttribute("role", "listitem") .setAttribute(DATA_ID, hashtagName) .setStyleName(style.hashtagName()) .append(hashtagName) .openElement("button") .setAttribute("title", "Remove hashtag") .setAttribute("onclick", REMOVE + "(event)") .append( new ImageResourceRenderer().render(Resources.I.remove_reviewer())) .closeElement("button"); html.closeSpan(); if (itr.hasNext()) { html.append(' '); } } return html; }
Source:
public int[] getSizes() { int[] array = new int[ headers.size()]; int x = 0; try { for ( CpioHeader header : headers) { Object object = sources.get( header); if ( object instanceof File) array[ x] = ( int) (( File) object).length(); else if ( object instanceof URL) array[ x] = (( URL) object).openConnection().getContentLength(); else if ( header.getType() == DIR) array[ x] = 4096; else if ( object instanceof String) array[ x] = (( String) object).length(); ++x; } } catch ( IOException e) { throw new RuntimeException( e); } return array; }

Target:
public int[] getSizes() { int[] array = new int[ headers.size()]; int x = 0; try { for ( CpioHeader header : headers) { Object object = sources.get( header); if ( object instanceof File) array[ x] = ( int) (( File) object).length(); else if ( object instanceof URL) array[ x] = (( URL) object).openConnection().getContentLength(); else if ( header.getType() == DIR) array[ x] = 4096; else if ( header.getType() == SYMLINK) array[ x] = (( String) object).length(); ++x; } } catch ( IOException e) { throw new RuntimeException( e); } return array; }
Source:
private void onWirelessDebuggingEnabled(boolean enabled) { setSwitchBarChecked(enabled); mSwitchWidget.setEnabled(true); if (mListener != null) { mListener.onEnabled(enabled); } }

Target:
private void onWirelessDebuggingEnabled(boolean enabled) { mSwitchWidget.setChecked(enabled); mSwitchWidget.setEnabled(true); if (mListener != null) { mListener.onEnabled(enabled); } }
Source:
public void execute(IProgressMonitor m) throws CoreException { IProgressMonitor monitor = m != null ? m : new NullProgressMonitor(); IWorkspaceRunnable action = new IWorkspaceRunnable() { public void run(IProgressMonitor pm) throws CoreException { pm.beginTask("", 2); pm.subTask(MessageFormat.format( CoreText.SquashCommitsOperation_squashing, Integer.valueOf(commits.size()))); InteractiveHandler handler = new InteractiveHandler() { public void prepareSteps(List<RebaseTodoLine> steps) { RevCommit firstCommit = commits.get(0); for (RebaseTodoLine step : steps) { if (isRelevant(step.getCommit())) { try { if (step.getCommit().prefixCompare( firstCommit) == 0) step.setAction(RebaseTodoLine.Action.REWORD); else step.setAction(RebaseTodoLine.Action.FIXUP); } catch (IllegalTodoFileModification e) { } } } } private boolean isRelevant(AbbreviatedObjectId id) { for (RevCommit commit : commits) { if (id.prefixCompare(commit) == 0) return true; } return false; } public String modifyCommitMessage(String oldMessage) { return message; } }; try { Git git = new Git(repository); git.rebase().setUpstream(commits.get(0).getParent(0)) .runInteractively(handler) .setOperation(RebaseCommand.Operation.BEGIN).call(); } catch (GitAPIException e) { throw new TeamException(e.getLocalizedMessage(), e.getCause()); } pm.worked(1); ProjectUtil.refreshValidProjects( ProjectUtil.getValidOpenProjects(repository), new SubProgressMonitor(pm, 1)); pm.done(); } }; ResourcesPlugin.getWorkspace().run(action, getSchedulingRule(), IWorkspace.AVOID_UPDATE, monitor); }

Target:
public void execute(IProgressMonitor m) throws CoreException { IProgressMonitor monitor = m != null ? m : new NullProgressMonitor(); IWorkspaceRunnable action = new IWorkspaceRunnable() { public void run(IProgressMonitor pm) throws CoreException { pm.beginTask("", 2); pm.subTask(MessageFormat.format( CoreText.SquashCommitsOperation_squashing, Integer.valueOf(commits.size()))); InteractiveHandler handler = new InteractiveHandler() { public void prepareSteps(List<RebaseTodoLine> steps) { RevCommit firstCommit = commits.get(0); for (RebaseTodoLine step : steps) { if (isRelevant(step.getCommit())) { try { if (step.getCommit().prefixCompare( firstCommit) == 0) step.setAction(RebaseTodoLine.Action.PICK); else step.setAction(RebaseTodoLine.Action.SQUASH); } catch (IllegalTodoFileModification e) { } } } } private boolean isRelevant(AbbreviatedObjectId id) { for (RevCommit commit : commits) { if (id.prefixCompare(commit) == 0) return true; } return false; } public String modifyCommitMessage(String oldMessage) { return messageHandler.modifyCommitMessage(oldMessage); } }; try { Git git = new Git(repository); git.rebase().setUpstream(commits.get(0).getParent(0)) .runInteractively(handler) .setOperation(RebaseCommand.Operation.BEGIN).call(); } catch (GitAPIException e) { throw new TeamException(e.getLocalizedMessage(), e.getCause()); } pm.worked(1); ProjectUtil.refreshValidProjects( ProjectUtil.getValidOpenProjects(repository), new SubProgressMonitor(pm, 1)); pm.done(); } }; ResourcesPlugin.getWorkspace().run(action, getSchedulingRule(), IWorkspace.AVOID_UPDATE, monitor); }
Source:
public static void generateFiles(String filePath, String content) throws IOException { FileOutputStream fos = null; File file; try { file = new File(filePath); fos = new FileOutputStream(file); if (!file.exists()) { file.createNewFile(); } byte[] bytesArray = content.getBytes(); fos.write(bytesArray); fos.flush(); } catch (IOException e) { String errorMessage = "Error while generating meta information of client certificates from path."; throw new IOException(errorMessage, e); } finally { try { if (fos != null) { fos.close(); } } catch (IOException e) { String errorMessage = "Error while generating meta information of client certificates from path."; throw new IOException(errorMessage, e); } } }

Target:
public static void generateFiles(String filePath, String content) throws APIManagementException { File file = new File(filePath); try (FileOutputStream fos = new FileOutputStream(file)) { if (!file.exists()) { file.createNewFile(); } byte[] bytesArray = content.getBytes(); fos.write(bytesArray); fos.flush(); } catch (IOException e) { String errorMessage = "Error while generating meta information of client certificates from path."; throw new APIManagementException(errorMessage, e); } }
Source:
public void testReadAll_withLambda() throws Exception { ByteBuffer bb = struct.encoder() .string("name", "joe") .structs("mapEntry", new StructArrayEncoderFunction() { @Override public void encode(StructArrayEncoder encoder) { encoder .string("key", "1") .string("value", "one") .next() .string("key", "2") .string("value", "two"); } }) .int64("id", 999L) .encode(); bb.rewind(); StructDecoder decoder = struct.decoder(bb); assertThat(decoder.string("name"), is("joe")); StructArrayDecoder sad = decoder.structs("mapEntry"); assertThat(sad.length(), is(2)); assertThat(sad.string("key"), is("1")); assertThat(sad.string("value"), is("one")); sad.next(); assertThat(sad.string("key"), is("2")); assertThat(sad.string("value"), is("two")); sad.end(); assertThat(decoder.int64("id"), is(999L)); }

Target:
public void testReadAll_withLambda() throws Exception { ByteBuffer bb = struct.encoder() .string("name", "joe") .structs("mapEntry", new StructArrayEncoderFunction() { @Override public void encode(StructArrayEncoder encoder) { encoder .string("key", "1") .enm("type", Type.STRING) .string("string", "one") .next() .string("key", "2") .enm("type", Type.STRING) .string("string", "two"); } }) .int64("id", 999L) .encode(); bb.rewind(); StructDecoder decoder = struct.decoder(bb); assertThat(decoder.string("name"), is("joe")); StructArrayDecoder sad = decoder.structs("mapEntry"); assertThat(sad.length(), is(2)); assertThat(sad.string("key"), is("1")); assertThat(sad.enm("type").get(), Is.<Object>is(Type.STRING)); assertThat(sad.string("string"), is("one")); sad.next(); assertThat(sad.string("key"), is("2")); assertThat(sad.enm("type").get(), Is.<Object>is(Type.STRING)); assertThat(sad.string("string"), is("two")); sad.end(); assertThat(decoder.int64("id"), is(999L)); }
Source:
protected MemoryImageBuilder getMemoryImageBuilder() { if (null == memoryBuilder) { memoryBuilder = createMemoryImageBuilder(); } return memoryBuilder; }

Target:
protected MemoryImageBuilder getMemoryImageBuilder() { if (memoryBuilder == null) { memoryBuilder = createMemoryImageBuilder(); } return memoryBuilder; }
Source:
public void onListItemClick(ListView l, View v, int position, long id) { Task taskClicked; if (TASK_TYPE == USER && mUserTaskList.size() > 0) taskClicked = mUserTaskList.get(position); else taskClicked = mAllTaskList.get(position); TaskDetailFragment detailFragment = TaskDetailFragment.newInstance(taskClicked); mParentActivity.replaceFragment(detailFragment); }

Target:
public void onListItemClick(ListView l, View v, int position, long id) { Task taskClicked; if (TASK_TYPE == USER) taskClicked = mUserTaskList.get(position); else taskClicked = mAllTaskList.get(position); TaskDetailFragment detailFragment = TaskDetailFragment.newInstance(taskClicked); mParentActivity.replaceFragment(detailFragment); }
Source:
public void teardown() { LOG.info("Shutting down"); terminated = true; mutex.release(); try { executorThread.awaitTermination(10000L + executeIntervalMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { } executorThread.shutdown(); }

Target:
public void teardown() { LOG.info("Shutting down"); terminated = true; mutex.release(); executorThread.shutdown(); try { executorThread.awaitTermination(10000L + executeIntervalMillis, TimeUnit.MILLISECONDS); } catch (InterruptedException ex) { } }