auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>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()); <START> if (response.getStatus() == 200) { <END> 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; }</code><technical_language>a constant for 200</technical_language>

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:
<code>public Menu getMenu(Control parent) { if (fMenu != null) { fMenu.dispose(); } fMenu= new Menu(parent); int accel = 1; ConsoleFactoryExtension pyDevExt = null; <START> 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); } } } <END> return fMenu; }</code><technical_language>above, switch this add factories care this simpler</technical_language>

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:
<code>public void changeSupportedCRS() throws OwsExceptionReport { geometryHandler.setSupportedCRS(String.valueOf(EPSG_4326)); assertThat(geometryHandler.getSupportedCRS().contains(String.valueOf(EPSG_4326)), is(true)); <START> assertThat(geometryHandler.getSupportedCRS().contains(String.valueOf(EPSG_31467)), is(false)); <END> }</code><technical_language>Check setting new supported epsg codes, if EPSG:31467 is contained</technical_language>

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:
<code>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); <START> } <END> return hudson.model.User.get(getUsername()); }</code><technical_language>InvocationTargetException caught unwind legitimate exception getById throw</technical_language>

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:
<code>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 = <START> javaClass.getMethod("attributes", null, <END> false); if (attributesMethod!=null) { AttributesAnalyzer attributesAnalyzer = new AttributesAnalyzer(); attributesAnalyzer.analyzeAttributes(attributesMethod.getSourceCode(), method.getParameters()); } method.setDeclaringService(service); service.addMethod(method); }</code><technical_language>prefer avoid magic names, "attributes", instead of annotation mark this method. Currently "Required" "Allowed" annotations, intended for similar, used. remove annotations introduce a new "Constraint" annotation for this purpose? I this: @Constraint default void anyNameYouLike() { mandatory(...); ... } initially ignore name of method</technical_language>

Target:
private void analyzeMethod(JavaClass javaClass, Service service) { Method method = createMethod(javaClass, service); analyzeInputDetail(javaClass, method, service); service.addMethod(method); }
Source:
<code>private void startOrStopGeoDataListener() { if (requireGeodata) { <START> geoDataSubscription = locationUpdater.start(GeoDirHandler.UPDATE_GEODATA); <END> } else { geoDataSubscription.unsubscribe(); } }</code><technical_language>Is save assign a new subscription unsubscribing a potentially existing previous subscription? ask different: guarantee this is called times in a row in activity lifecycle requireGeodata==true</technical_language>

Target:
private void startOrStopGeoDataListener() { geoDataSubscription.unsubscribe(); if (requireGeodata) { geoDataSubscription = locationUpdater.start(GeoDirHandler.UPDATE_GEODATA); } }
Source:
<code>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'"); <START> <END> 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"); }</code><technical_language>This strange me. include prefix</technical_language>

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:
<code>public void configUpdated(final ConfigStatusSource configStatusSource) { executorService.submit(new Runnable() { @Override public void run() { final ConfigStatusInfo info = getConfigStatus(configStatusSource.entityId, null); if (info != null) { <START> eventPublisher.post(new ConfigStatusInfoEvent(configStatusSource.getTopic(), <END> gson.toJson(info.getConfigStatusMessages()), null)); } } }); }</code><technical_language>I prefer if is a constructor takes ConfigStatusInfo object require gson caller</technical_language>

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:
<code>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); } <START> } <END></code><technical_language>Hm, crazy adding a couple new global helpers this in place. feels re-use template (see transfer reversals for example), convert these. do @ob-stripe</technical_language>

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:
<code>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))); } <START> registerProfile(results, <END> new AuthenticationProfile( authnExtension, EngineExtensionsManager.getInstance().getExtensionByName(authzName), mapperName != null ? EngineExtensionsManager.getInstance().getExtensionByName(mapperName) : null ) ); } return results; }</code><technical_language>try write 1st parameter line... if 2nd parameter is there... registerProfile( results, ..</technical_language>

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:
<code>public WorkProcessor<Page> pages() <START> { <END> return WorkProcessor.create(new PollPages()); }</code><technical_language>shorter involved named entities previously? method is compact too. Explicit class is needed process/transformation state</technical_language>

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:
<code>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()) <START> throw new AssertionError("There's no advancedCache.unlock so this must have originated remotely."); <END> releaseLocksOnFailureBeforePrepare(ctx); return false; } for (Object key : command.getKeys()) { lockAndRegisterBackupLock(ctx, key); } return true; } catch (Throwable te) { releaseLocksOnFailureBeforePrepare(ctx); throw te; } }</code><technical_language>is a remote unlock acceptable? I right need local unlock commands for remote tx cleanup, complicate allow anyway</technical_language>

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:
<code>public TextAnalyticsClientBuilder addPolicy(HttpPipelinePolicy policy) { <START> Objects.requireNonNull(policy); <END> policies.add(policy); return this; }</code><technical_language>Add message for this requireNotNull</technical_language>

Target:
public TextAnalyticsClientBuilder addPolicy(HttpPipelinePolicy policy) { Objects.requireNonNull(policy, "'policy' cannot be null."); policies.add(policy); return this; }
Source:
<code>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 " + ") " + <START> "ORDER BY random()"; <END> 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(); }</code><technical_language>I RANDOM() is supported in JPA</technical_language>

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:
<code>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); <START> emailSender.sendEmail(); <END> log.info("Email send by Mail API successfully : " + emailSubject); return waitToCheckEmailReceived(emailSubject); } return false; }</code><technical_language>sendEmail throws Exception need fix in next framework release send custom specific exception properly</technical_language>

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:
<code>String getConfig(String key, String group, long timeout) throws IllegalStateException; <START> default String getConfigFile(String key, String group) throws IllegalStateException { <END> return getConfigFile(key, group, 0L); }</code><technical_language>suggest change to: java default String getProperties(String group) { return getProperties(group, 0L); } String getProperties(String group, long timeout);</technical_language>

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:
<code>protected void onResume() { super.onResume(); if (mAppAdapter != null) mAppAdapter.notifyDataSetChanged(); final View vProgressEmpty = (View) findViewById(R.id.vProgressEmpty); <START> vProgressEmpty.post(new Runnable() { <END> @Override public void run() { mProgressWidth = vProgressEmpty.getMeasuredWidth(); updateProgress(); } }); }</code><technical_language>is a runnable needed here? this work devices? (the runnable UI work)</technical_language>

Target:
protected void onResume() { super.onResume(); if (mAppAdapter != null) mAppAdapter.notifyDataSetChanged(); }
Source:
<code>public synchronized BigtableClient getDataClient() { <START> if (this.client == null) { <END> 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; }</code><technical_language>initialize construction time instead of lazily request</technical_language>

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:
<code>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) { <START> String blogId = String.valueOf(WordPress.currentBlog.getLocalTableBlogId()); <END> 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); } }</code><technical_language>Minor nit: move blogId assignment for loop for pending videos</technical_language>

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:
<code>public List<ServerTemplateKey> loadKeys() { if (templateKeyMap.isEmpty()) { <START> loadTemplateMapsFromFile(); <END> } return new ArrayList<ServerTemplateKey>(templateKeyMap.values()); }</code><technical_language>this loaded new instance of this class is initialized is a chance multiple loads performed in multi threaded environment - e.g. kie servers connects pretty time</technical_language>

Target:
public List<ServerTemplateKey> loadKeys() { return new ArrayList<ServerTemplateKey>(templateKeyMap.values()); }
Source:
<code>public static MessageCorrectExtension from(Message message) { <START> return new MessageCorrectExtension(message.getStanzaId()); <END> }</code><technical_language>appears I unclear from(Message) do: Instead of creating a new MessageCorrect, extract extension message if is one. body of function return message.getExtension(ELEMENT, NAMESPACE);</technical_language>

Target:
public static MessageCorrectExtension from(Message message) { return message.getExtension(ELEMENT, NAMESPACE); }
Source:
<code>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); } <START> } <END></code><technical_language>hope diff ceilingKey() higherKey() higherKey intentionally</technical_language>

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:
<code>protected void executeQueryCommand() { if (getVdsStaticDao().get(getParameters().getServerName()) != null) { getQueryReturnValue().setSucceeded(false); getQueryReturnValue().setExceptionString(VdcBllMessages.SERVER_ALREADY_EXIST_IN_ANOTHER_CLUSTER.name()); return; <START> } <END> 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(); } } }</code><technical_language>method if server exists, checks vds_name field, represents hostname ip address of server, a name assigned user in UI. getAllForHost() *and* getAllWithIpAddress() check existence of server</technical_language>

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:
<code>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"}); <START> List<String> impc_imagesFacets = Arrays.asList(new String[]{"procedure_name", "selected_top_level_anatomy_term", "stage"}); <END> facetMap.put("gene", geneFacets); facetMap.put("mp", mpFacets); facetMap.put("disease", diseaseFacets); facetMap.put("anatomy", anatomyFacets); facetMap.put("impc_images", impc_imagesFacets); }</code><technical_language>new String[]{ is needed</technical_language>

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:
<code>public void showInformationDialogAndWait(String title, String content) { FXDialog alert = createDialog(AlertType.INFORMATION, title, content); <START> Globals.getThemeLoader().installCss(alert.getDialogPane().getScene(), Globals.prefs); <END> alert.showAndWait(); }</code><technical_language>work, if move this line createDialog? reduce some code duplication</technical_language>

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

Target:
protected void setColumnOrder(int size) { int[] order = new int[size]; Arrays.setAll(order, i -> i); Table table = (Table) getControl(); table.setColumnOrder(order); }
Source:
<code>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$); <START> return ScalaGuideProbeUtil.calculateVignetting(ctx, guideStarCoordinates, GmosSouthOiwfsProbeArm$.MODULE$); <END> }</code><technical_language>Site is enum get a reference (i.e, ==) comparison. A bigger issue is if branch calculation for GN appears thrown (you're Scala I think). Site comparison pick a guide probe arm call calculateVignetting selected arm</technical_language>

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:
<code>public PropertyNameTypeBinding( FilterFactory2 filterFactory, NamespaceSupport namespaceSupport, Catalog catalog) { super(filterFactory, namespaceSupport); <START> this.namespaceSupport = namespaceSupport; <END> this.catalog = catalog; }</code><technical_language>Is this me, this assignement useless? this.namespaceSupport = namespaceSupport;</technical_language>

Target:
public PropertyNameTypeBinding( FilterFactory2 filterFactory, NamespaceSupport namespaceSupport, Catalog catalog) { super(filterFactory, namespaceSupport); this.catalog = catalog; }
Source:
<code>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) <START> allRepresentations.toArray()[0]; <END> return representation; }</code><technical_language>safer find a rep name. representation order change a migration for example</technical_language>

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:
<code>private void shutdownGracefully(final String reason) { getLog().info("Shutting down gracefully. Reason: {}", reason); offsets.entrySet().stream().findFirst() <START> .ifPresent(pk -> flushData(pk.getKey(), new TreeMap<>(), Optional.of(reason))); <END> 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)); } }</code><technical_language>send for random topic-partition, right</technical_language>

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:
<code>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 = <START> systemFile.getContents();){ <END> sysImporter.importSystem(stream, system); } catch (CoreException|IOException e) { Activator.getDefault().logError(e.getMessage(), e); } return system; } return null; }</code><technical_language>semicolon needed</technical_language>

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:
<code>public ConnectionOptions batchWriterConfig(BatchWriterConfig batchWriterConfig) { setProperty(ClientProperty.BATCH_WRITER_MAX_MEMORY_BYTES, batchWriterConfig.getMaxMemory()); setProperty(ClientProperty.BATCH_WRITER_MAX_LATENCY_SEC, <START> batchWriterConfig.getMaxLatency(TimeUnit.MILLISECONDS) + "ms"); <END> 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; }</code><technical_language>For other props a timeduration type check if units need added else</technical_language>

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:
<code>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); } } <START> return failCnt == 0 ? TaskStatus.success(getId()) : TaskStatus.failure(getId()); <END> } }</code><technical_language>I print a log failures</technical_language>

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:
<code>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 '/'"); <START> boolean hasParams = str.indexOf(';') != -1; <END> 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); }</code><technical_language>a javax.activation.MimeType of type, subtype parameter parsing logic</technical_language>

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:
<code>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<?> <START> scriptClass : <END> preloadedClasses) { if (!Modifier.isAbstract(scriptClass.getModifiers()) && scriptClass.getAnnotation(annotation) != null) { classMetaDataSet.add(new ExtensionMetaData(scriptClass.getName(), getExportAnnotationValue(scriptClass, annotation))); } } } return result.build(); }</code><technical_language>'scriptClass'? this more generic eg. 'pluginClass'</technical_language>

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:
<code>public void testRestart_regularClient() throws Exception { WebClient wc = j.createWebClient() .withRedirectEnabled(false) .withThrowExceptionOnFailingStatusCode(false); <START> WebRequest request = new WebRequest(new URL(j.getURL() + "restart"), HttpMethod.POST); <END> 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)); }</code><technical_language>lines roughly lines of next block, refactor a function takes restart/restartSimple action argument? (I'm currently running IntelliJ's tooling, complains common code -- some reviewers ding for this....)</technical_language>

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:
<code>protected void ExecuteVdsIdCommand() { if (_vdsManager == null) { getVDSReturnValue().setSucceeded(false); return; } VDSReturnValue retVal = runHibernateBrokerVDSCommand(); if (retVal.getSucceeded()) { changeVmStatusToSavingState(); getVDSReturnValue().setSucceeded(true); } else { <START> log.errorFormat("VDS::hibernate Failed hibernate vm '{0}' in vds = {1} : {2}, error = {3}", <END> getParameters().getVmId(), getVds().getId(), getVds().getName(), retVal.getExceptionString()); getVDSReturnValue().setSucceeded(false); getVDSReturnValue().setExceptionString(retVal.getExceptionString()); getVDSReturnValue().setExceptionObject(retVal.getExceptionObject()); getVDSReturnValue().setVdsError(retVal.getVdsError()); } }</code><technical_language>i good enough log: "Failed hibernate vm '{0}' in vds = {1} : {2}, error = {3}"</technical_language>

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:
<code>private boolean equalIdAndMode(ObjectId id1, FileMode mode1, ObjectId id2, FileMode mode2) { if (mode1.equals(mode2)) { if (id1 == null) return id2 == null; <START> return (id1.equals(id2)); <END> } return false; }</code><technical_language>right, nicer. done</technical_language>

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; }