auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void subscribe(ActionEvent e) throws SystemException, PortalException { if (Helper.isUserLoggedIn()) { StringBuilder extraData = new StringBuilder(); if (pageType == DiscussionPageType.CATEGORY) { extraData.append(currentCategory.getId()); } else if (pageType == DiscussionPageType.THREAD) { extraData.append(currentThread.getCategoryId()); extraData.append(","); extraData.append(currentThread.getId()); } final User liferayUser = Helper.getLiferayUser(); if (liferayUser != null) { if (isSubscribed()) { ; <START> ActivitiesClient.deleteSubscription(new Long(liferayUser.getUserId()), ActivityEntryType <END> .DISCUSSION, getDiscussionId(), extraData.toString()); } else { ActivitiesClient.addSubscription(new Long(liferayUser.getUserId()), ActivityEntryType.DISCUSSION, getDiscussionId(), extraData.toString()); } } else { _log.error("Could not retrieve user for subscription: user was null"); } } }</code><technical_language>remove this change please</technical_language>

Target:
public void subscribe(ActionEvent e) throws SystemException, PortalException { if (Helper.isUserLoggedIn()) { StringBuilder extraData = new StringBuilder(); if (pageType == DiscussionPageType.CATEGORY) { extraData.append(currentCategory.getId()); } else if (pageType == DiscussionPageType.THREAD) { extraData.append(currentThread.getCategoryId()); extraData.append(","); extraData.append(currentThread.getId()); } final User liferayUser = Helper.getLiferayUser(); if (liferayUser != null) { if (isSubscribed()) { ActivitiesClient.deleteSubscription(liferayUser.getUserId(), ActivityEntryType .DISCUSSION, getDiscussionId(), extraData.toString()); ; } else { ActivitiesClient.addSubscription(liferayUser.getUserId(),ActivityEntryType.DISCUSSION, getDiscussionId(), extraData.toString()); } } else { _log.error("Could not retrieve user for subscription: user was null"); } } }
Source:
<code><START> private void cleanUsingTime(final String metricName, final Date firstAllowedDate) { <END> if (historyListMapping.containsKey(metricName) && historyListMapping.get(metricName) != null) { synchronized (historyListMapping.get(metricName)) { InMemoryHistoryNode firstNode = historyListMapping.get(metricName).peekFirst(); long localCopyOfInterval = 0; synchronized (this) { localCopyOfInterval = interval; } while (firstNode != null && TimeUnit.MILLISECONDS.toMillis(firstAllowedDate.getTime() - firstNode.getTimestamp().getTime()) > localCopyOfInterval) { historyListMapping.get(metricName).removeFirst(); firstNode = historyListMapping.get(metricName).peekFirst(); } } } }</code><technical_language>this cleaning of expired metrics done in background thread. done reportMetric getDrawMetric called. If calls methods for a long time (e.g.: /stats endpoint for a long time), historyListMapping grow humongous Azkaban run out of memory. I do cleaning in a background thread cleaning periodically</technical_language>

Target:
private void cleanUsingTime(final String metricName, final Date firstAllowedDate) { if (historyListMapping.containsKey(metricName) && historyListMapping.get(metricName) != null) { synchronized (historyListMapping.get(metricName)) { InMemoryHistoryNode firstNode = historyListMapping.get(metricName).peekFirst(); long localCopyOfTimeWindow = 0; synchronized (this) { localCopyOfTimeWindow = timeWindow; } while (firstNode != null && TimeUnit.MILLISECONDS.toMillis(firstAllowedDate.getTime() - firstNode.getTimestamp().getTime()) > localCopyOfTimeWindow) { historyListMapping.get(metricName).removeFirst(); firstNode = historyListMapping.get(metricName).peekFirst(); } } } }
Source:
<code>private void afterHypervisorMigrationCleanup(StoragePool destPool, VMInstanceVO vm, HostVO srcHost, Long srcClusterId, Answer[] hypervisorMigrationResults) throws InsufficientCapacityException { if(s_logger.isDebugEnabled()) { String msg = String.format("cleaning up after hypervisor pool migration volumes for VM %s(%s) to pool %s(%s)", vm.getInstanceName(), vm.getUuid(), destPool.getName(), destPool.getUuid()); <START> s_logger.debug(msg); <END> } setDestinationPoolAndReallocateNetwork(destPool, vm); Long destPodId = destPool.getPodId(); Long vmPodId = vm.getPodIdToDeployIn(); if (destPodId == null || ! destPodId.equals(vmPodId)) { if(s_logger.isDebugEnabled()) { String msg = String.format("resetting lasHost for VM %s(%s) as pod (%s) is no good.", vm.getInstanceName(), vm.getUuid(), destPodId); s_logger.debug(msg); } vm.setLastHostId(null); vm.setPodIdToDeployIn(destPodId); } markVolumesInPool(vm,destPool, hypervisorMigrationResults); }</code><technical_language>return _agentMgr.send(hostId, commandsContainer);</technical_language>

Target:
private void afterHypervisorMigrationCleanup(StoragePool destPool, VMInstanceVO vm, HostVO srcHost, Long srcClusterId, Answer[] hypervisorMigrationResults) throws InsufficientCapacityException { boolean isDebugEnabled = s_logger.isDebugEnabled(); if(isDebugEnabled) { String msg = String.format("cleaning up after hypervisor pool migration volumes for VM %s(%s) to pool %s(%s)", vm.getInstanceName(), vm.getUuid(), destPool.getName(), destPool.getUuid()); s_logger.debug(msg); } setDestinationPoolAndReallocateNetwork(destPool, vm); Long destPodId = destPool.getPodId(); Long vmPodId = vm.getPodIdToDeployIn(); if (destPodId == null || ! destPodId.equals(vmPodId)) { if(isDebugEnabled) { String msg = String.format("resetting lasHost for VM %s(%s) as pod (%s) is no good.", vm.getInstanceName(), vm.getUuid(), destPodId); s_logger.debug(msg); } vm.setLastHostId(null); vm.setPodIdToDeployIn(destPodId); } markVolumesInPool(vm,destPool, hypervisorMigrationResults); }
Source:
<code>public void testItAcceptsSharePhotoContent() throws MalformedURLException, URISyntaxException { String AppId = "200"; <START> PowerMockito.mockStatic(Validate.class); <END> when(Validate.hasContentProvider(RuntimeEnvironment.application)).thenReturn(true); FacebookSdk.sdkInitialize(RuntimeEnvironment.application); FacebookSdk.setApplicationId(AppId); SharePhotoContent.Builder spcBuilder = new SharePhotoContent.Builder(); SharePhoto sharePhoto = new SharePhoto.Builder().setBitmap(createStubBitmap()).build(); SharePhotoContent sharePhotoContent = spcBuilder.addPhoto(sharePhoto).build(); ShareContentValidation.validateForApiShare(sharePhotoContent); ShareContentValidation.validateForMessage(sharePhotoContent); ShareContentValidation.validateForNativeShare(sharePhotoContent); }</code><technical_language>need mock class do PowerMockito.spy(Validate.class);</technical_language>

Target:
public void testItAcceptsSharePhotoContent() throws Exception { String AppId = "200"; PowerMockito.spy(Validate.class); doNothing().when(Validate.class, "hasContentProvider", Mockito.any(Context.class)); FacebookSdk.sdkInitialize(RuntimeEnvironment.application); FacebookSdk.setApplicationId(AppId); SharePhotoContent.Builder spcBuilder = new SharePhotoContent.Builder(); SharePhoto sharePhoto = new SharePhoto.Builder().setBitmap(createStubBitmap()).build(); SharePhotoContent sharePhotoContent = spcBuilder.addPhoto(sharePhoto).build(); ShareContentValidation.validateForApiShare(sharePhotoContent); ShareContentValidation.validateForMessage(sharePhotoContent); ShareContentValidation.validateForNativeShare(sharePhotoContent); }
Source:
<code>public void handleAnalysisStarted(TmfStartAnalysisSignal signal) { IAnalysisModule module = signal.getAnalysisModule(); if (module instanceof ITmfAnalysisModuleWithStateSystems && !module.isAutomatic()) { <START> fStartedAnalysis.add((ITmfAnalysisModuleWithStateSystems) module); <END> rebuild(); } }</code><technical_language>If this module belong active trace of this view, consumed</technical_language>

Target:
public void handleAnalysisStarted(TmfStartAnalysisSignal signal) { IAnalysisModule module = signal.getAnalysisModule(); if (module instanceof ITmfAnalysisModuleWithStateSystems && !module.isAutomatic()) { fStartedAnalysis.add((ITmfAnalysisModuleWithStateSystems) module); if (Iterables.contains(allModules(getTrace()), module)) { rebuild(); } } }
Source:
<code>public String toString() { <START> return "#" + Integer.toHexString(toInt()); END> }</code><technical_language>this include zeros, fixed width #RRGGBBAA</technical_language>

Target:
public String toString() { return String.format("#%08h", toInt()); }
Source:
<code>private ItemKey[] sort(final Set<ItemKey> keys) { final List<ItemKey> res = new ArrayList<>(keys.size()); for (ItemKey key : SORT_ORDER) { if (keys.remove(key)) { res.add(key); } } final List<ItemKey> sortedKeys = new ArrayList<>(keys); Collections.sort(sortedKeys); final Map<String, List<ItemKey>> groupedItems = new HashMap<>(); for (ItemKey key : sortedKeys) { ItemKey parent = key; ItemKey tmp = parent.getParent(); while (tmp != null) { parent = tmp; tmp = parent.getParent(); } <START> List<ItemKey> lst = groupedItems.get(parent.getName()); <END> if (lst == null) { lst = new ArrayList<>(); groupedItems.put(parent.getName(), lst); } lst.add(key); } List<ItemKey> lst = groupedItems.remove("instrument"); if (lst != null) res.addAll(lst); lst = groupedItems.remove("telescope"); if (lst != null) res.addAll(lst); lst = groupedItems.remove("calibration"); if (lst != null) res.addAll(lst); for (String category : groupedItems.keySet()) { res.addAll(groupedItems.get(category)); } return res.toArray(new ItemKey[res.size()]); }</code><technical_language>I this is nitpicky, final a list, easily. final List<ItemKey> lst = groupedItems.get(parent.getName()); final List<ItemKey> finalLst; if (lst == null) { finalList = new ArrayList<>(); groupedItems.put(parent.getName(), finalList); } else finalList = lst;</technical_language>

Target:
private ItemKey[] sort(final Set<ItemKey> keys) { final List<ItemKey> res = new ArrayList<>(keys.size()); for (ItemKey key : SORT_ORDER) { if (keys.remove(key)) { res.add(key); } } final List<ItemKey> sortedKeys = new ArrayList<>(keys); Collections.sort(sortedKeys); final Map<String, List<ItemKey>> groupedItems = new HashMap<>(); for (final ItemKey key : sortedKeys) { ItemKey parent = key; ItemKey tmp = parent.getParent(); while (tmp != null) { parent = tmp; tmp = parent.getParent(); } List<ItemKey> lst = groupedItems.get(parent.getName()); if (lst == null) { lst = new ArrayList<>(); groupedItems.put(parent.getName(), lst); } lst.add(key); } List<ItemKey> lst = groupedItems.remove("instrument"); if (lst != null) res.addAll(lst); lst = groupedItems.remove("telescope"); if (lst != null) res.addAll(lst); lst = groupedItems.remove("calibration"); if (lst != null) res.addAll(lst); for (final String category : groupedItems.keySet()) { res.addAll(groupedItems.get(category)); } return res.toArray(new ItemKey[res.size()]); }
Source:
<code>private AbstractPlanNode buildSetOpPlan(AbstractPlanNode setOpPlanNode, List<CompiledPlan> childrenPlans, boolean needPushSetOpDown) { AbstractPlanNode rootNode = setOpPlanNode; if (needPushSetOpDown) { rootNode = SubPlanAssembler.addSendReceivePair(rootNode); for (CompiledPlan selectPlan : childrenPlans) { AbstractPlanNode childPlan = selectPlan.rootPlanGraph; AbstractPlanNode childParent = setOpPlanNode; <START> if (selectPlan.rootPlanGraph instanceof ProjectionPlanNode) { <END> setOpPlanNode.addAndLinkChild(selectPlan.rootPlanGraph); assert(selectPlan.rootPlanGraph.getChildCount() == 1); childPlan = selectPlan.rootPlanGraph.getChild(0); selectPlan.rootPlanGraph.clearChildren(); childParent = selectPlan.rootPlanGraph; } assert(childPlan instanceof MergeReceivePlanNode || childPlan instanceof ReceivePlanNode); childPlan = childPlan.getChild(0).getChild(0); childPlan.clearParents(); childParent.addAndLinkChild(childPlan); } } else { for (CompiledPlan selectPlan : childrenPlans) { rootNode.addAndLinkChild(selectPlan.rootPlanGraph); } } return rootNode; }</code><technical_language>For readability, childPlan in place of selectPlan.rootPlanGraph this block. Cache selectPlan.rootPlanGraph.getChild(0) in a local variable newChildPlan childPlan reassigned final statement of block</technical_language>

Target:
private AbstractPlanNode buildSetOpPlan(AbstractPlanNode setOpPlanNode, List<CompiledPlan> childrenPlans, boolean needPushSetOpDown) { AbstractPlanNode rootNode = setOpPlanNode; if (needPushSetOpDown) { rootNode = SubPlanAssembler.addSendReceivePair(rootNode); for (CompiledPlan selectPlan : childrenPlans) { AbstractPlanNode childPlan = selectPlan.rootPlanGraph; AbstractPlanNode childParent = setOpPlanNode; if (childPlan instanceof ProjectionPlanNode) { setOpPlanNode.addAndLinkChild(childPlan); assert(childPlan.getChildCount() == 1); AbstractPlanNode newChildPlan = childPlan.getChild(0); childPlan.clearChildren(); childParent = childPlan; childPlan = newChildPlan; } if(childPlan instanceof MergeReceivePlanNode || childPlan instanceof ReceivePlanNode) { childPlan = childPlan.getChild(0).getChild(0); childPlan.clearParents(); } childParent.addAndLinkChild(childPlan); } } else { for (CompiledPlan selectPlan : childrenPlans) { rootNode.addAndLinkChild(selectPlan.rootPlanGraph); } } return rootNode; }
Source:
<code>private Optional<Map.Entry<String, Object>> metacardEntryToJsonEntry( final Map.Entry<String, Object> entry, WorkspaceTransformation transformation) { if (transformation.getMetacardValueType().isInstance(entry.getValue())) { final String newKey = transformation.getJsonKey(); return transformation .metacardValueToJsonValue( this, transformation.getMetacardValueType().cast(entry.getValue())) .map(newValue -> new AbstractMap.SimpleEntry<>(newKey, newValue)); } else { LOGGER.warn( <START> "A workspace transformation expected a value of type for metacard attribute \"{}\", but instead found a value of type {}!", <END> transformation.getMetacardValueType().getName(), entry.getKey(), entry.getValue().getClass().getName()); return Optional.empty(); } }</code><technical_language>current logging convention</technical_language>

Target:
private Optional<Map.Entry<String, Object>> metacardEntryToJsonEntry( final Map.Entry<String, Object> entry, WorkspaceTransformation transformation) { if (transformation.getMetacardValueType().isInstance(entry.getValue())) { final String newKey = transformation.getJsonKey(); return transformation .metacardValueToJsonValue( this, transformation.getMetacardValueType().cast(entry.getValue())) .map(newValue -> new AbstractMap.SimpleEntry<>(newKey, newValue)); } else { LOGGER.warn( "A workspace transformation expected a value of type for metacard attribute \"{}\", but instead found a value of type {}.", transformation.getMetacardValueType().getName(), entry.getKey(), entry.getValue().getClass().getName()); return Optional.empty(); } }
Source:
<code>protected void init(T parameters) { super.init(parameters); DiskImage representativeImage = getRepresentativeImage(); if (representativeImage == null) { return; } setImage(representativeImage); setStorageDomainId(representativeImage.getStorageIds().get(0)); if (!Guid.isNullOrEmpty(getParameters().getContainerId())) { setVmId(getParameters().getContainerId()); } else { List<VM> listVms = getVmDAO().getVmsListForDisk(representativeImage.getId(), false); if (!listVms.isEmpty()) { VM vm = listVms.get(0); setVm(vm); } } <START> if (isLiveMerge()) { <END> clearTaskHandlers(); } }</code><technical_language>SEAT mechanism? i.e. add this check RemoveDiskSnapshotTaskHandler invoke RemoveSnapshotSingleDiskLive there.</technical_language>

Target:
protected void init(T parameters) { super.init(parameters); DiskImage representativeImage = getRepresentativeImage(); if (representativeImage == null) { return; } setImage(representativeImage); setStorageDomainId(representativeImage.getStorageIds().get(0)); if (!Guid.isNullOrEmpty(getParameters().getContainerId())) { setVmId(getParameters().getContainerId()); } else { List<VM> listVms = getVmDAO().getVmsListForDisk(representativeImage.getId(), false); if (!listVms.isEmpty()) { VM vm = listVms.get(0); setVm(vm); } } }
Source:
<code>private static Connection newConnection(Vertx vertx, RabbitMQOptions config) throws IOException, TimeoutException { ConnectionFactory cf = new ConnectionFactory(); String uri = config.getUri(); List<Address> addresses = null; if (uri != null) { try { log.info("Connecting to " + uri); cf.setUri(uri); } catch (Exception e) { throw new IllegalArgumentException("Invalid rabbitmq connection uri " + uri); } } else { cf.setUsername(config.getUser()); cf.setPassword(config.getPassword()); addresses = config.getAddresses().isEmpty() ? Collections.singletonList(new Address(config.getHost(), config.getPort())) : config.getAddresses(); cf.setVirtualHost(config.getVirtualHost()); } cf.setConnectionTimeout(config.getConnectionTimeout()); cf.setRequestedHeartbeat(config.getRequestedHeartbeat()); cf.setHandshakeTimeout(config.getHandshakeTimeout()); cf.setRequestedChannelMax(config.getRequestedChannelMax()); cf.setNetworkRecoveryInterval(config.getNetworkRecoveryInterval()); cf.setAutomaticRecoveryEnabled(config.isAutomaticRecoveryEnabled()); if(config.isSsl()) { SSLHelper sslHelper = new SSLHelper(config, config.getKeyCertOptions(), config.getTrustOptions()); <START> JdkSslContext ctx = (JdkSslContext)sslHelper.getContext((VertxInternal)vertx); <END> cf.useSslProtocol(ctx.context()); } return addresses == null ? cf.newConnection() : cf.newConnection(addresses); }</code><technical_language>is this cast required</technical_language>

Target:
private static Connection newConnection(Vertx vertx, RabbitMQOptions config) throws IOException, TimeoutException { ConnectionFactory cf = new ConnectionFactory(); String uri = config.getUri(); List<Address> addresses = null; if (uri != null) { try { log.info("Connecting to " + uri); cf.setUri(uri); } catch (Exception e) { throw new IllegalArgumentException("Invalid rabbitmq connection uri " + uri); } } else { cf.setUsername(config.getUser()); cf.setPassword(config.getPassword()); addresses = config.getAddresses().isEmpty() ? Collections.singletonList(new Address(config.getHost(), config.getPort())) : config.getAddresses(); cf.setVirtualHost(config.getVirtualHost()); } cf.setConnectionTimeout(config.getConnectionTimeout()); cf.setRequestedHeartbeat(config.getRequestedHeartbeat()); cf.setHandshakeTimeout(config.getHandshakeTimeout()); cf.setRequestedChannelMax(config.getRequestedChannelMax()); cf.setNetworkRecoveryInterval(config.getNetworkRecoveryInterval()); cf.setAutomaticRecoveryEnabled(config.isAutomaticRecoveryEnabled()); if(config.isSsl()) { config.setSslEngineOptions(new JdkSSLEngineOptions()); SSLHelper sslHelper = new SSLHelper(config, config.getKeyCertOptions(), config.getTrustOptions()); JdkSslContext ctx = (JdkSslContext)sslHelper.getContext((VertxInternal)vertx); cf.useSslProtocol(ctx.context()); } return addresses == null ? cf.newConnection() : cf.newConnection(addresses); }
Source:
<code><START> public List<String> search(@NonNull String input, @Nonnull String tableName, @Nonnull String resultColumn, <END> @Nullable String orderByColumn, @Nonnull String... searchColumns) { final List<String> results = new ArrayList<>(); synchronized (mDatabaseLock) { Cursor cursor = null; try { final SQLiteDatabase db = getReadableDatabase(); final String baseQuery = String.format("SELECT DISTINCT %s FROM %s WHERE ", resultColumn, tableName); StringBuilder builder = new StringBuilder(baseQuery); for (int i = 0; i < searchColumns.length; i++) { if (i != 0) { builder.append(" OR "); } builder.append(searchColumns[i]) .append(" like '") .append(input) .append("%' "); } if (orderByColumn != null) { builder.append(" ORDER BY ") .append(orderByColumn); } cursor = db.rawQuery(builder.toString(), null); if (cursor != null && cursor.moveToFirst()) { do { results.add(cursor.getString(0)); } while (cursor.moveToNext()); } } finally { if (cursor != null) { cursor.close(); } } } return results; }</code><technical_language>wrap this in a Single avoid risk of calling this UI thread</technical_language>

Target:
public Single<List<String>> search(@NonNull String input, @Nonnull String tableName, @Nonnull String resultColumn, @Nullable String orderByColumn, @Nonnull String... searchColumns) { return Single.fromCallable(() -> { final List<String> results = new ArrayList<>(); synchronized (mDatabaseLock) { Cursor cursor = null; try { final SQLiteDatabase db = getReadableDatabase(); final String baseQuery = String.format("SELECT DISTINCT %s FROM %s WHERE ", resultColumn, tableName); StringBuilder builder = new StringBuilder(baseQuery); for (int i = 0; i < searchColumns.length; i++) { if (i != 0) { builder.append(" OR "); } builder.append(searchColumns[i]) .append(" like '") .append(input) .append("%' "); } if (orderByColumn != null) { builder.append(" ORDER BY ") .append(orderByColumn); } cursor = db.rawQuery(builder.toString(), null); if (cursor != null && cursor.moveToFirst()) { do { results.add(cursor.getString(0)); } while (cursor.moveToNext()); } } finally { if (cursor != null) { cursor.close(); } } } return results; } ) .subscribeOn(Schedulers.io()); }
Source:
<code>protected void internalRefresh(Object element) { <START> if (element != null) { <END> getContentProvider().runWhenReady(IN_UI_SYNC, new Runnable() { public void run() { getViewer().refresh(); } }); getContentProvider().runWhenReady(IN_UI_SYNC, new Runnable() { public void run() { updateHighlightRelatedChanges(getSelection()); } }); getContentProvider().runWhenReady(IN_UI_ASYNC, new Runnable() { public void run() { refreshTitle(); } }); } }</code><technical_language>For future reference, is a clear "exit condition" this one, please clear: if (element == null) { return; } [...]</technical_language>

Target:
protected void internalRefresh(Object element) { if (element == null) { return; } getContentProvider().runWhenReady(IN_UI_SYNC, new Runnable() { public void run() { getViewer().refresh(); } }); getContentProvider().runWhenReady(IN_UI_SYNC, new Runnable() { public void run() { updateHighlightRelatedChanges(getSelection()); } }); getContentProvider().runWhenReady(IN_UI_ASYNC, new Runnable() { public void run() { refreshTitle(); } }); }
Source:
<code>public UploadSessionPart(File file, BoxUploadSession uploadSession, int partNumber, BoxSession session) throws IOException { super(BoxUploadSessionPart.class, uploadSession.getEndpoints().getUploadPartEndpoint(), session); mRequestUrlString = uploadSession.getEndpoints().getUploadPartEndpoint(); mRequestMethod = Methods.PUT; mPartNumber = partNumber; mUploadSession = uploadSession; mFileSize = file.length(); mCurrentChunkSize = BoxUploadSession.getChunkSize(uploadSession, partNumber, mFileSize); <START> mData = new byte[mCurrentChunkSize]; <END> FileInputStream inputStream = new FileInputStream(file); inputStream.skip(partNumber * uploadSession.getPartSize()); inputStream.read(mData); mContentType = ContentTypes.APPLICATION_OCTET_STREAM; }</code><technical_language>This mData byte array creates a big memory footprint for app. (loading 8mb more in RAM). Instead please BoundedInputStream Apache, set max read offset + chunkSize read</technical_language>

Target:
public UploadSessionPart(File file, BoxUploadSession uploadSession, int partNumber, BoxSession session) throws IOException { super(BoxUploadSessionPart.class, uploadSession.getEndpoints().getUploadPartEndpoint(), session); mRequestUrlString = uploadSession.getEndpoints().getUploadPartEndpoint(); mRequestMethod = Methods.PUT; mPartNumber = partNumber; mUploadSession = uploadSession; mFile = file; mCurrentChunkSize = BoxUploadSession.getChunkSize(uploadSession, partNumber, mFile.length()); mContentType = ContentTypes.APPLICATION_OCTET_STREAM; }
Source:
<code><START> public void request(long n) { <END> if (n >= 0) { int m = mode; if (m == 0) { return; } if (m == 1) { BackpressureUtils.getAndAddRequest(this, n); subscriber.emit(); return; } if (n == Long.MAX_VALUE) { if (MODE.compareAndSet(this, -1, 0)) { subscriber.requestAll(); return; } } else { if (MODE.compareAndSet(this, -1, 1)) { BackpressureUtils.getAndAddRequest(this, n); subscriber.requestDefault(); return; } } m = mode; if (m == 0) { return; } else if (m == 1) { BackpressureUtils.getAndAddRequest(this, n); subscriber.emit(); return; } throw new IllegalStateException("Shouldn't be in mode: " + m); } }</code><technical_language>This request method, this entire Producer implementation sense part of BackpressureUtils is generic. subscriber.* methods invoked a BackpressureSubscriber interface perhaps? This is code reusable for of backpressure aware operators</technical_language>

Target:
public void request(long n) { if (n > 0) { if (get() == Long.MAX_VALUE) { return; } BackpressureUtils.getAndAddRequest(this, n); subscriber.emit(); } else if (n < 0) { throw new IllegalArgumentException("n >= 0 required"); } }
Source:
<code>protected String createHttpRequestURL() { <START> String bugUrl = getUrlSuffix(); <END> if (bugUrl.length() > 0 && authenticationRequired) { if (!bugUrl.endsWith("?")) { bugUrl += "&"; } UserCredentials credentials = getClient().getLocation().getCredentials(AuthenticationType.REPOSITORY); if (credentials == null) { throw new IllegalStateException("Authentication requested without valid credentials"); } bugUrl += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", new Object[] { credentials.getUserName(), credentials.getPassword() }); } return baseUrl() + bugUrl; }</code><technical_language>is this called bug URL</technical_language>

Target:
protected String createHttpRequestURL() { String urlSuffix = getUrlSuffix(); if (urlSuffix.length() > 0 && authenticationRequired) { if (!urlSuffix.endsWith("?")) { urlSuffix += "&"; } UserCredentials credentials = getCredentials(); urlSuffix += MessageFormat.format("Bugzilla_login={0}&Bugzilla_password={1}", new Object[] { credentials.getUserName(), credentials.getPassword() }); } return baseUrl() + urlSuffix; }
Source:
<code>protected ActionForward promptForFinalBillConfirmation(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, String caller) throws Exception { ActionForward forward = null; Object question = request.getParameter(KFSConstants.QUESTION_INST_ATTRIBUTE_NAME); <START> if (question == null || question.toString().toLowerCase().contains("suspension")) { <END> String questionText = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_FINAL_BILL_INDICATOR); return performQuestionWithoutInput(mapping, form, request, response, CUKFSConstants.CINV_FINAL_BILL_INDICATOR_CONFIRMATION_QUESTION, questionText, KFSConstants.CONFIRMATION_QUESTION, caller, StringUtils.EMPTY); } Object buttonClicked = request.getParameter(KFSConstants.QUESTION_CLICKED_BUTTON); if (CUKFSConstants.CINV_FINAL_BILL_INDICATOR_CONFIRMATION_QUESTION.equals(question) && ConfirmationQuestion.NO.equals(buttonClicked)) { forward = mapping.findForward(KFSConstants.MAPPING_BASIC); } return forward; }</code><technical_language>If do end changing order in questions asked, update this method accidentally process answer suspension category question</technical_language>

Target:
protected ActionForward promptForFinalBillConfirmation(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response, String caller) throws Exception { ActionForward forward = null; Object question = request.getParameter(KFSConstants.QUESTION_INST_ATTRIBUTE_NAME); if (question == null) { String questionText = SpringContext.getBean(ConfigurationService.class).getPropertyValueAsString(CUKFSKeyConstants.WARNING_CINV_FINAL_BILL_INDICATOR); return performQuestionWithoutInput(mapping, form, request, response, CuArConstants.CINV_FINAL_BILL_INDICATOR_CONFIRMATION_QUESTION, questionText, KFSConstants.CONFIRMATION_QUESTION, caller, StringUtils.EMPTY); } Object buttonClicked = request.getParameter(KFSConstants.QUESTION_CLICKED_BUTTON); if (CuArConstants.CINV_FINAL_BILL_INDICATOR_CONFIRMATION_QUESTION.equals(question) && ConfirmationQuestion.NO.equals(buttonClicked)) { forward = mapping.findForward(KFSConstants.MAPPING_BASIC); } return forward; }
Source:
<code>public Path getParent() { if (virtualFile.parent() == null) { return null; } <START> return new BridgePath(virtualFile.parent(), fs); <END> }</code><technical_language>suggestion return new BridgePath(virtualFile.parent(), fileSystem);</technical_language>

Target:
public Path getParent() { if (virtualFile.parent() == null) { return null; } return new BridgePath(virtualFile.parent(), fileSystem); }
Source:
<code>public CallAdapter<?> nextCallAdapter(CallAdapter.Factory skipPast, Type returnType, Annotation[] annotations) { checkNotNull(returnType, "returnType == null"); checkNotNull(annotations, "annotations == null"); for (int i = 0, count = adapterFactories.size(); i < count; i++) { CallAdapter.Factory factory = adapterFactories.get(i); <START> if (factory == skipPast) continue; <END> CallAdapter<?> adapter = factory.get(returnType, annotations, this); if (adapter != null) { return adapter; } } StringBuilder builder = new StringBuilder("Could not locate call adapter for ") .append(returnType) .append(". Tried:"); for (CallAdapter.Factory adapterFactory : adapterFactories) { if (adapterFactory != skipPast) { builder.append("\n * ").append(adapterFactory.getClass().getName()); } } if (skipPast != null) { builder.append("\nSkipped:\n * ").append(skipPast); } throw new IllegalArgumentException(builder.toString()); }</code><technical_language>For recursive delegation need skip this prior</technical_language>

Target:
public CallAdapter<?> nextCallAdapter(CallAdapter.Factory skipPast, Type returnType, Annotation[] annotations) { checkNotNull(returnType, "returnType == null"); checkNotNull(annotations, "annotations == null"); int start = adapterFactories.indexOf(skipPast) + 1; for (int i = start, count = adapterFactories.size(); i < count; i++) { CallAdapter<?> adapter = adapterFactories.get(i).get(returnType, annotations, this); if (adapter != null) { return adapter; } } StringBuilder builder = new StringBuilder("Could not locate call adapter for ") .append(returnType) .append(". Tried:"); for (int i = start, count = adapterFactories.size(); i < count; i++) { builder.append("\n * ").append(adapterFactories.get(i).getClass().getName()); } if (skipPast != null) { builder.append("\nSkipped:"); for (int i = 0; i < start; i++) { builder.append("\n * ").append(adapterFactories.get(i).getClass().getName()); } } throw new IllegalArgumentException(builder.toString()); }
Source:
<code>public void testEmptyArray() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; <START> verify(checkConfig, getPath("InputIndentationEmptyArray.java"), expected); <END> }</code><technical_language>Indentation is special alot of extra checks balances of complexity. Please change verify verifyWarns turn checks on. asked change input file this</technical_language>

Target:
public void testEmptyArray() throws Exception { final DefaultConfiguration checkConfig = createCheckConfig(IndentationCheck.class); checkConfig.addAttribute("tabWidth", "4"); final String[] expected = CommonUtils.EMPTY_STRING_ARRAY; verifyWarns(checkConfig, getPath("InputIndentationEmptyArray.java"), expected); }
Source:
<code>protected void setup(Context context) throws IOException, InterruptedException { namedOutputMeta = context.getConfiguration().get("output.meta"); if (namedOutputMeta == null || namedOutputMeta.isEmpty()) { throw new RuntimeException("no named output provided for metadata"); } namedOutputFault = context.getConfiguration().get("output.fault"); if (namedOutputFault == null || namedOutputFault.isEmpty()) { throw new RuntimeException("no named output provided for fault"); } String excludedIdsCSV = context.getConfiguration().get("excluded.ids"); if (excludedIdsCSV != null && !excludedIdsCSV.trim().isEmpty() && !WorkflowRuntimeParameters.UNDEFINED_NONEMPTY_VALUE.equals(excludedIdsCSV)) { log.info("got excluded ids: " + excludedIdsCSV); excludedIds = new HashSet<String>(Arrays.asList(StringUtils.split(excludedIdsCSV.trim(), ','))); } else { log.info("got no excluded ids"); } String maxFileSizeMBStr = context.getConfiguration().get(ImportWorkflowRuntimeParameters.IMPORT_CONTENT_MAX_FILE_SIZE_MB); if (maxFileSizeMBStr != null && !maxFileSizeMBStr.trim().isEmpty() <START> && !WorkflowRuntimeParameters.UNDEFINED_NONEMPTY_VALUE.equals(maxFileSizeMBStr)) { <END> this.maxFileSizeKB = 1024l * Integer.valueOf(maxFileSizeMBStr); } String processingTimeThresholdSecsStr = context.getConfiguration() .get(LOG_FAULT_PROCESSING_TIME_THRESHOLD_SECS); if (processingTimeThresholdSecsStr != null && !processingTimeThresholdSecsStr.trim().isEmpty() && !WorkflowRuntimeParameters.UNDEFINED_NONEMPTY_VALUE.equals(processingTimeThresholdSecsStr)) { this.processingTimeThreshold = 1000l * Integer.valueOf(processingTimeThresholdSecsStr); } mos = new MultipleOutputs(context); currentProgress = 0; intervalTime = System.currentTimeMillis(); }</code><technical_language>getParamValue, long changing this place (we do a static import instead), it</technical_language>

Target:
protected void setup(Context context) throws IOException, InterruptedException { namedOutputMeta = context.getConfiguration().get("output.meta"); if (namedOutputMeta == null || namedOutputMeta.isEmpty()) { throw new RuntimeException("no named output provided for metadata"); } namedOutputFault = context.getConfiguration().get("output.fault"); if (namedOutputFault == null || namedOutputFault.isEmpty()) { throw new RuntimeException("no named output provided for fault"); } String excludedIdsCSV = context.getConfiguration().get("excluded.ids"); if (excludedIdsCSV != null && !excludedIdsCSV.trim().isEmpty() && !WorkflowRuntimeParameters.UNDEFINED_NONEMPTY_VALUE.equals(excludedIdsCSV)) { log.info("got excluded ids: " + excludedIdsCSV); excludedIds = new HashSet<String>(Arrays.asList(StringUtils.split(excludedIdsCSV.trim(), ','))); } else { log.info("got no excluded ids"); } Integer processingTimeThresholdSecs = WorkflowRuntimeParameters.getIntegerParamValue( LOG_FAULT_PROCESSING_TIME_THRESHOLD_SECS, context.getConfiguration()); if (processingTimeThresholdSecs != null) { this.processingTimeThreshold = 1000l * processingTimeThresholdSecs; } mos = new MultipleOutputs(context); currentProgress = 0; intervalTime = System.currentTimeMillis(); }
Source:
<code>public void updateOvfData(List<StoragePool> storagePools) { log.info("Attempting to update VMs/Templates Ovf."); for (StoragePool pool : storagePools) { VdcReturnValueBase returnValueBase = performOvfUpdateForStoragePool(pool.getId()); if (!returnValueBase.getSucceeded()) { <START> log.errorFormat("Exception while trying to update or remove VMs/Templates ovf in Data Center {0}.", pool.getName()); <END> } if (ovfOnAnyDomainSupported(pool)) { log.infoFormat("Attempting to update ovfs in domain in Data Center {0}", pool.getName()); Set<Guid> domainsToUpdate = (Set<Guid>) returnValueBase.getActionReturnValue(); if (domainsToUpdate != null) { for (Guid id : domainsToUpdate) { performOvfUpdateForDomain(pool.getId(), id); } } } } }</code><technical_language>forgot add continue();</technical_language>

Target:
public void updateOvfData(List<StoragePool> storagePools) { log.info("Attempting to update VMs/Templates Ovf."); for (StoragePool pool : storagePools) { VdcReturnValueBase returnValueBase = performOvfUpdateForStoragePool(pool.getId()); if (!returnValueBase.getSucceeded()) { log.error("Exception while trying to update or remove VMs/Templates ovf in Data Center {0}.", pool.getName()); } if (ovfOnAnyDomainSupported(pool)) { log.info("Attempting to update ovfs in domain in Data Center {0}", pool.getName()); Set<Guid> domainsToUpdate = (Set<Guid>) returnValueBase.getActionReturnValue(); if (domainsToUpdate != null) { for (Guid id : domainsToUpdate) { performOvfUpdateForDomain(pool.getId(), id); } } else { log.error("Data Center {0} domains list for OVF update returned as NULL"); } } } }
Source:
<code>@Nullable public static <T> T getCallback(@NonNull Fragment fragment, @NonNull Class<T> callback) { if (callback.isInstance(fragment.getTargetFragment())) { return (T) fragment.getTargetFragment(); } <START> if (callback.isInstance(fragment.getFragmentManager().getFragments().get(0))) <END> { return (T) fragment.getFragmentManager().getFragments().get(0); } if (callback.isInstance(fragment.getActivity())) { return (T) fragment.getActivity(); } return null; }</code><technical_language>I I put a bug in OverhaulFragment child FragmentManager instead of getFragmentManager(). Please change ViewPager adapter instead: new NavTabViewPagerAdapter(getChildFragmentManager())</technical_language>

Target:
@Nullable public static <T> T getCallback(@NonNull Fragment fragment, @NonNull Class<T> callback) { if (callback.isInstance(fragment.getTargetFragment())) { return (T) fragment.getTargetFragment(); } if (callback.isInstance(fragment.getParentFragment())) { return (T) fragment.getParentFragment(); } if (callback.isInstance(fragment.getActivity())) { return (T) fragment.getActivity(); } return null; }
Source:
<code>public void shouldNotNotFailOnNotFoundUsernameTEST() throws Exception { <START> initializeInMemoryDatabase(); <END> executeDataSet(TEST_DATA); authenticate(); ForgotPasswordFormController controller = new ForgotPasswordFormController(); MockHttpServletRequest request = new MockHttpServletRequest(); request.setParameter("uname", "bruno"); request.setParameter("secretAnswer", "valid secret answer"); request.setMethod("POST"); HttpServletResponse response = new MockHttpServletResponse(); controller.handleRequest(request, response); Assert.assertEquals("what is your name bruno?", request.getAttribute("secretQuestion")); }</code><technical_language>This is done for super class extended</technical_language>

Target:
public void shouldNotNotFailOnNotFoundUsernameTEST() throws Exception { executeDataSet(TEST_DATA); ForgotPasswordFormController controller = (ForgotPasswordFormController) applicationContext.getBean("forgotPasswordForm"); MockHttpServletRequest request = new MockHttpServletRequest(); MockHttpServletResponse response = new MockHttpServletResponse(); request.setParameter("uname", "bruno"); request.setParameter("secretAnswer", "valid secret answer"); request.setMethod("POST"); controller.handleRequest(request, response); Assert.assertEquals("what is your name bruno?", request.getParameter("secretQuestion")); }
Source:
<code>protected boolean shouldIgnoreClass(Type type) { if (type instanceof Class) { Class<?> cls = (Class<?>) type; <START> if (cls.getName().equals("javax.ws.rs.ApiResponse")) { <END> return true; } } else { if (type instanceof com.fasterxml.jackson.core.type.ResolvedType) { com.fasterxml.jackson.core.type.ResolvedType rt = (com.fasterxml.jackson.core.type.ResolvedType) type; LOGGER.debug("Can't check class {}, {}", type, rt.getRawClass().getName()); if (rt.getRawClass().equals(Class.class)) { return true; } } } return false; }</code><technical_language>Guessing this changed in package renaming. this "javax.ws.rs.core.Response"</technical_language>

Target:
protected boolean shouldIgnoreClass(Type type) { if (type instanceof Class) { Class<?> cls = (Class<?>) type; if (cls.getName().equals("javax.ws.rs.Response")) { return true; } } else { if (type instanceof com.fasterxml.jackson.core.type.ResolvedType) { com.fasterxml.jackson.core.type.ResolvedType rt = (com.fasterxml.jackson.core.type.ResolvedType) type; LOGGER.debug("Can't check class {}, {}", type, rt.getRawClass().getName()); if (rt.getRawClass().equals(Class.class)) { return true; } } } return false; }
Source:
<code>private List<String> validate(JsonSchema jsonSchema, byte[] message) { List<String> errors = new ArrayList<>(); try { JsonNode messageNode = objectMapper.readTree(message); ProcessingReport report = jsonSchema.validateUnchecked(messageNode); for (Iterator<ProcessingMessage> iterator = report.iterator(); iterator.hasNext();) { errors.add(iterator.next().getMessage()); <START> } <END> } catch (IOException e) { LOGGER.warn("Error while deserializing message: " + new String(message), e); errors.add("Problem with message deserialization. Is this correct JSON format?"); } return errors; }</code><technical_language>This simplified report.forEach(processingMessage -> errors.add(processingMessage.getMessage()));</technical_language>

Target:
private List<String> validate(JsonSchema jsonSchema, byte[] message) { List<String> errors = new ArrayList<>(); try { JsonNode messageNode = objectMapper.readTree(message); ProcessingReport report = jsonSchema.validateUnchecked(messageNode); report.forEach(processingMessage -> errors.add(processingMessage.getMessage())); } catch (IOException e) { LOGGER.warn("Error while deserializing message: " + new String(message), e); errors.add("Problem with message deserialization. Is this correct JSON format?"); } return errors; }
Source:
<code>private void advanceLocation() { <START> ParticleEffect.FIREWORKS_SPARK.display(this.location, 8, Math.random() / 2, Math.random() / 2, Math.random() / 2, 0); <END> playCombustionSound(this.location); this.location = this.location.add(this.direction.clone().multiply(this.speedFactor)); }</code><technical_language>spice this a tad throw in another nice aesthetic change</technical_language>

Target:
private void advanceLocation() { ParticleEffect.FIREWORKS_SPARK.display(this.location, 2, .001, .001, .001, 0); ParticleEffect.CRIT.display(this.location, 3, Math.random() * 2, Math.random() * 2, Math.random() * 2, 0); playCombustionSound(this.location); this.location = this.location.add(this.direction.clone().multiply(this.speedFactor)); }
Source:
<code>protected void run() { for (;;) { try { processPendingChannelFlags(); int strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks()); switch (strategy) { case SelectStrategy.CONTINUE: continue; case SelectStrategy.BUSY_WAIT: strategy = epollBusyWait(); break; case SelectStrategy.SELECT: if (pendingWakeup) { strategy = epollWaitTimeboxed(); if (strategy != 0) { break; } pendingWakeup = false; if (hasTasks()) { break; } } <START> wakenUp.lazySet(0); <END> try { if (!hasTasks()) { strategy = epollWait(); } } finally { if (wakenUp.get() == 1 || wakenUp.getAndSet(1) == 1) { pendingWakeup = true; } } default: } final int ioRatio = this.ioRatio; if (ioRatio == 100) { try { if (strategy > 0) { processReady(events, strategy); } } finally { runAllTasks(); } } else { final long ioStartTime = System.nanoTime(); try { if (strategy > 0) { processReady(events, strategy); } } finally { final long ioTime = System.nanoTime() - ioStartTime; runAllTasks(ioTime * (100 - ioRatio) / ioRatio); } } if (allowGrowing && strategy == events.length()) { events.increase(); } } catch (Throwable t) { handleLoopException(t); } try { if (isShuttingDown()) { closeAll(); if (confirmShutdown()) { break; } } } catch (Throwable t) { handleLoopException(t); } } }</code><technical_language>lazySet safe based @njhill other day</technical_language>

Target:
protected void run() { for (;;) { try { processPendingChannelFlags(); int strategy = selectStrategy.calculateStrategy(selectNowSupplier, hasTasks()); switch (strategy) { case SelectStrategy.CONTINUE: continue; case SelectStrategy.BUSY_WAIT: strategy = epollBusyWait(); break; case SelectStrategy.SELECT: if (pendingWakeup) { strategy = epollWaitTimeboxed(); if (strategy != 0) { break; } logger.warn("Missed eventfd write (not seen after > 1 second)"); pendingWakeup = false; if (hasTasks()) { break; } } wakenUp.set(0); try { if (!hasTasks()) { strategy = epollWait(); } } finally { if (wakenUp.get() == 1 || wakenUp.getAndSet(1) == 1) { pendingWakeup = true; } } default: } final int ioRatio = this.ioRatio; if (ioRatio == 100) { try { if (strategy > 0) { processReady(events, strategy); } } finally { runAllTasks(); } } else { final long ioStartTime = System.nanoTime(); try { if (strategy > 0) { processReady(events, strategy); } } finally { final long ioTime = System.nanoTime() - ioStartTime; runAllTasks(ioTime * (100 - ioRatio) / ioRatio); } } if (allowGrowing && strategy == events.length()) { events.increase(); } } catch (Throwable t) { handleLoopException(t); } try { if (isShuttingDown()) { closeAll(); if (confirmShutdown()) { break; } } } catch (Throwable t) { handleLoopException(t); } } }
Source:
<code><START> public Collection<ReflogEntry> call() throws GitAPIException, Exception { <END> checkCallable(); try { ReflogReader reader = new ReflogReader(repo, ref); return reader.getReverseEntries(); } catch (IOException e) { throw new InvalidRefNameException(MessageFormat.format( JGitText.get().cannotRead, ref), e); } }</code><technical_language>declare throw generic Exception</technical_language>

Target:
public Collection<ReflogEntry> call() throws GitAPIException { checkCallable(); try { ReflogReader reader = new ReflogReader(repo, ref); return reader.getReverseEntries(); } catch (IOException e) { throw new InvalidRefNameException(MessageFormat.format( JGitText.get().cannotRead, ref), e); } }
Source:
<code>private void invoke(LockListener invoker) { LockState state = lockState; switch (state) { case WAITING: throw new IllegalStateException("WAITING is not a valid state to invoke the listener"); case ACQUIRED: case RELEASED: <START> invoker.onEvent(LockState.AVAILABLE); <END> break; default: invoker.onEvent(state); break; } }</code><technical_language>This weird me, listener receive actual state</technical_language>

Target:
private void invoke(LockListener invoker) { LockState state = lockState; switch (state) { case WAITING: throw new IllegalStateException("WAITING is not a valid state to invoke the listener"); case ACQUIRED: case RELEASED: invoker.onEvent(LockState.ACQUIRED); break; default: invoker.onEvent(state); break; } }
Source:
<code><START> private void initiateMastershipMigration(long nextSeqNo, AckingContainer ackingContainer) { <END> Preconditions.checkNotNull(ackingContainer, "Acking container must be not null."); Pair<Long, Long> gap = m_gapTracker.getFirstGap(); assert (gap != null && nextSeqNo >= gap.getFirst() && nextSeqNo <= gap.getSecond()); setPendingContainer(ackingContainer); if (m_seqNoToDrain > nextSeqNo - 1) { exportLog.info("Export data missing from current queue [" + gap.getFirst() + ", " + gap.getSecond() + "] from " + this.toString() + ". Searching other sites for missing data."); m_seqNoToDrain = nextSeqNo - 1; mastershipCheckpoint(nextSeqNo - 1); } }</code><technical_language>'startMastershipMigration' a shorter name</technical_language>

Target:
private void initiateMastershipMigration(long nextSeqNo, AckingContainer ackingContainer) { Preconditions.checkNotNull(ackingContainer, "Acking container must be not null."); Pair<Long, Long> gap = m_gapTracker.getFirstGap(); assert (gap != null && nextSeqNo >= gap.getFirst() && nextSeqNo <= gap.getSecond()); setPendingContainer(ackingContainer); exportLog.info("Export data missing from current queue [" + gap.getFirst() + ", " + gap.getSecond() + "] from " + this.toString() + ". Searching other sites for missing data."); migrateMastershipTo(null); }
Source:
<code>public String toString() { <START> StringJoiner joiner = new StringJoiner(", ", "SmartPay authorisation response (", ")"); <END> if (StringUtils.isNotBlank(getTransactionId())) { joiner.add("pspReference: " + getTransactionId()); } if (StringUtils.isNotBlank(result)) { joiner.add("resultCode: " + result); } if (StringUtils.isNotBlank(getErrorCode())) { joiner.add("faultcode: " + getErrorCode()); } if (StringUtils.isNotBlank(getErrorMessage())) { joiner.add("faultstring: " + getErrorMessage()); } return joiner.toString(); }</code><technical_language>this "SmartPay 3DS authorisation response"</technical_language>

Target:
public String toString() { StringJoiner joiner = new StringJoiner(", ", "SmartPay 3DS authorisation response (", ")"); if (StringUtils.isNotBlank(getTransactionId())) { joiner.add("pspReference: " + getTransactionId()); } if (StringUtils.isNotBlank(result)) { joiner.add("resultCode: " + result); } if (StringUtils.isNotBlank(getErrorCode())) { joiner.add("faultcode: " + getErrorCode()); } if (StringUtils.isNotBlank(getErrorMessage())) { joiner.add("faultstring: " + getErrorMessage()); } return joiner.toString(); }
Source:
<code>public static void fineTunePrivileges(Path path) throws IOException { <START> if (!OS_WINDOWS) Files.setPosixFilePermissions(path,getPermissionsMasks(NO_PATH_PRODIVED,path)); <END> }</code><technical_language>Instead of checking if Windows do like: FileSystems.getDefault().supportedFileAttributeViews().contains("posix")</technical_language>

Target:
public static void fineTunePrivileges(Path path) throws IOException { if (!OS_WINDOWS) Files.setPosixFilePermissions(path, getPermissionsMasks(path)); }