auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testColumnMethods() { final ParseTreeTablePModel parseTree = new ParseTreeTablePModel(null); Assert.assertEquals(ParseTreeTableModel.class, parseTree.getColumnClass(0)); Assert.assertEquals(String.class, parseTree.getColumnClass(1)); Assert.assertEquals(Integer.class, parseTree.getColumnClass(2)); Assert.assertEquals(Integer.class, parseTree.getColumnClass(3)); Assert.assertEquals(String.class, parseTree.getColumnClass(4)); try { <START> parseTree.getColumnClass(67); <END> Assert.fail("IllegalStateException expected"); } catch (IllegalStateException ex) { Assert.assertEquals("Unknown column", ex.getMessage()); } Assert.assertTrue(parseTree.isCellEditable(0)); Assert.assertFalse(parseTree.isCellEditable(1)); Assert.assertEquals(5, parseTree.getColumnCount()); Assert.assertEquals("Tree", parseTree.getColumnName(0)); Assert.assertEquals("Type", parseTree.getColumnName(1)); Assert.assertEquals("Line", parseTree.getColumnName(2)); Assert.assertEquals("Column", parseTree.getColumnName(3)); Assert.assertEquals("Text", parseTree.getColumnName(4)); }</code><technical_language>this work if parseTree.getColumnCount() instead of 67? more sense some random number here</technical_language>

Target:
public void testColumnMethods() { final ParseTreeTablePModel parseTree = new ParseTreeTablePModel(null); Assert.assertEquals(ParseTreeTableModel.class, parseTree.getColumnClass(0)); Assert.assertEquals(String.class, parseTree.getColumnClass(1)); Assert.assertEquals(Integer.class, parseTree.getColumnClass(2)); Assert.assertEquals(Integer.class, parseTree.getColumnClass(3)); Assert.assertEquals(String.class, parseTree.getColumnClass(4)); try { parseTree.getColumnClass(parseTree.getColumnCount()); Assert.fail("IllegalStateException expected"); } catch (IllegalStateException ex) { Assert.assertEquals("Unknown column", ex.getMessage()); } Assert.assertFalse(parseTree.isCellEditable(1)); Assert.assertEquals(5, parseTree.getColumnCount()); Assert.assertEquals("Tree", parseTree.getColumnName(0)); Assert.assertEquals("Type", parseTree.getColumnName(1)); Assert.assertEquals("Line", parseTree.getColumnName(2)); Assert.assertEquals("Column", parseTree.getColumnName(3)); Assert.assertEquals("Text", parseTree.getColumnName(4)); }
Source:
<code>protected void resetWorkingCopies(final ICompilationUnit unit) { for (ICompilationUnit <START> u : <END> JavaCore.getWorkingCopies(fOwner)) { if (!u.equals(unit)) { try { u.discardWorkingCopy(); }catch (Exception exception) { } } else { try { u.getBuffer().setContents(unit.getPrimary().getBuffer().getContents()); JavaModelUtil.reconcile(u); }catch (JavaModelException exception) { JavaPlugin.log(exception); } } } }</code><technical_language>rename cu</technical_language>

Target:
protected void resetWorkingCopies(final ICompilationUnit unit) { for (ICompilationUnit cu : JavaCore.getWorkingCopies(fOwner)) { if (!cu.equals(unit)) { try { cu.discardWorkingCopy(); } catch (Exception exception) { } } else { try { cu.getBuffer().setContents(unit.getPrimary().getBuffer().getContents()); JavaModelUtil.reconcile(cu); }catch (JavaModelException exception) { JavaPlugin.log(exception); } } } }
Source:
<code>public void decodes() { compare(BigDecimal.class, new BigDecimal("12345678901234567890")); assertEquals(new BigDecimal(42L), converter.decode(BigDecimal.class, new BigDecimal(42L))); assertEquals(new BigDecimal("12345678901234567890"), converter.decode(BigDecimal.class, new BigInteger("12345678901234567890"))); assertEquals(new BigDecimal(42L), converter.decode(BigDecimal.class, 42L)); assertEquals(new BigDecimal(Long.valueOf(42)), converter.decode(BigDecimal.class, 42L)); assertEquals(new BigDecimal(42D), converter.decode(BigDecimal.class, 42D)); assertEquals(new BigDecimal(Double.valueOf(42)), converter.decode(BigDecimal.class, 42D)); assertEquals(new BigDecimal("12345678901234567890"), converter.decode(BigDecimal.class, "12345678901234567890")); assertEquals(new BigDecimal("1.2345678901234567890"), converter.decode(BigDecimal.class, "1.2345678901234567890")); assertEquals(new BigDecimal(Double.MAX_VALUE), converter.decode(BigDecimal.class, Double.MAX_VALUE)); assertEquals(new BigDecimal(Double.MIN_VALUE), converter.decode(BigDecimal.class, Double.MIN_VALUE)); assertEquals(new BigDecimal(Long.MAX_VALUE), converter.decode(BigDecimal.class, Long.MAX_VALUE)); assertEquals(new BigDecimal(Long.MIN_VALUE), converter.decode(BigDecimal.class, Long.MIN_VALUE)); assertEquals(new BigDecimal(0), converter.decode(BigDecimal.class, 0)); <START> assertEquals(new BigDecimal(-0), converter.decode(BigDecimal.class, -0)); <END> }</code><technical_language>This -0 test is extraneous, integer -0 bits integer 0</technical_language>

Target:
public void decodes() { compare(BigDecimal.class, new BigDecimal("12345678901234567890")); assertEquals(new BigDecimal(42L), converter.decode(BigDecimal.class, new BigDecimal(42L))); assertEquals(new BigDecimal("12345678901234567890"), converter.decode(BigDecimal.class, new BigInteger("12345678901234567890"))); assertEquals(new BigDecimal(42L), converter.decode(BigDecimal.class, 42L)); assertEquals(new BigDecimal(Long.valueOf(42)), converter.decode(BigDecimal.class, 42L)); assertEquals(new BigDecimal(42D), converter.decode(BigDecimal.class, 42D)); assertEquals(new BigDecimal(Double.valueOf(42)), converter.decode(BigDecimal.class, 42D)); assertEquals(new BigDecimal("12345678901234567890"), converter.decode(BigDecimal.class, "12345678901234567890")); assertEquals(new BigDecimal("1.2345678901234567890"), converter.decode(BigDecimal.class, "1.2345678901234567890")); assertEquals(new BigDecimal(Double.MAX_VALUE), converter.decode(BigDecimal.class, Double.MAX_VALUE)); assertEquals(new BigDecimal(Double.MIN_VALUE), converter.decode(BigDecimal.class, Double.MIN_VALUE)); assertEquals(new BigDecimal(Long.MAX_VALUE), converter.decode(BigDecimal.class, Long.MAX_VALUE)); assertEquals(new BigDecimal(Long.MIN_VALUE), converter.decode(BigDecimal.class, Long.MIN_VALUE)); assertEquals(new BigDecimal(0), converter.decode(BigDecimal.class, 0)); }
Source:
<code><START> long connectionCheckInterval() { <END> return 0; }</code><technical_language>changed</technical_language>

Target:
public long connectionCheckInterval() { return 0; }
Source:
<code>private void runExec() { this.destroyProcess(); if (logger.isInfoEnabled()) { logger.info("Starting tail process"); } try { <START> Process process = Runtime.getRuntime().exec(getCommand()); <END> BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); this.process = process; this.startProcessMonitor(); this.startStatusReader(); this.reader = reader; this.getTaskExecutor().execute(this); } catch (IOException e) { throw new MessagingException("Failed to exec tail command: '" + getCommand() + "'", e); } }</code><technical_language>follow reconfiguration rule in ApacheCommonsFileTailingMessageProducer? change file stop adapter, set a new for file start adapter afterward. move command "compilation" OSDelegatingFileTailingMessageProducer#doStart() this.getTaskExecutor().execute. WDYT? for me, a change, need fix broken FileTailInboundChannelAdapterParserTests :smile:</technical_language>

Target:
private void runExec() { this.destroyProcess(); if (logger.isInfoEnabled()) { logger.info("Starting tail process"); } try { Process process = Runtime.getRuntime().exec(this.command); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); this.process = process; this.startProcessMonitor(); this.startStatusReader(); this.reader = reader; this.getTaskExecutor().execute(this); } catch (IOException e) { throw new MessagingException("Failed to exec tail command: '" + this.command + "'", e); } }
Source:
<code>public void close() throws IOException { flush(); <START> log.info("Closing emitter org.apache.druid.emitter.influxdb.InfluxdbEmitter"); <END> started.set(false); exec.shutdown(); }</code><technical_language>suggestion log.info("Closing [%s]", this.getClass().getName());</technical_language>

Target:
public void close() throws IOException { flush(); log.info("Closing [%s]", this.getClass().getName()); started.set(false); exec.shutdownNow(); }
Source:
<code>public StatementExecution buildPreparedStatement() throws SQLException { <START> return new StatementExecution(environment.createStatementWithBoundFixtureSymbols(testHost, statementText), false, environment.supportsSavepoints()); <END> }</code><technical_language>SavePoints bringing some noise here. a discussion in #211 removing them: if do that, simplify changes here</technical_language>

Target:
public StatementExecution buildPreparedStatement() throws SQLException { return new StatementExecution(environment.createStatementWithBoundFixtureSymbols(testHost, statementText), false); }
Source:
<code>private String createExpectation(Map<Integer, Integer> transform, Collection<Integer> allValuesInRaster, String initial) { String expectation = initial; for (Integer sourceInt : allValuesInRaster) { String sourceValue = sourceInt.toString(); Integer targetInt = transform.containsKey(sourceInt) ? transform.get(sourceInt) : null; <START> String targetValue = targetInt != null ? Double.toString(targetInt) : "-9999"; <END> expectation = expectation.replace(sourceValue, targetValue); } expectation = expectation.replace("\n ", "\n"); expectation = expectation.replace("\n", System.lineSeparator()); expectation = expectation.toUpperCase(); expectation = expectation.replaceAll(" +", " "); expectation = expectation.replace("CELLSIZE 0.041666666667", "CELLSIZE 0.04166666666700003"); return expectation; }</code><technical_language>Another tiny thing, IMHO slighly more readable if expression in a tertiary is bracketed e.g. (targetInt != null)</technical_language>

Target:
private String createExpectation(Map<Integer, Integer> transform, Collection<Integer> allValuesInRaster, String initial) { String expectation = initial; for (Integer sourceInt : allValuesInRaster) { String sourceValue = sourceInt.toString(); Integer targetInt = transform.containsKey(sourceInt) ? transform.get(sourceInt) : null; String targetValue = (targetInt != null) ? Double.toString(targetInt) : "-9999"; expectation = expectation.replace(sourceValue, targetValue); } expectation = expectation.replace("\n ", "\n"); expectation = expectation.replace("\n", System.lineSeparator()); expectation = expectation.toUpperCase(); expectation = expectation.replaceAll(" +", " "); expectation = expectation.replace("CELLSIZE 0.041666666667", "CELLSIZE 0.04166666666700003"); return expectation; }
Source:
<code>public static PantsOptions getPantsOptions(@NotNull final String pantsExecutable) { File pantsExecutableFile = new File(pantsExecutable); <START> return optionsCache.computeIfAbsent(pantsExecutableFile, file -> execPantsOptions(pantsExecutable, file)); <END> }</code><technical_language>computeIfAbsent docstring > Some attempted update operations this map other threads blocked while computation is in progress, computation **short simple**, attempt update other mappings of this map. executing a Pants command is "short simple", sense another synchronization mechanism</technical_language>

Target:
public static PantsOptions getPantsOptions(@NotNull final String pantsExecutable) { File pantsExecutableFile = new File(pantsExecutable); return optionsCache.computeIfAbsent(pantsExecutableFile, file -> execPantsOptions(pantsExecutable)); }
Source:
<code>public ColumnChunk readNext() { ColumnChunk columnChunk = null; try { seek(); if (field.isRequired()) { columnChunk = readWithoutNull(); } else { columnChunk = readWithNull(); } } <START> catch (IOException ex) { <END> throw new PrestoException(PARQUET_IO_READ_ERROR, "Error reading Parquet column " + columnDescriptor, ex); } readOffset = 0; nextBatchSize = 0; return columnChunk; }</code><technical_language>s/ex/exception/g</technical_language>

Target:
public ColumnChunk readNext() { ColumnChunk columnChunk = null; try { seek(); if (field.isRequired()) { columnChunk = readWithoutNull(); } else { columnChunk = readWithNull(); } } catch (IOException exception) { throw new PrestoException(PARQUET_IO_READ_ERROR, "Error reading Parquet column " + columnDescriptor, exception); } readOffset = 0; nextBatchSize = 0; return columnChunk; }
Source:
<code>public void close() { super.close(); logger .trace("Closing NettyMultipartRequest with raw content chunks unread", getUri(), requestContents.size()); <START> while (rawRequestContents.peek() != null) { <END> ReferenceCountUtil.release(rawRequestContents.poll()); } }</code><technical_language>if checking for existence, simply while (rawRequestContents.size() > 0) (or yet, foreach pattern)</technical_language>

Target:
public void close() { super.close(); logger.trace("Closing NettyMultipartRequest with raw content chunks unread", rawRequestContents.size()); HttpContent content = rawRequestContents.poll(); while (content != null) { ReferenceCountUtil.release(content); content = rawRequestContents.poll(); } }
Source:
<code>public ApplicationListWidget(ViewLibrary parent) { this.parent = parent; this.rootItem = new TreeItem<>(); this.setRoot(rootItem); this.setShowRoot(false); try { installedApplications = new FilterPromise<>(this.parent.getEventHandler().getInstalledApplications(), this.filter); } catch (PlayOnLinuxException e) { <START> e.printStackTrace(); <END> } installedApplications.addObserver(this); }</code><technical_language>need log this exception popup alert</technical_language>

Target:
public ApplicationListWidget(ViewLibrary parent) { this.parent = parent; this.rootItem = new TreeItem<>(); this.setRoot(rootItem); this.setShowRoot(false); try { installedApplications = new FilterPromise<>(this.parent.getEventHandler().getInstalledApplications(), this.filter); } catch (PlayOnLinuxException e) { Alert alert = new Alert(Alert.AlertType.ERROR); alert.setTitle(translate("Error while trying to fetch installed applications.")); alert.setContentText(String.format("The error was: %s", e)); alert.show(); logger.error(e); } installedApplications.addObserver(this); }
Source:
<code>public void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { try { <START> rsp.setContentType("text/plain"); <END> send(read(req), req, rsp); } catch (FileNotFoundException noFile) { rsp.sendError(SC_NOT_FOUND); } }</code><technical_language>Constant for text/plain, elsewhere</technical_language>

Target:
public void doGet(final HttpServletRequest req, final HttpServletResponse rsp) throws IOException { try { rsp.setContentType(HttpSupport.TEXT_PLAIN); send(read(req), req, rsp); } catch (FileNotFoundException noFile) { rsp.sendError(SC_NOT_FOUND); } }
Source:
<code>public void testWbTypeRefFromDMNWhenQNameIsNotUndefined() { final org.kie.dmn.model.api.ItemDefinition dmn = mock(org.kie.dmn.model.api.ItemDefinition.class); final javax.xml.namespace.QName dmnQName = mock(javax.xml.namespace.QName.class); final QName expectedQName = BuiltInType.STRING.asQName(); when(dmn.getTypeRef()).thenReturn(dmnQName); when(dmnQName.getLocalPart()).thenReturn("string"); <START> when(dmnQName.getPrefix()).thenReturn("string"); <END> final QName actualQName = wbTypeRefFromDMN(dmn); assertEquals(actualQName, expectedQName); }</code><technical_language>remove this line because: - "string" is a probable for prefix - if check QName.equals, prefix is in comparison assertEquals(actualQName, expectedQName)</technical_language>

Target:
public void testWbTypeRefFromDMNWhenQNameIsNotUndefined() { final String qNameLocalPart = "string"; final String qNamePrefix = "qName prefix"; final org.kie.dmn.model.api.ItemDefinition dmn = mock(org.kie.dmn.model.api.ItemDefinition.class); final javax.xml.namespace.QName dmnQName = mock(javax.xml.namespace.QName.class); final QName expectedQName = BuiltInType.STRING.asQName(); when(dmn.getTypeRef()).thenReturn(dmnQName); when(dmnQName.getLocalPart()).thenReturn(qNameLocalPart); when(dmnQName.getPrefix()).thenReturn(qNamePrefix); final QName actualQName = wbTypeRefFromDMN(dmn); assertEquals(actualQName, expectedQName); }
Source:
<code><START> synchronized public void restartAllRunningTasls() { <END> final Iterator<Entry<TaskId, TaskDescriptor>> iterator = runningTasks.entrySet().iterator(); while (iterator.hasNext()) { final Entry<TaskId, TaskDescriptor> entry = iterator.next(); logger.info("JDI: " + entry.getKey() + " -> " + entry.getValue()); eligibleTasks.put(entry.getKey(), (EligibleTaskDescriptor) entry.getValue()); } runningTasks.clear(); }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') Reorder modifiers comply Java Language Specification. [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
synchronized public void restartAllRunningTasls() { final Iterator<Entry<TaskId, TaskDescriptor>> iterator = runningTasks.entrySet().iterator(); while (iterator.hasNext()) { final Entry<TaskId, TaskDescriptor> entry = iterator.next(); logger.info("Move " + entry.getKey() + " from running to eligible tasls"); eligibleTasks.put(entry.getKey(), (EligibleTaskDescriptor) entry.getValue()); } runningTasks.clear(); logger.info("Restarted all running tasks"); }
Source:
<code>private void initMatrixLocationListForRecyclerView() { matrixLocationList = new ArrayList<>(); <START> for (int x = 0; x < featureCollection.features().size(); x++) { <END> SingleRecyclerViewMatrixLocation singleRecyclerViewLocation = new SingleRecyclerViewMatrixLocation(); singleRecyclerViewLocation.setName(featureCollection.features().get(x) .getStringProperty("Station_Name")); singleRecyclerViewLocation.setLocationLatLng(new LatLng(pointList.get(x).latitude(), pointList.get(x).longitude())); matrixLocationList.add(singleRecyclerViewLocation); } }</code><technical_language>foreach</technical_language>

Target:
private void initMatrixLocationListForRecyclerView() { matrixLocationList = new ArrayList<>(); for (Feature feature : featureCollection.features()) { SingleRecyclerViewMatrixLocation singleRecyclerViewLocation = new SingleRecyclerViewMatrixLocation(); singleRecyclerViewLocation.setName(feature.getStringProperty("Station_Name")); singleRecyclerViewLocation.setLocationLatLng(new LatLng(((Point) feature.geometry()).latitude(), ((Point) feature.geometry()).longitude())); matrixLocationList.add(singleRecyclerViewLocation); } }
Source:
<code>ConditionMatcherFactory(ValueType keyType, IndexedTable.Index index) { this.keyType = keyType; this.index = index; this.dimensionCaches = Caffeine.newBuilder() .maximumSize(MAX_NUM_CACHE) .build( selector -> <START> Caffeine.newBuilder() <END> .maximumSize(CACHE_MAX_SIZE) .build(dimensionId -> getRowNumbers(selector, dimensionId)) ); }</code><technical_language>this compare LruEvalCache in SingleStringInputCachingExpressionColumnValueSelector? I solve problem, approach works better, class this approach</technical_language>

Target:
ConditionMatcherFactory(ValueType keyType, IndexedTable.Index index) { this.keyType = keyType; this.index = index; this.dimensionCaches = new LruLoadingHashMap<>( MAX_NUM_CACHE, selector -> { int cardinality = selector.getValueCardinality(); IntFunction<IntList> loader = dimensionId -> getRowNumbers(selector, dimensionId); return cardinality <= CACHE_MAX_SIZE ? new Int2IntListLookupTable(cardinality, loader) : new Int2IntListLruCache(CACHE_MAX_SIZE, loader); } ); }
Source:
<code>public void should_have_javascript_as_category_for_properties() throws Exception { List<PropertyDefinition> properties = properties(); assertThat(properties).isNotEmpty(); for (PropertyDefinition propertyDefinition : properties) { <START> if (propertyDefinition.key().equals("sonar.eslint.reportPaths") || propertyDefinition.key().equals("sonar.tslint.reportPaths")) { <END> assertThat(propertyDefinition.category()).isEqualTo("External Analyzers"); } else { assertThat(propertyDefinition.category()).isIn("JavaScript", "TypeScript"); } } }</code><technical_language>endsWith("lint.reportPaths")</technical_language>

Target:
public void should_have_javascript_as_category_for_properties() throws Exception { List<PropertyDefinition> properties = properties(); assertThat(properties).isNotEmpty(); for (PropertyDefinition propertyDefinition : properties) { if (propertyDefinition.key().endsWith("lint.reportPaths")) { assertThat(propertyDefinition.category()).isEqualTo("External Analyzers"); } else { assertThat(propertyDefinition.category()).isIn("JavaScript", "TypeScript"); } } }
Source:
<code>public Credential validate(Credential credential, RequestData data) throws WSSecurityException { if (credential == null || credential.getTimestamp() == null) { throw new WSSecurityException(ErrorCode.FAILURE, "noCredential"); } if (data.getWssConfig() == null) { throw new WSSecurityException(ErrorCode.FAILURE, "WSSConfig cannot be null"); } <START> WSSConfig wssConfig = data.getWssConfig(); <END> boolean timeStampStrict; int timeStampTTL = 300; int futureTimeToLive = 60; if (wssConfig != null) { timeStampTTL = data.getTimeStampTTL(); futureTimeToLive = data.getTimeStampFutureTTL(); } long timeStampTTLProperty = getTimeStampTTL(); if (timeStampTTLProperty >= 0) { timeStampTTL = (int) timeStampTTLProperty; } long futureTimeToLiveProperty = getTimeStampFutureTTL(); if (futureTimeToLiveProperty >= 0) { futureTimeToLive = (int) futureTimeToLiveProperty; } timeStampStrict = getTimeStampStrict(); CONNECTTimestamp timeStamp = new CONNECTTimestamp(credential.getTimestamp()); Date invocationTime = (Date) ((Message) data.getMsgContext()).get(TimestampInterceptor.INVOCATION_TIME_KEY); if (timeStampStrict && timeStamp.isExpired(invocationTime) || !timeStamp.verifyCreated(timeStampTTL, futureTimeToLive, invocationTime)) { throw new WSSecurityException(ErrorCode.MESSAGE_EXPIRED, "invalidTimestamp", new Object[] { "The security semantics of the message have expired" }); } return credential; }</code><technical_language>Is wssConfig used? this deleted null check below</technical_language>

Target:
public Credential validate(Credential credential, RequestData data) throws WSSecurityException { if (credential == null || credential.getTimestamp() == null) { throw new WSSecurityException(ErrorCode.FAILURE, "noCredential"); } WSSConfig wssConfig = data.getWssConfig(); if (wssConfig == null) { throw new WSSecurityException(ErrorCode.FAILURE, "WSSConfig cannot be null"); } boolean timeStampStrict; int timeStampTTL = data.getTimeStampTTL(); int futureTimeToLive = data.getTimeStampFutureTTL(); long timeStampTTLProperty = getTimeStampTTL(); if (timeStampTTLProperty >= 0) { timeStampTTL = (int) timeStampTTLProperty; } long futureTimeToLiveProperty = getTimeStampFutureTTL(); if (futureTimeToLiveProperty >= 0) { futureTimeToLive = (int) futureTimeToLiveProperty; } timeStampStrict = getTimeStampStrict(); CONNECTTimestamp timeStamp = new CONNECTTimestamp(credential.getTimestamp()); Date invocationTime = (Date) ((Message) data.getMsgContext()).get(TimestampInterceptor.INVOCATION_TIME_KEY); if (timeStampStrict && timeStamp.isExpired(invocationTime) || !timeStamp.verifyCreated(timeStampTTL, futureTimeToLive, invocationTime)) { throw new WSSecurityException(ErrorCode.MESSAGE_EXPIRED, "invalidTimestamp", new Object[] { "The security semantics of the message have expired" }); } return credential; }
Source:
<code>private void createDiff(RevCommit parent) { Diff diff = revision.getDiffToParent(parent); if (diff != null) { try { createDiffLinkAndText(parent, diff); } catch (IOException e) { Activator.logError( <START> "Error creating diff in blame information control for commit " + parent.toObjectId(), e); END> } } }</code><technical_language>Line is long</technical_language>

Target:
private void createDiff(RevCommit parent) { Diff diff = revision.getDiffToParent(parent); if (diff != null) { try { createDiffLinkAndText(parent, diff); } catch (IOException e) { String msg = "Error creating diff in blame information control for commit " + parent.toObjectId(); Activator.logError(msg, e); } } }
Source:
<code>public void setUp() { control = EasyMock.createNiceControl(); backend = control.createMock(BackendLocal.class); DbUser currentUser = new DbUser(); currentUser.setFirstName(USER); currentUser.setLastName(USER); currentUser.setDomain(DOMAIN); currentUser.setNamespace(NAMESPACE); currentUser.setId(GUIDS[0]); Current current = new Current(); current.setUser(currentUser); current.setSessionId(SESSION_ID); CurrentManager.put(current); httpHeaders = control.createMock(HttpHeaders.class); locales = new ArrayList<Locale>(); expect(httpHeaders.getAcceptableLanguages()).andReturn(locales).anyTimes(); accepts = new ArrayList<String>(); expect(httpHeaders.getRequestHeader("Accept")).andReturn(accepts).anyTimes(); List<String> filterValue = new ArrayList<String>(); filterValue.add("false"); expect(httpHeaders.getRequestHeader(USER_FILTER_HEADER)).andReturn(filterValue).anyTimes(); mapperLocator = new MappingLocator(); mapperLocator.populate(); validatorLocator = new ValidatorLocator(); validatorLocator.populate(); locale = Locale.getDefault(); Locale.setDefault(Locale.GERMANY); messageBundle = new MessageBundle(); messageBundle.setPath(BUNDLE_PATH); messageBundle.populate(); if (Config.getConfigUtils() == null) { Config.setConfigUtils(mock(IConfigUtilsInterface.class)); } <START> when(Config.getConfigUtils().getValue(ConfigValues.CoCoCommandLifeInMinutes, ConfigCommon.defaultConfigurationVersion)).thenReturn(300); <END> init(); }</code><technical_language>pls formatter</technical_language>

Target:
public void setUp() { control = EasyMock.createNiceControl(); backend = control.createMock(BackendLocal.class); DbUser currentUser = new DbUser(); currentUser.setFirstName(USER); currentUser.setLastName(USER); currentUser.setDomain(DOMAIN); currentUser.setNamespace(NAMESPACE); currentUser.setId(GUIDS[0]); Current current = new Current(); current.setUser(currentUser); current.setSessionId(SESSION_ID); CurrentManager.put(current); httpHeaders = control.createMock(HttpHeaders.class); locales = new ArrayList<Locale>(); expect(httpHeaders.getAcceptableLanguages()).andReturn(locales).anyTimes(); accepts = new ArrayList<String>(); expect(httpHeaders.getRequestHeader("Accept")).andReturn(accepts).anyTimes(); List<String> filterValue = new ArrayList<String>(); filterValue.add("false"); expect(httpHeaders.getRequestHeader(USER_FILTER_HEADER)).andReturn(filterValue).anyTimes(); mapperLocator = new MappingLocator(); mapperLocator.populate(); validatorLocator = new ValidatorLocator(); validatorLocator.populate(); locale = Locale.getDefault(); Locale.setDefault(Locale.GERMANY); messageBundle = new MessageBundle(); messageBundle.setPath(BUNDLE_PATH); messageBundle.populate(); init(); }
Source:
<code>public void disableCaptcha() { String currentURL = driver.getCurrentUrl(); if (currentURL.contains("?")) { currentURL += "&"; } else { currentURL += "?"; } <START> currentURL += "nocaptchatest=1"; <END> getUrl(currentURL); }</code><technical_language>appendQueryStringToURL() method UrlBuilder class</technical_language>

Target:
public void disableCaptcha() { String url = urlBuilder.appendQueryStringToURL( driver.getCurrentUrl(), URLsContent.disableCaptchaParameter ); getUrl(url); }
Source:
<code>public Collection<String> getVersions(String name) throws AgentException { URL url = urlProvider.getAgentVersions(name); try { HttpJsonResponse response = requestFactory.fromUrl(url.toString()).useGetMethod().request(); @SuppressWarnings("unchecked") List<String> versions = response.as(List.class, new TypeToken<List<String>>() { }.getType()); return versions; <START> } catch (IOException | ServerException | UnauthorizedException | ConflictException | BadRequestException | ForbiddenException e) { <END> throw new AgentException(format("Can't fetch available %s version.", name), e); } catch (NotFoundException e) { throw new AgentNotFoundException(format("Agent %s not found", name), e); } }</code><technical_language>catch ApiException instead of child classes</technical_language>

Target:
public List<String> getVersions(String name) throws AgentException { URL url = urlProvider.getAgentVersionsUrl(name); try { HttpJsonResponse response = requestFactory.fromUrl(url.toString()).useGetMethod().request(); @SuppressWarnings("unchecked") List<String> versions = response.as(List.class, new TypeToken<List<String>>() { }.getType()); return versions; } catch (NotFoundException e) { throw new AgentNotFoundException(format("Agent %s not found", name), e); } catch (IOException | ApiException e) { throw new AgentException(format("Can't fetch available %s version.", name), e); } }
Source:
<code>private static String parseZone(JsonObject json) { <START> return toString(json.get("metadata").asObject().get("labels").asObject().get("failure-domain.beta.kubernetes.io/zone")); <END> }</code><technical_language>label name is beta. change in future is out of beta</technical_language>

Target:
private static String parseZone(JsonObject json) { JsonObject labels = json.get("metadata").asObject().get("labels").asObject(); JsonValue zone = labels.get("failure-domain.kubernetes.io/zone"); if (zone != null) { return toString(zone); } return toString(labels.get("failure-domain.beta.kubernetes.io/zone")); }
Source:
<code>public void addContent(String content) { sourceModeTextArea.sendKeys(content); <START> PageObjectLogging.log("addContent", "content was added", true, driver); <END> }</code><technical_language>remove driver, is need capture screenshot sending keys</technical_language>

Target:
public void addContent(String content) { sourceModeTextArea.sendKeys(content); PageObjectLogging.log("addContent", "content was added", true); }
Source:
<code>protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { setClampHeight(1.0f); collectTote(); setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); drive(toteDistance.get()); collectTote(); setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); drive(toteDistance.get()); collectTote(); turn(90); drive(autoZoneDistance.get()); setClampHeight(0.0f); setClampOpen(true); setClampHeight(1.0f); DriveCode.octocanumShifting.set(true); strafe(1.0f, strafeTime.get()); strafe(1.0f, strafeTime.get()); ejectTotes(); <START> DriveCode.octocanumShifting.set(false); <END> }</code><technical_language>want eject totes setting container, if possible</technical_language>

Target:
protected void runAutonomous() throws InterruptedException, AutonomousModeOverException { setClampHeight(1.0f); collectTote(); setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); drive(toteDistance.get()); collectTote(); setClampHeight(0.0f); setClampOpen(true); drive(nudge.get()); setClampOpen(false); setClampHeight(1.0f); drive(toteDistance.get()); collectTote(); turn(90); drive(autoZoneDistance.get()); setClampHeight(0.0f); setClampOpen(true); setClampHeight(1.0f); DriveCode.octocanumShifting.set(true); strafe(1.0f, strafeTime.get()); ejectTotes(); strafe(1.0f, strafeTime.get()); DriveCode.octocanumShifting.set(false); }
Source:
<code>public List<QueryMetacardImpl> getQueryMetacards(WorkspaceMetacardImpl workspaceMetacard) { return workspaceMetacard .getQueries() .stream() <START> .map(this::getAssociatedMetacardById) <END> .filter(Objects::nonNull) .map(QueryMetacardImpl::from) .collect(Collectors.toList()); }</code><technical_language>endpointUtil.getMetacards(ids, "query") retrieve query metacards send a separate query for each</technical_language>

Target:
public List<QueryMetacardImpl> getQueryMetacards(WorkspaceMetacardImpl workspaceMetacard) { List<String> queryIds = workspaceMetacard.getQueries(); if (queryIds.isEmpty()) { LOGGER.trace( "Workspace metacard with id does not contain any queries", workspaceMetacard.getId()); return Collections.emptyList(); } Query query = new QueryImpl(getQueriesFilter(queryIds)); QueryRequest queryRequest = new QueryRequestImpl(query); return ResultIterable.resultIterable(catalogFramework::query, queryRequest) .stream() .map(Result::getMetacard) .filter(Objects::nonNull) .map(QueryMetacardImpl::new) .collect(Collectors.toList()); }
Source:
<code>public void searchChargeByPartialReference_ShouldReturnCharge() { insertTestChargeWithReference(ServicePaymentReference.of("rorytest")); insertTestCharge(); SearchParams searchParams = new SearchParams() <START> .withReferenceLike(ServicePaymentReference.of("reference")); <END> List<ChargeEntity> charges = chargeDao.findAllBy(searchParams); assertThat(charges.size(), is(1)); assertThat(charges.get(0).getReference(), is(defaultTestCharge.getReference())); }</code><technical_language>a bit confusing find charge setting in test, this reads expecting 'reference' find 'rory test' instead relying finding charge inserted reference of 'Test reference'. charge set-up test finds test exclusion match Test reference? for tests below</technical_language>

Target:
public void searchChargeByPartialReference_ShouldReturnCharge() { insertTestChargeWithReference(ServicePaymentReference.of("willnotreturn")); insertTestChargeWithReference(ServicePaymentReference.of("Test reference")); SearchParams searchParams = new SearchParams() .withReferenceLike(ServicePaymentReference.of("reference")); List<ChargeEntity> charges = chargeDao.findAllBy(searchParams); assertThat(charges.size(), is(1)); assertThat(charges.get(0).getReference(), is(defaultTestCharge.getReference())); }
Source:
<code>public static List<String> getPropertyNameElements(final ScenarioGridModel scenarioGridModel, final int columnIndex) { final Optional<Simulation> optionalSimulation = scenarioGridModel.getSimulation(); return optionalSimulation.map(simulation -> { <START> final FactMapping factMapping = scenarioGridModel.getSimulation().get().getSimulationDescriptor().getFactMappingByIndex(columnIndex); <END> if (scenarioGridModel.isSimpleType(factMapping.getFactAlias())) { return Arrays.asList(ConstantHolder.VALUE); } else { return Collections.unmodifiableList(simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex).getExpressionElementsWithoutClass() .stream() .map(ExpressionElement::getStep) .collect(Collectors.toList())); } }).orElse(null); }</code><technical_language>simulation instead of access scenarioGridModel.getSimulation()..</technical_language>

Target:
public static List<String> getPropertyNameElements(final ScenarioGridModel scenarioGridModel, final int columnIndex) { final Optional<Simulation> optionalSimulation = scenarioGridModel.getSimulation(); return optionalSimulation.map(simulation -> { final FactMapping factMapping = simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex); if (scenarioGridModel.isSimpleType(factMapping.getFactAlias())) { return Arrays.asList(ConstantHolder.VALUE); } else { return Collections.unmodifiableList(simulation.getSimulationDescriptor().getFactMappingByIndex(columnIndex).getExpressionElementsWithoutClass() .stream() .map(ExpressionElement::getStep) .collect(Collectors.toList())); } }).orElse(null); }
Source:
<code>public void registerEmail(final String address, final AsyncCallback<VoidResult> cb) { try { <START> switch (authConfig.getAuthType()) { <END> case OPENID: case HTTP: case HTTP_LDAP: case CLIENT_SSL_CERT_LDAP: case LDAP: case LDAP_BIND: final RegisterNewEmailSender sender; sender = registerNewEmailFactory.create(address); sender.send(); cb.onSuccess(VoidResult.INSTANCE); break; case DEVELOPMENT_BECOME_ANY_ACCOUNT: registerMail(address, cb); break; default: log.error( "Unsupported loginType: " + authConfig.getAuthType(), new ProvisionException("Unsupported loginType: " + authConfig.getAuthType())); throw new ProvisionException("Unsupported loginType: " + authConfig.getAuthType()); } } catch (EmailException e) { log.error("Cannot send email verification message to " + address, e); cb.onFailure(e); } catch (RuntimeException e) { log.error("Cannot send email verification message to " + address, e); cb.onFailure(e); } }</code><technical_language>I propose: if (authConfig.getAuthType() == DEVELOPMENT_BECOME_ANY_ACCOUNT) { registerMail(address, cb); } else { final RegisterNewEmailSender sender; sender = registerNewEmailFactory.create(address); sender.send(); cb.onSuccess(VoidResult.INSTANCE); }</technical_language>

Target:
public void registerEmail(final String address, final AsyncCallback<VoidResult> cb) { if (authConfig.getAuthType() == AuthType.DEVELOPMENT_BECOME_ANY_ACCOUNT) { checkFormatAndSaveEmail(address, cb); } else { try { final RegisterNewEmailSender sender; sender = registerNewEmailFactory.create(address); sender.send(); cb.onSuccess(VoidResult.INSTANCE); } catch (EmailException e) { log.error("Cannot send email verification message to " + address, e); cb.onFailure(e); } catch (RuntimeException e) { log.error("Cannot send email verification message to " + address, e); cb.onFailure(e); } } }
Source:
<code>public void writeExternal(ObjectOutput out) throws IOException { <START> out.writeObject(acc); <END> out.writeUTF(separator); }</code><technical_language>Please consider writing a class version number (e.g. 1) part of SerDe in case this is stored disk</technical_language>

Target:
public void writeExternal(ObjectOutput out) throws IOException { out.writeInt(VERSION); out.writeObject(acc); out.writeUTF(separator); }
Source:
<code>public HTableDescriptor adapt(Table table) { <START> String tableNameStr = bigtableClusterName.toTableId(table.getName()); <END> HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableNameStr)); for (Entry<String, ColumnFamily> entry : table.getColumnFamilies().entrySet()) { tableDescriptor.addFamily(columnDescriptorAdapter.adapt(entry.getKey(), entry.getValue())); } return tableDescriptor; }</code><technical_language>String bigtableTableId</technical_language>

Target:
public HTableDescriptor adapt(Table table) { String tableId = bigtableClusterName.toTableId(table.getName()); HTableDescriptor tableDescriptor = new HTableDescriptor(TableName.valueOf(tableId)); for (Entry<String, ColumnFamily> entry : table.getColumnFamilies().entrySet()) { tableDescriptor.addFamily(columnDescriptorAdapter.adapt(entry.getKey(), entry.getValue())); } return tableDescriptor; }
Source:
<code><START> public void run() { <END> try { final Manufacturer manufacturer = this.findManufacturer(this.deviceConnectionScheduledTaskManufacturerName); if (manufacturer == null) { return; } final List<DeviceModel> deviceModels = this.findDeviceModels(manufacturer); if (deviceModels == null || deviceModels.isEmpty()) { return; } final List<Device> devices = this.findDevices(deviceModels); if (devices.isEmpty()) { return; } final List<Device> devicesToContact = this.findDevicesToContact(devices, this.deviceConnectionScheduledTaskMaximumAllowedAge); if (devicesToContact.isEmpty()) { return; } this.contactDevices(devicesToContact, DeviceFunction.GET_STATUS); } catch (final Exception e) { LOGGER.error("Exception caught during DeviceConnectionScheduledTask.run()", e); } }</code><technical_language>![MAJOR](<LINK_0> Cyclomatic Complexity of this method "run" is 12 is greater 10 authorized. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
public void run() { try { final Manufacturer manufacturer = this.findManufacturer(this.deviceConnectionScheduledTaskManufacturerName); if (manufacturer == null) { return; } final List<DeviceModel> deviceModels = this.findDeviceModels(manufacturer); if (deviceModels == null || deviceModels.isEmpty()) { return; } final List<Device> devices = this.findDevices(deviceModels, LightMeasurementDevice.LMD_TYPE); if (devices.isEmpty()) { return; } final List<Device> devicesToContact = this.findDevicesToContact(devices, this.deviceConnectionScheduledTaskMaximumAllowedAge); if (devicesToContact == null || devicesToContact.isEmpty()) { return; } this.contactDevices(devicesToContact, DeviceFunction.GET_STATUS); } catch (final Exception e) { LOGGER.error("Exception caught during DeviceConnectionScheduledTask.run()", e); } }
Source:
<code><START> public void the_user_on_an_existing_candidates_page() throws Throwable { <END> webDriver.get("http://localhost:8080/atsy/secure/candidate/3"); }</code><technical_language>Throwable is needed, delete them. generated automatically cucumber for default pending exception</technical_language>

Target:
public void the_user_on_an_existing_candidates_page() { webDriver.get(CANDIDATE_PAGE_URL); }
Source:
<code>private static Method getMethod(Object svc, String methodName, Class... paramTypes) throws NoSuchMethodException { Method method = null; Class<?> clazz = svc.getClass(); hwile: while (!(clazz == Object.class || method != null)) { Method[] methods = clazz.getDeclaredMethods(); for (Method m : methods) { if (m.getName().compareTo(methodName) == 0) { method = m; break hwile; } } clazz = clazz.getSuperclass(); } if (method == null) { <START> throw new NoSuchMethodException("Method not found"); <END> } return method; }</code><technical_language>previous PR review: add method name exception message</technical_language>

Target:
private static Method getMethod(Object svc, String methodName, Class... paramTypes) throws NoSuchMethodException { Method method = null; Class<?> clazz = svc.getClass(); hwile: while (!(clazz == Object.class || method != null)) { Method[] methods = clazz.getDeclaredMethods(); for (Method m : methods) { if (m.getName().compareTo(methodName) == 0) { method = m; break hwile; } } clazz = clazz.getSuperclass(); } if (method == null) { throw new NoSuchMethodException(String.format("Method not found: %s", methodName)); } return method; }
Source:
<code>protected Object executeMethod(String name, Class<?>[] parameterTypes, Object... arguments) { try { Method method = target.getClass().getDeclaredMethod(name, parameterTypes); method.setAccessible(true); return ReflectionUtils.invokeMethod(method, target, arguments); } catch (NoSuchMethodException | SecurityException exception) { <START> LOG.warning(exception.getMessage()); <END> return null; } }</code><technical_language>I this throw exception instead of logging it. Otherwise, visible in a log silently ignored</technical_language>

Target:
protected Object executeMethod(String name, Class<?>[] parameterTypes, Object... arguments) { try { Method method = this.target.getClass().getDeclaredMethod(name, parameterTypes); method.setAccessible(true); return ReflectionUtils.invokeMethod(method, target, arguments); } catch (NoSuchMethodException | SecurityException ex) { throw new JUnitException( "Error while looking up method to call via reflection for class " + target.getClass().getName(), ex); } }
Source:
<code>protected void executeQueryCommand() { <START> getQueryReturnValue().setReturnValue(diskImageDao.getDiskImageByDiskAndImageIds(getParameters().getDiskId(), getParameters().getImageId())); <END> }</code><technical_language>This is a potential security breach - need pass filtering boolean userId DAO</technical_language>

Target:
protected void executeQueryCommand() { getQueryReturnValue().setReturnValue(diskImageDao.getDiskImageByDiskAndImageIds( getParameters().getDiskId(), getParameters().getImageId(), getUserID(), getParameters().isFiltered())); }
Source:
<code>void getPointer(DataInputStream din, DataOutputStream dout) throws Exception { <START> PublicKeyHash encodedSharingKey = PublicKeyHash.fromCbor(CborObject.deserialize(new CborDecoder(din), 1024)); <END> byte[] metadataBlob = mutable.getPointer(encodedSharingKey).get().orElse(new byte[0]); dout.write(metadataBlob); }</code><technical_language>Ah, good 2^10. a static constant a name explains choice a bit</technical_language>

Target:
void getPointer(DataInputStream din, DataOutputStream dout) throws Exception { PublicKeyHash encodedSharingKey = PublicKeyHash.fromCbor(CborObject.deserialize(new CborDecoder(din), PublicKeyHash.MAX_KEY_HASH_SIZE)); byte[] metadataBlob = mutable.getPointer(encodedSharingKey).get().orElse(new byte[0]); dout.write(metadataBlob); }
Source:
<code>public List<String> getMacsForMacPool(Guid macPoolId) { List<Guid> idsOfAllClustersHavingMacPool = getIdsOfAllClustersHavingMacPool(macPoolId); Map<Guid, VM> vmsById = idsOfAllClustersHavingMacPool.stream() .flatMap(clusterId -> vmDao.getAllForCluster(clusterId).stream()) .collect(Collectors.toMap(VM::getId, Function.identity())); Stream<Guid> idsOfRunningVMs = vmsById.values().stream().filter(VM::isRunning).map(VM::getId); Stream<VM> statelessSnapshotsOfRunningVMs = <START> idsOfRunningVMs.map(snapshotsManager::getVmConfigurationInStatelessSnapshotOfVm) <END> .filter(Optional::isPresent) .map(Optional::get); Map<Guid, List<VmNetworkInterface>> snapshottedInterfacesByVmId = statelessSnapshotsOfRunningVMs.collect(Collectors.toMap(VM::getId, VM::getInterfaces)); List<String> macsToBeAllocated = vmsById.keySet() .stream() .flatMap(vmId -> calculateAllMacsUsedInVmAndItsSnapshot(vmsById.get(vmId).getInterfaces(), snapshottedInterfacesByVmId.get(vmId))) .collect(Collectors.toList()); return macsToBeAllocated; }</code><technical_language>'snapshotsManager.getVmConfigurationInStatelessSnapshotOfVm' access data domain. Please call is needed. filter vms 'isStaeless'</technical_language>

Target:
public List<String> getMacsForMacPool(Guid macPoolId) { List<Guid> idsOfAllClustersHavingMacPool = getIdsOfAllClustersHavingMacPool(macPoolId); Map<Guid, VM> vmsById = idsOfAllClustersHavingMacPool.stream() .flatMap(clusterId -> vmDao.getAllForCluster(clusterId).stream()) .collect(Collectors.toMap(VM::getId, Function.identity())); Stream<Guid> idsOfRunningVMs = vmsById.values() .stream() .filter(VM::isRunning) .filter(VM::isStateless) .map(VM::getId); Stream<VM> statelessSnapshotsOfRunningVMs = idsOfRunningVMs.map(snapshotsManager::getVmConfigurationInStatelessSnapshotOfVm) .filter(Optional::isPresent) .map(Optional::get); Map<Guid, List<VmNetworkInterface>> snapshottedInterfacesByVmId = statelessSnapshotsOfRunningVMs.collect(Collectors.toMap(VM::getId, VM::getInterfaces)); List<String> macsToBeAllocated = vmsById.keySet() .stream() .flatMap(vmId -> calculateAllMacsUsedInVmAndItsSnapshot(vmsById.get(vmId).getInterfaces(), snapshottedInterfacesByVmId.get(vmId))) .collect(Collectors.toList()); return macsToBeAllocated; }
Source:
<code>public static void addCommonTooltipFromResources(List list, ItemStack itemstack) { if(itemstack.getItem() == null) { return; } String unloc = null; <START> if (itemstack.getItem() instanceof IResourceTooltipProvider) { <END> unloc = ((IResourceTooltipProvider)itemstack.getItem()).getUnlocalizedNameForTooltip(itemstack); } if(unloc == null) { unloc = itemstack.getItem().getUnlocalizedName(itemstack); } addCommonTooltipFromResources(list, unloc); }</code><technical_language>This is duplicated code below. extract this a private helper method is called multiple places</technical_language>

Target:
public static void addCommonTooltipFromResources(List list, ItemStack itemstack) { if(itemstack.getItem() == null) { return; } addCommonTooltipFromResources(list, getUnlocalizedNameForTooltip(itemstack)); }
Source:
<code>public void testImportMultipleTimes() throws Exception { System.out.println("testImportUpdateApplicationCatalog"); <START> Client client = getClient(); <END> waitForHashinator(client); pushDataToImporters(100, 1); verifyData(client, 100); Thread.sleep(0, 1); pushDataToImporters(100, 1); verifyData(client, 200); client.close(); }</code><technical_language>move stuff this @Setup method, method called JUnit prior invocation of test case</technical_language>

Target:
public void testImportMultipleTimes() throws Exception { System.out.println("testImportUpdateApplicationCatalog"); pushDataToImporters(100, 1); verifyData(m_client, 100); Thread.sleep(0, 1); pushDataToImporters(100, 1); verifyData(m_client, 200); }
Source:
<code>private static String getSolrUrl() { <START> return AccessController.doPrivileged( <END> (PrivilegedAction<String>) () -> System.getProperty(SOLR_HTTP_URL)); }</code><technical_language>re-use getProperty() method</technical_language>

Target:
private String getSolrUrl() { return getProperty(SOLR_HTTP_URL); }
Source:
<code>public boolean equals(Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } TransportEndpoint that = (TransportEndpoint) other; <START> return Objects.equals(id, that.id) && Objects.equals(getSocketAddress(), that.getSocketAddress()); <END> }</code><technical_language>I more logical compare hostAddress port transient/computable socketAddress field</technical_language>

Target:
public boolean equals(Object other) { if (this == other) { return true; } if (other == null || getClass() != other.getClass()) { return false; } TransportEndpoint that = (TransportEndpoint) other; return Objects.equals(id, that.id) && Objects.equals(host, that.host) && Objects.equals(port, that.port); }