auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean equals(Object that) { if (this == that) { return true; } if (that instanceof Rating) { Rating other = (Rating) that; return type.equals(other.type) && value.equals(other.value) && numberOfVotes.equals(other.numberOfVotes); } return false; }

Target:
public boolean equals(Object that) { if (this == that) { return true; } if (that instanceof Rating) { Rating other = (Rating) that; return type.equals(other.type) && value.equals(other.value) && Objects.equals(numberOfVotes, other.numberOfVotes); } return false; }
Source:
protected final <T> void waitUntil(Supplier<T> callable, Matcher<T> matcher) { waitUntil(callable, matcher, OPERATION_TIMEOUT); }

Target:
protected final <T> void waitUntil(Supplier<T> callable, Matcher<T> matcher) { waitUntil(callable, matcher, getAssertTimeout()); }
Source:
public void truncateTable(TableName tableName, boolean preserveSplits) throws IOException { bigtableTableAdminClient.deleteRowRange(BulkDeleteRowsRequest.newBuilder() .setTableName(options.getClusterName().toTableNameStr(tableName.getNameAsString())) .setDeleteAllDataFromTable(true) .build()); }

Target:
public void truncateTable(TableName tableName, boolean preserveSplits) throws IOException { if (!preserveSplits) { LOG.info("truncate will preserveSplits. The passed in variable is ignored."); } issueBulkDelete(tableName, BulkDeleteRowsRequest.newBuilder().setDeleteAllDataFromTable(true)); disabledTables.remove(tableName); }
Source:
public List<PaymentWorksNewVendorDTO> getPendingNewVendorRequestsFromPaymentWorks() { PaymentWorksNewVendorsRootDTO newVendorsRoot = null; List<PaymentWorksNewVendorDTO> newVendors = new ArrayList<PaymentWorksNewVendorDTO>(); boolean moreRecords = true; Client client = buildClient(); ClientResponse response = client.handle(buildClientRequest(buildPendingNewVendorRequestsFromPaymentWorksURL())); while (moreRecords) { newVendorsRoot = response.getEntity(PaymentWorksNewVendorsRootDTO.class); LOG.debug("getPendingNewVendorRequestsFromPaymentWorks, Status: " + response.getStatus()); if (response.getStatus() == 200) { if (ObjectUtils.isNotNull(newVendorsRoot)) { LOG.debug("getPendingNewVendorRequestsFromPaymentWorks, New Vendor Requests retrieved: " + newVendorsRoot.getCount()); } if (newVendorsRoot.getCount() > 0) { newVendors.addAll(newVendorsRoot.getNewVendors().getNewVendorList()); } if (StringUtils.isNotEmpty(newVendorsRoot.getNext())) { response = client.handle(buildClientRequest(newVendorsRoot.getNext())); } else { moreRecords = false; } } else { LOG.error("getPendingNewVendorRequestsFromPaymentWorks, Failed to retrieve Pending New Vendor Requests: " + response.getEntity(String.class)); moreRecords = false; } } return newVendors; }

Target:
public List<PaymentWorksNewVendorDTO> getPendingNewVendorRequestsFromPaymentWorks() { PaymentWorksNewVendorsRootDTO newVendorsRoot = null; List<PaymentWorksNewVendorDTO> newVendors = new ArrayList<PaymentWorksNewVendorDTO>(); boolean moreRecords = true; Client client = buildClient(); ClientResponse response = client.handle(buildClientRequest(buildPendingNewVendorRequestsFromPaymentWorksURL())); while (moreRecords) { newVendorsRoot = response.getEntity(PaymentWorksNewVendorsRootDTO.class); LOG.debug("getPendingNewVendorRequestsFromPaymentWorks, Status: " + response.getStatus()); if (response.getStatus() == HttpURLConnection.HTTP_OK) { if (ObjectUtils.isNotNull(newVendorsRoot)) { LOG.debug("getPendingNewVendorRequestsFromPaymentWorks, New Vendor Requests retrieved: " + newVendorsRoot.getCount()); } if (newVendorsRoot.getCount() > 0) { newVendors.addAll(newVendorsRoot.getNewVendors().getNewVendorList()); } if (StringUtils.isNotEmpty(newVendorsRoot.getNext())) { response = client.handle(buildClientRequest(newVendorsRoot.getNext())); } else { moreRecords = false; } } else { LOG.error( "getPendingNewVendorRequestsFromPaymentWorks, Failed to retrieve Pending New Vendor Requests: " + response.getEntity(String.class)); moreRecords = false; } } return newVendors; }
Source:
public Menu getMenu(Control parent) { if (fMenu != null) { fMenu.dispose(); } fMenu= new Menu(parent); int accel = 1; ConsoleFactoryExtension pyDevExt = null; for (ConsoleFactoryExtension extension : fFactoryExtensions) { if (!WorkbenchActivityHelper.filterItem(extension) && extension.isEnabled()) { ImageDescriptor image = extension.getImageDescriptor(); String label = extension.getLabel(); if (label.contains("PyDev Console")) { pyDevExt = extension; continue; } if (label.contains("PyDevConsoleNoDialog")) { label = "PyDev Console"; image = pyDevExt.getImageDescriptor(); } addActionToMenu(fMenu, new ConsoleFactoryAction(label, image, extension), accel); accel++; if (extension.isNewConsoleExtenson()) { new Separator("new").fill(fMenu, -1); } } } return fMenu; }

Target:
public Menu getMenu(Control parent) { if (fMenu != null) { fMenu.dispose(); } fMenu= new Menu(parent); int accel = 1; for (ConsoleFactoryExtension extension : fFactoryExtensions) { if (!WorkbenchActivityHelper.filterItem(extension) && extension.isEnabled()) { ImageDescriptor image = extension.getImageDescriptor(); String label = extension.getLabel(); if (label.contains("PyDevConsoleNoDialog")) { label = "PyDev Console"; image = this.pyDevImageDescriptor; } addActionToMenu(fMenu, new ConsoleFactoryAction(label, image, extension), accel); accel++; if (extension.isNewConsoleExtenson()) { new Separator("new").fill(fMenu, -1); } } } return fMenu; }
Source:
public void changeSupportedCRS() throws OwsExceptionReport { geometryHandler.setSupportedCRS(String.valueOf(EPSG_4326)); assertThat(geometryHandler.getSupportedCRS().contains(String.valueOf(EPSG_4326)), is(true)); assertThat(geometryHandler.getSupportedCRS().contains(String.valueOf(EPSG_31467)), is(false)); }

Target:
public void changeSupportedCRS() throws OwsExceptionReport { assertThat(geometryHandler.getSupportedCRS().contains(String.valueOf(EPSG_31467)), is(true)); geometryHandler.setSupportedCRS(String.valueOf(EPSG_4326)); assertThat(geometryHandler.getSupportedCRS().contains(String.valueOf(EPSG_4326)), is(true)); assertThat(geometryHandler.getSupportedCRS().contains(String.valueOf(EPSG_31467)), is(false)); }
Source:
public hudson.model.User getJenkinsUser() { try { return (hudson.model.User) hudson.model.User.class.getMethod("getById", String.class, boolean.class).invoke(getUsername(), true); } catch (NoSuchMethodException x) { } catch (Exception e) { LOGGER.log(Level.WARNING, String.format("There was a problem obtaining the Jenkins user %s by Id", getUsername()), e); } return hudson.model.User.get(getUsername()); }

Target:
public hudson.model.User getJenkinsUser() { try { return (hudson.model.User) hudson.model.User.class.getMethod("getById", String.class, boolean.class).invoke(null, getUsername(), true); } catch (InvocationTargetException e) { if (e.getCause() instanceof RuntimeException) { throw (RuntimeException)e.getCause(); } LOGGER.log(Level.WARNING, String.format("There was a problem obtaining the Jenkins user %s by Id", getUsername()), e); } catch (NoSuchMethodException e) { } catch (Exception e) { LOGGER.log(Level.WARNING, String.format("There was a problem obtaining the Jenkins user %s by Id", getUsername()), e); } return hudson.model.User.get(getUsername()); }
Source:
private void analyzeMethod(JavaClass javaClass, Service service) { Method method = new Method(); analyzeName(javaClass, method); analyzeAnnotations(javaClass, method); analyzeDocumentation(javaClass, method); javaClass.getMethods().forEach(x -> analyzeMethodMember(x, method)); JavaMethod attributesMethod = javaClass.getMethod("attributes", null, false); if (attributesMethod!=null) { AttributesAnalyzer attributesAnalyzer = new AttributesAnalyzer(); attributesAnalyzer.analyzeAttributes(attributesMethod.getSourceCode(), method.getParameters()); } method.setDeclaringService(service); service.addMethod(method); }

Target:
private void analyzeMethod(JavaClass javaClass, Service service) { Method method = createMethod(javaClass, service); analyzeInputDetail(javaClass, method, service); service.addMethod(method); }
Source:
private void startOrStopGeoDataListener() { if (requireGeodata) { geoDataSubscription = locationUpdater.start(GeoDirHandler.UPDATE_GEODATA); } else { geoDataSubscription.unsubscribe(); } }

Target:
private void startOrStopGeoDataListener() { geoDataSubscription.unsubscribe(); if (requireGeodata) { geoDataSubscription = locationUpdater.start(GeoDirHandler.UPDATE_GEODATA); } }
Source:
public void prefixed_cast_expression() { PrefixedCastExpressionTree tree = parse("b'abc'", PHPLexicalGrammar.CAST_TYPE); assertThat(tree.is(Kind.PREFIXED_CAST_EXPRESSION)).isTrue(); assertThat(tree.prefix().text()).isEqualTo("b"); assertThat(expressionToString(tree.expression())).isEqualTo("'abc'"); StringBuilder visitReport = new StringBuilder(); tree.accept(new PHPVisitorCheck() { @Override public void visitPrefixedCastExpression(PrefixedCastExpressionTree tree) { visitReport.append("visitPrefixedCastExpression"); super.visitPrefixedCastExpression(tree); } }); assertThat(visitReport.toString()).isEqualTo("visitPrefixedCastExpression"); }

Target:
public void prefixed_cast_expression() { PrefixedCastExpressionTree tree = parse("b'abc'", PHPLexicalGrammar.CAST_TYPE); assertThat(tree.is(Kind.PREFIXED_CAST_EXPRESSION)).isTrue(); assertThat(expressionToString(tree)).isEqualTo("b'abc'"); assertThat(tree.prefix().text()).isEqualTo("b"); assertThat(expressionToString(tree.expression())).isEqualTo("'abc'"); StringBuilder visitReport = new StringBuilder(); tree.accept(new PHPVisitorCheck() { @Override public void visitPrefixedCastExpression(PrefixedCastExpressionTree tree) { visitReport.append("visitPrefixedCastExpression"); super.visitPrefixedCastExpression(tree); } }); assertThat(visitReport.toString()).isEqualTo("visitPrefixedCastExpression"); }
Source:
public void configUpdated(final ConfigStatusSource configStatusSource) { executorService.submit(new Runnable() { @Override public void run() { final ConfigStatusInfo info = getConfigStatus(configStatusSource.entityId, null); if (info != null) { eventPublisher.post(new ConfigStatusInfoEvent(configStatusSource.getTopic(), gson.toJson(info.getConfigStatusMessages()), null)); } } }); }

Target:
public void configUpdated(final ConfigStatusSource configStatusSource) { executorService.submit(new Runnable() { @Override public void run() { final ConfigStatusInfo info = getConfigStatus(configStatusSource.entityId, null); if (info != null) { eventPublisher.post(new ConfigStatusInfoEvent(configStatusSource.getTopic(), info, null)); } } }); }
Source:
private void initDrawer() { final View drawer = findViewById(R.id.drawer); final DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); actions = findViewById(R.id.actions); actions.setSelected(true); actions.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(! actions.isSelected()) { replaceCurrentFragment(ActionsFragment.newInstance(), ActionsFragment.TAG); drawerLayout.closeDrawer(drawer); } } }); hub = findViewById(R.id.hub); hub.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(! hub.isSelected()) { replaceCurrentFragment(newInstance(false), TAG); drawerLayout.closeDrawer(drawer); } } }); invites = findViewById(R.id.invites); invites.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(! invites.isSelected()) { replaceCurrentFragment(InvitesFragment.newInstance(), InvitesFragment.TAG); drawerLayout.closeDrawer(drawer); } } }); notifications = findViewById(R.id.notifications); notifications.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { if(! notifications.isSelected()) { replaceCurrentFragment(NotificationsFragment.newInstance(), NotificationsFragment.TAG); drawerLayout.closeDrawer(drawer); } } }); View setting = findViewById(R.id.setting); setting.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(SettingsActivity.getLaunchIntent(MainActivity.this)); drawerLayout.closeDrawer(drawer); } }); }

Target:
private void initDrawer() { final String[] list = getResources().getStringArray(R.array.drawer_list); final View drawer = findViewById(R.id.drawer); final DrawerLayout drawerLayout = (DrawerLayout) findViewById(R.id.drawer_layout); final ListView listView = (ListView) findViewById(R.id.menu_list); listView.setAdapter(new DrawerListAdapter(this, list)); listView.setItemChecked(0, true); listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { String positionString = list[position]; if(TextUtils.equals(positionString, getString(R.string.actions))) { replaceCurrentFragment(ActionsFragment.newInstance(), ActionsFragment.TAG); } else if(TextUtils.equals(positionString, getString(R.string.hub))) { replaceCurrentFragment(HubFragment.newInstance(false), HubFragment.TAG); } else if(TextUtils.equals(positionString, getString(R.string.invites))) { replaceCurrentFragment(InvitesFragment.newInstance(), InvitesFragment.TAG); } else if(TextUtils.equals(positionString, getString(R.string.notifications))) { replaceCurrentFragment(NotificationsFragment.newInstance(), NotificationsFragment.TAG); } drawerLayout.closeDrawer(drawer); } }); View setting = findViewById(R.id.setting); setting.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { startActivity(SettingsActivity.getLaunchIntent(MainActivity.this)); drawerLayout.closeDrawer(drawer); } }); if(AppPrefs.getInstance(this).isFirstDrawer()) { AppPrefs.getInstance(this).setFirstDrawer(); drawerLayout.openDrawer(drawer); } }
Source:
protected static String subresourceURL(Class<?> clazz, String id, Class<?> subClazz, String apiBase) throws InvalidRequestException { try { return String.format("%s/%s/%ss", classURL(clazz, apiBase), urlEncode(id), className(subClazz)); } catch (UnsupportedEncodingException e) { throw new InvalidRequestException("Unable to encode parameters to " + CHARSET + ". Please contact support@stripe.com for assistance.", null, null, null, 0, e); } }

Target:
private static String subresourceURL(Class<?> clazz, String id, Class<?> subClazz, String apiBase) throws InvalidRequestException { try { return String.format("%s/%s/%ss", classURL(clazz, apiBase), urlEncode(id), className(subClazz)); } catch (UnsupportedEncodingException e) { throw new InvalidRequestException("Unable to encode parameters to " + CHARSET + ". Please contact support@stripe.com for assistance.", null, null, null, 0, e); } }
Source:
private Map<String, AuthenticationProfile> createProfiles() throws ConfigurationException { Map<String, AuthenticationProfile> results = new HashMap<>(); for (ExtensionProxy authnExtension : EngineExtensionsManager.getInstance().getExtensionsByService(AUTHN_SERVICE)) { String mapperName = authnExtension.getContext().<Properties>get(Base.ContextKeys.CONFIGURATION).getProperty(AUTHN_MAPPING_PLUGIN); String authzName = authnExtension.getContext().<Properties>get(Base.ContextKeys.CONFIGURATION).getProperty(AUTHN_AUTHZ_PLUGIN); if (authzName == null) { throw new ConfigurationException(String.format("Authz plugin for %1$s does not exist", authnExtension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME))); } registerProfile(results, new AuthenticationProfile( authnExtension, EngineExtensionsManager.getInstance().getExtensionByName(authzName), mapperName != null ? EngineExtensionsManager.getInstance().getExtensionByName(mapperName) : null ) ); } return results; }

Target:
private Map<String, AuthenticationProfile> createProfiles() throws ConfigurationException { Map<String, AuthenticationProfile> results = new HashMap<>(); for (ExtensionProxy authnExtension : EngineExtensionsManager.getInstance().getExtensionsByService(AUTHN_SERVICE)) { String mapperName = authnExtension.getContext().<Properties>get(Base.ContextKeys.CONFIGURATION).getProperty(AUTHN_MAPPING_PLUGIN); String authzName = authnExtension.getContext().<Properties>get(Base.ContextKeys.CONFIGURATION).getProperty(AUTHN_AUTHZ_PLUGIN); if (authzName == null) { throw new ConfigurationException(String.format("Authz plugin for %1$s does not exist", authnExtension.getContext().<String> get(Base.ContextKeys.INSTANCE_NAME))); } AuthenticationProfile profile = new AuthenticationProfile( authnExtension, EngineExtensionsManager.getInstance().getExtensionByName(authzName), mapperName != null ? EngineExtensionsManager.getInstance().getExtensionByName(mapperName) : null ); profiles.put(profile.getName(), profile); } return results; }
Source:
public WorkProcessor<Page> pages() { return WorkProcessor.create(new PollPages()); }

Target:
public WorkProcessor<Page> pages() { return WorkProcessor.create(() -> { Page page = removePage(); if (page == null) { if (isFinished()) { return ProcessState.finished(); } ListenableFuture<?> blocked = waitForReading(); if (!blocked.isDone()) { return ProcessState.blocked(blocked); } return ProcessState.yield(); } return ProcessState.ofResult(page); }); }
Source:
public Object visitLockControlCommand(TxInvocationContext ctx, LockControlCommand command) throws Throwable { if (!ctx.isInTxScope()) throw new IllegalStateException("Locks should only be acquired within the scope of a transaction!"); if (ctx.isOriginLocal() && !command.multipleKeys() && !cll.localNodeOwnsLock(command.getSingleKey())) { LocalTransaction localTx = (LocalTransaction) ctx.getCacheTransaction(); if (!localTx.getAffectedKeys().containsAll(command.getKeys())) { invokeNextInterceptor(ctx, command); } else { log.tracef("Already own locks on keys: %s, skipping remote call", command.getKeys()); } } try { abortIfRemoteTransactionInvalid(ctx, command); if (command.isUnlock()) { if (ctx.isOriginLocal()) throw new AssertionError("There's no advancedCache.unlock so this must have originated remotely."); releaseLocksOnFailureBeforePrepare(ctx); return false; } for (Object key : command.getKeys()) { lockAndRegisterBackupLock(ctx, key); } return true; } catch (Throwable te) { releaseLocksOnFailureBeforePrepare(ctx); throw te; } }

Target:
public Object visitLockControlCommand(TxInvocationContext ctx, LockControlCommand command) throws Throwable { if (!ctx.isInTxScope()) throw new IllegalStateException("Locks should only be acquired within the scope of a transaction!"); if (ctx.isOriginLocal()) { final boolean isSingleKeyAndLocal = !command.multipleKeys() && cdl.localNodeIsPrimaryOwner(command.getSingleKey()); if (!isSingleKeyAndLocal || command.multipleKeys()) { LocalTransaction localTx = (LocalTransaction) ctx.getCacheTransaction(); if (!localTx.getAffectedKeys().containsAll(command.getKeys())) { invokeNextInterceptor(ctx, command); } else { log.tracef("Already own locks on keys: %s, skipping remote call", command.getKeys()); } } } try { abortIfRemoteTransactionInvalid(ctx, command); if (command.isUnlock()) { if (ctx.isOriginLocal()) throw new AssertionError("There's no advancedCache.unlock so this must have originated remotely."); releaseLocksOnFailureBeforePrepare(ctx); return false; } for (Object key : command.getKeys()) { lockAndRegisterBackupLock(ctx, key); } return true; } catch (Throwable te) { releaseLocksOnFailureBeforePrepare(ctx); throw te; } }
Source:
public TextAnalyticsClientBuilder addPolicy(HttpPipelinePolicy policy) { Objects.requireNonNull(policy); policies.add(policy); return this; }

Target:
public TextAnalyticsClientBuilder addPolicy(HttpPipelinePolicy policy) { Objects.requireNonNull(policy, "'policy' cannot be null."); policies.add(policy); return this; }
Source:
public List<ChargeEntity> findChargesForCapture(int maxNumberOfCharges, Duration notAttemptedWithin) { String query = "SELECT c FROM ChargeEntity c WHERE " + "(c.status=:captureApprovedStatus OR c.status=:captureApprovedRetryStatus) " + "AND NOT EXISTS (" + " SELECT ce FROM ChargeEventEntity ce WHERE " + " ce.chargeEntity = c AND " + " ce.status = :eventStatus AND " + " ce.updated >= :cutoffDate " + ") " + "ORDER BY random()"; return entityManager.get() .createQuery(query, ChargeEntity.class) .setMaxResults(maxNumberOfCharges) .setParameter("captureApprovedStatus", CAPTURE_APPROVED.getValue()) .setParameter("captureApprovedRetryStatus", CAPTURE_APPROVED_RETRY.getValue()) .setParameter("eventStatus", CAPTURE_APPROVED_RETRY) .setParameter("cutoffDate", ZonedDateTime.now().minus(notAttemptedWithin)) .getResultList(); }

Target:
public List<ChargeEntity> findChargesForCapture(int maxNumberOfCharges, Duration notAttemptedWithin) { String query = "SELECT c FROM ChargeEntity c WHERE " + "(c.status=:captureApprovedStatus OR c.status=:captureApprovedRetryStatus) " + "AND NOT EXISTS (" + " SELECT ce FROM ChargeEventEntity ce WHERE " + " ce.chargeEntity = c AND " + " ce.status = :eventStatus AND " + " ce.updated >= :cutoffDate " + ") " + "ORDER BY c.createdDate ASC"; return entityManager.get() .createQuery(query, ChargeEntity.class) .setMaxResults(maxNumberOfCharges) .setParameter("captureApprovedStatus", CAPTURE_APPROVED.getValue()) .setParameter("captureApprovedRetryStatus", CAPTURE_APPROVED_RETRY.getValue()) .setParameter("eventStatus", CAPTURE_APPROVED_RETRY) .setParameter("cutoffDate", ZonedDateTime.now().minus(notAttemptedWithin)) .getResultList(); }
Source:
public static boolean sendMailAndCheckReceived(String emailSubject) throws Exception { Properties props = getSMTPProperties(); EmailSender emailSender = new EmailSender(props, sender, String.valueOf(senderPassword), domain, receiver + "@" + domain); if (emailSender.createSession()) { emailSender.setSubject(emailSubject); emailSender.setBody("Body : " + emailSubject); emailSender.sendEmail(); log.info("Email send by Mail API successfully : " + emailSubject); return waitToCheckEmailReceived(emailSubject); } return false; }

Target:
public static boolean sendMailAndCheckReceived(String emailSubject) throws Exception { Properties props = getSMTPProperties(); boolean isEmailReceived = false; EmailSender emailSender = new EmailSender(props, sender, String.valueOf(senderPassword), domain, receiver + "@" + domain); if (emailSender.createSession()) { emailSender.setSubject(emailSubject); emailSender.setBody("Body : " + emailSubject); emailSender.sendEmail(); log.info("Email send by Mail API successfully : " + emailSubject); isEmailReceived = waitToCheckEmailReceived(emailSubject,EMAIL_INBOX); } return isEmailReceived; }
Source:
String getConfig(String key, String group, long timeout) throws IllegalStateException; default String getConfigFile(String key, String group) throws IllegalStateException { return getConfigFile(key, group, 0L); }

Target:
String getConfig(String key, String group, long timeout) throws IllegalStateException; default String getConfigs(String key, String group) throws IllegalStateException { return getConfigs(key, group, -1L); }
Source:
protected void onResume() { super.onResume(); if (mAppAdapter != null) mAppAdapter.notifyDataSetChanged(); final View vProgressEmpty = (View) findViewById(R.id.vProgressEmpty); vProgressEmpty.post(new Runnable() { @Override public void run() { mProgressWidth = vProgressEmpty.getMeasuredWidth(); updateProgress(); } }); }

Target:
protected void onResume() { super.onResume(); if (mAppAdapter != null) mAppAdapter.notifyDataSetChanged(); }
Source:
public synchronized BigtableClient getDataClient() { if (this.client == null) { ChannelOptions channelOptions = options.getChannelOptions(); BigtableGrpcClientOptions clientOptions = BigtableGrpcClientOptions.fromRetryOptions(channelOptions.getUnaryCallRetryOptions()); Channel channel = createChannel( createTransportOptions(options.getDataHost()), channelOptions, batchPool, channelOptions.getChannelCount()); this.client = new BigtableGrpcClient(channel, batchPool, clientOptions); } return client; }

Target:
public synchronized BigtableClient getDataClient() { if (this.client == null) { BigtableGrpcClientOptions clientOptions = BigtableGrpcClientOptions.fromRetryOptions(options.getChannelOptions() .getUnaryCallRetryOptions()); Channel channel = createChannel( createTransportOptions(options.getDataHost()), options.getChannelOptions().getChannelCount()); this.client = new BigtableGrpcClient(channel, batchPool, clientOptions); } return client; }
Source:
private void refreshBlogMedia() { if (NetworkUtils.isNetworkAvailable(this)) { List<Object> apiArgs = new ArrayList<Object>(); apiArgs.add(WordPress.getCurrentBlog()); ApiHelper.SyncMediaLibraryTask.Callback callback = new ApiHelper.SyncMediaLibraryTask.Callback() { @Override public void onSuccess(int count) { mBlogMediaStatus = 1; runOnUiThread(new Runnable() { @Override public void run() { if (!mPendingVideoPressInfoRequests.isEmpty()) { for (String videoId : mPendingVideoPressInfoRequests) { String blogId = String.valueOf(WordPress.currentBlog.getLocalTableBlogId()); String videoUrl = WordPressMediaUtils.getNetworkVideoUrlFromVideoPressId(blogId, videoId); String posterUrl = WordPressMediaUtils.getVideoPressVideoPosterFromURL(videoUrl); mEditorFragment.setUrlForVideoPressId(videoId, videoUrl, posterUrl); } mPendingVideoPressInfoRequests.clear(); } } }); } @Override public void onFailure(final ApiHelper.ErrorType errorType, String errorMessage, Throwable throwable) { mBlogMediaStatus = 0; ToastUtils.showToast(EditPostActivity.this, R.string.error_refresh_media, ToastUtils.Duration.SHORT); } }; ApiHelper.SyncMediaLibraryTask getMediaTask = new ApiHelper.SyncMediaLibraryTask(0, MediaGridFragment.Filter.ALL, callback); getMediaTask.execute(apiArgs); } else { mBlogMediaStatus = 0; ToastUtils.showToast(this, R.string.error_refresh_media, ToastUtils.Duration.SHORT); } }

Target:
private void refreshBlogMedia() { if (NetworkUtils.isNetworkAvailable(this)) { List<Object> apiArgs = new ArrayList<Object>(); apiArgs.add(WordPress.getCurrentBlog()); ApiHelper.SyncMediaLibraryTask.Callback callback = new ApiHelper.SyncMediaLibraryTask.Callback() { @Override public void onSuccess(int count) { mBlogMediaStatus = 1; runOnUiThread(new Runnable() { @Override public void run() { if (mPendingVideoPressInfoRequests != null && !mPendingVideoPressInfoRequests.isEmpty()) { String blogId = String.valueOf(WordPress.currentBlog.getLocalTableBlogId()); for (String videoId : mPendingVideoPressInfoRequests) { String videoUrl = WordPress.wpDB.getMediaUrlByVideoPressId(blogId, videoId); String posterUrl = WordPressMediaUtils.getVideoPressVideoPosterFromURL(videoUrl); mEditorFragment.setUrlForVideoPressId(videoId, videoUrl, posterUrl); } mPendingVideoPressInfoRequests.clear(); } } }); } @Override public void onFailure(final ApiHelper.ErrorType errorType, String errorMessage, Throwable throwable) { mBlogMediaStatus = 0; ToastUtils.showToast(EditPostActivity.this, R.string.error_refresh_media, ToastUtils.Duration.SHORT); } }; ApiHelper.SyncMediaLibraryTask getMediaTask = new ApiHelper.SyncMediaLibraryTask(0, MediaGridFragment.Filter.ALL, callback); getMediaTask.execute(apiArgs); } else { mBlogMediaStatus = 0; ToastUtils.showToast(this, R.string.error_refresh_media, ToastUtils.Duration.SHORT); } }
Source:
public List<ServerTemplateKey> loadKeys() { if (templateKeyMap.isEmpty()) { loadTemplateMapsFromFile(); } return new ArrayList<ServerTemplateKey>(templateKeyMap.values()); }

Target:
public List<ServerTemplateKey> loadKeys() { return new ArrayList<ServerTemplateKey>(templateKeyMap.values()); }
Source:
public static MessageCorrectExtension from(Message message) { return new MessageCorrectExtension(message.getStanzaId()); }

Target:
public static MessageCorrectExtension from(Message message) { return message.getExtension(ELEMENT, NAMESPACE); }
Source:
void updateLogSegmentBucket(Long bucketKey, String logSegmentName, long value) { if (bucketKey != null && logSegmentBuckets.containsKey(bucketKey)) { Map<String, Long> deltaInValidSizePerLogSegment = logSegmentBuckets.get(bucketKey); updateMapHelper(deltaInValidSizePerLogSegment, logSegmentName, value); } }

Target:
void updateLogSegmentBucket(Long bucketKey, String logSegmentName, long value) { if (bucketKey != null && logSegmentBuckets.containsKey(bucketKey)) { Map<String, Long> existingBucketEntry = logSegmentBuckets.get(bucketKey); updateMapHelper(existingBucketEntry, logSegmentName, value); } }
Source:
protected void executeQueryCommand() { if (getVdsStaticDao().get(getParameters().getServerName()) != null) { getQueryReturnValue().setSucceeded(false); getQueryReturnValue().setExceptionString(VdcBllMessages.SERVER_ALREADY_EXIST_IN_ANOTHER_CLUSTER.name()); return; } SSHClient client = null; try { client = connect(getParameters().getServerName()); validateFingerprint(client, getParameters().getFingerprint()); authenticate(client, ROOT, getParameters().getPassword()); String serversXml = executeCommand(client); Map<String, String> serverFingerPrint = extractServers(serversXml); if (serverFingerPrint == null) { getQueryReturnValue().setSucceeded(false); getQueryReturnValue().setExceptionString(VdcBllMessages.SERVER_ALREADY_EXIST_IN_ANOTHER_CLUSTER.name()); return; } getQueryReturnValue().setReturnValue(serverFingerPrint); } catch (Exception e) { throw new RuntimeException(e); } finally { if (client != null) { client.disconnect(); } } }

Target:
protected void executeQueryCommand() { if (getVdsStaticDao().getAllForHost(getParameters().getServerName()).size() > 0 || getVdsStaticDao().getAllWithIpAddress(getParameters().getServerName()).size() > 0) { setReturnMessage(); } SSHClient client = null; try { client = connect(getParameters().getServerName()); validateFingerprint(client, getParameters().getFingerprint()); authenticate(client, ROOT, getParameters().getPassword()); String serversXml = executeCommand(client); Map<String, String> serverFingerPrint = extractServers(serversXml); if (isServerPartOfCluster(serverFingerPrint)) { setReturnMessage(); } getQueryReturnValue().setReturnValue(serverFingerPrint); } catch (Exception e) { throw new RuntimeException(e); } finally { if (client != null) { client.disconnect(); } } }
Source:
private void setFecetFields(){ List<String> geneFacets = Arrays.asList(new String[]{"latest_phenotype_status", "legacy_phenotype_status", "status", "latest_production_centre", "latest_phenotyping_centre", "marker_type", "embryo_data_available", "embryo_modalities" }); List<String> mpFacets = Arrays.asList(new String[]{"top_level_mp_term"}); List<String> diseaseFacets = Arrays.asList(new String[]{"disease_source", "disease_classes", "human_curated", "mouse_curated", "impc_predicted_known_gene", "mgi_predicted_known_gene", "impc_predicted", "impc_novel_predicted_in_locus", "mgi_predicted", "mgi_novel_predicted_in_locus"}); List<String> anatomyFacets = Arrays.asList(new String[]{"selected_top_level_anatomy_term", "stage"}); List<String> impc_imagesFacets = Arrays.asList(new String[]{"procedure_name", "selected_top_level_anatomy_term", "stage"}); facetMap.put("gene", geneFacets); facetMap.put("mp", mpFacets); facetMap.put("disease", diseaseFacets); facetMap.put("anatomy", anatomyFacets); facetMap.put("impc_images", impc_imagesFacets); }

Target:
private void setFecetFields(){ List<String> geneFacets = Arrays.asList("latest_phenotype_status", "legacy_phenotype_status", "status", "latest_production_centre", "latest_phenotyping_centre", "marker_type", "embryo_data_available", "embryo_modalities" ); List<String> mpFacets = Arrays.asList("top_level_mp_term"); List<String> diseaseFacets = Arrays.asList("disease_source", "disease_classes", "human_curated", "mouse_curated", "impc_predicted_known_gene", "mgi_predicted_known_gene", "impc_predicted", "impc_novel_predicted_in_locus", "mgi_predicted", "mgi_novel_predicted_in_locus"); List<String> anatomyFacets = Arrays.asList("selected_top_level_anatomy_term", "stage"); List<String> impc_imagesFacets = Arrays.asList("procedure_name", "selected_top_level_ma_term"); facetMap.put("gene", geneFacets); facetMap.put("mp", mpFacets); facetMap.put("disease", diseaseFacets); facetMap.put("anatomy", anatomyFacets); facetMap.put("impc_images", impc_imagesFacets); }
Source:
public void showInformationDialogAndWait(String title, String content) { FXDialog alert = createDialog(AlertType.INFORMATION, title, content); Globals.getThemeLoader().installCss(alert.getDialogPane().getScene(), Globals.prefs); alert.showAndWait(); }

Target:
public void showInformationDialogAndWait(String title, String content) { FXDialog alert = createDialog(AlertType.INFORMATION, title, content); alert.showAndWait(); }
Source:
protected void setColumnOrder(int size) { int[] order = new int[size]; for (int i = 0; i < order.length; i++) { order[i] = i; } Table table = (Table) getControl(); table.setColumnOrder(order); }

Target:
protected void setColumnOrder(int size) { int[] order = new int[size]; Arrays.setAll(order, i -> i); Table table = (Table) getControl(); table.setColumnOrder(order); }
Source:
public double calculateVignetting(final ObsContext ctx, final edu.gemini.spModel.core.Coordinates guideStarCoordinates) { if (Site.GN.equals(ctx.getSite().getOrNull())) ScalaGuideProbeUtil.calculateVignetting(ctx, guideStarCoordinates, GmosNorthOiwfsProbeArm$.MODULE$); return ScalaGuideProbeUtil.calculateVignetting(ctx, guideStarCoordinates, GmosSouthOiwfsProbeArm$.MODULE$); }

Target:
public double calculateVignetting(final ObsContext ctx, final edu.gemini.spModel.core.Coordinates guideStarCoordinates) { if (Site.GN == ctx.getSite().getOrNull()) return ScalaGuideProbeUtil.calculateVignetting(ctx, guideStarCoordinates, GmosNorthOiwfsProbeArm$.MODULE$); return ScalaGuideProbeUtil.calculateVignetting(ctx, guideStarCoordinates, GmosSouthOiwfsProbeArm$.MODULE$); }
Source:
public PropertyNameTypeBinding( FilterFactory2 filterFactory, NamespaceSupport namespaceSupport, Catalog catalog) { super(filterFactory, namespaceSupport); this.namespaceSupport = namespaceSupport; this.catalog = catalog; }

Target:
public PropertyNameTypeBinding( FilterFactory2 filterFactory, NamespaceSupport namespaceSupport, Catalog catalog) { super(filterFactory, namespaceSupport); this.catalog = catalog; }
Source:
private DRepresentation getRepresentation() throws Exception { session = SessionManager.INSTANCE.getSession(URI.createPlatformResourceURI("/" + TEMPORARY_PROJECT_NAME + "/" + SESSION_MODEL_FILENAME, true), new NullProgressMonitor()); session.open(new NullProgressMonitor()); TestsUtil.emptyEventsFromUIThread(); Collection<DRepresentation> allRepresentations = DialectManager.INSTANCE.getAllRepresentations(session); DRepresentation representation = (DRepresentation) allRepresentations.toArray()[0]; return representation; }

Target:
private DRepresentation getRepresentation() throws Exception { session = SessionManager.INSTANCE.getSession(URI.createPlatformResourceURI("/" + TEMPORARY_PROJECT_NAME + "/" + SESSION_MODEL_FILENAME, true), new NullProgressMonitor()); session.open(new NullProgressMonitor()); TestsUtil.emptyEventsFromUIThread(); DRepresentation representation = getRepresentation("new diagExportAsImage"); return representation; }
Source:
private void shutdownGracefully(final String reason) { getLog().info("Shutting down gracefully. Reason: {}", reason); offsets.entrySet().stream().findFirst() .ifPresent(pk -> flushData(pk.getKey(), new TreeMap<>(), Optional.of(reason))); final Map<Partition.PartitionKey, Long> uncommitted = offsets.entrySet().stream() .filter(e -> !e.getValue().isCommitted()) .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getSentOffset())); if (uncommitted.isEmpty()) { switchState(new CleanupState()); } else { switchState(new ClosingState(uncommitted, lastCommitMillis)); } }

Target:
private void shutdownGracefully(final String reason) { getLog().info("Shutting down gracefully. Reason: {}", reason); final Map<Partition.PartitionKey, Long> uncommitted = offsets.entrySet().stream() .filter(e -> !e.getValue().isCommitted()) .collect(Collectors.toMap(Map.Entry::getKey, e -> e.getValue().getSentOffset())); if (uncommitted.isEmpty()) { switchState(new CleanupState()); } else { switchState(new ClosingState(uncommitted, lastCommitMillis)); } }
Source:
private AutomationSystem loadSystem(final IProject project) { try { project.deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); } catch (CoreException e1) { Activator.getDefault().logError(e1.getMessage(), e1); } IFile systemFile = project.getFile(project.getName() + SYSTEM_FILE_ENDING); if(systemFile.exists()){ AutomationSystem system = createAutomationSystem(project); SystemImporter sysImporter = new SystemImporter(); try (InputStream stream = systemFile.getContents();){ sysImporter.importSystem(stream, system); } catch (CoreException|IOException e) { Activator.getDefault().logError(e.getMessage(), e); } return system; } return null; }

Target:
private AutomationSystem loadSystem(final IProject project) { try { project.deleteMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE); } catch (CoreException e1) { Activator.getDefault().logError(e1.getMessage(), e1); } IFile systemFile = project.getFile(project.getName() + SYSTEM_FILE_ENDING); if(systemFile.exists()){ AutomationSystem system = createAutomationSystem(project); SystemImporter sysImporter = new SystemImporter(); try (InputStream stream = systemFile.getContents()){ sysImporter.importSystem(stream, system); } catch (CoreException | IOException e) { Activator.getDefault().logError(e.getMessage(), e); } return system; } return null; }
Source:
public ConnectionOptions batchWriterConfig(BatchWriterConfig batchWriterConfig) { setProperty(ClientProperty.BATCH_WRITER_MAX_MEMORY_BYTES, batchWriterConfig.getMaxMemory()); setProperty(ClientProperty.BATCH_WRITER_MAX_LATENCY_SEC, batchWriterConfig.getMaxLatency(TimeUnit.MILLISECONDS) + "ms"); setProperty(ClientProperty.BATCH_WRITER_MAX_TIMEOUT_SEC, batchWriterConfig.getTimeout(TimeUnit.MILLISECONDS) + "ms"); setProperty(ClientProperty.BATCH_WRITER_MAX_WRITE_THREADS, batchWriterConfig.getMaxWriteThreads()); setProperty(ClientProperty.BATCH_WRITER_DURABILITY, batchWriterConfig.getDurability().toString()); return this; }

Target:
public ConnectionOptions batchWriterConfig(BatchWriterConfig batchWriterConfig) { ClientProperty.BATCH_WRITER_MEMORY_MAX.setBytes(properties, batchWriterConfig.getMaxMemory()); ClientProperty.BATCH_WRITER_LATENCY_MAX.setTimeInMillis(properties, batchWriterConfig.getMaxLatency(TimeUnit.MILLISECONDS)); ClientProperty.BATCH_WRITER_TIMEOUT_MAX.setTimeInMillis(properties, batchWriterConfig.getTimeout(TimeUnit.MILLISECONDS)); setProperty(ClientProperty.BATCH_WRITER_THREADS_MAX, batchWriterConfig.getMaxWriteThreads()); setProperty(ClientProperty.BATCH_WRITER_DURABILITY, batchWriterConfig.getDurability().toString()); return this; }
Source:
public TaskStatus run(final TaskToolbox toolbox) throws Exception { if (indexTaskSpecs == null) { indexTaskSpecs = createIngestionSchema( toolbox, segmentProvider, partitionConfigurationManager, dimensionsSpec, keepSegmentGranularity, jsonMapper ).stream() .map(spec -> new IndexTask( getId(), getGroupId(), getTaskResource(), getDataSource(), spec, getContext(), authorizerMapper, chatHandlerProvider, rowIngestionMetersFactory )) .collect(Collectors.toList()); } if (indexTaskSpecs.isEmpty()) { log.warn("Interval[%s] has no segments, nothing to do.", interval); return TaskStatus.failure(getId()); } else { log.info("Generated [%d] compaction task specs", indexTaskSpecs.size()); int failCnt = 0; for (IndexTask eachSpec : indexTaskSpecs) { final String json = jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(eachSpec); log.info("Running indexSpec: " + json); try { final TaskStatus eachResult = eachSpec.run(toolbox); if (!eachResult.isSuccess()) { failCnt++; log.warn("Failed to run indexSpec: [%s].\nTrying the next indexSpec.", json); } } catch (Exception e) { failCnt++; log.warn(e, "Failed to run indexSpec: [%s].\nTrying the next indexSpec.", json); } } return failCnt == 0 ? TaskStatus.success(getId()) : TaskStatus.failure(getId()); } }

Target:
public TaskStatus run(final TaskToolbox toolbox) throws Exception { if (indexTaskSpecs == null) { indexTaskSpecs = createIngestionSchema( toolbox, segmentProvider, partitionConfigurationManager, dimensionsSpec, keepSegmentGranularity, jsonMapper ).stream() .map(spec -> new IndexTask( getId(), getGroupId(), getTaskResource(), getDataSource(), spec, getContext(), authorizerMapper, chatHandlerProvider, rowIngestionMetersFactory )) .collect(Collectors.toList()); } if (indexTaskSpecs.isEmpty()) { log.warn("Interval[%s] has no segments, nothing to do.", interval); return TaskStatus.failure(getId()); } else { final int totalNumSpecs = indexTaskSpecs.size(); log.info("Generated [%d] compaction task specs", totalNumSpecs); int failCnt = 0; for (IndexTask eachSpec : indexTaskSpecs) { final String json = jsonMapper.writerWithDefaultPrettyPrinter().writeValueAsString(eachSpec); log.info("Running indexSpec: " + json); try { final TaskStatus eachResult = eachSpec.run(toolbox); if (!eachResult.isSuccess()) { failCnt++; log.warn("Failed to run indexSpec: [%s].\nTrying the next indexSpec.", json); } } catch (Exception e) { failCnt++; log.warn(e, "Failed to run indexSpec: [%s].\nTrying the next indexSpec.", json); } } log.info("Run [%d] specs, [%d] succeeded, [%d] failed", totalNumSpecs, totalNumSpecs - failCnt, failCnt); return failCnt == 0 ? TaskStatus.success(getId()) : TaskStatus.failure(getId()); } }
Source:
public static MediaType parse(String str) { if (str == null || str.isEmpty()) throw new EncodingException("MediaType cannot be empty or null!"); if (str.indexOf('/') == -1) throw new EncodingException("MediaType must contain a type and a subtype separated by '/'"); boolean hasParams = str.indexOf(';') != -1; if (!hasParams) { String[] types = str.split("/"); return new MediaType(types[0].trim(), types[1].trim()); } int paramSeparator = str.indexOf(';'); String types = str.substring(0, paramSeparator); String params = str.substring(paramSeparator + 1); String[] typeSubType = types.split("/"); Map<String, String> paramMap = parseParams(params); return new MediaType(typeSubType[0].trim(), typeSubType[1].trim(), paramMap); }

Target:
public static MediaType parse(String str) { if (str == null || str.isEmpty()) throw log.missingMediaType(); if (str.indexOf('/') == -1) throw log.invalidMediaTypeSubtype(); boolean hasParams = str.indexOf(';') != -1; if (!hasParams) { String[] types = str.split("/"); return new MediaType(types[0].trim(), types[1].trim()); } int paramSeparator = str.indexOf(';'); String types = str.substring(0, paramSeparator); String params = str.substring(paramSeparator + 1); String[] typeSubType = types.split("/"); Map<String, String> paramMap = parseParams(params); return new MediaType(typeSubType[0].trim(), typeSubType[1].trim(), paramMap); }
Source:
public Map<Class<? extends Annotation>, Iterable<ExtensionMetaData>> scan( String pluginName, Iterable<Class<? extends Annotation>> annotations) throws InvalidPluginException { ImmutableMap.Builder<Class<? extends Annotation>, Iterable<ExtensionMetaData>> result = ImmutableMap.builder(); for (Class<? extends Annotation> annotation : annotations) { Set<ExtensionMetaData> classMetaDataSet = Sets.newHashSet(); result.put(annotation, classMetaDataSet); for (Class<?> scriptClass : preloadedClasses) { if (!Modifier.isAbstract(scriptClass.getModifiers()) && scriptClass.getAnnotation(annotation) != null) { classMetaDataSet.add(new ExtensionMetaData(scriptClass.getName(), getExportAnnotationValue(scriptClass, annotation))); } } } return result.build(); }

Target:
public Map<Class<? extends Annotation>, Iterable<ExtensionMetaData>> scan( String pluginName, Iterable<Class<? extends Annotation>> annotations) throws InvalidPluginException { ImmutableMap.Builder<Class<? extends Annotation>, Iterable<ExtensionMetaData>> result = ImmutableMap.builder(); for (Class<? extends Annotation> annotation : annotations) { Set<ExtensionMetaData> classMetaDataSet = Sets.newHashSet(); result.put(annotation, classMetaDataSet); for (Class<?> clazz : preloadedClasses) { if (!Modifier.isAbstract(clazz.getModifiers()) && clazz.getAnnotation(annotation) != null) { classMetaDataSet.add(new ExtensionMetaData(clazz.getName(), getExportAnnotationValue(clazz, annotation))); } } } return result.build(); }
Source:
public void testRestart_regularClient() throws Exception { WebClient wc = j.createWebClient() .withRedirectEnabled(false) .withThrowExceptionOnFailingStatusCode(false); WebRequest request = new WebRequest(new URL(j.getURL() + "restart"), HttpMethod.POST); assertThat(verifyRestartableCalled.get(), is(false)); assertThat(restartCalled.get(), is(false)); Page page = wc.getPage(request); assertThat(page.getWebResponse().getStatusCode(), is(HttpURLConnection.HTTP_MOVED_TEMP)); restartSemaphore.acquire(1); assertThat(verifyRestartableCalled.get(), is(true)); assertThat(restartCalled.get(), is(true)); }

Target:
public void testRestart_regularClient() throws Exception { WebClient wc = j.createWebClient().withRedirectEnabled(false).withThrowExceptionOnFailingStatusCode(false); WebRequest request = preparePostRequest("restart"); assertThat(verifyRestartableCalled.get(), is(false)); assertThat(restartCalled.get(), is(false)); Page page = wc.getPage(request); assertThat(page.getWebResponse().getStatusCode(), is(HttpURLConnection.HTTP_MOVED_TEMP)); restartSemaphore.acquire(1); assertThat(verifyRestartableCalled.get(), is(true)); assertThat(restartCalled.get(), is(true)); }
Source:
protected void ExecuteVdsIdCommand() { if (_vdsManager == null) { getVDSReturnValue().setSucceeded(false); return; } VDSReturnValue retVal = runHibernateBrokerVDSCommand(); if (retVal.getSucceeded()) { changeVmStatusToSavingState(); getVDSReturnValue().setSucceeded(true); } else { log.errorFormat("VDS::hibernate Failed hibernate vm '{0}' in vds = {1} : {2}, error = {3}", getParameters().getVmId(), getVds().getId(), getVds().getName(), retVal.getExceptionString()); getVDSReturnValue().setSucceeded(false); getVDSReturnValue().setExceptionString(retVal.getExceptionString()); getVDSReturnValue().setExceptionObject(retVal.getExceptionObject()); getVDSReturnValue().setVdsError(retVal.getVdsError()); } }

Target:
protected void ExecuteVdsIdCommand() { if (_vdsManager == null) { getVDSReturnValue().setSucceeded(false); return; } VDSReturnValue retVal = runHibernateBrokerVDSCommand(); if (retVal.getSucceeded()) { changeVmStatusToSavingState(); getVDSReturnValue().setSucceeded(true); } else { log.errorFormat("Failed to hibernate vm '{0}' in vds = {1} : {2}, error = {3}", getParameters().getVmId(), getVds().getId(), getVds().getName(), retVal.getExceptionString()); getVDSReturnValue().setSucceeded(false); getVDSReturnValue().setExceptionString(retVal.getExceptionString()); getVDSReturnValue().setExceptionObject(retVal.getExceptionObject()); getVDSReturnValue().setVdsError(retVal.getVdsError()); } }
Source:
private boolean equalIdAndMode(ObjectId id1, FileMode mode1, ObjectId id2, FileMode mode2) { if (mode1.equals(mode2)) { if (id1 == null) return id2 == null; return (id1.equals(id2)); } return false; }

Target:
private boolean equalIdAndMode(ObjectId id1, FileMode mode1, ObjectId id2, FileMode mode2) { if (!mode1.equals(mode2)) return false; return id1 != null ? id1.equals(id2) : id2 == null; }
Source:
private void createAttributeEditors(FormToolkit toolkit, Composite peopleComposite) { Collection<TaskAttribute> attributes = getAttributes(); for (TaskAttribute attribute : attributes) { addAttribute(peopleComposite, toolkit, attribute); } }

Target:
protected void createAttributeEditors(FormToolkit toolkit, Composite peopleComposite) { Collection<TaskAttribute> attributes = getAttributes(); for (TaskAttribute attribute : attributes) { addAttribute(peopleComposite, toolkit, attribute); } }