auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private Collection<LockComponent> getGlobalLocks(Configuration conf) { String lockNames = conf.get(ConfVars.HIVE_QUERY_EXCLUSIVE_LOCK.varname); if (StringUtils.isEmpty(lockNames)) { return Collections.emptyList(); } List<LockComponent> globalLocks = new ArrayList<LockComponent>(); <START> for (String lockName : lockNames.split(",")) { <END> lockName = lockName.trim(); if (StringUtils.isEmpty(lockName)) { continue; } LockComponentBuilder compBuilder = new LockComponentBuilder(); compBuilder.setExclusive(); compBuilder.setOperationType(DataOperationType.UPDATE); compBuilder.setDbName("__GLOBAL_LOCKS"); compBuilder.setTableName(lockName); globalLocks.add(compBuilder.build()); LOG.debug("Adding global lock: " + lockName); } return globalLocks; }</code><technical_language>end multiple locks for schedule query? case</technical_language>

Target:
private Collection<LockComponent> getGlobalLocks(Configuration conf) { String lockNames = conf.get(Constants.HIVE_QUERY_EXCLUSIVE_LOCK); if (StringUtils.isEmpty(lockNames)) { return Collections.emptyList(); } List<LockComponent> globalLocks = new ArrayList<LockComponent>(); for (String lockName : lockNames.split(",")) { lockName = lockName.trim(); if (StringUtils.isEmpty(lockName)) { continue; } LockComponentBuilder compBuilder = new LockComponentBuilder(); compBuilder.setExclusive(); compBuilder.setOperationType(DataOperationType.UPDATE); compBuilder.setDbName("__GLOBAL_LOCKS"); compBuilder.setTableName(lockName); globalLocks.add(compBuilder.build()); LOG.debug("Adding global lock: " + lockName); } return globalLocks; }
Source:
<code>public void setBarState(int state) { if (state != mState && mVisible && (state == StatusBarState.SHADE_LOCKED || (state == StatusBarState.SHADE && isGoingToNotificationShade()))) { clearNotificationEffects(); } if (state == StatusBarState.KEYGUARD) { removeRemoteInputEntriesKeptUntilCollapsed(); <START> } <END> mState = state; mGroupManager.setStatusBarState(state); mFalsingManager.setStatusBarState(state); mStatusBarWindowManager.setStatusBarState(state); updateDozing(); }</code><technical_language>add a maybeEscalateHeadsUp() if keyguard remove in screenOff, this safer ensures a heads keyguard</technical_language>

Target:
public void setBarState(int state) { if (state != mState && mVisible && (state == StatusBarState.SHADE_LOCKED || (state == StatusBarState.SHADE && isGoingToNotificationShade()))) { clearNotificationEffects(); } if (state == StatusBarState.KEYGUARD) { removeRemoteInputEntriesKeptUntilCollapsed(); maybeEscalateHeadsUp(); } mState = state; mGroupManager.setStatusBarState(state); mFalsingManager.setStatusBarState(state); mStatusBarWindowManager.setStatusBarState(state); updateDozing(); }
Source:
<code>X509Certificate getCertificate(String certSerialId) throws CertificateException; X509Certificate getCertificate(); boolean verifyCertificate(X509Certificate certificate); byte[] signDataStream(InputStream stream) throws CertificateException; byte[] signData(byte[] data) throws CertificateException; boolean verifySignature(InputStream stream, byte[] signature, X509Certificate cert) throws CertificateException; boolean verifySignature(byte[] data, byte[] signature, X509Certificate cert) throws CertificateException; CertificateSignRequest.Builder getCSRBuilder() throws CertificateException; X509Certificate queryCertificate(String query); <START> void storeCertificate(String pemEncodedCert, boolean force, boolean caCert) <END> throws CertificateException; void storeTrustChain(CertStore certStore) throws CertificateException; void storeTrustChain(List<X509Certificate> certificates) throws CertificateException; InitResponse init() throws CertificateException; enum InitResponse { SUCCESS, FAILURE, GETCERT, RECOVER }</code><technical_language>Adding a new interface method storeCACertificate() avoid unrelated changes</technical_language>

Target:
X509Certificate getCertificate(String certSerialId) throws CertificateException; X509Certificate getCertificate(); boolean verifyCertificate(X509Certificate certificate); byte[] signDataStream(InputStream stream) throws CertificateException; byte[] signData(byte[] data) throws CertificateException; boolean verifySignature(InputStream stream, byte[] signature, X509Certificate cert) throws CertificateException; boolean verifySignature(byte[] data, byte[] signature, X509Certificate cert) throws CertificateException; CertificateSignRequest.Builder getCSRBuilder() throws CertificateException; X509Certificate queryCertificate(String query); void storeCertificate(String pemEncodedCert, boolean force) throws CertificateException; void storeCertificate(String pemEncodedCert, boolean force, boolean caCert) throws CertificateException; void storeTrustChain(CertStore certStore) throws CertificateException; void storeTrustChain(List<X509Certificate> certificates) throws CertificateException; InitResponse init() throws CertificateException; enum InitResponse { SUCCESS, FAILURE, GETCERT, RECOVER }
Source:
<code>public static TripPlanListFragment newInstance(String city, String group, String season) { TripPlanListFragment tripPlanListFragment = new TripPlanListFragment(); Bundle args = new Bundle(); args.putString("city", city); args.putString("group", group); args.putString("season", season); tripPlanListFragment.setArguments(args); <START> TripPlanListFragment.city = city; <END> TripPlanListFragment.group = group; TripPlanListFragment.season = season; return tripPlanListFragment; }</code><technical_language>This is wrong, static fields (it's a problem for Fragment lifecycle). Please remove static ...and is done TripPlanDetailsFragment ..that's right way. non-static fields read onCreate methods ...like that: if (getArguments() != null) { mTripPLanObjectId = getArguments().getString(ARG_TRIP_PLAN_OBJECT_ID); }</technical_language>

Target:
public static TripPlanListFragment newInstance(String city, String group, String season) { TripPlanListFragment tripPlanListFragment = new TripPlanListFragment(); Bundle args = new Bundle(); args.putString("city", city); args.putString("group", group); args.putString("season", season); tripPlanListFragment.setArguments(args); return tripPlanListFragment; }
Source:
<code>private void avroAssertColumnTypes(QueryResult queryResult) { Connection connection = defaultQueryExecutor().getConnection(); if (usingPrestoJdbcDriver(connection)) { assertThat(queryResult).hasColumns( BIGINT, DOUBLE, BIGINT ); } <START> else if (usingTeradataJdbcDriver(connection)) { <END> assertThat(queryResult).hasColumns( BIGINT, DOUBLE, BIGINT ); } else { throw new IllegalStateException(); } }</code><technical_language>conditions same. combine</technical_language>

Target:
private void avroAssertColumnTypes(QueryResult queryResult) { Connection connection = defaultQueryExecutor().getConnection(); if (usingPrestoJdbcDriver(connection) || usingTeradataJdbcDriver(connection)) { assertThat(queryResult).hasColumns( BIGINT, DOUBLE, BIGINT ); } else { throw new IllegalStateException(); } }
Source:
<code>public List<String> getSuggestedNames(String queryString, int maxResults) throws GeoEntryQueryException { <START> LOGGER.debug("getSuggestedNames is not implemented for GeoNamesQueryLuceneDirectoryIndex"); <END> return Collections.emptyList(); }</code><technical_language>Do need expose implementation details? simply log implemented</technical_language>

Target:
public List<String> getSuggestedNames(String queryString, int maxResults) throws GeoEntryQueryException { LOGGER.debug("Suggestion query not implemented."); return Collections.emptyList(); }
Source:
<code>protected void initChannel(Channel ch) throws Exception { if (isSsl) { <START> ch.pipeline().addFirst("SSL Handler", this.buildClientSslContext().newHandler(ch.alloc())); <END> } final Http2FrameCodec http2FrameCodec = Http2FrameCodecBuilder.forClient() .initialSettings(Http2Settings.defaultSettings()) .build(); ch.pipeline().addLast("HTTP2 Frame Codec", http2FrameCodec); ch.pipeline().addLast("HTTP2 Multiplex Handler", new Http2MultiplexHandler(new SimpleChannelInboundHandler() { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) { } })); }</code><technical_language>in other examples inject SslContext if ssl build in main method. Consider this consistent</technical_language>

Target:
protected void initChannel(Channel ch) throws Exception { if (sslCtx != null) { ch.pipeline().addFirst(sslCtx.newHandler(ch.alloc())); } final Http2FrameCodec http2FrameCodec = Http2FrameCodecBuilder.forClient() .initialSettings(Http2Settings.defaultSettings()) .build(); ch.pipeline().addLast(http2FrameCodec); ch.pipeline().addLast(new Http2MultiplexHandler(new SimpleChannelInboundHandler() { @Override protected void channelRead0(ChannelHandlerContext ctx, Object msg) { } })); }
Source:
<code>private void setActiveTransferState(boolean active) { setTxtOriginEnabled(!active); if (active) { listOriginDataSource.setEnabled(false); btnOriginAction.setEnabled(false); btnSelectOrClearAllForms.setEnabled(false); btnTransfer.setEnabled(false); btnCancel.setEnabled(true); lblDownloading.setText(DOWNLOADING_DOT_ETC); lblDownloading.setForeground(lblOrigin.getForeground()); terminationFuture.reset(); } else { listOriginDataSource.setEnabled(true); btnOriginAction.setEnabled(true); btnSelectOrClearAllForms.setEnabled(true); <START> btnTransfer.setEnabled(formTransferTable.getSelectedForms().size() != 0); <END> btnCancel.setEnabled(false); lblDownloading.setText(DOWNLOADING_DOT_ETC); lblDownloading.setForeground(lblDownloading.getBackground()); } transferStateActive = active; }</code><technical_language>I building a consensus isEmpty is preferred</technical_language>

Target:
private void setActiveTransferState(boolean active) { setTxtOriginEnabled(!active); if (active) { listOriginDataSource.setEnabled(false); btnOriginAction.setEnabled(false); btnSelectOrClearAllForms.setEnabled(false); btnTransfer.setEnabled(false); btnCancel.setEnabled(true); lblDownloading.setText(DOWNLOADING_DOT_ETC); lblDownloading.setForeground(lblOrigin.getForeground()); terminationFuture.reset(); } else { listOriginDataSource.setEnabled(true); btnOriginAction.setEnabled(true); btnSelectOrClearAllForms.setEnabled(true); btnTransfer.setEnabled(!formTransferTable.getSelectedForms().isEmpty()); btnCancel.setEnabled(false); lblDownloading.setText(DOWNLOADING_DOT_ETC); lblDownloading.setForeground(lblDownloading.getBackground()); } transferStateActive = active; }
Source:
<code>public void shouldMergeTemplateIntoString() throws Exception { <START> when(settingsFacade.getRawConfig(CORRECT_TEMPLATE)).thenReturn(loadFile(CORRECT_TEMPLATE)); <END> String result = parser.mergeTemplateIntoString(CORRECT_TEMPLATE, params); verify(settingsFacade, times(1)).getRawConfig(CORRECT_TEMPLATE); verifyResult(result); }</code><technical_language>close stream (use try resource)</technical_language>

Target:
public void shouldMergeTemplateIntoString() throws Exception { try (FileInputStream template = loadFile(CORRECT_TEMPLATE)) { when(settingsFacade.getRawConfig(CORRECT_TEMPLATE)).thenReturn(template); String result = parser.mergeTemplateIntoString(CORRECT_TEMPLATE, params); verify(settingsFacade).getRawConfig(CORRECT_TEMPLATE); verifyResult(result); } }
Source:
<code>public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); <START> if (android.os.Build.VERSION.SDK_INT != android.os.Build.VERSION_CODES.KITKAT){ <END> if (!isCurrentlyLoading) { return; } } isCurrentlyLoading = false; LOG.d(TAG, "onPageFinished(" + url + ")"); if (this.doClearHistory) { view.clearHistory(); this.doClearHistory = false; } this.appView.loadUrlTimeout++; this.appView.postMessage("onPageFinished", url); if (this.appView.getVisibility() == View.INVISIBLE) { Thread t = new Thread(new Runnable() { public void run() { try { Thread.sleep(2000); cordova.getActivity().runOnUiThread(new Runnable() { public void run() { appView.postMessage("spinner", "stop"); } }); } catch (InterruptedException e) { } } }); t.start(); } if (url.equals("about:blank")) { appView.postMessage("exit", null); } }</code><technical_language>confirmed working Lollipop? If not, remove isCurrentlyLoading guard</technical_language>

Target:
public void onPageFinished(WebView view, String url) { super.onPageFinished(view, url); if (!isCurrentlyLoading && !url.startsWith("about:")) { return; } isCurrentlyLoading = false; LOG.d(TAG, "onPageFinished(" + url + ")"); if (this.doClearHistory) { view.clearHistory(); this.doClearHistory = false; } this.appView.loadUrlTimeout++; this.appView.postMessage("onPageFinished", url); if (this.appView.getVisibility() == View.INVISIBLE) { Thread t = new Thread(new Runnable() { public void run() { try { Thread.sleep(2000); cordova.getActivity().runOnUiThread(new Runnable() { public void run() { appView.postMessage("spinner", "stop"); } }); } catch (InterruptedException e) { } } }); t.start(); } if (url.equals("about:blank")) { appView.postMessage("exit", null); } }
Source:
<code>private void validateUnitsAreAmongAllowedConcepts(Errors errors, DrugOrder order) { OrderService orderService = Context.getOrderService(); if (order.getDoseUnits() != null) { List<Concept> drugDosingUnits = orderService.getDrugDosingUnits(); if (!drugDosingUnits.contains(order.getDoseUnits())) { errors.rejectValue("doseUnits", "DrugOrder.error.notAmongAllowedConcepts"); } } if (order.getQuantityUnits() != null) { List<Concept> drugDispensingUnits = orderService.getDrugDispensingUnits(); if (!drugDispensingUnits.contains(order.getQuantityUnits())) { errors.rejectValue("quantityUnits", "DrugOrder.error.notAmongAllowedConcepts"); } } if (order.getDurationUnits() != null) { List<Concept> drugDurationUnits = orderService.getDurationUnits(); if (!drugDurationUnits.contains(order.getDurationUnits())) { errors.rejectValue("durationUnits", "DrugOrder.error.notAmongAllowedConcepts"); } if (Duration.getCode(order.getDurationUnits()) == null) { <START> errors.rejectValue("durationUnits", "DrugOrder.error.durationUnitsNotMappedToSNOMED_CTDurationCode"); <END> } } if (order.getRoute() != null) { List<Concept> routes = orderService.getDrugRoutes(); if (!routes.contains(order.getRoute())) { errors.rejectValue("route", "DrugOrder.error.routeNotAmongAllowedConcepts"); } } }</code><technical_language>I capitalization DrugOrder.error.durationUnitsNotMappedToSnomedCtDurationCode</technical_language>

Target:
private void validateUnitsAreAmongAllowedConcepts(Errors errors, DrugOrder order) { OrderService orderService = Context.getOrderService(); if (order.getDoseUnits() != null) { List<Concept> drugDosingUnits = orderService.getDrugDosingUnits(); if (!drugDosingUnits.contains(order.getDoseUnits())) { errors.rejectValue("doseUnits", "DrugOrder.error.notAmongAllowedConcepts"); } } if (order.getQuantityUnits() != null) { List<Concept> drugDispensingUnits = orderService.getDrugDispensingUnits(); if (!drugDispensingUnits.contains(order.getQuantityUnits())) { errors.rejectValue("quantityUnits", "DrugOrder.error.notAmongAllowedConcepts"); } } if (order.getDurationUnits() != null) { List<Concept> drugDurationUnits = orderService.getDurationUnits(); if (!drugDurationUnits.contains(order.getDurationUnits())) { errors.rejectValue("durationUnits", "DrugOrder.error.notAmongAllowedConcepts"); } if (Duration.getCode(order.getDurationUnits()) == null) { errors.rejectValue("durationUnits", "DrugOrder.error.durationUnitsNotMappedToSnomedCtDurationCode"); } } if (order.getRoute() != null) { List<Concept> routes = orderService.getDrugRoutes(); if (!routes.contains(order.getRoute())) { errors.rejectValue("route", "DrugOrder.error.routeNotAmongAllowedConcepts"); } } }
Source:
<code>protected User authenticateUser(String requestBody) { PutMethod put = new PutMethod(Joiner.on("/").join(zeppelinhubUrl, USER_LOGIN_API_ENDPOINT)); String responseBody = StringUtils.EMPTY; String userSession = StringUtils.EMPTY; try { put.setRequestEntity(new StringRequestEntity(requestBody, JSON_CONTENT_TYPE, UTF_8_ENCODING)); int statusCode = httpClient.executeMethod(put); if (statusCode != HttpStatus.SC_OK) { LOG.error("Cannot login user, HTTP status code is instead on 200 (OK)", statusCode); put.releaseConnection(); throw new AuthenticationException("Couldnt login to ZeppelinHub. " + "Login or password incorrect"); } responseBody = put.getResponseBodyAsString(); userSession = put.getResponseHeader(USER_SESSION_HEADER).getValue(); put.releaseConnection(); } catch (IOException e) { LOG.error("Cannot login user", e); throw new AuthenticationException(e.getMessage()); } User account = null; try { account = gson.fromJson(responseBody, User.class); } catch (JsonParseException e) { LOG.error("Cannot deserialize ZeppelinHub response to User instance", e); throw new AuthenticationException("Cannot login to ZeppelinHub"); } HashSet<String> userAndRoles = new HashSet<String>(); userAndRoles.add(account.login); ZeppelinServer.notebookWsServer.broadcastReloadedNoteList( new org.apache.zeppelin.user.AuthenticationInfo(account.login), userAndRoles); <START> UserSessionContainer.instance.setSession(account.login, userSession); <END> return account; }</code><technical_language>i this setSession lines above, right catch statement, broadcastReloadedNoteList called require</technical_language>

Target:
protected User authenticateUser(String requestBody) { PutMethod put = new PutMethod(Joiner.on("/").join(zeppelinhubUrl, USER_LOGIN_API_ENDPOINT)); String responseBody = StringUtils.EMPTY; String userSession = StringUtils.EMPTY; try { put.setRequestEntity(new StringRequestEntity(requestBody, JSON_CONTENT_TYPE, UTF_8_ENCODING)); int statusCode = httpClient.executeMethod(put); if (statusCode != HttpStatus.SC_OK) { LOG.error("Cannot login user, HTTP status code is instead on 200 (OK)", statusCode); put.releaseConnection(); throw new AuthenticationException("Couldnt login to ZeppelinHub. " + "Login or password incorrect"); } responseBody = put.getResponseBodyAsString(); userSession = put.getResponseHeader(USER_SESSION_HEADER).getValue(); put.releaseConnection(); } catch (IOException e) { LOG.error("Cannot login user", e); throw new AuthenticationException(e.getMessage()); } User account = null; try { account = gson.fromJson(responseBody, User.class); } catch (JsonParseException e) { LOG.error("Cannot deserialize ZeppelinHub response to User instance", e); throw new AuthenticationException("Cannot login to ZeppelinHub"); } UserSessionContainer.instance.setSession(account.login, userSession); HashSet<String> userAndRoles = new HashSet<String>(); userAndRoles.add(account.login); ZeppelinServer.notebookWsServer.broadcastReloadedNoteList( new org.apache.zeppelin.user.AuthenticationInfo(account.login), userAndRoles); return account; }
Source:
<code>public void onMapReady(@NonNull MapboxMap mapboxMap) { mapboxMap.setStyle(new Style.Builder().fromUri(Style.SATELLITE_STREETS) .withSource(new GeoJsonSource(CIRCLE_GEOJSON_SOURCE_ID)) .withSource(new GeoJsonSource(LINE_GEOJSON_SOURCE_ID)), new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { <START> MultipleGeometriesDirectionsRouteActivity.this.mapboxMap = mapboxMap; <END> initDirectionsRouteLineLayer(style); initDirectionStepsCircleLayer(style); initDirectionStepsBackgroundCircleLayer(style); getRoute(origin, destination); } }); }</code><technical_language>moved onMapReady instead, avoids needing do MultipleGeometriesDirectionsRouteActivity.this</technical_language>

Target:
public void onMapReady(@NonNull MapboxMap mapboxMap) { this.mapboxMap = mapboxMap; mapboxMap.setStyle(new Style.Builder().fromUri(Style.SATELLITE_STREETS) .withSource(new GeoJsonSource(CIRCLE_GEOJSON_SOURCE_ID)) .withSource(new GeoJsonSource(LINE_GEOJSON_SOURCE_ID)), new Style.OnStyleLoaded() { @Override public void onStyleLoaded(@NonNull Style style) { initLineLayerForDirectionsRoute(style); initStepManeuverCircleLayer(style); initStepManeuverBackgroundCircleLayer(style); getRoute(origin, destination); mapboxMap.addOnMapClickListener(MultipleGeometriesDirectionsRouteActivity.this); Toast.makeText(MultipleGeometriesDirectionsRouteActivity.this, getString(R.string.tap_on_map_to_change_destination), Toast.LENGTH_SHORT).show(); } }); }
Source:
<code>public SubPlan createSubPlans(Session session, Metadata metadata, NodePartitioningManager nodePartitioningManager, Plan plan, boolean forceSingleNode) { Fragmenter fragmenter = new Fragmenter(session, metadata, plan.getTypes()); FragmentProperties properties = new FragmentProperties(new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), plan.getRoot().getOutputSymbols())); if (forceSingleNode || isForceSingleNodeOutput(session)) { properties = properties.setSingleNodeDistribution(); } PlanNode root = SimplePlanRewriter.rewriteWith(fragmenter, plan.getRoot(), properties); SubPlan subPlan = fragmenter.buildRootFragment(root, properties); subPlan = analyzeGroupedExecution(session, metadata, nodePartitioningManager, subPlan); checkState(!isForceSingleNodeOutput(session) || subPlan.getFragment().getPartitioning().isSingleNode(), "Root of PlanFragment is not single node"); <START> sanityCheckFragmentedPlan(subPlan, SystemSessionProperties.getQueryMaxStageCount(session)); <END> return subPlan; }</code><technical_language>static import</technical_language>

Target:
public SubPlan createSubPlans(Session session, Metadata metadata, NodePartitioningManager nodePartitioningManager, Plan plan, boolean forceSingleNode) { Fragmenter fragmenter = new Fragmenter(session, metadata, plan.getTypes()); FragmentProperties properties = new FragmentProperties(new PartitioningScheme(Partitioning.create(SINGLE_DISTRIBUTION, ImmutableList.of()), plan.getRoot().getOutputSymbols())); if (forceSingleNode || isForceSingleNodeOutput(session)) { properties = properties.setSingleNodeDistribution(); } PlanNode root = SimplePlanRewriter.rewriteWith(fragmenter, plan.getRoot(), properties); SubPlan subPlan = fragmenter.buildRootFragment(root, properties); subPlan = analyzeGroupedExecution(session, metadata, nodePartitioningManager, subPlan); checkState(!isForceSingleNodeOutput(session) || subPlan.getFragment().getPartitioning().isSingleNode(), "Root of PlanFragment is not single node"); sanityCheckFragmentedPlan(subPlan, getQueryMaxStageCount(session)); return subPlan; }
Source:
<code>public static Uri compatUriFromFile(@NonNull final ReactContext context, @NonNull final File file) { compileAuthorities(context); String existingAuthority = Uri.fromFile(file).getAuthority(); if (!TextUtils.isEmpty(existingAuthority) && authorities.contains(existingAuthority)) { return Uri.fromFile(file); } if (file.getAbsolutePath().startsWith("content://")) { return Uri.fromFile(file); } Uri result = null; for (int i = 0; i < authorities.size(); i++) { try { String authority = authorities.get(i); result = FileProvider.getUriForFile(context, authority, file); if (result != null) { break; } } catch (Exception e) { <START> System.out.println("ERROR " + e.getMessage()); <END> } } return result; }</code><technical_language>This some prefix indicating from, e.g. suggestion System.out.println("RNSharePathUtil::compatUriFromFile ERROR " + e.getMessage());</technical_language>

Target:
public static Uri compatUriFromFile(@NonNull final ReactContext context, @NonNull final File file) { compileAuthorities(context); String existingAuthority = Uri.fromFile(file).getAuthority(); if (!TextUtils.isEmpty(existingAuthority) && authorities.contains(existingAuthority)) { return Uri.fromFile(file); } if (file.getAbsolutePath().startsWith("content://")) { return Uri.fromFile(file); } Uri result = null; for (int i = 0; i < authorities.size(); i++) { try { String authority = authorities.get(i); result = FileProvider.getUriForFile(context, authority, file); if (result != null) { break; } } catch (Exception e) { System.out.println("RNSharePathUtil::compatUriFromFile ERROR " + e.getMessage()); } } return result; }
Source:
<code>public ExtMap queryUsers(ExtMap input, ExtMap output, long pageSize) { LdapQueryData queryData = new LdapQueryDataImpl(); queryData.setLdapQueryType(LdapQueryType.searchUsers); queryData.setDomain(getDirectoryName()); queryData.setFilterParameters(new Object[] { generateQueryString(input) }); LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.SearchUserByQuery, new LdapSearchByQueryParameters(configuration, null, getDirectoryName(), queryData, <START> input.<Integer> get(Authz.InvokeKeys.QUERY_FLAGS, Authz.QueryFlags.RESOLVE_GROUPS_NONE) != Authz.QueryFlags.RESOLVE_GROUPS_NONE <END> ) ); List<LdapUser> ldapUsers = (List<LdapUser>) ldapResult.getReturnValue(); List<ExtMap> results = new ArrayList<>(); int addedUsers = 0; for (LdapUser ldapUser : ldapUsers) { if (addedUsers++ < pageSize) { results.add(mapLdapUser(ldapUser)); } } return output.mput(Authz.InvokeKeys.QUERY_RESULT, results); }</code><technical_language>.. ready for new flags. comparing 0 means nothing. RESOLVE_GROUPS set if recursive need check this flags in case</technical_language>

Target:
public ExtMap queryUsers(ExtMap input, ExtMap output, long pageSize) { LdapQueryData queryData = new LdapQueryDataImpl(); queryData.setLdapQueryType(LdapQueryType.searchUsers); queryData.setDomain(getDirectoryName()); queryData.setFilterParameters(new Object[] { generateQueryString(input) }); LdapReturnValueBase ldapResult = broker.runAdAction( AdActionType.SearchUserByQuery, new LdapSearchByQueryParameters(configuration, null, getDirectoryName(), queryData, (input.<Integer> get(Authz.InvokeKeys.QUERY_FLAGS, Authz.QueryFlags.RESOLVE_GROUPS_NONE) & Authz.QueryFlags.RESOLVE_GROUPS) !=0 ) ); List<LdapUser> ldapUsers = (List<LdapUser>) ldapResult.getReturnValue(); List<ExtMap> results = new ArrayList<>(); int addedUsers = 0; for (LdapUser ldapUser : ldapUsers) { if (addedUsers++ < pageSize) { results.add(mapLdapUser(ldapUser)); } } return output.mput(Authz.InvokeKeys.QUERY_RESULT, results); }
Source:
<code>public NewCpdTokens newCpdTokens() { <START> if (analysisMode.isIssues() || branchConfiguration.isShortLivingBranch() || branchConfiguration.isPullRequest()) { <END> return NO_OP_NEW_CPD_TOKENS; } return new DefaultCpdTokens(config, sensorStorage); }</code><technical_language>a helper method in branchConfiguration good encapsulate condition branchConfiguration.isShortLivingBranch() || branchConfiguration.isPullRequest(). I good ideas for name. about: isShortLivingMode()</technical_language>

Target:
public NewCpdTokens newCpdTokens() { if (analysisMode.isIssues() || branchConfiguration.isShortOrPullRequest()) { return NO_OP_NEW_CPD_TOKENS; } return new DefaultCpdTokens(config, sensorStorage); }
Source:
<code>public BaseDto<BasePaginationDataDto<UserItemDataDto>> findAllUser(String loginName, String email, String mobile, Date beginTime, Date endTime, Source source, RoleStage roleStage, String referrerMobile, String channel, UserOperation userOperation, Integer index, Integer pageSize) { BaseDto<BasePaginationDataDto<UserItemDataDto>> baseDto = new BaseDto<>(); List<UserView> userViews = userMapperConsole.findAllUser(loginName, email, mobile, beginTime, endTime, source, roleStage, referrerMobile, channel, userOperation, (index - 1) * pageSize, pageSize); List<UserItemDataDto> userItems = Lists.newArrayList(); for (UserView userView : userViews) { UserItemDataDto userItemDataDto = new UserItemDataDto(userView); List<UserRoleModel> userRoleModels = userRoleMapper.findByLoginName(userView.getLoginName()); <START> userRoleModels = userRoleModels.stream().filter(userRoleModel -> { <END> return userRoleModel.getRole() != Role.INVESTOR && userRoleModel.getRole() != Role.LOANER; }).collect(Collectors.toList()); userItemDataDto.setUserRoles(userRoleModels); String taskId = OperationType.USER + "-" + userView.getLoginName(); userItemDataDto.setModify(redisWrapperClient.hexistsSeri(TaskConstant.TASK_KEY + Role.OPERATOR_ADMIN, taskId)); userItems.add(userItemDataDto); } int count = userMapperConsole.findAllUserCount(loginName, email, mobile, beginTime, endTime, source, roleStage, referrerMobile, channel, userOperation); BasePaginationDataDto<UserItemDataDto> basePaginationDataDto = new BasePaginationDataDto<>(index, pageSize, count, userItems); basePaginationDataDto.setStatus(true); baseDto.setData(basePaginationDataDto); return baseDto; }</code><technical_language>remove</technical_language>

Target:
public BaseDto<BasePaginationDataDto<UserItemDataDto>> findAllUser(String loginName, String email, String mobile, Date beginTime, Date endTime, Source source, RoleStage roleStage, String referrerMobile, String channel, UserOperation userOperation, Integer index, Integer pageSize) { BaseDto<BasePaginationDataDto<UserItemDataDto>> baseDto = new BaseDto<>(); List<UserView> userViews = userMapperConsole.findAllUser(loginName, email, mobile, beginTime, endTime, source, roleStage, referrerMobile, channel, userOperation, (index - 1) * pageSize, pageSize); List<UserItemDataDto> userItems = Lists.newArrayList(); for (UserView userView : userViews) { UserItemDataDto userItemDataDto = new UserItemDataDto(userView); List<UserRoleModel> userRoleModels = userRoleMapper.findByLoginName(userView.getLoginName()); userItemDataDto.setUserRoles(userRoleModels); String taskId = OperationType.USER + "-" + userView.getLoginName(); userItemDataDto.setModify(redisWrapperClient.hexistsSeri(TaskConstant.TASK_KEY + Role.OPERATOR_ADMIN, taskId)); userItems.add(userItemDataDto); } int count = userMapperConsole.findAllUserCount(loginName, email, mobile, beginTime, endTime, source, roleStage, referrerMobile, channel, userOperation); BasePaginationDataDto<UserItemDataDto> basePaginationDataDto = new BasePaginationDataDto<>(index, pageSize, count, userItems); basePaginationDataDto.setStatus(true); baseDto.setData(basePaginationDataDto); return baseDto; }
Source:
<code>public static FilterExpression replaceMilestoneAliases(IModel model, FilterExpression expr) { List<String> repoIds = getMetaQualifierContent(expr, QualifierType.REPO).stream() .map(String::toLowerCase) .collect(Collectors.toList()); if (repoIds.isEmpty()) { repoIds.add(model.getDefaultRepo().toLowerCase()); } List<TurboMilestone> allMilestones = model.getMilestones().stream() .filter(ms -> ms.getDueDate().isPresent()) .filter(ms -> repoIds.contains(ms.getRepoId().toLowerCase())) .sorted((a, b) -> getMilestoneDueDateComparator().compare(a, b)) .collect(Collectors.toList()); List<TurboMilestone> openMilestones = model.getMilestones().stream() .filter(ms -> ms.isOpen()) .collect(Collectors.toList()); if (openMilestones.size() == 1 && !openMilestones.get(0).getDueDate().isPresent()) { allMilestones.addAll(openMilestones); <START> } <END> Optional<Integer> currentMilestoneIndex = getCurrentMilestoneIndex(allMilestones); if (!currentMilestoneIndex.isPresent()) { return expr; } return expr.map(q -> { if (Qualifier.isMilestoneQualifier(q)) { return q.convertMilestoneAliasQualifier(allMilestones, currentMilestoneIndex.get()); } else { return q; } }); }</code><technical_language>Do need this? Besides, this code belongs in this method. i.e. method more thing</technical_language>

Target:
public static FilterExpression replaceMilestoneAliases(IModel model, FilterExpression expr) { List<String> repoIds = getMetaQualifierContent(expr, QualifierType.REPO).stream() .map(String::toLowerCase) .collect(Collectors.toList()); if (repoIds.isEmpty()) { repoIds.add(model.getDefaultRepo().toLowerCase()); } List<TurboMilestone> milestonesOfReposInPanel = TurboMilestone.filterMilestonesOfRepos( model.getMilestones(), repoIds); List<TurboMilestone> aliasableMilestones = getAliasableMilestones(milestonesOfReposInPanel); Map<Integer, TurboMilestone> milestoneAliasIndex = getMilestoneAliasIndex(aliasableMilestones); if (milestoneAliasIndex.isEmpty()) { return expr; } return expr.map(q -> { if (Qualifier.isMilestoneQualifier(q)) { return q.convertMilestoneAliasQualifier(milestoneAliasIndex); } else { return q; } }); }
Source:
<code>public static String[] tokenizeClassName(final String className) { <START> String[] result = new String[0]; <END> if (className != null) { result = JAVA_SEPERATOR_PATTERN.split(className); } return result; }</code><technical_language>initialize in else block</technical_language>

Target:
public static String[] tokenizeClassName(final String className) { return JAVA_SEPARATOR_PATTERN.split(notNull(className)); }
Source:
<code>public void testSimpleInsertion() { final SAMRecordSetBuilder builder = getRecordBuilder(); final int startPosition = 165; for(int i = 0; i < coverage; i++) { builder.addFrag("record"+i, 0, startPosition, true, false, "30M3I3M", null, 10); } final int insStart = 194; for (final boolean incIndels : new boolean[]{false, true}){ final SamLocusIterator sli = createSamLocusIterator(builder); sli.setIncludeIndels(incIndels); int pos = startPosition; for (final SamLocusIterator.LocusInfo li : sli) { Assert.assertEquals(li.getPosition(), pos++); Assert.assertEquals(li.getRecordAndPositions().size(), coverage); Assert.assertEquals(li.getDeletedInRecord().size(), 0); <START> if(incIndels && li.getPosition() == insStart) { <END> Assert.assertEquals(li.getInsertedInRecord().size(), coverage, "Tracking indels: "+incIndels+". At "+li.toString()); } else { Assert.assertEquals(li.getInsertedInRecord().size(), 0, "Tracking indels: "+incIndels+". At "+li.toString()); } } } }</code><technical_language>if (</technical_language>

Target:
public void testSimpleInsertion() { final SAMRecordSetBuilder builder = getRecordBuilder(); final int startPosition = 165; for (int i = 0; i < coverage; i++) { builder.addFrag("record" + i, 0, startPosition, true, false, "30M3I3M", null, 10); } final int insStart = 194; for (final boolean incIndels : new boolean[] {false, true}) { final SamLocusIterator sli = createSamLocusIterator(builder); sli.setIncludeIndels(incIndels); int pos = startPosition; for (final SamLocusIterator.LocusInfo li : sli) { Assert.assertEquals(li.getPosition(), pos++); Assert.assertEquals(li.getRecordAndPositions().size(), coverage); Assert.assertEquals(li.getDeletedInRecord().size(), 0); if (incIndels && li.getPosition() == insStart) { Assert.assertEquals(li.getInsertedInRecord().size(), coverage); } else { Assert.assertEquals(li.getInsertedInRecord().size(), 0); } } } }
Source:
<code>private Object extractContent(MimeMessage message, Map<String, Object> headers) { Object content; try { content = message.getContent(); if (content instanceof String) { <START> String mailContentType = (String) headers.get(MailHeaders.CONTENT_TYPE); <END> if (mailContentType != null && mailContentType.startsWith("text")) { headers.put(MessageHeaders.CONTENT_TYPE, mailContentType); } else { headers.put(MessageHeaders.CONTENT_TYPE, "text/plain"); } } else if (content instanceof InputStream) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); FileCopyUtils.copy((InputStream) content, baos); content = byteArrayToContent(headers, baos); } else if (content instanceof Multipart && this.embeddedPartsAsBytes) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ((Multipart) content).writeTo(baos); content = byteArrayToContent(headers, baos); } else if (content instanceof Part && this.embeddedPartsAsBytes) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ((Part) content).writeTo(baos); content = byteArrayToContent(headers, baos); } return content; } catch (Exception e) { throw new org.springframework.messaging.MessagingException("Failed to extract content from " + message, e); } }</code><technical_language>missed here... I MailHeaders.CONTENT_TYPE in DefaultMailHeaderMapper. a simple omission? fix merge</technical_language>

Target:
private Object extractContent(MimeMessage message, Map<String, Object> headers) { Object content; try { content = message.getContent(); if (content instanceof String) { String mailContentType = (String) headers.get(MailHeaders.CONTENT_TYPE); if (mailContentType != null && mailContentType.toLowerCase().startsWith("text")) { headers.put(MessageHeaders.CONTENT_TYPE, mailContentType); } else { headers.put(MessageHeaders.CONTENT_TYPE, "text/plain"); } } else if (content instanceof InputStream) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); FileCopyUtils.copy((InputStream) content, baos); content = byteArrayToContent(headers, baos); } else if (content instanceof Multipart && this.embeddedPartsAsBytes) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ((Multipart) content).writeTo(baos); content = byteArrayToContent(headers, baos); } else if (content instanceof Part && this.embeddedPartsAsBytes) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); ((Part) content).writeTo(baos); content = byteArrayToContent(headers, baos); } return content; } catch (Exception e) { throw new org.springframework.messaging.MessagingException("Failed to extract content from " + message, e); } }
Source:
<code>public void configure(ReadableConfig configuration, ClassLoader classLoader) { configuration.getOptional(StreamPipelineOptions.TIME_CHARACTERISTIC) .ifPresent(this::setStreamTimeCharacteristic); Optional.ofNullable(loadStateBackend(configuration, classLoader)) .ifPresent(this::setStateBackend); configuration.getOptional(PipelineOptions.OPERATOR_CHAINING) .ifPresent(c -> this.isChainingEnabled = c); configuration.getOptional(ExecutionOptions.BUFFER_TIMEOUT) .ifPresent(t -> this.setBufferTimeout(t.toMillis())); configuration.getOptional(PipelineOptions.CACHED_FILES) .ifPresent(f -> { this.cacheFile.clear(); this.cacheFile.addAll(DistributedCache.parseCachedFilesFromString(f)); }); config.configure(configuration, classLoader); checkpointCfg.configure(configuration); configuration.getOptional(ExecutionOptions.JOB_LISTENERS) .ifPresent(l -> { for (String listener : l) { <START> try { <END> Class<? extends JobListener> clazz = Class.forName(listener, true, classLoader) .asSubclass(JobListener.class); jobListeners.add(clazz.newInstance()); } catch (Throwable t) { throw new RuntimeException("Could not load JobListener : " + listener, t); } } }); }</code><technical_language>method InstantiationUtil#instantiate(final String className, final Class<T> targetType, final ClassLoader classLoader)</technical_language>

Target:
public void configure(ReadableConfig configuration, ClassLoader classLoader) { configuration.getOptional(StreamPipelineOptions.TIME_CHARACTERISTIC) .ifPresent(this::setStreamTimeCharacteristic); Optional.ofNullable(loadStateBackend(configuration, classLoader)) .ifPresent(this::setStateBackend); configuration.getOptional(PipelineOptions.OPERATOR_CHAINING) .ifPresent(c -> this.isChainingEnabled = c); configuration.getOptional(ExecutionOptions.BUFFER_TIMEOUT) .ifPresent(t -> this.setBufferTimeout(t.toMillis())); configuration.getOptional(PipelineOptions.CACHED_FILES) .ifPresent(f -> { this.cacheFile.clear(); this.cacheFile.addAll(DistributedCache.parseCachedFilesFromString(f)); }); config.configure(configuration, classLoader); checkpointCfg.configure(configuration); configuration.getOptional(DeploymentOptions.JOB_LISTENERS) .ifPresent(l -> { for (String listener : l) { JobListener jobListener; try { jobListener = InstantiationUtil.instantiate( listener, JobListener.class, classLoader); jobListeners.add(jobListener); } catch (FlinkException e) { throw new RuntimeException("Could not load JobListener : " + listener, e); } } }); }
Source:
<code>private static void serializePrimitive(Type type, BlockBuilder builder, Object object) { requireNonNull(builder, "builder is null"); if (object == null) { builder.appendNull(); return; } if (type.equals(BOOLEAN)) { type.writeBoolean(builder, (Boolean) object); } else if (type.equals(BIGINT)) { type.writeLong(builder, (Long) object); } else if (type.equals(DOUBLE)) { type.writeDouble(builder, (Double) object); } else if (type.equals(INTEGER)) { type.writeLong(builder, (Integer) object); } else if (type.equals(VARCHAR) || type.equals(VARBINARY)) { type.writeSlice(builder, utf8Slice(object.toString())); } else { throw new IllegalArgumentException("Unknown primitive type: " + type.getDisplayName()); } return; <START> } <END></code><technical_language>remove</technical_language>

Target:
private static void serializePrimitive(Type type, BlockBuilder builder, Object object) { requireNonNull(builder, "builder is null"); if (object == null) { builder.appendNull(); return; } if (type.equals(BOOLEAN)) { type.writeBoolean(builder, (Boolean) object); } else if (type.equals(BIGINT)) { type.writeLong(builder, (Long) object); } else if (type.equals(DOUBLE)) { type.writeDouble(builder, (Double) object); } else if (type.equals(INTEGER)) { type.writeLong(builder, (Integer) object); } else if (type.equals(VARCHAR) || type.equals(VARBINARY)) { type.writeSlice(builder, utf8Slice(object.toString())); } else { throw new IllegalArgumentException("Unknown primitive type: " + type.getDisplayName()); } }
Source:
<code>public ScsiController build() { <START> disks(disks() != null ? ImmutableList.copyOf(disks()) : new ArrayList<ScsiDisk>()); <END> return autoBuild(); }</code><technical_language>Enforce immutable list in cases</technical_language>

Target:
public ScsiController build() { disks(disks() != null ? ImmutableList.copyOf(disks()) : null); return autoBuild(); }
Source:
<code>public List<BasicEntityRecord> getEntityRecordsFromLookup(Long entityId, String lookupName, Map<String, Object> lookupMap, QueryParams queryParams) { EntityDto entity = getEntity(entityId); validateCredentialsForReading(entity); LookupDto lookup = getLookupByName(entityId, lookupName); List<FieldDto> fields = entityService.getEntityFieldsForUI(entityId); Map<String, FieldDto> fieldMap = entityService.getLookupFieldsMapping(entityId, lookupName); MotechDataService service = getServiceForEntity(entity); <START> String lookupExceptionMessageKey = "mds.error.lookupExecError"; <END> try { LookupExecutor lookupExecutor = new LookupExecutor(service, lookup, fieldMap); Object result = lookupExecutor.execute(lookupMap, queryParams); if (lookup.isSingleObjectReturn()) { BasicEntityRecord record = instanceToBasicRecord(result, entity, fields, service, EntityType.STANDARD, getRelatedEntitiesFields(fields)); return (record == null) ? new ArrayList<BasicEntityRecord>() : Collections.singletonList(record); } else { List instances = (List) result; return instancesToBasicRecords(instances, entity, fields, service, EntityType.STANDARD); } } catch (LookupExecutorException e) { if (e.getMessageKey() != null) { throw new LookupExecutionException(e, e.getMessageKey()); } else { throw new LookupExecutionException(e, lookupExceptionMessageKey); } } catch (RuntimeException e) { throw new LookupExecutionException(e, lookupExceptionMessageKey); } }</code><technical_language>a constant of this class in places need this</technical_language>

Target:
public List<BasicEntityRecord> getEntityRecordsFromLookup(Long entityId, String lookupName, Map<String, Object> lookupMap, QueryParams queryParams) { EntityDto entity = getEntity(entityId); validateCredentialsForReading(entity); LookupDto lookup = getLookupByName(entityId, lookupName); List<FieldDto> fields = entityService.getEntityFieldsForUI(entityId); Map<String, FieldDto> fieldMap = entityService.getLookupFieldsMapping(entityId, lookupName); MotechDataService service = getServiceForEntity(entity); try { LookupExecutor lookupExecutor = new LookupExecutor(service, lookup, fieldMap); Object result = lookupExecutor.execute(lookupMap, queryParams); if (lookup.isSingleObjectReturn()) { BasicEntityRecord record = instanceToBasicRecord(result, entity, fields, service, EntityType.STANDARD, getRelatedEntitiesFields(fields)); return (record == null) ? new ArrayList<BasicEntityRecord>() : Collections.singletonList(record); } else { List instances = (List) result; return instancesToBasicRecords(instances, entity, fields, service, EntityType.STANDARD); } } catch (LookupExecutorException e) { if (e.getMessageKey() != null) { throw new LookupExecutionException(e, e.getMessageKey()); } else { throw new LookupExecutionException(e, LOOKUP_EXCEPTION_MESSAGE_KEY); } } catch (RuntimeException e) { throw new LookupExecutionException(e, LOOKUP_EXCEPTION_MESSAGE_KEY); } }
Source:
<code>private void setup() { setPrefColumnCount(30); validationSupport.registerValidator(this, (c, newValue) -> { <START> boolean isValidFilter = true; <END> try { Parser.parse(getText()); setStyleForValidFilter(); } catch (ParseException e) { isValidFilter = false; setStyleForInvalidFilter(); } return ValidationResult.fromErrorIf(this, "Parse error", !isValidFilter); }); setOnKeyTyped(e -> { boolean isModifierKeyPress = e.isAltDown() || e.isMetaDown() || e.isControlDown(); String key = e.getCharacter(); if (key == null || key.isEmpty() || isModifierKeyPress) { return; } char typed = e.getCharacter().charAt(0); if (typed == '\t') { e.consume(); if (!getSelectedText().isEmpty()) { confirmCompletion(); } } else if (Character.isAlphabetic(typed) && shouldStartCompletion()) { startCompletion(e); } }); setOnKeyPressed(e -> { if (e.getCode() == KeyCode.TAB) { e.consume(); } }); setOnKeyReleased(e -> { e.consume(); if (e.getCode() == KeyCode.ENTER) { confirmEdit(); } else if (e.getCode() == KeyCode.ESCAPE) { if (getText().equals(previousText)) { cancel.run(); } else { revertEdit(); } } }); }</code><technical_language>reason for this change</technical_language>

Target:
private void setup() { setPrefColumnCount(30); validationSupport.registerValidator(this, (c, newValue) -> { boolean wasError = false; try { Parser.parse(getText()); setStyleForValidFilter(); } catch (ParseException e) { wasError = true; setStyleForInvalidFilter(); } return ValidationResult.fromErrorIf(this, "Parse error", wasError); }); setOnKeyTyped(e -> { boolean isModifierKeyPress = e.isAltDown() || e.isMetaDown() || e.isControlDown(); String key = e.getCharacter(); if (key == null || key.isEmpty() || isModifierKeyPress) { return; } char typed = e.getCharacter().charAt(0); if (typed == '\t') { e.consume(); if (!getSelectedText().isEmpty()) { confirmCompletion(); } } else if (Character.isAlphabetic(typed) && shouldStartCompletion()) { startCompletion(e); } }); setOnKeyPressed(e -> { if (e.getCode() == KeyCode.TAB) { e.consume(); } }); setOnKeyReleased(e -> { e.consume(); if (e.getCode() == KeyCode.ENTER) { confirmEdit(); } else if (e.getCode() == KeyCode.ESCAPE) { if (getText().equals(previousText)) { cancel.run(); } else { revertEdit(); } } }); }
Source:
<code>public static TemporaryBuffer cleanLfsBlob(Repository db, InputStream originalContent) throws IOException { LocalFile buffer = new TemporaryBuffer.LocalFile(null); CleanFilter f = new CleanFilter(db, originalContent, buffer); try { while (f.run() != -1) { } } catch (IOException e) { <START> buffer.close(); <END> throw e; } return buffer; }</code><technical_language>buffer.destroy()? left a partial on-disk file</technical_language>

Target:
public static TemporaryBuffer cleanLfsBlob(Repository db, InputStream originalContent) throws IOException { LocalFile buffer = new TemporaryBuffer.LocalFile(null); CleanFilter f = new CleanFilter(db, originalContent, buffer); try { while (f.run() != -1) { } } catch (IOException e) { buffer.destroy(); throw e; } return buffer; }
Source:
<code>public Builder uploadIdMarker(String uploadIdMarker) { <START> operations.add(args -> args.uploadIdMarker = uploadIdMarker); <END> return this; }</code><technical_language>uploadIdMarker ""; null. validateNullOrNotEmpty()</technical_language>

Target:
public Builder uploadIdMarker(String uploadIdMarker) { validateNullOrNotEmptyString(uploadIdMarker, "uploadIdMarker"); operations.add(args -> args.uploadIdMarker = uploadIdMarker); return this; }
Source:
<code>private static Optional<CompositeColumnFilter> typeFilter(EventStreamQuery query) { final CompositeColumnFilter.Builder typeFilter = CompositeColumnFilter.newBuilder() .setOperator(EITHER); for (EventFilter eventFilter : query.getFilterList()) { final String type = eventFilter.getEventType() <START> .trim(); <END> if (!type.isEmpty()) { final ColumnFilter filter = eq(TYPE_COLUMN, type); typeFilter.addFilter(filter); } } return buildFilter(typeFilter); }</code><technical_language>spaces in eventType field</technical_language>

Target:
private static Optional<CompositeColumnFilter> typeFilter(EventStreamQuery query) { final CompositeColumnFilter.Builder typeFilter = CompositeColumnFilter.newBuilder() .setOperator(EITHER); for (EventFilter eventFilter : query.getFilterList()) { final String type = eventFilter.getEventType(); if (!type.trim() .isEmpty()) { final ColumnFilter filter = eq(TYPE_COLUMN, type); typeFilter.addFilter(filter); } } return buildFilter(typeFilter); }