auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private List<String> getResourcesFromFile(String resourceNameType, Path filePath) { List<String> resourceNames = new ArrayList<>(); try (BufferedReader reader = new BufferedReader(new FileReader(filePath.toString()))) { StringBuilder builder = new StringBuilder(); String line; <START> while ((line = reader.readLine()) != null) { <END> builder.append(line); } JSONObject jsonObject = new JSONObject(builder.toString()); if (jsonObject.has(resourceNameType)) { try { JSONArray resources = jsonObject.getJSONArray(resourceNameType); for (int i = 0; i < resources.length(); i++) { String resource = resources.getString(i); resourceNames.add(resource); LOG.info("Get '{}' JSON array '{}' element from resource file with: '{}'.", resourceNameType, i, resource); } } catch (JSONException e) { String resource = jsonObject.getString(resourceNameType); resourceNames.add(resource); LOG.info("Get '{}' JSON object from resource file with: '{}'.", resourceNameType, resource); } } else { LOG.error("Cannot find '{}' in resource file '{}'.", resourceNameType, filePath.getFileName()); } return resourceNames; } catch (JSONException e) { LOG.warn("Cannot get '{}' key, because of: {}", resourceNameType, e.getMessage(), e); return resourceNames; } catch (FileNotFoundException e) { LOG.warn("'{}' file not found, because of: {}", filePath, e.getMessage(), e); return resourceNames; } catch (IOException e) { LOG.warn("Reading '{}' file throws exception: {}", filePath, e.getMessage(), e); return resourceNames; } }</code><technical_language>Please this standard library method for file reading: <LINK_0></technical_language>

Target:
private List<String> getResourcesFromFile(String resourceNameType, Path filePath) { List<String> resourceNames = new ArrayList<>(); try { String resourcesFromFile = Files.readString(filePath); JSONObject jsonObject = new JSONObject(resourcesFromFile); if (jsonObject.has(resourceNameType)) { try { JSONArray resources = jsonObject.getJSONArray(resourceNameType); for (int i = 0; i < resources.length(); i++) { String resource = resources.getString(i); resourceNames.add(resource); LOG.info("Get '{}' JSON array '{}' element from resource file with: '{}'.", resourceNameType, i, resource); } } catch (JSONException e) { String resource = jsonObject.getString(resourceNameType); resourceNames.add(resource); LOG.info("Get '{}' JSON object from resource file with: '{}'.", resourceNameType, resource); } } else { LOG.error("Cannot find '{}' in resource file '{}'.", resourceNameType, filePath.getFileName()); } return resourceNames; } catch (JSONException e) { LOG.warn("Cannot get '{}' key, because of: {}", resourceNameType, e.getMessage(), e); return resourceNames; } catch (FileNotFoundException e) { LOG.warn("'{}' file not found, because of: {}", filePath, e.getMessage(), e); return resourceNames; } catch (IOException e) { LOG.warn("Reading '{}' file throws exception: {}", filePath, e.getMessage(), e); return resourceNames; } }
Source:
<code>public void test_changelog_with_merge_commit_and_first_parent() throws Exception { w.init(); w.commitEmpty("init"); w.git.branch("branch-1"); w.git.checkout("branch-1"); w.touch("file-1", "content-1"); w.git.add("file-1"); w.git.commit("commit-1"); String commitSha1 = w.git.revParse("HEAD").name(); w.git.checkout("master"); String mergeMessage = "Merge message to be tested."; w.git.merge().setMessage(mergeMessage).setGitPluginFastForwardMode(MergeCommand.GitPluginFastForwardMode.NO_FF).setRevisionToMerge(w.git.getHeadRev(w.repoPath(), "branch-1")).execute(); <START> if (w.git instanceof CliGitAPIImpl) { <END> StringWriter writer = new StringWriter(); w.git.changelog().firstParent().to(writer).execute(); assertThat(writer.toString(),isEmptyString()); } }</code><technical_language>I suggest @NotImplementedInJGit test method instead of this instanceof check. is more descriptive</technical_language>

Target:
public void test_changelog_with_merge_commit_and_first_parent() throws Exception { w.init(); w.commitEmpty("init"); w.git.branch("branch-1"); w.git.checkout("branch-1"); w.touch("file-1", "content-1"); w.git.add("file-1"); w.git.commit("commit-1"); String commitSha1 = w.git.revParse("HEAD").name(); w.git.checkout("master"); String mergeMessage = "Merge message to be tested."; w.git.merge().setMessage(mergeMessage).setGitPluginFastForwardMode(MergeCommand.GitPluginFastForwardMode.NO_FF).setRevisionToMerge(w.git.getHeadRev(w.repoPath(), "branch-1")).execute(); StringWriter writer = new StringWriter(); w.git.changelog().firstParent().to(writer).execute(); assertThat(writer.toString(),isEmptyString()); }
Source:
<code>public void testMexParsingWs2005() throws Exception { StringBuilder sb = new StringBuilder(); try (BufferedReader br = new BufferedReader(new FileReader( <START> (this.getClass().getResource( <END> TestConfiguration.AAD_MEX_2005_RESPONSE_FILE).getFile())))) { String line = br.readLine(); while (line != null) { sb.append(line); sb.append(System.lineSeparator()); line = br.readLine(); } } BindingPolicy endpoint = MexParser.getWsTrustEndpointFromMexResponse(sb .toString()); Assert.assertEquals(endpoint.getUrl(),"<LINK_0>"); }</code><technical_language>Super nitpick: Unnecessary parentheses</technical_language>

Target:
public void testMexParsingWs2005() throws Exception { StringBuilder sb = new StringBuilder(); try (BufferedReader br = new BufferedReader(new FileReader( this.getClass().getResource( TestConfiguration.AAD_MEX_2005_RESPONSE_FILE).getFile()))) { String line = br.readLine(); while (line != null) { sb.append(line); sb.append(System.lineSeparator()); line = br.readLine(); } } BindingPolicy endpoint = MexParser.getWsTrustEndpointFromMexResponse(sb .toString()); Assert.assertEquals(endpoint.getUrl(),"<LINK_0>"); }
Source:
<code>public ExecutorFactory(Configuration configuration) { this.executor = new LocalExecutor(); if (configuration != null) { <START> if (configuration.getExecution().getMode().equalsIgnoreCase("local")) { <END> this.executor = new LocalExecutor(); } else if (configuration.getExecution().getMode().equalsIgnoreCase("sge")) { this.executor = new SGEExecutor(configuration); System.out.println("SGE not ready"); } else if (configuration.getExecution().getMode().equalsIgnoreCase("azure")) { this.executor = new AzureBatchExecutor(configuration); } } }</code><technical_language>a switch/case statement</technical_language>

Target:
public ExecutorFactory(Configuration configuration) { String mode = StringUtils.isEmpty(configuration.getExecution().getMode()) ? "local" : configuration.getExecution().getMode().toLowerCase(); switch (mode) { case "local": this.executor = new LocalExecutor(); break; case "sge": this.executor = new SGEExecutor(configuration); break; case "azure": this.executor = new AzureBatchExecutor(configuration); break; default: throw new UnsupportedOperationException("nonsoupported execution mode { " + mode + " }, accepted modes are : local, sge, azure"); } }
Source:
<code>public static <T extends Number> T subtract(final T ... values) { if (values.length == 0) return null; T result = values[0]; for (int i = 1; i < values.length; i++) { if (result instanceof java.math.BigDecimal) { result = add(result, (T) java.math.BigDecimal.valueOf(values[i].longValue() * -1)); } else if (result instanceof java.math.BigInteger) { <START> result = add(result, (T) java.math.BigInteger.valueOf(values[i].longValue() * -1)); <END> } else if (result instanceof Byte) { result = add(result, (T) Byte.valueOf((byte) (values[i].byteValue() * -1))); } else if (result instanceof Double) { result = add(result, (T) Double.valueOf(values[i].doubleValue() * -1)); } else if (result instanceof Float) { result = add(result, (T) Float.valueOf(values[i].floatValue() * -1)); } else if (result instanceof Integer) { result = add(result, (T) Integer.valueOf(values[i].intValue() * -1)); } else if (result instanceof Long) { result = add(result, (T) Long.valueOf(values[i].longValue() * -1)); } else if (result instanceof Short) { result = add(result, (T) Short.valueOf((short) (values[i].shortValue() * -1))); } } return result; }</code><technical_language>negative method for BigDecimal/BigInteger</technical_language>

Target:
public static <T extends Number> T subtract(final T ... values) { if (values.length == 0) { return null; } T result = values[0]; for (int i = 1; i < values.length; i++) { if (result instanceof java.math.BigDecimal) { java.math.BigDecimal value = (java.math.BigDecimal) values[i]; result = add(result, (T) value.negate()); } else if (result instanceof java.math.BigInteger) { java.math.BigInteger value = (java.math.BigInteger) values[i]; result = add(result, (T) value.negate()); } else if (result instanceof Byte) { result = add(result, (T) Byte.valueOf((byte) (values[i].byteValue() * -1))); } else if (result instanceof Double) { result = add(result, (T) Double.valueOf(values[i].doubleValue() * -1)); } else if (result instanceof Float) { result = add(result, (T) Float.valueOf(values[i].floatValue() * -1)); } else if (result instanceof Integer) { result = add(result, (T) Integer.valueOf(values[i].intValue() * -1)); } else if (result instanceof Long) { result = add(result, (T) Long.valueOf(values[i].longValue() * -1)); } else if (result instanceof Short) { result = add(result, (T) Short.valueOf((short) (values[i].shortValue() * -1))); } } return result; }
Source:
<code><START> public THttpTransport(CloseableHttpClient httpClient, String url, <END> int requestSizeLimit, int responseSizeLimit) { this.httpClient = httpClient; this.url = url; this.requestSizeLimit = requestSizeLimit; this.responseSizeLimit = responseSizeLimit; this.frameBuffer = new ArrayBlockingQueue<>(FRAME_BUFFER_SIZE); this.requestBuffer = new ByteArrayOutputStream(); }</code><technical_language>Please a builder instead of constructors. more flexible for future refactors</technical_language>

Target:
private THttpTransport(CloseableHttpClient httpClient, String url, int requestSizeLimit, int responseSizeLimit) { this.httpClient = httpClient; this.url = url; this.requestSizeLimit = requestSizeLimit; this.responseSizeLimit = responseSizeLimit; this.frameBuffer = new ArrayBlockingQueue<>(FRAME_BUFFER_SIZE); this.requestBuffer = new ByteArrayOutputStream(); }
Source:
<code>public Config[] createGmosConfig(GmosParameters gmosParams, int numExp) { Config[] conf = createCommonConfig(numExp); for (Config step : conf) { <START> System.out.println("SIte: " + gmosParams.site().displayName); <END> if (gmosParams.site().displayName.equals("Gemini North")) { step.putItem(InstInstrumentKey, "GMOS-N"); } else if (gmosParams.site().displayName.equals("Gemini South")) { step.putItem(InstInstrumentKey, "GMOS-S"); } else { throw new Error("invalid site"); } step.putItem(FPUKey, (gmosParams.fpMask().displayValue())); step.putItem(AmpReadModeKey, (gmosParams.ampReadMode())); step.putItem(DetectorManufacturerKey, (gmosParams.ccdType())); step.putItem(BuiltinROIKey, (gmosParams.builtinROI())); step.putItem(DisperserKey, (gmosParams.grating().displayValue())); GmosCommonType.Binning xbin = GmosCommonType.Binning.getBinningByValue(gmosParams.spectralBinning()); GmosCommonType.Binning ybin = GmosCommonType.Binning.getBinningByValue(gmosParams.spatialBinning()); step.putItem(CcdXBinning, xbin); step.putItem(CcdYBinning, ybin); step.putItem(AmpGain, (gmosParams.ampGain())); if (gmosParams.ccdType().displayValue().equals("E2V")) { step.putItem(AmpCount, GmosCommonType.AmpCount.SIX); } else { step.putItem(AmpCount, GmosCommonType.AmpCount.TWELVE); } } return conf; }</code><technical_language>Typo: **Site**, SIte</technical_language>

Target:
public ConfigCreatorResult createGmosConfig(GmosParameters gmosParams, int numExp) { ConfigCreatorResult result = createCommonConfig(numExp); for (Config step : result.getConfig()) { if (gmosParams.site().equals(Site.GN)) { step.putItem(InstInstrumentKey, SPComponentType.INSTRUMENT_GMOS); } else if (gmosParams.site().equals(Site.GS)) { step.putItem(InstInstrumentKey, SPComponentType.INSTRUMENT_GMOSSOUTH); } else { throw new Error("Invalid site"); } step.putItem(FPUKey, (gmosParams.fpMask())); step.putItem(AmpReadModeKey, (gmosParams.ampReadMode())); step.putItem(DetectorManufacturerKey, (gmosParams.ccdType())); step.putItem(BuiltinROIKey, (gmosParams.builtinROI())); step.putItem(DisperserKey, (gmosParams.grating())); GmosCommonType.Binning xbin = GmosCommonType.Binning.getBinningByValue(gmosParams.spectralBinning()); GmosCommonType.Binning ybin = GmosCommonType.Binning.getBinningByValue(gmosParams.spatialBinning()); step.putItem(CcdXBinning, xbin); step.putItem(CcdYBinning, ybin); step.putItem(AmpGain, (gmosParams.ampGain())); if (gmosParams.ccdType().equals(GmosCommonType.DetectorManufacturer.E2V)) { step.putItem(AmpCount, GmosCommonType.AmpCount.SIX); } else if (gmosParams.ccdType().equals(GmosCommonType.DetectorManufacturer.HAMAMATSU)){ step.putItem(AmpCount, GmosCommonType.AmpCount.TWELVE); } else { throw new Error("Invalid detector type"); } } return result; }
Source:
<code>public PlanNode visitApply(ApplyNode node, RewriteContext<Void> context) { List<PlanNode> sources = recursionStrategy.process(node, context); checkState(sources.size() == 2, "Apply node expects two sources only, but got: %s", sources.size()); return new ApplyNode( planNodeIdAllocationStrategy.getId(node), sources.get(0), sources.get(1), mapAndDistinct(node.getSubqueryAssignments()), mapAndDistinct(node.getCorrelation())); <START> } <END></code><technical_language>Is necessary map rows? I assumed literals, I guess types ensure that</technical_language>

Target:
public PlanNode visitApply(ApplyNode node, RewriteContext<Void> context) { List<PlanNode> sources = recursionStrategy.process(node, context); checkState(sources.size() == 2, "Apply node expects two sources only, but got: %s", sources.size()); return new ApplyNode( planNodeIdGenerationStrategy.getPlanNodeId(node), sources.get(0), sources.get(1), mapAndDistinct(node.getSubqueryAssignments()), mapAndDistinct(node.getCorrelation()), node.getOriginSubquery()); }
Source:
<code>public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() == MERGED) { return; } if (target.getSource() == RIGHT) { for (Diff diff : target.getRefines()) { <START> getMergerDelegate(diff).copyRightToLeft(diff, monitor); <END> } } if (target.getState() == MERGED) { return; } if (target.getSource() == RIGHT && target.getKind() != DELETE) { super.copyRightToLeft(target, monitor); } else if (target.getSource() == LEFT && target.getKind() == DELETE) { super.copyRightToLeft(target, monitor); } else { target.setState(MERGED); for (Diff refiningDiff : target.getRefinedBy()) { refiningDiff.setState(MERGED); } } }</code><technical_language>a good question... I forgot remove :)</technical_language>

Target:
public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() == MERGED) { return; } if (target.getSource() == RIGHT && target.getKind() != DELETE) { super.copyRightToLeft(target, monitor); } else if (target.getSource() == LEFT && target.getKind() == DELETE) { super.copyRightToLeft(target, monitor); } else { target.setState(MERGED); for (Diff refiningDiff : target.getRefinedBy()) { refiningDiff.setState(MERGED); } } }
Source:
<code>GHReleaseUpdater(GHRelease base) { this.base = base; <START> this.builder = base.root.retrieve().method("POST"); <END> }</code><technical_language>remove method("POST")</technical_language>

Target:
GHReleaseUpdater(GHRelease base) { this.base = base; this.builder = base.root.createRequest(); }
Source:
<code>private String splitAppendedTenantDomain(String issuer) throws UserStoreException, IdentityException { if (issuer.contains("@")) { String tenantDomain = issuer.substring(issuer.lastIndexOf('@') + 1); issuer = issuer.substring(0, issuer.lastIndexOf('@')); <START> if (StringUtils.isNotEmpty(tenantDomain) && StringUtils.isNotEmpty(issuer)) { <END> SAMLSSOUtil.setTenantDomainInThreadLocal(tenantDomain); if (log.isDebugEnabled()) { log.debug("Tenant Domain :" + " " + tenantDomain + " " + "&" + " " + "Issuer name :" + issuer + " " + "has being spilt"); } } } return issuer; }</code><technical_language>isNotEmpty check isNotBlank</technical_language>

Target:
private String splitAppendedTenantDomain(String issuer) throws UserStoreException, IdentityException { if (issuer.contains("@")) { String tenantDomain = issuer.substring(issuer.lastIndexOf('@') + 1); issuer = issuer.substring(0, issuer.lastIndexOf('@')); if (StringUtils.isNotBlank(tenantDomain) && StringUtils.isNotBlank(issuer)) { SAMLSSOUtil.setTenantDomainInThreadLocal(tenantDomain); if (log.isDebugEnabled()) { log.debug("Tenant Domain :" + " " + tenantDomain + " " + "&" + " " + "Issuer name :" + issuer + " " + "has being spilt"); } } } return issuer; }
Source:
<code>public Reader restoreReader(Configuration config, FileSourceSplit split) throws IOException { Reader reader = new Reader(config, split); reader.seek(split.getReaderPosition().get().getRecordsAfterOffset()); <START> return null; <END> }</code><technical_language>return reader</technical_language>

Target:
public Reader restoreReader(Configuration config, FileSourceSplit split) throws IOException { Reader reader = new Reader(config, split); reader.seek(split.getReaderPosition().get().getRecordsAfterOffset()); return reader; }
Source:
<code>public Response installInterpreter(@NotNull String message) { logger.info("Install interpreter: {}", message); <START> InterpreterInstallationRequest request = gson <END> .fromJson(message, InterpreterInstallationRequest.class); try { interpreterService.installInterpreter(request); } catch (Throwable t) { return new JsonResponse<>(Status.INTERNAL_SERVER_ERROR, t.getMessage()).build(); } return new JsonResponse<>(Status.OK).build(); }</code><technical_language>put method toJson fromJson InterpreterInstallationRequest other classes (Note, Paragraph etc)</technical_language>

Target:
public Response installInterpreter(@NotNull String message) { logger.info("Install interpreter: {}", message); InterpreterInstallationRequest request = InterpreterInstallationRequest.fromJson(message); try { interpreterService.installInterpreter( request, new ServiceCallback() { @Override public void onStart(String message) { Message m = new Message(OP.INTERPRETER_INSTALL_STARTED); Map<String, Object> data = Maps.newHashMap(); data.put("result", "Starting"); data.put("message", message); m.data = data; notebookServer.broadcast(m); } @Override public void onSuccess(String message) { Message m = new Message(OP.INTERPRETER_INSTALL_RESULT); Map<String, Object> data = Maps.newHashMap(); data.put("result", "Succeed"); data.put("message", message); m.data = data; notebookServer.broadcast(m); } @Override public void onFailure(String message) { Message m = new Message(OP.INTERPRETER_INSTALL_RESULT); Map<String, Object> data = Maps.newHashMap(); data.put("result", "Failed"); data.put("message", message); m.data = data; notebookServer.broadcast(m); } }); } catch (Throwable t) { return new JsonResponse<>(Status.INTERNAL_SERVER_ERROR, t.getMessage()).build(); } return new JsonResponse<>(Status.OK).build(); }
Source:
<code>private IASTTranslationUnit <START> getAST() <END> { IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) return null; IWorkbenchPage page = window.getActivePage(); if (page == null) return null; IEditorPart editor = page.getActiveEditor(); if (editor == null) return null; IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager(); ITranslationUnit unit = manager.getWorkingCopy(editor.getEditorInput()); if (unit == null) return null; try { IASTTranslationUnit ast = unit.getAST(null, ITranslationUnit.AST_SKIP_ALL_HEADERS); return ast; } catch (CModelException e) { CUIPlugin.log(e); } catch (CoreException e) { CUIPlugin.log(e); } return null; }</code><technical_language>Is a possibility this method caused multiple times for a single user action? If so, parsing code multiple times avoided</technical_language>

Target:
private IASTTranslationUnit getAST() { if (fTranslationUnit != null) return fTranslationUnit; IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) return null; IWorkbenchPage page = window.getActivePage(); if (page == null) return null; IEditorPart editor = page.getActiveEditor(); if (editor == null) return null; IWorkingCopyManager manager = CUIPlugin.getDefault().getWorkingCopyManager(); ITranslationUnit unit = manager.getWorkingCopy(editor.getEditorInput()); if (unit == null) return null; try { fTranslationUnit = unit.getAST(null, ITranslationUnit.AST_SKIP_ALL_HEADERS); return fTranslationUnit; } catch (CoreException e) { CUIPlugin.log(e); } return null; }
Source:
<code>private void loadGeodatabaseSymbolDictionary() { <START> Geodatabase geodatabase = new Geodatabase(Environment.getExternalStorageDirectory() + "/ArcGIS/samples/Dictionary/militaryoverlay.geodatabase"); <END> geodatabase.loadAsync(); DictionarySymbolStyle symbolDictionary = new DictionarySymbolStyle("mil2525d", Environment.getExternalStorageDirectory() + "/ArcGIS/samples/Dictionary/mil2525d.stylx"); symbolDictionary.loadAsync(); geodatabase.addDoneLoadingListener(() -> { if (geodatabase.getLoadStatus() == LoadStatus.LOADED) { for (GeodatabaseFeatureTable table : geodatabase.getGeodatabaseFeatureTables()) { FeatureLayer featureLayer = new FeatureLayer(table); featureLayer.loadAsync(); featureLayer.setMinScale(1000000); mMapView.getMap().getOperationalLayers().add(featureLayer); DictionaryRenderer dictionaryRenderer = new DictionaryRenderer(symbolDictionary); featureLayer.setRenderer(dictionaryRenderer); featureLayer.addDoneLoadingListener(() -> { if (featureLayer.getLoadStatus() == LoadStatus.LOADED) { mMapView.setViewpointGeometryAsync(featureLayer.getFullExtent()); } else { String error = "Feature Layer Failed to Load!"; Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); } } else { String error = "Geodatabase Failed to Load!"; Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); }</code><technical_language>extract string resource (I alt + enter string offer a do automatically)</technical_language>

Target:
private void loadGeodatabaseSymbolDictionary() { Geodatabase geodatabase = new Geodatabase( Environment.getExternalStorageDirectory() + getString(R.string.militaryoverlay_geodatabase)); geodatabase.loadAsync(); DictionarySymbolStyle symbolDictionary = new DictionarySymbolStyle("mil2525d", Environment.getExternalStorageDirectory() + getString(R.string.mil2525d_stylx)); symbolDictionary.loadAsync(); geodatabase.addDoneLoadingListener(() -> { if (geodatabase.getLoadStatus() == LoadStatus.LOADED) { for (GeodatabaseFeatureTable table : geodatabase.getGeodatabaseFeatureTables()) { FeatureLayer featureLayer = new FeatureLayer(table); featureLayer.loadAsync(); featureLayer.setMinScale(1000000); mMapView.getMap().getOperationalLayers().add(featureLayer); DictionaryRenderer dictionaryRenderer = new DictionaryRenderer(symbolDictionary); featureLayer.setRenderer(dictionaryRenderer); featureLayer.addDoneLoadingListener(() -> { if (featureLayer.getLoadStatus() == LoadStatus.LOADED) { mMapView.setViewpointGeometryAsync(featureLayer.getFullExtent()); } else { String error = "Feature Layer Failed to Load: " + featureLayer.getLoadError().getMessage(); Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); } } else { String error = "Geodatabase Failed to Load: " + geodatabase.getLoadError().getMessage(); Toast.makeText(this, error, Toast.LENGTH_LONG).show(); Log.e(TAG, error); } }); }
Source:
<code>public OperationFuture<LoadBalancerPool> update( LoadBalancerPool loadBalancerPool, List<LoadBalancerNodeMetadata> nodesList ) { LoadBalancer loadBalancer = loadBalancerPool.getLoadBalancer(); <START> loadBalancerNodeClient.update( <END> fetchDataCenterId(loadBalancer.getDataCenter()), fetchLoadBalancerId(loadBalancer), fetchLoadBalancerPoolId(loadBalancerPool), nodesList ); return new OperationFuture<>( loadBalancerPool, new NoWaitingJobFuture() ); }</code><technical_language>If I understood correctly, load balancer pool, extract needed information it. (getDataCenterId, getLoadBalancerId)</technical_language>

Target:
public OperationFuture<LoadBalancerPool> update( LoadBalancerPool loadBalancerPool, List<LoadBalancerNodeMetadata> nodesList ) { LoadBalancerPoolMetadata loadBalancerPoolMetadata = loadBalancerPoolService.findByRef( loadBalancerPool ); loadBalancerNodeClient.update( loadBalancerPoolMetadata.getDataCenterId(), loadBalancerPoolMetadata.getLoadBalancerId(), loadBalancerPoolMetadata.getId(), nodesList ); return new OperationFuture<>( loadBalancerPool, new NoWaitingJobFuture() ); }
Source:
<code>public void clusterShouldNotElectNewLeader() throws Exception { int leaderId = 0; clusterRule.withInstanceCoreParam( CausalClusteringSettings.refuse_to_be_leader, ( x ) -> { if ( x == leaderId ) { return "false"; } else { return "true"; } } ); Cluster cluster = clusterRule.createCluster(); cluster.start(); <START> cluster.awaitLeader(); <END> cluster.coreTx( ( db, tx ) -> { Node node = db.createNode( label( "boo" ) ); node.setProperty( "foobar", "baz_bat" ); tx.success(); } ); cluster.removeCoreMemberWithMemberId( leaderId ); try { cluster.awaitLeader(10, SECONDS); fail( "Should not have elected a leader" ); } catch ( TimeoutException ex ) { } }</code><technical_language>assert leader is expected instance</technical_language>

Target:
public void clusterShouldNotElectNewLeader() throws Exception { int leaderId = 0; clusterRule.withInstanceCoreParam( CausalClusteringSettings.refuse_to_be_leader, ( x ) -> { if ( x == leaderId ) { return "false"; } else { return "true"; } } ); Cluster cluster = clusterRule.createCluster(); cluster.start(); assertEquals( leaderId, cluster.awaitLeader().serverId() ); cluster.coreTx( ( db, tx ) -> { Node node = db.createNode( label( "boo" ) ); node.setProperty( "foobar", "baz_bat" ); tx.success(); } ); cluster.removeCoreMemberWithMemberId( leaderId ); try { cluster.awaitLeader(10, SECONDS); fail( "Should not have elected a leader" ); } catch ( TimeoutException ex ) { } }
Source:
<code><START> public void addMoodToMessage(Message message, Mood mood) { <END> addMoodToMessage(message, mood, null); }</code><technical_language>static</technical_language>

Target:
public static void addMoodToMessage(Message message, Mood mood) { addMoodToMessage(message, mood, null); }
Source:
<code>public SearchResult searchByCenter(@NonNull final Geopoint center) { <START> return new SearchResult(); <END> }</code><technical_language>search center? affect nearby other search contexts lead list results</technical_language>

Target:
public SearchResult searchByCenter(@NonNull final Geopoint center) { try { return new SearchResult(SuApi.searchByCenter(center, 20, this)); } catch (final SuApi.NotAuthorizedException e) { return new SearchResult(StatusCode.NOT_LOGGED_IN); } catch (final SuApi.ConnectionErrorException e) { return new SearchResult(StatusCode.CONNECTION_FAILED_SU); } catch (final Exception e) { Log.e("SuConnector.searchByCenter failed: ", e); return new SearchResult(StatusCode.UNKNOWN_ERROR); } }
Source:
<code>private short[] mergeShortHashes(SparseHll other) { short[] result = new short[numberOfHashes + other.numberOfHashes]; int leftIndex = 0; int rightIndex = 0; int index = 0; while (leftIndex < numberOfHashes && rightIndex < other.numberOfHashes) { int left = shortHashes[leftIndex] & 0xFFFF; int right = other.shortHashes[rightIndex] & 0xFFFF; if (left < right) { result[index++] = shortHashes[leftIndex++]; } else if (left > right) { result[index++] = other.shortHashes[rightIndex++]; } else { <START> result[index] = shortHashes[leftIndex]; <END> index++; leftIndex++; rightIndex++; } } while (leftIndex < numberOfHashes) { result[index++] = shortHashes[leftIndex++]; } while (rightIndex < other.numberOfHashes) { result[index++] = other.shortHashes[rightIndex++]; } return Arrays.copyOf(result, index); }</code><technical_language>This result[index++]</technical_language>

Target:
private short[] mergeShortHashes(SparseHll other) { short[] result = new short[numberOfHashes + other.numberOfHashes]; int leftIndex = 0; int rightIndex = 0; int index = 0; while (leftIndex < numberOfHashes && rightIndex < other.numberOfHashes) { int left = shortHashes[leftIndex] & 0xFFFF; int right = other.shortHashes[rightIndex] & 0xFFFF; if (left < right) { result[index++] = shortHashes[leftIndex++]; } else if (left > right) { result[index++] = other.shortHashes[rightIndex++]; } else { result[index++] = shortHashes[leftIndex]; leftIndex++; rightIndex++; } } while (leftIndex < numberOfHashes) { result[index++] = shortHashes[leftIndex++]; } while (rightIndex < other.numberOfHashes) { result[index++] = other.shortHashes[rightIndex++]; } return Arrays.copyOf(result, index); }
Source:
<code><START> public AggregationBuilder addAggregation(Symbol output, Expression expression, List<Type> inputTypes, Optional<Symbol> mask) <END> { checkArgument(expression instanceof FunctionCall); FunctionCall aggregation = (FunctionCall) expression; Signature signature = metadata.getFunctionRegistry().resolveFunction(aggregation.getName(), TypeSignatureProvider.fromTypes(inputTypes)); return addAggregation(output, new Aggregation(aggregation, signature, mask)); }</code><technical_language>this method get rid of Optional? in case of Optional.empty() method added called</technical_language>

Target:
private AggregationBuilder addAggregation(Symbol output, Expression expression, List<Type> inputTypes, Optional<Symbol> mask) { checkArgument(expression instanceof FunctionCall); FunctionCall aggregation = (FunctionCall) expression; Signature signature = metadata.getFunctionRegistry().resolveFunction(aggregation.getName(), TypeSignatureProvider.fromTypes(inputTypes)); return addAggregation(output, new Aggregation(aggregation, signature, mask)); }
Source:
<code>public static List<String> getNationalities() { List<String> nationalities = new ArrayList<>(); for (String nationality : NATIONALITIES) { nationalities.add(nationality); } <START> return nationalities; <END> }</code><technical_language>@sznicci Arrays.asList() instead</technical_language>

Target:
public static List<String> getNationalities() { return Arrays.asList(NATIONALITIES); }
Source:
<code>protected KieContainer getKieContainer(Path path) { KieModule kieModule = moduleService.resolveModule(path); KieContainer kieContainer = buildInfoService.getBuildInfo(kieModule).getKieContainer(); if (kieContainer == null) { <START> throw new IllegalArgumentException("Impossible to retrieve KieContainer, please fix compilation errors of " + <END> "the project and then build it again."); } return kieContainer; }</code><technical_language>Change message to: > Retrieving KieContainer failed. Fix compilation errors project build project again</technical_language>

Target:
protected KieContainer getKieContainer(Path path) { KieModule kieModule = moduleService.resolveModule(path); KieContainer kieContainer = buildInfoService.getBuildInfo(kieModule).getKieContainer(); if (kieContainer == null) { throw new IllegalArgumentException("Retrieving KieContainer has failed. Fix all compilation errors within the " + "project and build the project again."); } return kieContainer; }
Source:
<code>public int getAuditerMessagesCount(PerunSession perunSession) throws InternalErrorException, PrivilegeException { if (!AuthzResolver.isAuthorized(perunSession, Role.PERUNADMIN)) { throw new PrivilegeException(perunSession, "getAuditerMessagesCount"); <START> } <END> return getAuditMessagesManagerBl().getAuditerMessagesCount(perunSession); }</code><technical_language>This is nagios, restrictions probe broken</technical_language>

Target:
public int getAuditerMessagesCount(PerunSession perunSession) throws InternalErrorException { return getAuditMessagesManagerBl().getAuditerMessagesCount(perunSession); }
Source:
<code>public MBeanNamespaceManager(String baseName) { <START> this.baseNamespace = baseName; <END> }</code><technical_language>Check for null</technical_language>

Target:
private MBeanNamespaceManager(String baseName) { requireNonNull(baseName, "baseName is null"); this.baseNamespace = baseName; }
Source:
<code>protected void updateMipmapLevel(int level, long endTime) { try { List<ITmfStateInterval> lowerIntervals = intervals.get(level - 1); if (lowerIntervals.size() == 0) { return; } long startTime = lowerIntervals.get(0).getStartTime(); ITmfStateValue value = computeMipmapValue(lowerIntervals, startTime, endTime); lowerIntervals.clear(); int levelQuark = ss.getQuarkRelativeAndAdd(mipmapQuark, String.valueOf(level)); if (!checkLevelExists(level)) { addLevelQuark(levelQuark); ss.updateOngoingState(TmfStateValue.newValueInt(level), mipmapQuark); intervals.add(new ArrayList<ITmfStateInterval>(getMipmapResolution())); } ITmfStateInterval interval = new TmfStateInterval(startTime, endTime, levelQuark, value); intervals.get(level).add(interval); ss.modifyAttribute(startTime, value, levelQuark); } catch (StateValueTypeException e) { Activator.logError("TmfMipmapFeature : Bad state value type", e); } catch (AttributeNotFoundException e) { Activator.logError("TmfMipmapFeature : Attribute not found", e); } catch (TimeRangeException e) { <START> Activator.logError("TmfMipmapFeature : bad state value type", e); END> } }</code><technical_language>this bad time range for state</technical_language>

Target:
protected void updateMipmapLevel(int level, long endTime) { try { List<ITmfStateInterval> lowerIntervals = intervals.get(level - 1); if (lowerIntervals.size() == 0) { return; } long startTime = lowerIntervals.get(0).getStartTime(); ITmfStateValue value = computeMipmapValue(lowerIntervals, startTime, endTime); lowerIntervals.clear(); int levelQuark = ss.getQuarkRelativeAndAdd(mipmapQuark, String.valueOf(level)); if (!checkLevelExists(level)) { addLevelQuark(levelQuark); ss.updateOngoingState(TmfStateValue.newValueInt(level), mipmapQuark); intervals.add(new ArrayList<ITmfStateInterval>(getMipmapResolution())); } ITmfStateInterval interval = new TmfStateInterval(startTime, endTime, levelQuark, value); intervals.get(level).add(interval); ss.modifyAttribute(startTime, value, levelQuark); } catch (StateValueTypeException e) { Activator.logError("TmfMipmapFeature : Bad state value type", e); } catch (AttributeNotFoundException e) { Activator.logError("TmfMipmapFeature : Attribute not found", e); } catch (TimeRangeException e) { Activator.logError("TmfMipmapFeature : Time stamp is out of range", e); } }
Source:
<code>private int getItemIndex(T item) { Objects.requireNonNull(item, "item cannot be null"); <START> final Object itemIdentifier = getDataProvider().getId(item); Objects.requireNonNull(itemIdentifier, "Identity Provider should not return null"); <END> AtomicInteger index = new AtomicInteger(-1); if (!getItems().peek(t -> index.incrementAndGet()) .filter(t -> itemIdentifier.equals(getDataProvider() .getId(t))).findFirst().isPresent()) { return -1; } return index.get(); }</code><technical_language>This is duplicated 3 times a method getIdentifier(T item) unchecked getId calls this method get null check</technical_language>

Target:
private int getItemIndex(T item) { ListDataProvider<T> dataProvider = getDataProvider(); return getItemIndex(item, dataProvider::getId); }
Source:
<code>protected @NonNull TmfViewer createLeftChildViewer(@Nullable Composite parent) { <START> String name = getSecondaryIdName(); <END> return new ScriptedXYTreeViewer(Objects.requireNonNull(parent), name); }</code><technical_language>Inline in next call</technical_language>

Target:
protected @NonNull TmfViewer createLeftChildViewer(@Nullable Composite parent) { return new ScriptedXYTreeViewer(Objects.requireNonNull(parent), getViewSite().getSecondaryId().replace(ScriptedXYView.COLON, ":")); }
Source:
<code>private void flushIndexBuffer() throws IOException { if (indexBuffer.position() > 0) { indexBuffer.flip(); <START> indexFileChannel.write(indexBuffer); <END> } }</code><technical_language>I need iterates buffer is write (writeFully). dataFileChannel done this</technical_language>

Target:
private void flushIndexBuffer() throws IOException { indexBuffer.flip(); if (indexBuffer.limit() > 0) { BufferReaderWriterUtil.writeBuffer(indexFileChannel, indexBuffer); } }
Source:
<code><START> public static boolean isIdentificationResponse(Intent intent) { <END> return intent.hasExtra("identification"); }</code><technical_language>nice "identification" "registration" static/final class variables</technical_language>

Target:
public static boolean isIdentificationResponse(Intent intent) { return intent.hasExtra(IDENTIFICATION_KEY); }
Source:
<code>Collection<Slice> writeDeltaDeleteFile(BitSet rowsToDelete) { if (rowsToDelete.isEmpty()) { return ImmutableList.of(); } List<Long> columnIds = new ArrayList<>(); List<Type> columnTypes = new ArrayList<>(); columnIds.add(0L); columnTypes.add(BIGINT); <START> if (oldDeltaDeleteShardUuid.isPresent()) { <END> mergeRowsToDelete(rowsToDelete, oldDeltaDeleteShardUuid.get()); } if (rowsToDelete.cardinality() == getRowCount(oldShardUuid)) { return shardDeleteDelta(oldShardUuid, oldDeltaDeleteShardUuid, Optional.empty()); } BlockBuilder blockBuilder = new LongArrayBlockBuilder(null, rowsToDelete.size()); for (int i = rowsToDelete.nextSetBit(0); i >= 0; i = rowsToDelete.nextSetBit(i + 1)) { blockBuilder.writeLong(i); } Block blockToDelete = blockBuilder.build(); StoragePageSink pageSink = orcStorageManager.createStoragePageSink(transactionId, bucketNumber, columnIds, columnTypes, true); pageSink.appendPages(ImmutableList.of(new Page(blockToDelete))); List<ShardInfo> shardInfos = getFutureValue(pageSink.commit()); ShardInfo newDeltaDeleteShard = Iterables.getOnlyElement(shardInfos); return shardDeleteDelta(oldShardUuid, oldDeltaDeleteShardUuid, Optional.of(newDeltaDeleteShard)); }</code><technical_language>nit: IntelliJ suggests simplification: java oldDeltaDeleteShardUuid.ifPresent(uuid -> mergeRowsToDelete(rowsToDelete, uuid));</technical_language>

Target:
Collection<Slice> writeDeltaDeleteFile(BitSet rowsToDelete) { if (rowsToDelete.isEmpty()) { return ImmutableList.of(); } List<Long> columnIds = new ArrayList<>(); List<Type> columnTypes = new ArrayList<>(); columnIds.add(0L); columnTypes.add(BIGINT); oldDeltaDeleteShardUuid.ifPresent(oldDeltaDeleteShardUuid -> mergeToRowsToDelete(rowsToDelete, oldDeltaDeleteShardUuid)); if (rowsToDelete.cardinality() == getRowCount(oldShardUuid)) { return shardDeleteDelta(oldShardUuid, oldDeltaDeleteShardUuid, Optional.empty()); } BlockBuilder blockBuilder = new LongArrayBlockBuilder(null, rowsToDelete.size()); for (int i = rowsToDelete.nextSetBit(0); i >= 0; i = rowsToDelete.nextSetBit(i + 1)) { blockBuilder.writeLong(i); } Block blockToDelete = blockBuilder.build(); StoragePageSink pageSink = orcStorageManager.createStoragePageSink(fileSystemContext, transactionId, bucketNumber, columnIds, columnTypes, true); pageSink.appendPages(ImmutableList.of(new Page(blockToDelete))); List<ShardInfo> shardInfos = getFutureValue(pageSink.commit()); ShardInfo newDeltaDeleteShard = Iterables.getOnlyElement(shardInfos); return shardDeleteDelta(oldShardUuid, oldDeltaDeleteShardUuid, Optional.of(newDeltaDeleteShard)); }
Source:
<code><START> public static String getStateString(Bundle bundle) { <END> final int state = bundle.getState(); return String.format("%s/%x", JsonBundle.getSimpleState(state), state); }</code><technical_language>this method other static methods bottom of this class</technical_language>

Target:
public static String getStateString(Bundle bundle) { return JsonBundle.getStateString(bundle.getState()); }
Source:
<code>HelixAccountService(HelixPropertyStore<ZNRecord> helixStore, AccountServiceMetrics accountServiceMetrics, Notifier<String> notifier) { if (helixStore == null || accountServiceMetrics == null || notifier == null) { throw new IllegalArgumentException("helixStore or accountServiceMetrics or notifier cannot be null"); } this.helixStore = helixStore; this.accountServiceMetrics = accountServiceMetrics; this.notifier = notifier; listener = (topic, message) -> { checkOpen(); logger.trace("Start to process message={} for topic={}", message, topic); boolean noException = true; try { switch (message) { case FULL_ACCOUNT_METADATA_CHANGE_MESSAGE: readFullAccountAndUpdateCache(FULL_ACCOUNT_METADATA_PATH, false); break; default: logger.error("Could not understand message={} for topic={}", message, topic); accountServiceMetrics.unRecognizedMessageErrorCount.inc(); } } catch (Exception e) { noException = false; logger.error("Exception occurred when processing message={} for topic={}.", message, topic, e); accountServiceMetrics.processFullAccountMessageErrorCount.inc(); } if (noException) { <START> logger.trace("Completed processing message={} for topic={}", message, topic); <END> } }; notifier.subscribe(ACCOUNT_METADATA_CHANGE_TOPIC, listener); readFullAccountAndUpdateCache(FULL_ACCOUNT_METADATA_PATH, true); isOpen = true; }</code><technical_language>put this message switch case in try get rid of noException variable</technical_language>

Target:
HelixAccountService(HelixPropertyStore<ZNRecord> helixStore, AccountServiceMetrics accountServiceMetrics, Notifier<String> notifier) { this.helixStore = Objects.requireNonNull(helixStore, "helixStore cannot be null"); this.accountServiceMetrics = Objects.requireNonNull(accountServiceMetrics, "accountServiceMetrics cannot be null"); this.notifier = Objects.requireNonNull(notifier, "notifier cannot be null"); listener = (topic, message) -> { checkOpen(); logger.trace("Start to process message={} for topic={}", message, topic); try { switch (message) { case FULL_ACCOUNT_METADATA_CHANGE_MESSAGE: logger.trace("Start processing message={} for topic={}", message, topic); readFullAccountAndUpdateCache(FULL_ACCOUNT_METADATA_PATH); logger.trace("Completed processing message={} for topic={}", message, topic); break; default: accountServiceMetrics.unRecognizedMessageErrorCount.inc(); throw new RuntimeException("Could not understand message=" + message + " for topic=" + topic); } } catch (Exception e) { logger.error("Exception occurred when processing message={} for topic={}.", message, topic, e); accountServiceMetrics.remoteDataCorruptionErrorCount.inc(); accountServiceMetrics.fetchRemoteAccountErrorCount.inc(); } }; notifier.subscribe(ACCOUNT_METADATA_CHANGE_TOPIC, listener); try { readFullAccountAndUpdateCache(FULL_ACCOUNT_METADATA_PATH); } catch (Exception e) { logger.error("Exception occurred when fetching remote account data", e); accountServiceMetrics.fetchRemoteAccountErrorCount.inc(); } isOpen = true; }
Source:
<code>private String getStartedBy(final Run run) { final Cause.UserIdCause cause = (Cause.UserIdCause) run.getCause(Cause.UserIdCause.class); <START> final String startedBy; <END> if (cause != null) { startedBy = cause.getUserId(); } else { startedBy = null; } return startedBy == null ? "" : startedBy; }</code><technical_language>I this simpler 'final' 'else' clause. initialize 'null'</technical_language>

Target:
private String getStartedBy(final Run run) { final Cause.UserIdCause cause = (Cause.UserIdCause) run.getCause(Cause.UserIdCause.class); String startedBy = ""; if (cause != null && cause.getUserId() != null) { startedBy = cause.getUserId(); } return startedBy; }
Source:
<code>public static void handleRequest(RestRequestInfo restRequestInfo, AdminMetrics adminMetrics) throws RestServiceException { RestResponseHandler responseHandler = restRequestInfo.getRestResponseHandler(); if (restRequestInfo.isFirstPart()) { logger.trace("Handling echo - {}", restRequestInfo.getRestRequestMetadata().getUri()); adminMetrics.echoRate.mark(); long startTime = System.currentTimeMillis(); String echoStr = echo(restRequestInfo.getRestRequestMetadata(), adminMetrics).toString(); responseHandler.setContentType("application/json"); responseHandler.addToResponseBody(echoStr.getBytes(), true); responseHandler.flush(); <START> adminMetrics.echoTimeInMs.update(System.currentTimeMillis() - startTime); <END> } else if (restRequestInfo.getRestRequestContent().isLast()) { responseHandler.onRequestComplete(null, false); logger.trace("Finished handling echo - {}", restRequestInfo.getRestRequestMetadata().getUri()); } }</code><technical_language>time updated in finally</technical_language>

Target:
public static void handleRequest(RestRequestInfo restRequestInfo, AdminMetrics adminMetrics) throws RestServiceException { RestResponseHandler responseHandler = restRequestInfo.getRestResponseHandler(); if (restRequestInfo.isFirstPart()) { logger.trace("Handling echo - {}", restRequestInfo.getRestRequestMetadata().getUri()); adminMetrics.echoRate.mark(); long startTime = System.currentTimeMillis(); try { String echoStr = echo(restRequestInfo.getRestRequestMetadata(), adminMetrics).toString(); responseHandler.setContentType("application/json"); responseHandler.addToResponseBody(echoStr.getBytes(), true); responseHandler.flush(); logger.trace("Sent echo response for request {}", restRequestInfo.getRestRequestMetadata().getUri()); } finally { long processingTime = System.currentTimeMillis() - startTime; logger.trace("Processing echo response for request took ms", restRequestInfo.getRestRequestMetadata().getUri(), processingTime); adminMetrics.echoProcessingTimeInMs.update(processingTime); } } else if (restRequestInfo.getRestRequestContent().isLast()) { responseHandler.onRequestComplete(null, false); logger.trace("Echo request complete", restRequestInfo.getRestRequestMetadata().getUri()); } }
Source:
<code>ValueHolder<V> getAndFault(K key) throws StoreAccessException; ValueHolder<V> computeIfAbsentAndFault(K key, Function<? super K, ? extends V> mappingFunction) throws StoreAccessException; boolean flush(K key, ValueHolder<V> valueHolder); void setInvalidationValve(InvalidationValve<K> valve); <START> interface InvalidationValve<K> { <END> void invalidateAll() throws StoreAccessException; }</code><technical_language>generic type is needed</technical_language>

Target:
ValueHolder<V> getAndFault(K key) throws StoreAccessException; ValueHolder<V> computeIfAbsentAndFault(K key, Function<? super K, ? extends V> mappingFunction) throws StoreAccessException; boolean flush(K key, ValueHolder<V> valueHolder); void setInvalidationValve(InvalidationValve valve); interface InvalidationValve { void invalidateAll() throws StoreAccessException; }
Source:
<code>public Function<Class<?>, NamedEntityProjection> visitRelationship(CoreParser.RelationshipContext ctx) { return (parentClass) -> { String entityName = ctx.term().getText(); Class<?> entityClass = getEntityClass(parentClass, entityName); FilterExpression filter = scope.getExpressionForRelation(parentClass, entityName).orElse(null); Sorting sorting = SortingImpl.getDefaultEmptyInstance(); if (scope.getQueryParams().isPresent()) { <START> sorting = SortingImpl.parseQueryParams(scope.getQueryParams().get(), entityClass, dictionary); <END> } return NamedEntityProjection.builder() .name(entityName) .projection(EntityProjection.builder() .filterExpression(filter) .sorting(sorting) .pagination(scope.getPagination()) .type(entityClass) .build() ).build(); }; }</code><technical_language>this simplified with: java Sorting sorting = SortingImpl.parseQueryParams(scope.getQueryParams().get(), entityClass, dictionary);</technical_language>

Target:
public Function<Class<?>, NamedEntityProjection> visitRelationship(CoreParser.RelationshipContext ctx) { return (parentClass) -> { String entityName = ctx.term().getText(); Class<?> entityClass = getEntityClass(parentClass, entityName); FilterExpression filter = scope.getExpressionForRelation(parentClass, entityName).orElse(null); Sorting sorting = SortingImpl.parseQueryParams(scope.getQueryParams(), entityClass, dictionary); Pagination pagination = PaginationImpl.parseQueryParams(entityClass, scope.getQueryParams(), scope.getElideSettings()); return NamedEntityProjection.builder() .name(entityName) .projection(EntityProjection.builder() .filterExpression(filter) .sorting(sorting) .pagination(pagination) .type(entityClass) .build() ).build(); }; }
Source:
<code>private void cacheParents(CloneSourceProvider repositoryImport, Collection<RepositoryServerInfo> repositoryServerInfos) { <START> for (RepositoryServerInfo info : repositoryServerInfos) { <END> parents.put(info, repositoryImport); } }</code><technical_language>nit: braces single line block</technical_language>

Target:
private void cacheParents(CloneSourceProvider repositoryImport, Collection<RepositoryServerInfo> repositoryServerInfos) { for (RepositoryServerInfo info : repositoryServerInfos) parents.put(info, repositoryImport); }