auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testActivateFilterException() throws InvalidSyntaxException { CloudPublisher cp = new CloudPublisher(); WireHelperService wireHelperServiceMock = mock(WireHelperService.class); cp.bindWireHelperService(wireHelperServiceMock); BundleContext bundleCtxMock = mock(BundleContext.class); <START> Filter filter = mock(Filter.class); <END> when(bundleCtxMock.createFilter(anyString())).thenThrow(new InvalidSyntaxException("test", "filter")); ComponentContext ctxMock = mock(ComponentContext.class); when(ctxMock.getBundleContext()).thenReturn(bundleCtxMock); Map<String, Object> properties = new HashMap<>(); properties.put("cloud.service.pid", "cspid"); properties.put("publish.priority", 1); properties.put("publish.qos", 0); properties.put("publish.retain", true); try { cp.activate(ctxMock, properties); fail("Exception was expected."); } catch (NullPointerException e) { } verify(ctxMock, times(1)).getBundleContext(); verify(bundleCtxMock, times(1)) .createFilter("(&(objectClass=org.eclipse.kura.cloud.CloudService)(kura.service.pid=cspid))"); }</code><technical_language>filter needs cleaned up, is declared used</technical_language>

Target:
public void testActivateFilterException() throws InvalidSyntaxException { CloudPublisher cp = new CloudPublisher(); WireHelperService wireHelperServiceMock = mock(WireHelperService.class); cp.bindWireHelperService(wireHelperServiceMock); BundleContext bundleCtxMock = mock(BundleContext.class); when(bundleCtxMock.createFilter(anyString())).thenThrow(new InvalidSyntaxException("test", "filter")); ComponentContext ctxMock = mock(ComponentContext.class); when(ctxMock.getBundleContext()).thenReturn(bundleCtxMock); Map<String, Object> properties = new HashMap<>(); properties.put("cloud.service.pid", "cspid"); properties.put("publish.priority", 1); properties.put("publish.qos", 0); properties.put("publish.retain", true); try { cp.activate(ctxMock, properties); fail("Exception was expected."); } catch (NullPointerException e) { } verify(ctxMock, times(1)).getBundleContext(); verify(bundleCtxMock, times(1)) .createFilter("(&(objectClass=org.eclipse.kura.cloud.CloudService)(kura.service.pid=cspid))"); }
Source:
<code>private void changeExperimentName(TracePackageExperimentElement experimentElement) { String currentName = experimentElement.getImportName(); int nameSuffixIndex = <START> 1; <END> while (experimentExists(experimentElement)) { String newName = currentName + " (" + nameSuffixIndex + ')'; experimentElement.setImportName(newName); nameSuffixIndex++; } }</code><technical_language>start 2</technical_language>

Target:
private void changeExperimentName(TracePackageExperimentElement experimentElement) { String currentName = experimentElement.getImportName(); int nameSuffixIndex = 2; while (experimentExists(experimentElement)) { String newName = currentName + " (" + nameSuffixIndex + ')'; experimentElement.setImportName(newName); nameSuffixIndex++; } }
Source:
<code>void assertSameContent( List<Long> actual, List<Long> expected ) { actual.sort( Long::compareTo ); expected.sort( Long::compareTo ); <START> assertThat( actual, is( expected ) ); <END> }</code><technical_language>IsIterableContainingInAnyOrder.containsInAnyOrder instead</technical_language>

Target:
void assertSameContent( List<Long> actual, List<Long> expected ) { assertThat( actual, is( containsInAnyOrder( expected.toArray() ) ) ); }
Source:
<code>public List<SingularityPendingTaskId> getScheduledTaskIds( @Parameter(hidden = true) @Auth SingularityUser user, @Parameter(description = "Use the cached version of this data to limit expensive api calls") @QueryParam("useWebCache") Boolean useWebCache) { List<SingularityPendingTaskId> taskIds = authorizationHelper.filterByAuthorizedRequests(user, taskManager.getPendingTaskIds(useWebCache(useWebCache)), SingularityTransformHelpers.PENDING_TASK_ID_TO_REQUEST_ID, SingularityAuthorizationScope.READ); <START> Collections.sort(taskIds); <END> return taskIds; }</code><technical_language>is taskIds guaranteed mutable? safer return a sorted copy</technical_language>

Target:
public List<SingularityPendingTaskId> getScheduledTaskIds( @Parameter(hidden = true) @Auth SingularityUser user, @Parameter(description = "Use the cached version of this data to limit expensive api calls") @QueryParam("useWebCache") Boolean useWebCache) { return authorizationHelper.filterByAuthorizedRequests(user, taskManager.getPendingTaskIds(useWebCache(useWebCache)), SingularityTransformHelpers.PENDING_TASK_ID_TO_REQUEST_ID, SingularityAuthorizationScope.READ) .stream() .sorted() .collect(Collectors.toList()); }
Source:
<code>private static Symbol symbol(ExpressionTree tree) { <START> return Optional.ofNullable(tree).filter(t -> t.is(Kind.IDENTIFIER)).map(t -> ((IdentifierTree) t).symbol()).orElse(null); <END> }</code><technical_language>annotate parameter @Nullable , if need handle null argument, need ofNullable</technical_language>

Target:
private static Symbol symbol(ExpressionTree tree) { if (tree.is(Kind.IDENTIFIER)) { return ((IdentifierTree) tree).symbol(); } return null; }
Source:
<code>public boolean startDeleteUserFlow(String userStoreDomain, String userName) throws WorkflowException { WorkflowService workflowService = IdentityWorkflowDataHolder.getInstance().getWorkflowService(); String tenant = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String nameWithTenant = UserCoreUtil.addTenantDomainToEntry(userName, tenant); String fullyQualifiedName = UserCoreUtil.addDomainToName(nameWithTenant, userStoreDomain); Map<String, Object> wfParams = new HashMap<>(); Map<String, Object> nonWfParams = new HashMap<>(); wfParams.put(USERNAME, userName); wfParams.put(USER_STORE_DOMAIN, userStoreDomain); String uuid = UUID.randomUUID().toString(); boolean state = startWorkFlow(wfParams, nonWfParams, uuid); if (!Boolean.TRUE.equals(getWorkFlowCompleted()) && !state) { try { workflowService.addRequestEntityRelationships(uuid, new Entity[]{new Entity(fullyQualifiedName, "USER")}); } catch (InternalWorkflowException e) { <START> log.info("No workflow associated with the operation."); <END> } } return state; }</code><technical_language>Exception is logged thrown</technical_language>

Target:
public boolean startDeleteUserFlow(String userStoreDomain, String userName) throws WorkflowException { WorkflowService workflowService = IdentityWorkflowDataHolder.getInstance().getWorkflowService(); String tenant = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); String fullyQualifiedName = UserCoreUtil.addDomainToName(userName, userStoreDomain); Entity userEntity = new Entity(fullyQualifiedName, UserStoreWFConstants.ENTITY_TYPE_USER, tenant); Map<String, Object> wfParams = new HashMap<>(); Map<String, Object> nonWfParams = new HashMap<>(); wfParams.put(USERNAME, userName); wfParams.put(USER_STORE_DOMAIN, userStoreDomain); String uuid = UUID.randomUUID().toString(); if (workflowService.eventEngagedWithWorkflows(UserStoreWFConstants.DELETE_USER_EVENT) && !Boolean.TRUE.equals (getWorkFlowCompleted()) && !isValidOperation(new Entity[]{userEntity})) { throw new WorkflowException("Operation is not valid"); } boolean state = startWorkFlow(wfParams, nonWfParams, uuid); if (!Boolean.TRUE.equals(getWorkFlowCompleted()) && !state) { try { workflowService.addRequestEntityRelationships(uuid, new Entity[]{userEntity}); } catch (InternalWorkflowException e) { if (log.isDebugEnabled()) { log.debug("No workflow associated with the operation.", e); } } } return state; }
Source:
<code>public static ParserRuleContext shallowCopy(ParserRuleContext t) { try { Class<? extends ParserRuleContext> cl = t.getClass(); Class<?> sup = cl.getSuperclass(); Class<?> supSup = sup.getSuperclass(); if ( ctorCache==null ) { ctorCache = new ConcurrentHashMap<>(); } boolean <START> isAltLabelNode = sup!=ParserRuleContext.class && END> supSup!=ParserRuleContext.class; if ( isAltLabelNode ) { Constructor<? extends ParserRuleContext> ctor = ctorCache.get(cl); if ( ctor==null ) { ctor = cl.getConstructor(sup); } return ctor.newInstance(t); } else { Constructor<? extends ParserRuleContext> ctor = ctorCache.get(cl); if ( ctor==null ) { ctor = cl.getConstructor(ParserRuleContext.class, int.class); ctorCache.put(cl, ctor); } ParserRuleContext copy = ctor.newInstance(t.getParent(), t.invokingState); copy.copyFrom(t); return copy; } } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>This potentially invalid assumptions context super class option</technical_language>

Target:
public static ParserRuleContext shallowCopy(ParserRuleContext t) { try { Class<? extends ParserRuleContext> cl = t.getClass(); Class<?> sup = cl.getSuperclass(); Class<?> supSup = sup.getSuperclass(); boolean isAltLabelNode = sup!=ParserRuleContext.class && supSup!=ParserRuleContext.class; if ( isAltLabelNode ) { Constructor<? extends ParserRuleContext> ctor = ctorCache.get(cl); if ( ctor==null ) { ctor = cl.getConstructor(sup); } return ctor.newInstance(t); } else { Constructor<? extends ParserRuleContext> ctor = ctorCache.get(cl); if ( ctor==null ) { ctor = cl.getConstructor(ParserRuleContext.class, int.class); ctorCache.put(cl, ctor); } ParserRuleContext copy = ctor.newInstance(t.getParent(), t.invokingState); copy.copyFrom(t); return copy; } } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { CanaryTool.RegionStdOutSink sink = (CanaryTool.RegionStdOutSink) getServletContext().getAttribute( "sink"); <START> assert sink != null : "No tool in context!"; <END> resp.setContentType("text/html"); CanaryStatusTmpl tmpl = new CanaryStatusTmpl(); tmpl.render(resp.getWriter(), sink); }</code><technical_language>sink == null running assertions? A nasty NPE? handle null properly</technical_language>

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { CanaryTool.RegionStdOutSink sink = (CanaryTool.RegionStdOutSink) getServletContext().getAttribute( "sink"); if (sink == null) { throw new ServletException( "RegionStdOutSink is null! The CanaryTool's InfoServer is not initialized correctly"); } resp.setContentType("text/html"); CanaryStatusTmpl tmpl = new CanaryStatusTmpl(); tmpl.render(resp.getWriter(), sink); }
Source:
<code>public void testGetBrickByServerIdAndDirectory() { GlusterBrickEntity brick = dao.getBrickByServerIdAndDirectory(BRICK_SERVER_ID, BRICK_DIRECTORY); <START> assertNotNull(brick); <END> }</code><technical_language>assert returned brick's server id directory matches parameters passed</technical_language>

Target:
public void testGetBrickByServerIdAndDirectory() { GlusterBrickEntity brick = dao.getBrickByServerIdAndDirectory(BRICK_SERVER_ID, BRICK_DIRECTORY); assertNotNull(brick); assertEquals(brick.getServerId(), BRICK_SERVER_ID); assertEquals(brick.getBrickDirectory(), BRICK_DIRECTORY); }
Source:
<code><START> public List<IArrivingVehicle> getVehicles(@NonNull IStop stop){ <END> List<JsonArrival> jsonArrivals = vasttrafikAdapter.getVehiclesHeadedToStop(stop); List<IArrivingVehicle> arrivingVehicles = new ArrayList<>(); for(JsonArrival a : jsonArrivals){ arrivingVehicles.add(VehicleFactory.getArrivingVehicle(a)); } return arrivingVehicles; }</code><technical_language>'{' instead of ' {'</technical_language>

Target:
public List<IArrivingVehicle> getVehicles(@NonNull IStop stop) { List<JsonArrival> jsonArrivals = vasttrafikAdapter.getVehiclesHeadedToStop(stop); List<IArrivingVehicle> arrivingVehicles = new ArrayList<>(); if (jsonArrivals != null) { for(JsonArrival a : jsonArrivals) { arrivingVehicles.add(VehicleFactory.getArrivingVehicle(a)); } } return arrivingVehicles; }
Source:
<code>public CreateContainerCmd fillContainerConfig(CreateContainerCmd containerConfig) { final CreateContainerCmd result = dockerTemplateBase.fillContainerConfig(containerConfig); final String templateName = getName(); Map<String, String> labels = result.getLabels(); <START> labels.put(DockerContainerLabelKeys.REMOVE_VOLUMES, Boolean.toString(this.isRemoveVolumes())); <END> labels.put(DockerContainerLabelKeys.TEMPLATE_NAME, templateName); final String nodeName = calcUnusedNodeName(templateName); setNodeNameInContainerConfig(result, nodeName); return result; }</code><technical_language>Code style: This plugin code this necessary</technical_language>

Target:
public CreateContainerCmd fillContainerConfig(CreateContainerCmd containerConfig) { final CreateContainerCmd result = dockerTemplateBase.fillContainerConfig(containerConfig); final String templateName = getName(); final Map<String, String> labels = result.getLabels(); labels.put(DockerContainerLabelKeys.REMOVE_VOLUMES, Boolean.toString(isRemoveVolumes())); labels.put(DockerContainerLabelKeys.TEMPLATE_NAME, templateName); final String nodeName = calcUnusedNodeName(templateName); setNodeNameInContainerConfig(result, nodeName); return result; }
Source:
<code>private void verifyKeySizesMatch(ArrayList<IndexEntry> entries) { StoreKey firstKey = entries.get(0).getKey(); for (IndexEntry entry : entries) { if (entry.getKey().sizeInBytes() != firstKey.sizeInBytes()) { <START> throw new IllegalArgumentException( <END> "Key sizes in the entries list are not the same, key size: " + entry.getKey().sizeInBytes() + " key: " + entry.getKey() + " is different from size of first key: " + firstKey.sizeInBytes() + " key: " + firstKey); } } }</code><technical_language>more thing. add a metric track this issue</technical_language>

Target:
private void verifyKeySizesMatch(ArrayList<IndexEntry> entries) { StoreKey firstKey = entries.get(0).getKey(); for (IndexEntry entry : entries) { if (entry.getKey().sizeInBytes() != firstKey.sizeInBytes()) { metrics.keySizeMismatchCount.inc(1); throw new IllegalArgumentException( "Key sizes in the entries list are not the same, key size: " + entry.getKey().sizeInBytes() + " key: " + entry.getKey() + " is different from size of first key: " + firstKey.sizeInBytes() + " key: " + firstKey); } } }
Source:
<code>public static Object[][] fliteTagBrokenOasis() { return new Object[][]{ {"adtest", "SyntheticTests/FliteTagBrokenWidth", <START> "Invalid width of the flite unit was passed. Make sure you provide width parameter with numeric value.", "#mw-content-text .error"}, <END> {"adtest", "SyntheticTests/FliteTagBrokenHeight", "Invalid height of the flite unit was passed. Make sure you provide height parameter with numeric value.", "#mw-content-text .error"}, {"adtest", "SyntheticTests/FliteTagBrokenTag", "Invalid guid parameter was passed. Provide valid guid or remove this tag from article's content.", "#mw-content-text .error"}}; }</code><technical_language>java { "adtest", "SyntheticTests/FliteTagBrokenWidth", "Invalid width of flite unit passed. provide width parameter numeric value.", "#mw-content-text .error" }, for below</technical_language>

Target:
public static Object[][] fliteTagBrokenOasis() { return new Object[][]{ { "SyntheticTests/FliteTagBrokenWidth", "Invalid width of the flite unit was passed. Make sure you provide width parameter with numeric value." }, { "SyntheticTests/FliteTagBrokenHeight", "Invalid height of the flite unit was passed. Make sure you provide height parameter with numeric value." }, { "SyntheticTests/FliteTagBrokenTag", "Invalid guid parameter was passed. Provide valid guid or remove this tag from article's content." } }; }
Source:
<code>public VoiceMessageResponse sendVoiceMessage(final VoiceMessage voiceMessage) throws UnauthorizedException, GeneralException { if (voiceMessage.getMachineTimeout() == 0){ <START> voiceMessage.setMachineTimeout(7000); END> } return messageBirdService.sendPayLoad(VOICEMESSAGESPATH, voiceMessage, VoiceMessageResponse.class); }</code><technical_language>please, define 7000 a constant top value</technical_language>

Target:
public VoiceMessageResponse sendVoiceMessage(final VoiceMessage voiceMessage) throws UnauthorizedException, GeneralException { addDefaultMachineTimeoutValueIfNotExists(voiceMessage); checkMachineTimeoutValueIsInRange(voiceMessage); return messageBirdService.sendPayLoad(VOICEMESSAGESPATH, voiceMessage, VoiceMessageResponse.class); }
Source:
<code>public List<QueryHandle> getAllQueries(GrillSessionHandle sessionHandle, String state, String userName, String queryName) throws GrillException { try { acquire(sessionHandle); Status status = null; try { status = StringUtils.isBlank(state) ? null : Status.valueOf(state); } catch (IllegalArgumentException e) { throw new BadRequestException("Bad state argument passed, possible" + " values are " + Status.values(), e); } boolean filterByStatus = status != null; queryName = queryName.toLowerCase(); boolean filterByQueryName = StringUtils.isNotBlank(queryName); if (StringUtils.isBlank(userName)) { userName = getSession(sessionHandle).getUserName(); } List<QueryHandle> all = new ArrayList<QueryHandle>(allQueries.keySet()); Iterator<QueryHandle> itr = all.iterator(); while (itr.hasNext()) { QueryHandle q = itr.next(); QueryContext context = allQueries.get(q); <START> GrillQuery query = context.toGrillQuery(); <END> if ((filterByStatus && status != context.getStatus().getStatus()) || (filterByQueryName && !query.getQueryName().toLowerCase().contains(queryName)) || (!"all".equalsIgnoreCase(userName) && !userName.equalsIgnoreCase(context.getSubmittedUser())) ) { itr.remove(); } } return all; } finally { release(sessionHandle); } }</code><technical_language>Is this conversion GrillQuery required</technical_language>

Target:
public List<QueryHandle> getAllQueries(GrillSessionHandle sessionHandle, String state, String userName, String queryName) throws GrillException { try { acquire(sessionHandle); Status status = null; try { status = StringUtils.isBlank(state) ? null : Status.valueOf(state); } catch (IllegalArgumentException e) { throw new BadRequestException("Bad state argument passed, possible" + " values are " + Status.values(), e); } boolean filterByStatus = status != null; queryName = queryName.toLowerCase(); boolean filterByQueryName = StringUtils.isNotBlank(queryName); if (StringUtils.isBlank(userName)) { userName = getSession(sessionHandle).getUserName(); } List<QueryHandle> all = new ArrayList<QueryHandle>(allQueries.keySet()); Iterator<QueryHandle> itr = all.iterator(); while (itr.hasNext()) { QueryHandle q = itr.next(); QueryContext context = allQueries.get(q); if ((filterByStatus && status != context.getStatus().getStatus()) || (filterByQueryName && !context.getQueryName().toLowerCase().contains(queryName)) || (!"all".equalsIgnoreCase(userName) && !userName.equalsIgnoreCase(context.getSubmittedUser())) ) { itr.remove(); } } return all; } finally { release(sessionHandle); } }
Source:
<code>public boolean remove(final K key) throws CacheAccessException { removeObserver.begin(); checkKey(key); final StoreEventSink<K, V> eventSink = storeEventDispatcher.eventSink(); final long now = timeSource.getTimeMillis(); try { final AtomicReference<OnHeapValueHolder<V>> removedValue = new AtomicReference<OnHeapValueHolder<V>>(); map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { <START> if (mappedValue != null && mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { <END> onExpiration(key, mappedValue, eventSink); return null; } if (mappedValue != null) { removedValue.set(mappedValue); eventSink.removed(mappedKey, mappedValue.value()); } return null; } }); storeEventDispatcher.releaseEventSink(eventSink); OnHeapValueHolder<V> removedValueHolder = removedValue.get(); if (removedValueHolder != null) { removeObserver.end(StoreOperationOutcomes.RemoveOutcome.REMOVED); decrementCurrentUsageInBytesIfRequired(removedValueHolder.size()); } else { removeObserver.end(StoreOperationOutcomes.RemoveOutcome.MISS); } return removedValueHolder != null; } catch (RuntimeException re) { storeEventDispatcher.releaseEventSinkAfterFailure(eventSink, re); handleRuntimeException(re); return false; } }</code><technical_language>computeIfPresent means mappedValue null</technical_language>

Target:
public boolean remove(final K key) throws CacheAccessException { removeObserver.begin(); checkKey(key); final StoreEventSink<K, V> eventSink = storeEventDispatcher.eventSink(); final long now = timeSource.getTimeMillis(); try { final AtomicReference<OnHeapValueHolder<V>> removedValue = new AtomicReference<OnHeapValueHolder<V>>(); map.computeIfPresent(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue != null && mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { onExpiration(mappedKey, mappedValue, eventSink); return null; } if (mappedValue != null) { removedValue.set(mappedValue); eventSink.removed(mappedKey, mappedValue.value()); } return null; } }); storeEventDispatcher.releaseEventSink(eventSink); OnHeapValueHolder<V> removedValueHolder = removedValue.get(); if (removedValueHolder != null) { removeObserver.end(StoreOperationOutcomes.RemoveOutcome.REMOVED); decrementCurrentUsageInBytesIfRequired(removedValueHolder.size()); } else { removeObserver.end(StoreOperationOutcomes.RemoveOutcome.MISS); } return removedValueHolder != null; } catch (RuntimeException re) { storeEventDispatcher.releaseEventSinkAfterFailure(eventSink, re); handleRuntimeException(re); return false; } }
Source:
<code>private static void createMappingIfNeeded(JestClient jestClient, String indexName, String typeName) throws IOException { synchronized (CREATE_MAPPING_LOCK) { IndicesExists indicesExists = new IndicesExists.Builder(indexName).build(); boolean indexExists = jestClient.execute(indicesExists).isSucceeded(); if (!indexExists) { CreateIndex createIndex = new CreateIndex.Builder(indexName).build(); jestClient.execute(createIndex); URL url = ElasticWriter.class.getResource("/elastic-mapping.json"); String mapping = Resources.toString(url, Charsets.UTF_8); PutMapping putMapping = new PutMapping.Builder(indexName, typeName,mapping).build(); JestResult result = jestClient.execute(putMapping); <START> if (!result.isSucceeded()) { <END> log.warn("Failed to create mapping: {}", result.getErrorMessage()); } else { log.info("Created mapping for index {}", indexName); } } } }</code><technical_language>result null, condition if (result == null || !result.isSucceeded()). understand thi result null</technical_language>

Target:
private static void createMappingIfNeeded(JestClient jestClient, String indexName, String typeName) throws ElasticWriterException, IOException { synchronized (CREATE_MAPPING_LOCK) { IndicesExists indicesExists = new IndicesExists.Builder(indexName).build(); boolean indexExists = jestClient.execute(indicesExists).isSucceeded(); if (!indexExists) { CreateIndex createIndex = new CreateIndex.Builder(indexName).build(); jestClient.execute(createIndex); URL url = ElasticWriter.class.getResource("/elastic-mapping.json"); String mapping = Resources.toString(url, Charsets.UTF_8); PutMapping putMapping = new PutMapping.Builder(indexName, typeName,mapping).build(); JestResult result = jestClient.execute(putMapping); if (!result.isSucceeded()) { throw new ElasticWriterException(String.format("Failed to create mapping: %s", result.getErrorMessage())); } else { log.info("Created mapping for index {}", indexName); } } } }
Source:
<code>public List<? extends Module> getJacksonModules() { <START> return ImmutableList.of(new SimpleModule("LookupModule-" + UUID.randomUUID().toString())); <END> }</code><technical_language>return empty list</technical_language>

Target:
public List<? extends Module> getJacksonModules() { return Collections.emptyList(); }
Source:
<code>public void onAttach(@NonNull Context context) { super.onAttach(context); <START> mCameraController = new CameraController(context); <END> }</code><technical_language>find CameraController constructor takes a Context</technical_language>

Target:
public void onAttach(@NonNull Context context) { super.onAttach(context); mCameraController = new CameraController(); }
Source:
<code><START> public Optional<ChargeStatus> getIntermediateChargeStatus(ChargeStatus fromStatus, ChargeStatus toStatus) { <END> if (fromStatus.equals(ChargeStatus.AUTHORISATION_3DS_REQUIRED) && toStatus.equals(ChargeStatus.EXPIRED)) { return Optional.of(ChargeStatus.EXPIRE_CANCEL_READY); } if (fromStatus.equals(ChargeStatus.AUTHORISATION_SUCCESS) && toStatus.equals(ChargeStatus.CAPTURE_ERROR)) { return Optional.of(CAPTURE_READY); } return graph.successors(fromStatus) .stream() .filter(chargeStatus -> graph.predecessors(toStatus).contains(chargeStatus)) .findFirst(); }</code><technical_language>Unsure adding this method this class for purpose of backfilling, I if moved some utility of history event emitter</technical_language>

Target:
public Optional<ChargeStatus> getIntermediateChargeStatus(ChargeStatus fromStatus, ChargeStatus toStatus) { if (fromStatus.equals(AUTHORISATION_3DS_REQUIRED) && toStatus.equals(EXPIRED)) { return Optional.of(EXPIRE_CANCEL_READY); } if (fromStatus.equals(AUTHORISATION_SUCCESS) && toStatus.equals(CAPTURE_ERROR)) { return Optional.of(CAPTURE_READY); } return graph.successors(fromStatus) .stream() .filter(chargeStatus -> graph.predecessors(toStatus).contains(chargeStatus)) .findFirst(); }
Source:
<code><START> public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { <END> Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { LttngUstTrace trace = getTrace(); ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT; if (trace != null) { layout = trace.getEventLayout(); } @NonNull Set<@NonNull String> requiredEventsFields = ImmutableSet.of( layout.contextProcname(), layout.contextVtid()); @NonNull TmfAnalysisEventFieldRequirement entryReq = new TmfAnalysisEventFieldRequirement( ImmutableSet.of(layout.eventCygProfileFuncEntry(), layout.eventCygProfileFastFuncEntry()), requiredEventsFields, ValuePriorityLevel.MANDATORY); @NonNull TmfAnalysisEventFieldRequirement exitReq = new TmfAnalysisEventFieldRequirement( ImmutableSet.of(layout.eventCygProfileFuncExit(), layout.eventCygProfileFastFuncExit()), requiredEventsFields, ValuePriorityLevel.MANDATORY); exitReq.addInformation(nullToEmptyString(Messages.LttnUstCallStackAnalysisModule_EventsLoadingInformation)); requirements = ImmutableSet.of(entryReq, exitReq); fAnalysisRequirements = requirements; } return requirements; }</code><technical_language>This is a small class, worth putting @NonNullByDefault instead of sprinkling non-nulls everywhere</technical_language>

Target:
public @NonNull Iterable<@NonNull TmfAnalysisRequirement> getAnalysisRequirements() { Set<@NonNull TmfAnalysisRequirement> requirements = fAnalysisRequirements; if (requirements == null) { LttngUstTrace trace = getTrace(); ILttngUstEventLayout layout = ILttngUstEventLayout.DEFAULT_LAYOUT; if (trace != null) { layout = trace.getEventLayout(); } requirements = ImmutableSet.of(new LttngUstCallStackAnalysisRequirement(layout)); fAnalysisRequirements = requirements; } return requirements; }
Source:
<code>private Pod getPluginBrokerPod(Map<String, Pod> pods) throws InfrastructureException { if (pods.isEmpty()) { throw new InternalInfrastructureException("There is no any pod in plugin broker environment"); } if (pods.size() > 1) { throw new InternalInfrastructureException( <START> "There are multiply pods in plugin broker environment"); <END> } return pods.values().iterator().next(); }</code><technical_language>WDYT if change checks one? like: Plugin brokering supports pod only. Workspace 'ID' contains 'N' pods</technical_language>

Target:
private Pod getPluginBrokerPod(Map<String, Pod> pods) throws InfrastructureException { if (pods.size() != 1) { throw new InternalInfrastructureException( format( "Plugin broker environment must have only " + "one pod. Workspace `%s` contains `%s` pods.", workspaceId, pods.size())); } return pods.values().iterator().next(); }
Source:
<code>public static Module module() { return new CacheModule() { @Override protected void configure() { persist(NAME, ConflictKey.class, Boolean.class) <START> .maximumWeight(10 << 20) <END> .loader(ConflictsLoader.class); bind(ConflictsCacheImpl.class); bind(ConflictsCache.class).to(ConflictsCacheImpl.class); } }; }</code><technical_language>This is 10M entries in cache. 10 MiB? If need write a Weigher implementation bind measure size of entry. Fortunately entries fixed size (approx 140 bytes overheads accounted for). 10MiB of memory is 74,800 items. easier that: .maximumSize(74,800) // Approximately 10 MiB</technical_language>

Target:
public static Module module() { return new CacheModule() { @Override protected void configure() { persist(NAME, ConflictKey.class, Boolean.class) .maximumWeight(37400); bind(ConflictsCache.class).to(ConflictsCacheImpl.class); } }; }
Source:
<code>public synchronized void setCrlLocationUrl(String crlLocationUrl) { this.crlLocationUrl = crlLocationUrl; if (handle != null) { <START> handle.cancel(true); <END> } handle = scheduler.scheduleAtFixedRate(this, INITIAL_DELAY, SCHEDULER_INTERVAL, TimeUnit.MINUTES); }</code><technical_language>Do want interrupt here? if in middle of writing a file? task finish instead</technical_language>

Target:
public synchronized void setCrlLocationUrl(String crlLocationUrl) { this.crlLocationUrl = crlLocationUrl; if (handle != null) { handle.cancel(false); } handle = scheduler.scheduleAtFixedRate(this, INITIAL_DELAY, SCHEDULER_INTERVAL, TimeUnit.MINUTES); }
Source:
<code>private void initGlusterPeerProcess() { <START> List<VDS> vdsList = DbFacade.getInstance().getVdsDAO().getAllForVdsGroup(getVdsGroupId()); <END> if (vdsList != null && vdsList.size() > 1) { VDS upServer = null; for (int i = 0; i < vdsList.size(); i++) { if (!Guid.OpEquality(getVdsId(), vdsList.get(i).getId()) && vdsList.get(i).getstatus() == VDSStatus.Up) { upServer = vdsList.get(i); break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), upServer.getId())) { String newServerName = getVds().gethost_name().isEmpty() ? getVds().getManagmentIp() : getVds().gethost_name(); glusterPeerProbe(upServer.getId(), newServerName); } } } }</code><technical_language>use: getVdsDao().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); get servers in cluster</technical_language>

Target:
private void initGlusterPeerProcess() { List<VDS> vdsList = getVdsDAO().getAllForVdsGroupWithStatus(getVdsGroupId(), VDSStatus.Up); if (vdsList != null && vdsList.size() > 1) { VDS upServer = null; for (VDS vds : vdsList) { if (!Guid.OpEquality(getVdsId(), vds.getId()) && vds.getstatus() == VDSStatus.Up) { upServer = vds; break; } } if (upServer != null) { if (!hostExists(getGlusterPeers(upServer.getId()), getVdsId())) { String newServerName = getVds().gethost_name().isEmpty() ? getVds().getManagmentIp() : getVds().gethost_name(); glusterPeerProbe(upServer.getId(), newServerName); } } } }
Source:
<code>private IEntityAction chooseNewAction() { List<EntityActionEntry> entry = Lists.newArrayList(); int weightsum = 0; for (IEntityAction e : availableActions) { int weight = ((DefaultEntityAction<T>) e).getWeight(entity); if (weight > 0) { entry.add(new EntityActionEntry(weight, e)); } } <START> if (weightsum > 0) { <END> return WeightedRandom.getRandomItem(entity.getRNG(), entry, weightsum).getAction(); } return null; }</code><technical_language>weightsum is increased :)</technical_language>

Target:
private IEntityAction chooseNewAction() { List<EntityActionEntry> entry = Lists.newArrayList(); int weightsum = 0; for (IEntityAction e : availableActions) { int weight = ((DefaultEntityAction<T>) e).getWeight(entity); if (weight > 0) { entry.add(new EntityActionEntry(weight, e)); weightsum += weight; } } if (weightsum > 0) { return WeightedRandom.getRandomItem(entity.getRNG(), entry, weightsum).getAction(); } return null; }
Source:
<code>private String getCodeCodeableConceptIdIfExists(IBase theValue) { List<IBase> codings = mySearchParameterExtractor.getCodingsFromCodeableConcept(theValue); String codeCodeableConceptId = null; for (IBase nextCoding : codings) { ResourceIndexedSearchParamToken param = mySearchParameterExtractor.createSearchParamForCoding("Observation", new RuntimeSearchParam(null, null, "code", null, null, null, null, null, null, null), nextCoding); if (param != null) { String system = param.getSystem(); String code = param.getValue(); String text = mySearchParameterExtractor.getDisplayTextForCoding(nextCoding); if (code != null && system != null) { codeCodeableConceptId = myObservationIndexedCodeCodingSearchParamDao.findForCodeAndSystem(code, system); } else { codeCodeableConceptId = myObservationIndexedCodeCodingSearchParamDao.findForDisplay(text); } if (codeCodeableConceptId != null) { break; } } } return codeCodeableConceptId; <START> } <END></code><technical_language>This function a good candidate return Optional</technical_language>

Target:
private Optional<String> getCodeCodeableConceptIdIfExists(IBase theValue) { List<IBase> codings = mySearchParameterExtractor.getCodingsFromCodeableConcept(theValue); String codeCodeableConceptId = null; Optional<String> codeCodeableConceptIdOptional = Optional.empty(); for (IBase nextCoding : codings) { ResourceIndexedSearchParamToken param = mySearchParameterExtractor.createSearchParamForCoding("Observation", new RuntimeSearchParam(null, null, "code", null, null, null, null, null, null, null), nextCoding); if (param != null) { String system = param.getSystem(); String code = param.getValue(); String text = mySearchParameterExtractor.getDisplayTextForCoding(nextCoding); if (code != null && system != null) { codeCodeableConceptIdOptional = Optional.ofNullable(myObservationIndexedCodeCodingSearchParamDao.findByCodeAndSystem(code, system)); } else { codeCodeableConceptIdOptional = Optional.ofNullable(myObservationIndexedCodeCodingSearchParamDao.findByDisplay(text)); } if (codeCodeableConceptIdOptional.isPresent()) { break; } } } return codeCodeableConceptIdOptional; }
Source:
<code>public void simpleHostRouteWithEncodedQuery() { this.routes.addRoute("/self/**", "http://localhost:" + this.port + "/"); this.endpoint.reset(); ResponseEntity<String> result = new TestRestTemplate().exchange( "http://localhost:" + this.port + "/self/query?foo={foo}", HttpMethod.GET, new HttpEntity<>((Void) null), String.class, "weird#chars"); assertEquals(HttpStatus.OK, result.getStatusCode()); <START> assertEquals("/query?foo=weird%23chars", result.getBody()); <END> }</code><technical_language>worried this test changed. # char meaning in a url, if changed, I accept this</technical_language>

Target:
public void simpleHostRouteWithEncodedQuery() { this.routes.addRoute("/self/**", "http://localhost:" + this.port + "/"); this.endpoint.reset(); ResponseEntity<String> result = new TestRestTemplate().exchange( "http://localhost:" + this.port + "/self/query?foo={foo}", HttpMethod.GET, new HttpEntity<>((Void) null), String.class, "weird#chars"); assertEquals(HttpStatus.OK, result.getStatusCode()); assertEquals("/query?foo=weird#chars", result.getBody()); }
Source:
<code>public void copyIncrementalWithResponseCodeSnippet2() { final String snapshot = "copy snapshot"; PageBlobCopyIncrementalRequestConditions destinationRequestConditions = new PageBlobCopyIncrementalRequestConditions() .setIfNoneMatch("snapshotMatch"); Context context = new Context(key, value); CopyStatusType statusType = client .copyIncrementalWithResponse(new PageBlobCopyIncrementalOptions(url, snapshot) .setRequestConditions(destinationRequestConditions), timeout, context).getValue(); <START> if (CopyStatusType.SUCCESS == statusType) { <END> System.out.println("Page blob copied successfully"); } else if (CopyStatusType.FAILED == statusType) { System.out.println("Page blob copied failed"); } else if (CopyStatusType.ABORTED == statusType) { System.out.println("Page blob copied aborted"); } else if (CopyStatusType.PENDING == statusType) { System.out.println("Page blob copied pending"); } END: com.azure.storage.blob.specialized.PageBlobClient.copyIncrementalWithResponse#PageBlobCopyIncrementalOptions-Duration-Context }</code><technical_language>nit: switch more natural choice imo</technical_language>

Target:
public void copyIncrementalWithResponseCodeSnippet2() { final String snapshot = "copy snapshot"; PageBlobCopyIncrementalRequestConditions destinationRequestConditions = new PageBlobCopyIncrementalRequestConditions() .setIfNoneMatch("snapshotMatch"); Context context = new Context(key, value); CopyStatusType statusType = client .copyIncrementalWithResponse(new PageBlobCopyIncrementalOptions(url, snapshot) .setRequestConditions(destinationRequestConditions), timeout, context).getValue(); switch (statusType) { case SUCCESS: System.out.println("Page blob copied successfully"); break; case FAILED: System.out.println("Page blob copied failed"); break; case ABORTED: System.out.println("Page blob copied aborted"); break; case PENDING: System.out.println("Page blob copied pending"); break; default: break; } END: com.azure.storage.blob.specialized.PageBlobClient.copyIncrementalWithResponse#PageBlobCopyIncrementalOptions-Duration-Context }
Source:
<code>public ModelAndView index(Request request, Response response) { Map<Object, Object> object = new HashMap<Object, Object>() {{ <START> put("viewTitle", "Pipelines"); <END> }}; return new ModelAndView(object, null); }</code><technical_language>put("viewTitle", "Pipeline Configuration"); ?</technical_language>

Target:
public ModelAndView index(Request request, Response response) { Map<Object, Object> object = new HashMap<Object, Object>() {{ put("viewTitle", "Pipeline Configuration"); }}; return new ModelAndView(object, null); }
Source:
<code>public List<CourseAttributes> getCourses(List<String> courseIds) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseIds); List<Course> courses = getCourseEntities(courseIds); List<CourseAttributes> courseAttributes = new ArrayList<CourseAttributes>(); for (Course c: courses) { <START> if (c != null) { <END> courseAttributes.add(new CourseAttributes(c)); } } return courseAttributes; }</code><technical_language>c null</technical_language>

Target:
public List<CourseAttributes> getCourses(List<String> courseIds) { Assumption.assertNotNull(Const.StatusCodes.DBLEVEL_NULL_INPUT, courseIds); List<Course> courses = getCourseEntities(courseIds); List<CourseAttributes> courseAttributes = new ArrayList<CourseAttributes>(); for (Course c: courses) { courseAttributes.add(new CourseAttributes(c)); } return courseAttributes; }
Source:
<code>private void onSiteInitialized(long HSId, long masterHSId, long dataSinkHSId, boolean schemaHasNoTables) { String nonce = null; String data = null; synchronized(m_lock) { m_snapshotSites.remove(HSId); if (dataSinkHSId != Long.MIN_VALUE) { m_srcToDest.put(masterHSId, dataSinkHSId); } m_rejoiningSites.add(HSId); nonce = m_nonces.get(HSId); if (m_snapshotSites.isEmpty()) { data = makeSnapshotRequest(m_srcToDest); m_srcToDest.clear(); } } if (nonce == null) { throw new RuntimeException("Received an INITIATION_RESPONSE for an HSID for which no nonce exists: " + CoreUtils.hsIdToString(HSId)); } if (data != null && !schemaHasNoTables) { REJOINLOG.debug("Snapshot request: " + data); <START> SnapshotUtil.requestSnapshot(0l, "", nonce, !m_liveRejoin, SnapshotFormat.STREAM, SnapthotPathType.SNAP_CL, data, <END> SnapshotUtil.fatalSnapshotResponseHandler, true); } }</code><technical_language>SnapthotPathType.SNAP_CL a meaning in this snapshot request</technical_language>

Target:
private void onSiteInitialized(long HSId, long masterHSId, long dataSinkHSId, boolean schemaHasNoTables) { String nonce = null; String data = null; synchronized(m_lock) { m_snapshotSites.remove(HSId); if (dataSinkHSId != Long.MIN_VALUE) { m_srcToDest.put(masterHSId, dataSinkHSId); } m_rejoiningSites.add(HSId); nonce = m_nonces.get(HSId); if (m_snapshotSites.isEmpty()) { data = makeSnapshotRequest(m_srcToDest); m_srcToDest.clear(); } } if (nonce == null) { throw new RuntimeException("Received an INITIATION_RESPONSE for an HSID for which no nonce exists: " + CoreUtils.hsIdToString(HSId)); } if (data != null && !schemaHasNoTables) { REJOINLOG.debug("Snapshot request: " + data); SnapshotUtil.requestSnapshot(0l, "", nonce, !m_liveRejoin, SnapshotFormat.STREAM, SnapshotPathType.SNAP_NO_PATH, data, SnapshotUtil.fatalSnapshotResponseHandler, true); } }
Source:
<code>public void dispose() { GitProjectData.removeRepositoryChangeListener(repoChangeListener); IndexDiffCache indexDiffCache = Activator.getDefault() <START> .getIndexDiffCache(); <END> if (indexDiffCache != null) indexDiffCache .removeIndexDiffChangedListener(indexDiffChangeListener); super.dispose(); }</code><technical_language>NPE is if getDefault() returns null. Caused by: java.lang.NullPointerException org.eclipse.egit.core.synchronize.GitSubscriberMergeContext.dispose(GitSubscriberMergeContext.java:110) org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant.dispose(ModelSynchronizeParticipant.java:253) org.eclipse.team.internal.ui.synchronize.SynchronizeManager.dispose(SynchronizeManager.java:574) org.eclipse.team.internal.ui.TeamUIPlugin.stop(TeamUIPlugin.java:250) org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:771) java.security.AccessController.doPrivileged(Native Method) org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:764)</technical_language>

Target:
public void dispose() { GitProjectData.removeRepositoryChangeListener(repoChangeListener); ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); super.dispose(); }
Source:
<code>public long getLength(String path) { <START> return (((Number) getAttributeValue (path, "length")).longValue()); <END> }</code><technical_language>nit: need outermost parens</technical_language>

Target:
public long getLength(String path) { return ((Number) getAttributeValue (path, "length")).longValue(); }
Source:
<code>public static String streamToString(java.io.InputStream is) { java.util.Scanner s = new java.util.Scanner(is).useDelimiter("\\A"); <START> return s.hasNext() ? s.next() : ""; <END> }</code><technical_language>Returning chunk of stream "\A" [implementation] returning entire stream contents [interface] in sync</technical_language>

Target:
public static String streamToString(java.io.InputStream is) { java.util.Scanner s = new java.util.Scanner(is, "UTF-8").useDelimiter("\\A"); return s.hasNext() ? s.next() : ""; }
Source:
<code>private String getAverageExcludingSelfText(boolean showAvgExcludingSelf, DecimalFormat df, Double averageExcludingSelf) { if (showAvgExcludingSelf) { return averageExcludingSelf == null ? "-" : df.format(averageExcludingSelf); } else { return ""; <START> } <END> }</code><technical_language>Surprised PMD complain here. else clause necessary. Edit: PMD rule this. ESLint wins point this</technical_language>

Target:
private String getAverageExcludingSelfText(boolean showAvgExcludingSelf, DecimalFormat df, Double averageExcludingSelf) { if (showAvgExcludingSelf) { return averageExcludingSelf == null ? "-" : df.format(averageExcludingSelf); } return ""; }
Source:
<code>protected static void removeTaskFromDbByTaskId(Guid taskId) { try { if (DbFacade.getInstance().getAsyncTaskDao().remove(taskId) != 0) { <START> log.infoFormat("BaseAsyncTask::RemoveTaskFromDB: Removed task {0} from DataBase", taskId); <END> } } catch (RuntimeException e) { log.error(String.format( "AsyncTaskManager::RemoveTaskFromDB: Removing task %1$s from DataBase threw an exception.", taskId), e); } }</code><technical_language>BaseAsyncTask::RemoveTaskFromDB: removed</technical_language>

Target:
protected static void removeTaskFromDbByTaskId(Guid taskId) { try { if (DbFacade.getInstance().getAsyncTaskDao().remove(taskId) != 0) { log.infoFormat("Removed task {0} from DataBase", taskId); } } catch (RuntimeException e) { log.error(String.format( "Removing task %1$s from DataBase threw an exception.", taskId), e); } }
Source:
<code>public void switch_statement_with_expression_in_case() { final CFG cfg = buildCFG( "void fun() { int a; switch(b) { case c : System.out.println(1);break; case d || e: System.out.println(2);break;} }"); final CFGChecker cfgChecker = checker( block( element(Kind.CASE_GROUP), element(Kind.IDENTIFIER, "c"), element(Kind.IDENTIFIER, "System"), element(Kind.MEMBER_SELECT), element(INT_LITERAL, "1"), element(Tree.Kind.METHOD_INVOCATION)).successors(0), block( element(Kind.CASE_GROUP), element(Kind.IDENTIFIER, "d")).terminator(Kind.CONDITIONAL_OR).successors(2, 3), block( element(Kind.IDENTIFIER, "e")).successors(2), <START> block( <END> element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(INT_LITERAL, "2"), element(Tree.Kind.METHOD_INVOCATION)).terminator(Tree.Kind.BREAK_STATEMENT).successors(0), block( element(Tree.Kind.VARIABLE, "a"), element(Tree.Kind.IDENTIFIER, "b")).terminator(Tree.Kind.SWITCH_STATEMENT).successors(0, 4, 5)); cfgChecker.check(cfg); }</code><technical_language>if syntactically valid, this compile. boolean operator here, switch a boolean parameter. (also out of scope of ticket)</technical_language>

Target:
public void switch_statement_with_expression_in_case() { final CFG cfg = buildCFG( "void fun() { int a; switch(b) { case c : System.out.println(1);break; case d || e: System.out.println(2);break;} }"); final CFGChecker cfgChecker = checker( block( element(Kind.IDENTIFIER, "c"), element(Kind.IDENTIFIER, "System"), element(Kind.MEMBER_SELECT), element(INT_LITERAL, "1"), element(Tree.Kind.METHOD_INVOCATION)).hasCaseGroup().successors(0), block( element(Kind.IDENTIFIER, "d")).terminator(Kind.CONDITIONAL_OR).hasCaseGroup().successors(2, 3), block( element(Kind.IDENTIFIER, "e")).successors(2), block( element(Tree.Kind.IDENTIFIER, "System"), element(Tree.Kind.MEMBER_SELECT), element(INT_LITERAL, "2"), element(Tree.Kind.METHOD_INVOCATION)).terminator(Tree.Kind.BREAK_STATEMENT).successors(0), block( element(Tree.Kind.VARIABLE, "a"), element(Tree.Kind.IDENTIFIER, "b")).terminator(Tree.Kind.SWITCH_STATEMENT).successors(0, 4, 5)); cfgChecker.check(cfg); }
Source:
<code>public List<Note> call() throws JGitInternalException { checkCallable(); List<Note> notes = new ArrayList<Note>(); RevWalk walk = new RevWalk(repo); <START> ObjectInserter inserter = repo.newObjectInserter(); <END> NoteMap map = NoteMap.newEmptyMap(); try { Ref ref = repo.getRef(notesRef); if (ref != null) { RevCommit notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } Iterator<Note> i = map.iterator(); while (i.hasNext()) notes.add(i.next()); inserter.flush(); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } finally { inserter.release(); walk.release(); } return notes; }</code><technical_language>Unnecessary</technical_language>

Target:
public List<Note> call() throws JGitInternalException { checkCallable(); List<Note> notes = new ArrayList<Note>(); RevWalk walk = new RevWalk(repo); NoteMap map = NoteMap.newEmptyMap(); try { Ref ref = repo.getRef(notesRef); if (ref != null) { RevCommit notesCommit = walk.parseCommit(ref.getObjectId()); map = NoteMap.read(walk.getObjectReader(), notesCommit); } Iterator<Note> i = map.iterator(); while (i.hasNext()) notes.add(i.next()); } catch (IOException e) { throw new JGitInternalException(e.getMessage(), e); } finally { walk.release(); } return notes; }
Source:
<code>private VmDevice createVmDevice(Guid vmGuid) { Map<String, String> customProp = new LinkedHashMap<>(); <START> customProp.put("prop1", "value1"); <END> return new VmDevice(new VmDeviceId(Guid.newGuid(), vmGuid), VmDeviceGeneralType.DISK, "floppy", "type:'drive', controller:'0', bus:'0', unit:'1'", 2, new HashMap<String, Object>(), true, false, false, "alias", customProp, null, null); }</code><technical_language>remove customProp Collections.singletonMap</technical_language>

Target:
private VmDevice createVmDevice(Guid vmGuid) { return new VmDevice(new VmDeviceId(Guid.newGuid(), vmGuid), VmDeviceGeneralType.DISK, "floppy", "type:'drive', controller:'0', bus:'0', unit:'1'", 2, new HashMap<String, Object>(), true, false, false, "alias", Collections.singletonMap("prop1", "value1"), null, null); }
Source:
<code>public Collection<RefRight> getInheritedRights() { if (isSpecialWildProject()) { <START> return Collections.emptySet(); <END> } return inheritedRights.get(); }</code><technical_language>Pointless modification. drop change</technical_language>

Target:
public Collection<RefRight> getInheritedRights() { if (isSpecialWildProject()) { return Collections.emptyList(); } return inheritedRights.get(); }