auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private XYPlot createScalabilityPlot(List<XYSeries> seriesList, String xAxisLabel, NumberFormat xAxisNumberFormat, String yAxisLabel, NumberFormat yAxisNumberFormat) { NumberAxis xAxis = new NumberAxis(xAxisLabel); if (useLogarithmicProblemScale(seriesList)) { LogarithmicAxis xLogAxis = new LogarithmicAxis(xAxis.getLabel() + " (logarithmic)"); xLogAxis.setAllowNegativesFlag(true); <START> xAxis = xLogAxis; <END> } xAxis.setNumberFormatOverride(xAxisNumberFormat); NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setNumberFormatOverride(yAxisNumberFormat); XYPlot plot = new XYPlot(null, xAxis, yAxis, null); int seriesIndex = 0; for (XYSeries series : seriesList) { XYSeriesCollection seriesCollection = new XYSeriesCollection(); seriesCollection.addSeries(series); plot.setDataset(seriesIndex, seriesCollection); XYItemRenderer renderer = createScalabilityPlotRenderer(yAxisNumberFormat); plot.setRenderer(seriesIndex, renderer); seriesIndex++; } plot.setOrientation(PlotOrientation.VERTICAL); return plot; }</code><technical_language>need a separate xLogAxis variable (especially a local variable, is multi-threading danger whatsoever). change original code avoid unnecessary instantiation: NumberAxis xAxis; if (!...) { xAxis = new NumberAxis(xAxisLabel); } else { xAxis = new LogarithmicAxis(...) ... }</technical_language>

Target:
private XYPlot createScalabilityPlot(List<XYSeries> seriesList, String xAxisLabel, NumberFormat xAxisNumberFormat, String yAxisLabel, NumberFormat yAxisNumberFormat) { NumberAxis xAxis; if (useLogarithmicProblemScale(seriesList)) { LogarithmicAxis logarithmicAxis = new LogarithmicAxis(xAxisLabel + " (logarithmic)"); logarithmicAxis.setAllowNegativesFlag(true); xAxis = logarithmicAxis; } else { xAxis = new NumberAxis(xAxisLabel); } xAxis.setNumberFormatOverride(xAxisNumberFormat); NumberAxis yAxis = new NumberAxis(yAxisLabel); yAxis.setNumberFormatOverride(yAxisNumberFormat); XYPlot plot = new XYPlot(null, xAxis, yAxis, null); int seriesIndex = 0; for (XYSeries series : seriesList) { XYSeriesCollection seriesCollection = new XYSeriesCollection(); seriesCollection.addSeries(series); plot.setDataset(seriesIndex, seriesCollection); XYItemRenderer renderer = createScalabilityPlotRenderer(yAxisNumberFormat); plot.setRenderer(seriesIndex, renderer); seriesIndex++; } plot.setOrientation(PlotOrientation.VERTICAL); return plot; }
Source:
<code>public void addInitialParticipant(SessionId sessionId, ProjectId projectId, ACOrgUnitId participantId, EClass roleClass) throws ESException { checkForNulls(sessionId, projectId, participantId, roleClass); final ACUser resolvedUser = getAuthorizationControl().resolveUser(sessionId); if (!resolvedUser.getId().equals(participantId)) { throw new AccessControlException(Messages.AdminEmfStoreImpl_OnlyAllowedForRequstingUser); } <START> final boolean isServerAdmin = getAuthorizationControl().checkProjectAdminAccess( <END> sessionId, null, PAPrivileges.ShareProject); if (isServerAdmin) { return; } if (isServerAdminRole(roleClass)) { throw new AccessControlException(Messages.AdminEmfStoreImpl_Not_Allowed_To_Assign_ServerAdminRole); } final ShareProjectAdapter adapter = ShareProjectAdapter.find(sessionId); if (adapter == null) { throw new AccessControlException(Messages.AdminEmfStoreImpl_IllegalRequestToAddInitialRole); } final boolean didRemove = adapter.removeProject(projectId); if (!didRemove) { throw new AccessControlException(Messages.AdminEmfStoreImpl_IllegalRequestToAddInitialRole); } projectId = getProjectId(projectId); final ACOrgUnit orgUnit = getOrgUnit(participantId); for (final Role role : orgUnit.getRoles()) { if (areEqual(role, roleClass)) { role.getProjects().add(ModelUtil.clone(projectId)); save(); return; } } }</code><technical_language>name of variable is misleading</technical_language>

Target:
public void addInitialParticipant(SessionId sessionId, ProjectId projectId, ACOrgUnitId participantId, EClass roleClass) throws ESException { checkForNulls(sessionId, projectId, participantId, roleClass); if (isServerAdminRole(roleClass)) { throw new AccessControlException(Messages.AdminEmfStoreImpl_Not_Allowed_To_Assign_ServerAdminRole); } final ACUser resolvedUser = getAuthorizationControl().resolveUser(sessionId); if (!resolvedUser.getId().equals(participantId)) { throw new AccessControlException(Messages.AdminEmfStoreImpl_OnlyAllowedForRequstingUser); } getAuthorizationControl().checkProjectAdminAccess( sessionId, null, PAPrivileges.ShareProject); checkIfSessionIsAssociatedWithProject(sessionId, projectId); projectId = getProjectId(projectId); final ACOrgUnit orgUnit = getOrgUnit(participantId); for (final Role role : orgUnit.getRoles()) { if (areEqual(role, roleClass)) { role.getProjects().add(ModelUtil.clone(projectId)); save(); return; } } }
Source:
<code>private void updateWatchdogItems(Set<VmWatchdogType> vmWatchdogTypes) { List<String> watchDogModels = new ArrayList<String>(); for (VmWatchdogType vmWatchdogType : vmWatchdogTypes) { watchDogModels.add(EnumTranslator.getInstance().get(vmWatchdogType)); } watchDogModels.add(0, null); <START> String oldWatchdogSelected = getWatchdogModel().getSelectedItem(); <END> getWatchdogModel().setItems(watchDogModels); if (watchDogModels.contains(oldWatchdogSelected)) { getWatchdogModel().setSelectedItem(oldWatchdogSelected); } }</code><technical_language>Please include in patch related subject of patch</technical_language>

Target:
private void updateWatchdogItems(Set<VmWatchdogType> vmWatchdogTypes) { List<String> watchDogModels = new ArrayList<String>(); for (VmWatchdogType vmWatchdogType : vmWatchdogTypes) { watchDogModels.add(EnumTranslator.getInstance().get(vmWatchdogType)); } watchDogModels.add(0, null); String oldWatchdogSelected = (String) getWatchdogModel().getSelectedItem(); getWatchdogModel().setItems(watchDogModels); if (watchDogModels.contains(oldWatchdogSelected)) { getWatchdogModel().setSelectedItem(oldWatchdogSelected); } }
Source:
<code>private void RestoreVmFromBaseSnapshot(VM vm) { if (DbFacade.getInstance().getDiskImageDAO().getAllStatelessVmImageMapsForVm(vm.getId()).size() > 0) { <START> log.infoFormat("Deleting snapshots for stateless vm {0}", vm.getId()); <END> Backend.getInstance().runInternalAction(VdcActionType.RestoreStatelessVm, new VmOperationParameterBase(vm.getId()), new CommandContext(getCompensationContext())); } }</code><technical_language>Please dont this {0} , String.format instead</technical_language>

Target:
private void RestoreVmFromBaseSnapshot(VM vm) { if (getDiskImageDAO().getAllStatelessVmImageMapsForVm(vm.getId()).size() > 0) { log.infoFormat("Deleting snapshots for stateless vm {0}", vm.getId()); Backend.getInstance().runInternalAction(VdcActionType.RestoreStatelessVm, new VmOperationParameterBase(vm.getId()), new CommandContext(getCompensationContext())); } }
Source:
<code>public TransactionsLockWatchUpdate getUpdateForTransactions( Set<Long> startTimestamps, Optional<LockWatchVersion> lastKnownVersion) { Preconditions.checkArgument(!startTimestamps.isEmpty(), "Cannot get events for empty set of transactions"); TimestampMapping timestampMapping = getTimestampMappings(startTimestamps); <START> lastKnownVersion.ifPresent(version -> assertTrue(version.version() <= timestampMapping.lastVersion().version(), <END> "Cannot get update for transactions when the last known version is more recent than the transactions")); VersionBounds versionBounds = new VersionBounds.Builder() .startVersion(lastKnownVersion) .endVersion(timestampMapping.lastVersion()) .earliestSnapshotVersion(timestampMapping.versionRange().lowerEndpoint()) .build(); return eventLog.getEventsBetweenVersions(versionBounds) .toTransactionsLockWatchUpdate(timestampMapping, lastKnownVersion); }</code><technical_language>For completeness, remove "Preconditions.checkArgument(!startTimestamps.isEmpty(), "Cannot get events for empty set of transactions");" here; checked in TimestampMapping</technical_language>

Target:
public TransactionsLockWatchUpdate getUpdateForTransactions( Set<Long> startTimestamps, Optional<LockWatchVersion> lastKnownVersion) { TimestampMapping timestampMapping = getTimestampMappings(startTimestamps); VersionBounds versionBounds = new VersionBounds.Builder() .startVersion(lastKnownVersion) .endVersion(timestampMapping.lastVersion()) .earliestSnapshotVersion(timestampMapping.versionRange().lowerEndpoint()) .build(); return eventLog.getEventsBetweenVersions(versionBounds) .toTransactionsLockWatchUpdate(timestampMapping, lastKnownVersion); }
Source:
<code>public List<TokenCacheItem> getTokensForUser(String userId) { Iterator<TokenCacheItem> results = this.getAll(); <START> List<TokenCacheItem> tokenItems = new ArrayList<>(); <END> while (results.hasNext()) { final TokenCacheItem tokenCacheItem = results.next(); if (tokenCacheItem.getUserInfo() != null && tokenCacheItem.getUserInfo().getUserId().equalsIgnoreCase(userId)) { tokenItems.add(tokenCacheItem); } } return tokenItems; }</code><technical_language>final</technical_language>

Target:
public List<TokenCacheItem> getTokensForUser(String userId) { Iterator<TokenCacheItem> results = this.getAll(); final List<TokenCacheItem> tokenItems = new ArrayList<>(); while (results.hasNext()) { final TokenCacheItem tokenCacheItem = results.next(); if (tokenCacheItem.getUserInfo() != null && tokenCacheItem.getUserInfo().getUserId().equalsIgnoreCase(userId)) { tokenItems.add(tokenCacheItem); } } return tokenItems; }
Source:
<code>public Measurement(final int id, final String node, final int qualifier, final DateTime time, final double value) { super(id, node); <START> final DecimalFormat df = new DecimalFormat("#.#####"); <END> df.setRoundingMode(RoundingMode.HALF_UP); this.qualifier = qualifier; this.time = time; this.value = Double.parseDouble(df.format(value)); }</code><technical_language>Create separate private method correct precision</technical_language>

Target:
public Measurement(final int id, final String node, final int qualifier, final DateTime time, final double value) { super(id, node); this.qualifier = qualifier; this.time = time; this.value = this.roundValue(value); }
Source:
<code>private static boolean safeShouldPublish(MetricName metricName, MetricPublicationFilter filter) { try { return filter.shouldPublish(); <START> } catch (Exception e) { <END> log.warn("Exception thrown when attempting to determine whether a metric should be published." + " In this case we don't filter out the metric.", SafeArg.of("metricName", metricName), e); return true; } }</code><technical_language>nit: Prefer catching RuntimeException Exception allow type system if add a checked exception shouldPublish. suggestion } catch (RuntimeException e) {</technical_language>

Target:
private static boolean safeShouldPublish(MetricName metricName, MetricPublicationFilter filter) { try { return filter.shouldPublish(); } catch (RuntimeException e) { log.warn("Exception thrown when attempting to determine whether a metric should be published." + " In this case we don't filter out the metric.", SafeArg.of("metricName", metricName), e); return true; } }
Source:
<code>public RewriteRelation step(org.kframework.kil.Term cfg, int steps, boolean computeGraph) throws KRunExecutionException { <START> return javaKILRun(cfg, steps, computeGraph); <END> }</code><technical_language>I a code overall, I find method names confusing, in name clear do. For example, is javaKILrun</technical_language>

Target:
public RewriteRelation step(org.kframework.kil.Term cfg, int steps, boolean computeGraph) throws KRunExecutionException { return javaRewriteEngineRun(cfg, steps, computeGraph); }
Source:
<code>public List<String> getNames() { <START> if (!valid()) { <END> return List.of(); } return List.of(AIR_ATTACK_NON_SUBS); }</code><technical_language>nit, a ternary a bit more concise. generally a bit easier (lower cognitive load) for if statements lead 'true' value. IE: return valid() ? List.of(AIR_ATTACK_NON_SUBS) : List.of();</technical_language>

Target:
public List<String> getNames() { return valid() ? List.of(AIR_ATTACK_NON_SUBS) : List.of(); }
Source:
<code>Trigger getTrigger(UDTValue value) { <START> int type = value.getInt("type"); <END> switch (type) { case 0: return new SingleExecutionTrigger(value.getLong("trigger_time")); case 1: return new RepeatingTrigger( value.getLong("interval"), value.getLong("delay"), value.getLong("trigger_time"), value.getInt("repeat_count"), value.getInt("execution_count") ); default: throw new IllegalArgumentException("Trigger type [" + type + "] is not supported"); } }</code><technical_language>applies these.. type is in described</technical_language>

Target:
static Trigger getTrigger(UDTValue value) { int type = value.getInt("type"); switch (type) { case 0: return new SingleExecutionTrigger(value.getLong("trigger_time")); case 1: return new RepeatingTrigger( value.getLong("interval"), value.getLong("delay"), value.getLong("trigger_time"), value.getInt("repeat_count"), value.getInt("execution_count") ); default: throw new IllegalArgumentException("Trigger type [" + type + "] is not supported"); } }
Source:
<code>public Response checkMessagingConnectionForTheDm( String message, long timeout ) { if ( message == null ) { message = "ECHO " + UUID.randomUUID(); } if ( timeout > MAXIMUM_TIMEOUT ) { this.logger.warning( "Timeout " + timeout + "ms is above maximum limit " + MAXIMUM_TIMEOUT + "ms. Normalizing" ); timeout = MAXIMUM_TIMEOUT; } this.logger.fine( "Checking connection to the message queue. message=" + message + ", timeout=" + timeout + "ms" ); boolean hasReceived; try { hasReceived = this.manager.pingMessageQueue( message, timeout ); } catch ( IOException e ) { final String eMessage = "Unable to send Echo message " + message; <START> logger.log( Level.SEVERE, eMessage, e ); <END> return Response.status( Status.INTERNAL_SERVER_ERROR ).entity( eMessage ).build(); } catch ( InterruptedException e ) { final String eMessage = "Interrupted while waiting for Echo message " + message; logger.log( Level.WARNING, eMessage, e ); return Response.status( Status.INTERNAL_SERVER_ERROR ).entity( eMessage ).build(); } if ( hasReceived ) { final String rMessage = "Has received Echo message " + message; logger.fine( rMessage ); return Response.status( Status.OK ).entity( rMessage ).build(); } else { final String rMessage = "Did not receive Echo message " + message + " before timeout (" + timeout + "ms)"; logger.warning( rMessage ); return Response.status( 408 ).entity( rMessage ).build(); } }</code><technical_language>Utils.logException log stack trace</technical_language>

Target:
public Response checkMessagingConnectionForTheDm( String message, long timeout ) { if ( message == null ) { message = "ECHO " + UUID.randomUUID(); } if ( timeout > MAXIMUM_TIMEOUT ) { this.logger.warning( "Timeout " + timeout + "ms is above maximum limit " + MAXIMUM_TIMEOUT + "ms. Normalizing" ); timeout = MAXIMUM_TIMEOUT; } this.logger.fine( "Checking connection to the message queue. message=" + message + ", timeout=" + timeout + "ms" ); Response response; String responseMessage; try { if ( this.manager.pingMessageQueue( message, timeout ) ) { responseMessage = "Has received Echo message " + message; logger.fine( responseMessage ); response = Response.status( Status.OK ).entity( responseMessage ).build(); } else { responseMessage = "Did not receive Echo message " + message + " before timeout (" + timeout + "ms)"; logger.warning( responseMessage ); response = Response.status( 408 ).entity( responseMessage ).build(); } } catch ( IOException e ) { responseMessage = "Unable to send Echo message " + message; this.logger.severe( responseMessage ); Utils.logException( this.logger, Level.FINEST, e); response = Response.status( Status.INTERNAL_SERVER_ERROR ).entity( responseMessage ).build(); } catch ( InterruptedException e ) { responseMessage = "Interrupted while waiting for Echo message " + message; this.logger.severe( responseMessage ); Utils.logException( this.logger, Level.FINEST, e); response = Response.status( Status.INTERNAL_SERVER_ERROR ).entity( responseMessage ).build(); } return response; }
Source:
<code>private AppLovinAdSize appLovinAdSizeFromLocalExtras(final Map<String, Object> localExtras) { if ( localExtras == null || localExtras.isEmpty() ) { log( ERROR, "No serverExtras provided" ); return null; } try { final int width = (Integer) localExtras.get( AD_WIDTH_KEY ); final int height = (Integer) localExtras.get( AD_HEIGHT_KEY ); if ( width > 0 && height > 0 ) { log( DEBUG, "Valid width (" + width + ") and height (" + height + ") provided" ); final int offset = Math.abs( BANNER_STANDARD_HEIGHT - height ); if ( offset <= BANNER_HEIGHT_OFFSET_TOLERANCE ) { return AppLovinAdSize.BANNER; } <START> else if ( height == LEADER_STANDARD_HEIGHT || height == AppLovinAdSize.LEADER.getHeight() ) <END> { return AppLovinAdSize.LEADER; } else if ( height <= AppLovinAdSize.MREC.getHeight() ) { return AppLovinAdSize.MREC; } else { log( ERROR, "Provided dimensions does not meet the dimensions required of banner or mrec ads" ); } } else { log( ERROR, "Invalid width (" + width + ") and height (" + height + ") provided" ); } } catch ( Throwable th ) { log( ERROR, "Encountered error while parsing width and height from serverExtras", th ); } return null; }</code><technical_language>Actually, do this if clause a range instead of separate values? This, in essence, LEADER's a height tolerance BANNER height</technical_language>

Target:
private AppLovinAdSize appLovinAdSizeFromLocalExtras(final Map<String, Object> localExtras) { if ( localExtras == null || localExtras.isEmpty() ) { log( ERROR, "No serverExtras provided" ); return null; } try { final int width = (Integer) localExtras.get( AD_WIDTH_KEY ); final int height = (Integer) localExtras.get( AD_HEIGHT_KEY ); if ( width > 0 && height > 0 ) { log( DEBUG, "Valid width (" + width + ") and height (" + height + ") provided" ); final int bannerOffset = Math.abs( BANNER_STANDARD_HEIGHT - height ); final int leaderOffset = Math.abs( LEADER_STANDARD_HEIGHT - height ); if ( bannerOffset <= BANNER_HEIGHT_OFFSET_TOLERANCE ) { return AppLovinAdSize.BANNER; } else if ( leaderOffset <= LEADER_HEIGHT_OFFSET_TOLERANCE ) { return AppLovinAdSize.LEADER; } else if ( height <= AppLovinAdSize.MREC.getHeight() ) { return AppLovinAdSize.MREC; } else { log( ERROR, "Provided dimensions does not meet the dimensions required of banner or mrec ads" ); } } else { log( ERROR, "Invalid width (" + width + ") and height (" + height + ") provided" ); } } catch ( Throwable th ) { log( ERROR, "Encountered error while parsing width and height from serverExtras", th ); } return null; }
Source:
<code>private JSONArray getDatacenters() throws JSONException { List<String> names = new ArrayList<String>(datacenterCount); List<JSONArray> dataNodes = new ArrayList<JSONArray>(datacenterCount); int curBasePort = basePort; <START> int sslPort = basePort + 1000; <END> for (int i = 0; i < datacenterCount; i++) { names.add(i, "DC" + i); dataNodes.add(i, getDataNodes(curBasePort, sslPort, getDisks())); curBasePort += dataNodeCount; } return TestUtils.getJsonArrayDatacenters(names, dataNodes); }</code><technical_language>sslPort for nodes sslPort is set time, I this work. a baseSslPort = 7666 beginning, curSslPort updated curBasePort</technical_language>

Target:
private JSONArray getDatacenters() throws JSONException { List<String> names = new ArrayList<String>(datacenterCount); List<JSONArray> dataNodes = new ArrayList<JSONArray>(datacenterCount); int curBasePort = basePort; int curSslBasePort = baseSslPort + 1000; for (int i = 0; i < datacenterCount; i++) { names.add(i, "DC" + i); dataNodes.add(i, getDataNodes(curBasePort, curSslBasePort, getDisks())); curBasePort += dataNodeCount; curSslBasePort += dataNodeCount; } return TestUtils.getJsonArrayDatacenters(names, dataNodes); }
Source:
<code>@Test public void testNodeTypeCountExchange() { final RelNode rel = convertSql("select * from emp"); final RelDistribution dist = RelDistributions.hash(ImmutableList.<Integer>of()); final LogicalExchange exchange = LogicalExchange.create(rel, dist); final Map<Class<? extends RelNode>, Integer> expected = new HashMap<>(); expected.put(TableScan.class, 1); expected.put(Exchange.class, 1); expected.put(Project.class, 1); final RelMetadataQuery mq = rel.getCluster().getMetadataQuery(); final Multimap<Class<? extends RelNode>, RelNode> result = mq.getNodeTypes(exchange); assertThat(result, notNullValue()); final Map<Class<? extends RelNode>, Integer> resultCount = new HashMap<>(); for (Entry<Class<? extends RelNode>, Collection<RelNode>> e : result.asMap().entrySet()) { resultCount.put(e.getKey(), e.getValue().size()); } assertEquals(expected, resultCount); <START> } <END></code><technical_language>suggest assertThat instead of assertEquals, is more clear for parameters</technical_language>

Target:
@Test public void testNodeTypeCountExchange() { final RelNode rel = convertSql("select * from emp"); final RelDistribution dist = RelDistributions.hash(ImmutableList.<Integer>of()); final LogicalExchange exchange = LogicalExchange.create(rel, dist); final Map<Class<? extends RelNode>, Integer> expected = new HashMap<>(); expected.put(TableScan.class, 1); expected.put(Exchange.class, 1); expected.put(Project.class, 1); final RelMetadataQuery mq = rel.getCluster().getMetadataQuery(); final Multimap<Class<? extends RelNode>, RelNode> result = mq.getNodeTypes(exchange); assertThat(result, notNullValue()); final Map<Class<? extends RelNode>, Integer> resultCount = new HashMap<>(); for (Entry<Class<? extends RelNode>, Collection<RelNode>> e : result.asMap().entrySet()) { resultCount.put(e.getKey(), e.getValue().size()); } assertThat(expected, equalTo(resultCount)); }
Source:
<code>public String toString() { final StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("{"); sb.append("alias=").append(alias); <START> sb.append(", get=").append(value); <END> sb.append('}'); return sb.toString(); }</code><technical_language>bad replacement? (not this one)</technical_language>

Target:
public String toString() { final StringBuilder sb = new StringBuilder(getClass().getSimpleName()).append("{"); sb.append("alias=").append(alias); sb.append(", value=").append(value); sb.append('}'); return sb.toString(); }
Source:
<code><START> public void testSerializeRequest(CommandSerializer testSubject) { <END> Map<String, ?> metadata = new HashMap<String, Object>() {{ this.put("firstKey", "firstValue"); this.put("secondKey", "secondValue"); }}; CommandMessage message = new GenericCommandMessage<>("payload", metadata); Command command = testSubject.serialize(message, "routingKey", 1); CommandMessage<?> deserialize = testSubject.deserialize(command); assertEquals(message.getIdentifier(), deserialize.getIdentifier()); assertEquals(message.getCommandName(), deserialize.getCommandName()); assertEquals(message.getMetaData(), deserialize.getMetaData()); assertEquals(message.getPayloadType(), deserialize.getPayloadType()); assertEquals(message.getPayload(), deserialize.getPayload()); }</code><technical_language>Nit: remove public here</technical_language>

Target:
void testSerializeRequest(CommandSerializer testSubject) { Map<String, ?> metadata = new HashMap<String, Object>() {{ this.put("firstKey", "firstValue"); this.put("secondKey", "secondValue"); }}; CommandMessage message = new GenericCommandMessage<>("payload", metadata); Command command = testSubject.serialize(message, "routingKey", 1); CommandMessage<?> deserialize = testSubject.deserialize(command); assertEquals(message.getIdentifier(), deserialize.getIdentifier()); assertEquals(message.getCommandName(), deserialize.getCommandName()); assertEquals(message.getMetaData(), deserialize.getMetaData()); assertEquals(message.getPayloadType(), deserialize.getPayloadType()); assertEquals(message.getPayload(), deserialize.getPayload()); }
Source:
<code>public void verifyTwitterWindow(){ CommonFunctions.waitForWindow("", ""); Object[] windows = driver.getWindowHandles().toArray(); driver.switchTo().window(windows[1].toString()); <START> waitForStringInURL("twitter.com"); <END> driver.close(); driver.switchTo().window(windows[0].toString()); PageObjectLogging.log("verifyTwitterWindow", "Verify that the Twitter window URL is correct", true, driver); }</code><technical_language>external url's stored in ContentPatterns.URLsContent class</technical_language>

Target:
public void verifyTwitterWindow(){ CommonFunctions.waitForWindow("", ""); Object[] windows = driver.getWindowHandles().toArray(); driver.switchTo().window(windows[1].toString()); waitForStringInURL(URLsContent.twitterDomain); driver.close(); driver.switchTo().window(windows[0].toString()); PageObjectLogging.log("verifyTwitterWindow", "Verify that the Twitter window URL is correct", true, driver); }
Source:
<code>private void initGlusterPeerProcess() { _glusterPeerListSucceeded = true; _glusterPeerProbeSucceeded = true; List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { List<GlusterServerInfo> glusterServers = getGlusterPeers(upServer.getId()); if (glusterServers.size() == 0) { setNonOperational(NonOperationalReason.GLUSTER_PEER_LIST_FAILED); } else if (!hostExists(glusterServers, getVds())) { try { if (!glusterPeerProbe(upServer.getId(), getVds().gethost_name())) { setNonOperational(NonOperationalReason.GLUSTER_PEER_PROBE_FAILED); } } catch (Exception e) { log.errorFormat("Could not peer probe the gluster server {0}. Error: {1}", getVds().gethost_name(), <START> e.getMessage()); <END> } } } } }</code><technical_language>need set non-op</technical_language>

Target:
private void initGlusterPeerProcess() { _glusterPeerListSucceeded = true; _glusterPeerProbeSucceeded = true; List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 0) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId())) { upServer = vds; break; } } if (upServer != null) { List<GlusterServerInfo> glusterServers = getGlusterPeers(upServer.getId()); if (glusterServers.size() == 0) { setNonOperational(NonOperationalReason.GLUSTER_PEER_LIST_FAILED); } else if (!hostExists(glusterServers, getVds())) { if (!glusterPeerProbe(upServer.getId(), getVds().gethost_name())) { setNonOperational(NonOperationalReason.GLUSTER_PEER_PROBE_FAILED); } } } } }
Source:
<code>public void the_factory_can_load_prefixed_keys_on_saved_preferences() { BriefcasePreferences prefs = new BriefcasePreferences(InMemoryPreferences.empty()); prefs.putAll(validConfig.asMap("some_prefix")); <START> ExportConfiguration load = load(Optional.empty(), prefs, "some_prefix"); <END> assertThat(load, is(validConfig)); }</code><technical_language>This factory receive a FormStatus, Optional<FormStatus></technical_language>

Target:
public void the_factory_can_load_prefixed_keys_on_saved_preferences() { BriefcasePreferences prefs = new BriefcasePreferences(InMemoryPreferences.empty()); prefs.putAll(validConfig.asMap("some_prefix")); ExportConfiguration load = loadFormConfig(prefs, "some_prefix"); assertThat(load, is(validConfig)); }
Source:
<code>protected void addMissingValuesReplacements(KiePMMLModel model, PMMLContext context) { logger.debug("addMissingValuesReplacements {}", model, context); final PMMLRequestData requestData = context.getRequestData(); final Map<String, ParameterInfo> mappedRequestParams = requestData.getMappedRequestParams(); final Map<String, Object> missingValueReplacementMap = model.getMissingValueReplacementMap(); missingValueReplacementMap.forEach((fieldName, missingValueReplacement) -> { if (!mappedRequestParams.containsKey(fieldName)) { logger.debug("missingValueReplacement {}", fieldName, missingValueReplacement); <START> requestData.addRequestParam(fieldName, missingValueReplacement); <END> } }); }</code><technical_language>Is track of fact default for this parameter (a status field in ParameterInfo similar)</technical_language>

Target:
protected void addMissingValuesReplacements(KiePMMLModel model, PMMLContext context) { logger.debug("addMissingValuesReplacements {}", model, context); final PMMLRequestData requestData = context.getRequestData(); final Map<String, ParameterInfo> mappedRequestParams = requestData.getMappedRequestParams(); final Map<String, Object> missingValueReplacementMap = model.getMissingValueReplacementMap(); missingValueReplacementMap.forEach((fieldName, missingValueReplacement) -> { if (!mappedRequestParams.containsKey(fieldName)) { logger.debug("missingValueReplacement {}", fieldName, missingValueReplacement); requestData.addRequestParam(fieldName, missingValueReplacement); context.addMissingValueReplaced(fieldName, missingValueReplacement); } }); }
Source:
<code>public BaseResponseDto updateUserAddress(UserAddressRequestDto userAddressRequestDto) { BaseResponseDto baseResponseDto = new BaseResponseDto(); List<UserAddressModel> byLoginName = userAddressMapper.findByLoginName(userAddressRequestDto.getBaseParam().getUserId()); if (CollectionUtils.isNotEmpty(byLoginName)) { UserAddressModel userAddressModel = convertUserAddressModel(userAddressRequestDto); userAddressModel.setId(byLoginName.get(0).getId()); userAddressMapper.update(userAddressModel); } else { userAddressMapper.create(convertUserAddressModel(userAddressRequestDto)); } <START> baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); <END> return baseResponseDto; }</code><technical_language>msg</technical_language>

Target:
public BaseResponseDto updateUserAddress(UserAddressRequestDto userAddressRequestDto) { BaseResponseDto baseResponseDto = new BaseResponseDto(); List<UserAddressModel> byLoginName = userAddressMapper.findByLoginName(userAddressRequestDto.getBaseParam().getUserId()); if (CollectionUtils.isNotEmpty(byLoginName)) { UserAddressModel userAddressModel = convertUserAddressModel(userAddressRequestDto); userAddressModel.setId(byLoginName.get(0).getId()); userAddressMapper.update(userAddressModel); } else { userAddressMapper.create(convertUserAddressModel(userAddressRequestDto)); } baseResponseDto.setCode(ReturnMessage.SUCCESS.getCode()); baseResponseDto.setMessage(ReturnMessage.SUCCESS.getMsg()); return baseResponseDto; }
Source:
<code>@Override public T convert(ResponseBody value) throws IOException { <START> BufferedSource source = value.source(); <END> try { return adapter.decode(source); } finally { if (source != null) { try { source.close(); } catch (IOException ignored) { } } } }</code><technical_language>calling value.source() throw, this need split lines, variable initialization retrieving source-the of is try block</technical_language>

Target:
@Override public T convert(ResponseBody value) throws IOException { BufferedSource source = null; try { source = value.source(); return adapter.decode(source); } finally { if (source != null) { try { source.close(); } catch (IOException ignored) { } } } }
Source:
<code>protected ConfigAttrIpv6AddrRangeBase(int attributeType, LinkAddress ipv6LinkAddress) { super(attributeType); <START> validateLinkAddressTypeOrThrow(ipv6LinkAddress); <END> linkAddress = ipv6LinkAddress; }</code><technical_language>Suggest "validateIpv6LinkAddress" this is abstracted a higher layer</technical_language>

Target:
protected ConfigAttrIpv6AddrRangeBase(int attributeType, LinkAddress ipv6LinkAddress) { super(attributeType); validateIpv6LinkAddressTypeOrThrow(ipv6LinkAddress); linkAddress = ipv6LinkAddress; }
Source:
<code>private boolean downloadFileWrapper(String urlString, String destination, String outputFile, NotificationDetails details) { boolean previouslyCorrupted = false; int res = DOWNLOAD_SUCCESS; for (int i = 0; i < RETRY_COUNT; i++) { if (isDownloadCanceled) { break; } String url = urlString; if (fallbackByDefault || i > 0) { <START> if (urlString.contains("android.quran.com")) { <END> url = urlString.replace("android.quran.com", "quran.app"); } else if (urlString.contains("quranicaudio.com")) { url = urlString.replace("quranicaudio.com", "quranicaudio.org"); } try { Thread.sleep(WAIT_TIME); } catch (InterruptedException exception) { } notifier.resetNotifications(); } wifiLock.acquire(); res = startDownload(url, destination, outputFile, details); if (wifiLock.isHeld()) { wifiLock.release(); } if (res == DOWNLOAD_SUCCESS) { fallbackByDefault = (i > 0); return true; } else if (res == QuranDownloadNotifier.ERROR_DISK_SPACE || res == QuranDownloadNotifier.ERROR_PERMISSIONS) { notifier.notifyError(res, true, details); return false; } else if (res == QuranDownloadNotifier.ERROR_INVALID_DOWNLOAD) { if (!previouslyCorrupted) { i--; previouslyCorrupted = true; } if (i + 1 < RETRY_COUNT) { notifyError(res, false, details); } } } if (isDownloadCanceled) { res = QuranDownloadNotifier.ERROR_CANCELLED; } notifyError(res, true, details); return false; }</code><technical_language>replace if block/check, contains replace double look-up anyway</technical_language>

Target:
private boolean downloadFileWrapper(String urlString, String destination, String outputFile, NotificationDetails details) { boolean previouslyCorrupted = false; int res = DOWNLOAD_SUCCESS; for (int i = 0; i < RETRY_COUNT; i++) { if (isDownloadCanceled) { break; } String url = urlString; if (fallbackByDefault || i > 0) { url = urlUtil.fallbackUrl(url); try { Thread.sleep(WAIT_TIME); } catch (InterruptedException exception) { } notifier.resetNotifications(); } wifiLock.acquire(); res = startDownload(url, destination, outputFile, details); if (wifiLock.isHeld()) { wifiLock.release(); } if (res == DOWNLOAD_SUCCESS) { fallbackByDefault = (i > 0); return true; } else if (res == QuranDownloadNotifier.ERROR_DISK_SPACE || res == QuranDownloadNotifier.ERROR_PERMISSIONS) { notifier.notifyError(res, true, details); return false; } else if (res == QuranDownloadNotifier.ERROR_INVALID_DOWNLOAD) { if (!previouslyCorrupted) { i--; previouslyCorrupted = true; } if (i + 1 < RETRY_COUNT) { notifyError(res, false, details); } } } if (isDownloadCanceled) { res = QuranDownloadNotifier.ERROR_CANCELLED; } notifyError(res, true, details); return false; }
Source:
<code>public int hashCode() { <START> int result = name.hashCode(); <END> result = 31 * result + fieldName.hashCode(); return result; }</code><technical_language>Objects.hash()</technical_language>

Target:
public int hashCode() { return Objects.hash(fieldName, name); }
Source:
<code>private void drain() { if (wip.getAndIncrement() == 0) { final Subscriber<? super T> c = child; final Queue<Object> q = queue; do { if (c.isUnsubscribed()) { return; } wip.lazySet(1); long r = get(); long e = 0; Object v; while (r != 0 && (v = q.poll()) != null) { try { if (v == NULL_SENTINEL) { c.onNext(null); } else { @SuppressWarnings("unchecked") T t = (T)v; c.onNext(t); } } catch (Throwable ex) { Exceptions.throwIfFatal(ex); Throwable ex1 = OnErrorThrowable.addValueAsLastCause(ex, v != NULL_SENTINEL ? v : null); c.onError(ex1); return; } if (c.isUnsubscribed()) { return; } r--; e++; } <START> if (e != 0) { <END> addAndGet(-e); } } while (wip.decrementAndGet() != 0); } }</code><technical_language>&& get() != Long.MAX_VALUE</technical_language>

Target:
private void drain() { if (wip.getAndIncrement() == 0) { final Subscriber<? super T> c = child; final Queue<Object> q = queue; do { if (c.isUnsubscribed()) { return; } wip.lazySet(1); long r = get(); long e = 0; Object v; while (r != 0 && (v = q.poll()) != null) { try { if (v == NULL_SENTINEL) { c.onNext(null); } else { @SuppressWarnings("unchecked") T t = (T)v; c.onNext(t); } } catch (Throwable ex) { Exceptions.throwIfFatal(ex); Throwable ex1 = OnErrorThrowable.addValueAsLastCause(ex, v != NULL_SENTINEL ? v : null); c.onError(ex1); return; } if (c.isUnsubscribed()) { return; } r--; e++; } if (e != 0 && get() != Long.MAX_VALUE) { addAndGet(-e); } } while (wip.decrementAndGet() != 0); } }
Source:
<code>public static void main(String[] args) throws IOException { if (args.length == 0) { System.err.println("Usage: RealValueFileEventStream eventfile [iterations cutoff]"); System.exit(1); } int ai = 0; String eventFile = args[ai++]; Map<String,String> params=new HashMap<String, String>(); params.put(AbstractTrainer.ITERATIONS_PARAM,"100"); params.put(AbstractTrainer.CUTOFF_PARAM, "5"); if (ai < args.length) { params.put(AbstractTrainer.ITERATIONS_PARAM,args[ai++]); params.put(AbstractTrainer.CUTOFF_PARAM, args[ai++]); } <START> PluggableParameters parameters=new PluggableParameters(params, new HashMap<>()); <END> AbstractModel model; try (RealValueFileEventStream es = new RealValueFileEventStream(eventFile)) { DataIndexer indexer=new OnePassDataIndexer(); indexer.init(params, new HashMap<String, String>()); model = GIS.trainModel(parameters.getIntParam(AbstractTrainer.ITERATIONS_PARAM, AbstractTrainer.CUTOFF_DEFAULT), indexer); } new SuffixSensitiveGISModelWriter(model, new File(eventFile + ".bin.gz")).persist(); }</code><technical_language>add spaces '='</technical_language>

Target:
public static void main(String[] args) throws IOException { if (args.length == 0) { System.err.println("Usage: RealValueFileEventStream eventfile [iterations cutoff]"); System.exit(1); } int ai = 0; String eventFile = args[ai++]; Map<String,String> params = new HashMap<>(); params.put(AbstractTrainer.ITERATIONS_PARAM,"100"); params.put(AbstractTrainer.CUTOFF_PARAM, "5"); if (ai < args.length) { params.put(AbstractTrainer.ITERATIONS_PARAM,args[ai++]); params.put(AbstractTrainer.CUTOFF_PARAM, args[ai++]); } PluggableParameters parameters = new PluggableParameters(params, new HashMap<>()); AbstractModel model; try (RealValueFileEventStream es = new RealValueFileEventStream(eventFile)) { DataIndexer indexer = new OnePassDataIndexer(); indexer.init(params, new HashMap<String, String>()); model = GIS.trainModel(parameters.getIntParam(AbstractTrainer.ITERATIONS_PARAM, AbstractTrainer.CUTOFF_DEFAULT), indexer); } new SuffixSensitiveGISModelWriter(model, new File(eventFile + ".bin.gz")).persist(); }
Source:
<code>public Operation<K> decode(final ByteBuffer buffer) { OperationCode opCode = OperationCode.valueOf(buffer.get()); validateOperation(opCode); try { return newOperation(keySerializer.read(buffer)); } catch (ClassNotFoundException e) { <START> throw new SerializerException(e); <END> } }</code><technical_language>Again, SerializerException is completely unrelated operation codecs - throw else</technical_language>

Target:
public Operation<K> decode(final ByteBuffer buffer) { OperationCode opCode = OperationCode.valueOf(buffer.get()); validateOperation(opCode); try { return newOperation(keySerializer.read(buffer)); } catch (ClassNotFoundException e) { throw new CodecException(e); } }
Source:
<code>public Player addPlayer(String playerName, SpoutServerSession<?> session, int syncDistance) { SpoutPlayer player = PlayerFiles.loadPlayerData(playerName); boolean created = false; if (player == null) { getLogger().info("First login for " + playerName + ", creating new player data"); player = new SpoutPlayer(this, playerName, getDefaultWorld().getSpawnPoint()); <START> player.getNetwork().setSyncDistance(syncDistance); <END> created = true; } SpoutPlayer oldPlayer = players.put(playerName, player); if (reclamation != null) { reclamation.addPlayer(); } if (oldPlayer != null && oldPlayer.getNetwork().getSession() != null) { oldPlayer.kick("Login occured from another client"); } final SpoutPhysicsComponent physics = (SpoutPhysicsComponent) player.getPhysics(); created |= physics.getTransformLive().getPosition().getWorld() == null; player.connect(session, created ? ((SpoutServerWorld) getDefaultWorld()).getSpawnPoint() : physics.getTransformLive()); World world = physics.getTransformLive().getPosition().getWorld(); world.spawnEntity(player); ((SpoutServerWorld) world).addPlayer(player); session.getProtocol().initializeServerSession(session); if (player.getNetwork() == null) { throw new IllegalStateException("initializeServerSession failed to set a player's NetworkComponent. Protocol: " + session.getProtocol()); } player.getNetwork().forceSync(); return player; }</code><technical_language>Move this initializeServerSession</technical_language>

Target:
public Player addPlayer(String playerName, SpoutServerSession<?> session, int syncDistance) { SpoutPlayer player = PlayerFiles.loadPlayerData(playerName); boolean created = false; if (player == null) { getLogger().info("First login for " + playerName + ", creating new player data"); player = new SpoutPlayer(this, playerName, getDefaultWorld().getSpawnPoint()); created = true; } SpoutPlayer oldPlayer = players.put(playerName, player); if (reclamation != null) { reclamation.addPlayer(); } if (oldPlayer != null && oldPlayer.getNetwork().getSession() != null) { oldPlayer.kick("Login occured from another client"); } final SpoutPhysicsComponent physics = (SpoutPhysicsComponent) player.getPhysics(); created |= physics.getTransformLive().getPosition().getWorld() == null; player.connect(session, created ? ((SpoutServerWorld) getDefaultWorld()).getSpawnPoint() : physics.getTransformLive()); World world = physics.getTransformLive().getPosition().getWorld(); world.spawnEntity(player); ((SpoutServerWorld) world).addPlayer(player); session.getProtocol().initializeServerSession(session); if (player.getNetwork() == null) { throw new IllegalStateException("initializeServerSession failed to set a player's NetworkComponent. Protocol: " + session.getProtocol()); } player.getNetwork().setSyncDistance(syncDistance); player.getNetwork().forceSync(); return player; }
Source:
<code>public PhoenixNonRetryableRuntimeException() { <START> super(); <END> }</code><technical_language>necessary call super(). is implicit call super() arguments for classes a parent</technical_language>

Target:
public PhoenixNonRetryableRuntimeException() { }
Source:
<code>private void reload(final Repository repository) { <START> final IndexDiff[] results = new IndexDiff[1]; <END> Job job = new Job(UIText.StagingView_IndexDiffReload) { @Override protected IStatus run(IProgressMonitor monitor) { IndexDiff indexDiff = doReload(repository); results[0] = indexDiff; return Status.OK_STATUS; } }; job.addJobChangeListener(new JobChangeAdapter() { public void done(final IJobChangeEvent event) { form.getDisplay().asyncExec(new Runnable() { public void run() { if (form.isDisposed()) return; IndexDiff indexDiff = results[0]; unstagedTableViewer.setInput(new Object[] { repository, indexDiff }); stagedTableViewer .setInput(new Object[] { repository, indexDiff }); commitAction.setEnabled(repository.getRepositoryState() .canCommit()); form.setText(StagingView.getRepositoryName(repository)); updateCommitMessageComponent(); clearCommitMessageToggles(); updateSectionText(); } }); } }); schedule(job); }</code><technical_language>AtomicReference<T> is easier handle thread safe</technical_language>

Target:
private void reload(final Repository repository) { final AtomicReference<IndexDiff> results = new AtomicReference<IndexDiff>(); final String jobTitle = MessageFormat.format(UIText.StagingView_IndexDiffReload, StagingView.getRepositoryName(repository)); Job job = new Job(jobTitle) { @Override protected IStatus run(IProgressMonitor monitor) { IndexDiff indexDiff = doReload(repository, monitor, jobTitle); results.set(indexDiff); return Status.OK_STATUS; } }; job.setUser(true); job.setRule(ResourcesPlugin.getWorkspace().getRoot()); job.addJobChangeListener(new JobChangeAdapter() { public void done(final IJobChangeEvent event) { form.getDisplay().asyncExec(new Runnable() { public void run() { if (form.isDisposed()) return; IndexDiff indexDiff = results.get(); unstagedTableViewer.setInput(new Object[] { repository, indexDiff }); stagedTableViewer .setInput(new Object[] { repository, indexDiff }); commitAction.setEnabled(repository.getRepositoryState() .canCommit()); form.setText(StagingView.getRepositoryName(repository)); updateCommitMessageComponent(); clearCommitMessageToggles(); updateSectionText(); } }); } }); schedule(job); }
Source:
<code>public String toString() { <START> return "VibrationElement" + Arrays.toString(channels); <END> }</code><technical_language>I prefer toString write duration</technical_language>

Target:
public String toString() { return "VibrationElement{duration=" + duration + ", channels=" + Arrays.toString(channels) + "}"; }
Source:
<code><START> public final <R> R as(@NonNull CompletableConverter<? extends R> converter) { <END> try { return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); } catch (Throwable ex) { Exceptions.throwIfFatal(ex); throw ExceptionHelper.wrapOrThrow(ex); } }</code><technical_language>Please add @Experimental @since 2.1.7 - experimental of them</technical_language>

Target:
public final <R> R as(@NonNull CompletableConverter<? extends R> converter) { return ObjectHelper.requireNonNull(converter, "converter is null").apply(this); }
Source:
<code>public void getCandidateApplicationsByCandidateIdShouldThrowIllegalArgumentExceptionWhenCandidateEntityIsNull() { given(candidateRepository.findOne(FIRST_ID)).willReturn(null); <START> given(applicationsRepository.findByCandidateEntity(null)).willThrow(IllegalArgumentException.class); <END> statesService.getCandidateApplicationsByCandidateId(FIRST_ID); }</code><technical_language>remove this line</technical_language>

Target:
public void getCandidateApplicationsByCandidateIdShouldThrowIllegalArgumentExceptionWhenCandidateEntityIsNull() { given(candidateRepository.findOne(FIRST_ID)).willReturn(null); statesService.getCandidateApplicationsByCandidateId(FIRST_ID); }
Source:
<code><START> private DatastreamRuntimeException generateSendFailure(Exception exception) { <END> _dynamicMetricsManager.createOrUpdateMeter(_metricsNamesPrefix, AGGREGATE, PRODUCER_ERROR, 1); if (exception instanceof IllegalStateException) { _log.warn("send failed transiently with exception: ", exception); return new DatastreamTransientException(exception); } else { _log.warn("send failed, restart producer, exception: ", exception); shutdownProducer(); return new DatastreamRuntimeException(exception); } }</code><technical_language>nit: this method called generateSendFailure. this renamed handleSendFailure</technical_language>

Target:
private DatastreamRuntimeException generateSendFailure(Exception exception) { _dynamicMetricsManager.createOrUpdateMeter(_metricsNamesPrefix, AGGREGATE, PRODUCER_ERROR, 1); if (exception instanceof IllegalStateException) { _log.warn("Send failed transiently with exception: ", exception); return new DatastreamTransientException(exception); } else { _log.warn("Send failed with a non-transient exception. Shutting down producer, exception: ", exception); shutdownProducer(); return new DatastreamRuntimeException(exception); } }
Source:
<code>public InitdServiceInstaller(Entity entity, Enricher enricher) { <START> this.entity = entity; <END> this.enricher = enricher; }</code><technical_language>Preference for fields final, initialising this.entity = checkNotNull(entity, "entity") avoid NPEs (that harder debug)</technical_language>

Target:
public InitdServiceInstaller(Entity entity, Enricher enricher) { this.entity = checkNotNull(entity, "entity"); this.enricher = checkNotNull(enricher, "enricher"); }
Source:
<code>protected void unregisterVersioningRestriction(VersioningRestrictionDescriptor contrib) { versioningRestrictionsRegistry.removeContribution(contrib); <START> log.info("Unregistered versioning policy: " + contrib.getType()); <END> recompute(); }</code><technical_language>policy -> restriction</technical_language>

Target:
protected void unregisterVersioningRestriction(VersioningRestrictionDescriptor contrib) { versioningRestrictionsRegistry.removeContribution(contrib); log.info("Unregistered versioning restriction: " + contrib.getType()); recompute(); }